This commit was manufactured by cvs2svn to create tag 'R1_0_2'.
diff --git a/bundles/org.eclipse.jst.jsp.core/.options b/bundles/org.eclipse.jst.jsp.core/.options
index 30e9fad..4da1fdb 100644
--- a/bundles/org.eclipse.jst.jsp.core/.options
+++ b/bundles/org.eclipse.jst.jsp.core/.options
@@ -31,6 +31,4 @@
 org.eclipse.jst.jsp.core/debug/jspjavamapping=false
 
 org.eclipse.jst.jsp.core/debug/jspvalidator=false
-org.eclipse.jst.jsp.core/debug/taglibvars=false
-
-org.eclipse.jst.jsp.core/debug/taglibclassloader
\ No newline at end of file
+org.eclipse.jst.jsp.core/debug/taglibvars=false
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91..0000000
--- a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs
index 9dd3d0d..517fce1 100644
--- a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Mar 02 00:44:42 EST 2006

+#Sat Oct 01 19:06:11 EDT 2005

 eclipse.preferences.version=1

 org.eclipse.jdt.core.builder.cleanOutputFolder=clean

 org.eclipse.jdt.core.builder.duplicateResourceTask=warning

@@ -68,7 +68,6 @@
 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore

 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

 org.eclipse.jdt.core.compiler.problem.unusedImport=error

-org.eclipse.jdt.core.compiler.problem.unusedLabel=error

 org.eclipse.jdt.core.compiler.problem.unusedLocal=error

 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore

 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled

diff --git a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac65..0000000
--- a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c..0000000
--- a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.pde.prefs
index 110ca2e..42fb716 100644
--- a/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.jst.jsp.core/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:41:15 EDT 2006
-compilers.p.build=0
+#Fri May 27 23:56:32 EDT 2005
 compilers.p.deprecated=1
 compilers.p.illegal-att-value=0
 compilers.p.no-required-att=0
diff --git a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
index f3b3a77..975e202 100644
--- a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
@@ -2,39 +2,37 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.jsp.core; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.0.2.qualifier
 Bundle-Activator: org.eclipse.jst.jsp.core.internal.JSPCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Export-Package: org.eclipse.jst.jsp.core.internal;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.contentmodel;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.contentmodel.tld;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.contentproperties;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.contenttype;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.document;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.domdocument;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.encoding;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.java;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.java.jspel;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.java.search;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.modelhandler;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.modelquery;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.parser;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.parser.internal;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.preferences;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.provisional;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.provisional.contenttype;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.provisional.text;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.regions;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.taglib;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.tasks;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.text;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.util;x-friends:="org.eclipse.jst.jsp.ui",
- org.eclipse.jst.jsp.core.internal.validation;x-friends:="org.eclipse.jst.jsp.ui",
+Export-Package: org.eclipse.jst.jsp.core.internal,
+ org.eclipse.jst.jsp.core.internal.contentmodel,
+ org.eclipse.jst.jsp.core.internal.contentmodel.tld,
+ org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional,
+ org.eclipse.jst.jsp.core.internal.contenttype,
+ org.eclipse.jst.jsp.core.internal.document,
+ org.eclipse.jst.jsp.core.internal.domdocument,
+ org.eclipse.jst.jsp.core.internal.encoding,
+ org.eclipse.jst.jsp.core.internal.java,
+ org.eclipse.jst.jsp.core.internal.java.jspel,
+ org.eclipse.jst.jsp.core.internal.java.search,
+ org.eclipse.jst.jsp.core.internal.modelhandler,
+ org.eclipse.jst.jsp.core.internal.modelquery,
+ org.eclipse.jst.jsp.core.internal.parser,
+ org.eclipse.jst.jsp.core.internal.parser.internal,
+ org.eclipse.jst.jsp.core.internal.preferences,
+ org.eclipse.jst.jsp.core.internal.provisional,
+ org.eclipse.jst.jsp.core.internal.provisional.contenttype,
+ org.eclipse.jst.jsp.core.internal.provisional.text,
+ org.eclipse.jst.jsp.core.internal.regions,
+ org.eclipse.jst.jsp.core.internal.taglib,
+ org.eclipse.jst.jsp.core.internal.tasks,
+ org.eclipse.jst.jsp.core.internal.text,
+ org.eclipse.jst.jsp.core.internal.util,
+ org.eclipse.jst.jsp.core.internal.validation,
  org.eclipse.jst.jsp.core.jspel,
- org.eclipse.jst.jsp.core.taglib,
- org.eclipse.jst.jsp.core.text
+ org.eclipse.jst.jsp.core.taglib
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.core.resources,
  org.eclipse.core.filebuffers,
@@ -45,6 +43,5 @@
  org.eclipse.text,
  org.eclipse.wst.common.uriresolver,
  org.eclipse.wst.validation,
- org.eclipse.tomcat;resolution:=optional,
- org.eclipse.wst.sse.ui
-Eclipse-LazyStart: true; exceptions="org.eclipse.jst.jsp.core.internal.contenttype"
+ org.eclipse.tomcat;resolution:=optional
+Eclipse-AutoStart: true; exceptions="org.eclipse.jst.jsp.core.internal.contenttype"
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.properties b/bundles/org.eclipse.jst.jsp.core/plugin.properties
index d72a934..9d662e3 100644
--- a/bundles/org.eclipse.jst.jsp.core/plugin.properties
+++ b/bundles/org.eclipse.jst.jsp.core/plugin.properties
@@ -10,13 +10,12 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=Structured Source JSP Model
+nlFeatureName=Structured Source JSP Model NL Support
 Structured_JSP_Document_Factory_Extension.name=Structured JSP Document Factory Extension
 JSP_Content_Type_Extension_Element.name=JSP
 JSP_Tag_Content_Type_Extension_Element.name=JSP Tag Definition
 JSP_Fragment_Content_Type_Extension_Element.name=JSP Fragment
 JSP_Syntax_Validator.name=JSP Syntax Validator
-JSP_Directive_Validator.name=JSP Directive Validator
 EL_Syntax_Validator.name=EL Syntax Validator
 Structured_JSP_Document_Setup_participant.name=Structured JSP Document Setup Participant
-
-extension-point.name.0 = org.eclipse.jst.jsp.core.eltranslator
+JSP_EL_Translator=JSP EL Translator
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.xml b/bundles/org.eclipse.jst.jsp.core/plugin.xml
index 9324934..8684199 100644
--- a/bundles/org.eclipse.jst.jsp.core/plugin.xml
+++ b/bundles/org.eclipse.jst.jsp.core/plugin.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <plugin>
-   <extension-point id="elTranslator" name="%extension-point.name.0" schema="schema/eltranslator.exsd"/>
+   <extension-point id="elTranslator" name="%JSP_EL_Translator" schema="schema/eltranslator.exsd"/>
 
 	<extension point="org.eclipse.wst.sse.core.modelHandler">
 		<modelHandler
@@ -85,7 +85,7 @@
 	</extension>
 
 	<extension point="org.eclipse.core.runtime.contentTypes">
-		<!-- create content type for JSP files -->
+		<!-- associate JSP file types -->
 		<content-type
 			file-extensions="jsp,jsv,jtpl,jspx"
 			priority="high"
@@ -96,7 +96,6 @@
 			<describer
 				class="org.eclipse.jst.jsp.core.internal.contenttype.ContentDescriberForJSP" />
 		</content-type>
-		<!-- create content type for JSP fragment files -->
 		<content-type
 			file-extensions="jspf,jsf"
 			priority="high"
@@ -107,22 +106,19 @@
 			<describer
 				class="org.eclipse.jst.jsp.core.internal.contenttype.ContentDescriberForJSP" />
 		</content-type>
-		<!-- create content type for JSP 2.0 Tag file types -->
+		<!-- associate JSP 2.0 Tag file types -->
 		<content-type
 			file-extensions="tag,tagx,tagf"
 			priority="high"
 			name="%JSP_Tag_Content_Type_Extension_Element.name"
 			id="tagsource"
 			base-type="org.eclipse.jst.jsp.core.jspsource"
-			default-charset="UTF-8"/>
-		<!-- create content type for .tld files -->
-		<content-type
-			file-extensions="tld"
-			priority="high"
-			name="%JSP_TLD_Content_Type_Extension_Element.name"
-			id="tldsource"
-			base-type="org.eclipse.core.runtime.xml"
-			default-charset="UTF-8"/>
+			default-charset="UTF-8">
+		</content-type>
+		<!-- associate .tld files with the XML content type -->
+		<file-association
+			content-type="org.eclipse.core.runtime.xml"
+			file-extensions="tld" />
 	</extension>
 
 	<!-- initialize jsp core preferences -->
@@ -131,9 +127,7 @@
 			class="org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceInitializer" />
 	</extension>
 
-	<!--======================================================================================-->
-	<!-- JSP EL batch validator				                                                  -->
-	<!--======================================================================================-->
+
 	<extension
 		id="JSPELValidator"
 		name="%EL_Syntax_Validator.name"
@@ -172,10 +166,10 @@
 	</extension>
 
 	<!--======================================================================================-->
-	<!-- JSP batch validation                                       						  -->
+	<!-- Workbench validation                                       						  -->
 	<!--======================================================================================-->
 	<extension
-		id="JSPJavaValidator"
+		id="JSPValidator"
 		name="%JSP_Syntax_Validator.name"
 		point="org.eclipse.wst.validation.validator">
 		<validator>
@@ -207,59 +201,17 @@
 			</helper>
 			<run
 				enabled="true"
-				class="org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator">
+				class="org.eclipse.jst.jsp.core.internal.validation.JSPValidator">
 			</run>
 		</validator>
 	</extension>
-	
 	<!--======================================================================================-->
-	<!-- JSP directive batch validation                                						  -->
-	<!--======================================================================================-->
-	<extension
-		id="JSPDirectiveValidator"
-		name="%JSP_Directive_Validator.name"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<projectNature id="org.eclipse.wst.common.modulecore.ModuleCoreNature" />
-			<projectNature id="org.eclipse.jdt.core.javanature" />
-
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsp">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jspf">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsf">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsv">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jtpl">
-			</filter>
-			<helper
-				class="org.eclipse.wst.validation.internal.operations.WorkbenchContext">
-			</helper>
-			<run
-				enabled="true"
-				class="org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator">
-			</run>
-		</validator>
-	</extension>
-	
-	<!--======================================================================================-->
-	<!-- source (as you type) validation for JSP Java				   						  -->
+	<!-- source validation for JSP Java				   										  -->
 	<!--======================================================================================-->
 	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
 		<validator
 			scope="total"
-			class="org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator"
+			class="org.eclipse.jst.jsp.core.internal.validation.JSPValidator"
 			id="org.eclipse.jst.jsp.jspsourcevalidator">
 			<contentTypeIdentifier
 				id="org.eclipse.jst.jsp.core.jspsource">
@@ -289,24 +241,6 @@
 			</contentTypeIdentifier>
 		</validator>
 	</extension>
-	<!--======================================================================================-->
-	<!-- source (as you type) validation for JSP directive			   						  -->
-	<!--======================================================================================-->
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="partial"
-			class="org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator"
-			id="org.eclipse.jst.jsp.tldsourcevalidator">
-			<contentTypeIdentifier
-				id="org.eclipse.jst.jsp.core.jspsource">
-				<partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
-				</partitionType>
-				<partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
-				</partitionType>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
-	
     <extension
        point="org.eclipse.jst.jsp.core.elTranslator">
        <elTranslator
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
index e447cb7..2ddc9b7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
@@ -28,8 +28,6 @@
 	public static String JSPEL_Syntax;
 	public static String JSPEL_Token;
 	public static String JSPDocumentLoader_1;
-	public static String JSPFContentPropertiesManager_Updating;
-	public static String JSPFContentPropertiesManager_Problems_Updating;
 	
 	private JSPCoreMessages() {
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
index 3956bb3..d0b1047 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
@@ -13,7 +13,6 @@
 import org.eclipse.core.runtime.Plugin;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentPropertiesManager;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
@@ -23,8 +22,8 @@
  * The main plugin class to be used in the desktop.
  */
 public class JSPCorePlugin extends Plugin {
-	// The shared instance.
-	private static JSPCorePlugin plugin;
+	//The shared instance.
+	private static JSPCorePlugin plugin;	
 
 	/**
 	 * The constructor.
@@ -36,54 +35,43 @@
 
 	/**
 	 * Returns the shared instance.
-	 * 
-	 * @deprecated - will be removed. Currently used to get "model
-	 *             preferences", but there are other, better ways.
+	 * @deprecated - will be removed. Currently used to get 
+	 * "model preferences", but there are other, better ways. 
 	 */
 	public static JSPCorePlugin getDefault() {
 		return plugin;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
+	/* (non-Javadoc)
 	 * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
 	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
-
+		
 		TaglibIndex.startup();
 		// JSPIndexManager depends on TaglibController, so TaglibController
 		// should be started first
 		TaglibController.startup();
-
+		
 		// listen for classpath changes
 		JavaCore.addElementChangedListener(TaglibHelperManager.getInstance());
-
-
+		
+		
 		JSPIndexManager.getInstance().initialize();
-
-		// listen for resource changes to update content properties keys
-		JSPFContentPropertiesManager.startup();
-
+		
 	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
+	
+	/* (non-Javadoc)
 	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
 	 */
 	public void stop(BundleContext context) throws Exception {
-		// stop listenning for resource changes to update content properties
-		// keys
-		JSPFContentPropertiesManager.shutdown();
 
 		// stop any indexing
 		JSPIndexManager.getInstance().shutdown();
-
+		
 		// stop listening for classpath changes
 		JavaCore.removeElementChangedListener(TaglibHelperManager.getInstance());
-
+		
 		// stop taglib controller
 		TaglibController.shutdown();
 		TaglibIndex.shutdown();
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
index afe9594..199cf6a 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
@@ -15,5 +15,3 @@
 JSPEL_Syntax=EL Syntax Error 
 JSPEL_Token=Unable to analyse EL expression due to lexical analysis error
 MESSAGE_JSP_VALIDATING_MESSAGE_UI_=JSP Validator validating {0}
-JSPFContentPropertiesManager_Updating=Updating JSP Fragment Content Settings
-JSPFContentPropertiesManager_Problems_Updating=Problem saving JSP Fragment Content Settings for {0}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
index ea5999e..c018b77 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
@@ -17,7 +17,7 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDAttributeDeclaration;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java
index 9f47c7b..7516441 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java
@@ -21,7 +21,7 @@
 import org.eclipse.jst.jsp.core.internal.Logger;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDValidator;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
index 9866be3..fbc9cfc 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
@@ -19,7 +19,7 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
index a5f2d62..39c745c 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
@@ -27,6 +27,7 @@
 import java.util.Map;
 import java.util.Stack;
 
+import org.eclipse.core.filebuffers.FileBuffers;
 import org.eclipse.core.filebuffers.ITextFileBuffer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
@@ -62,7 +63,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.util.Assert;
 import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
@@ -251,15 +252,15 @@
 				IPath root = TaglibIndex.getContextRoot(TaglibController.getFileBuffer(TLDCMDocumentManager.this).getLocation());
 				// strip any extraneous quotes and white space
 				includedFile = StringUtils.strip(includedFile).trim();
-				IPath filePath = null;
+				IPath fileLocation = null;
 				if (includedFile.startsWith("/")) { //$NON-NLS-1$
-					filePath = root.append(includedFile);
+					fileLocation = root.append(includedFile);
 				}
 				else {
-					filePath = new Path(URIHelper.normalize(includedFile, TaglibController.getFileBuffer(TLDCMDocumentManager.this).getLocation().toString(), root.toString()));
+					fileLocation = new Path(URIHelper.normalize(includedFile, TaglibController.getFileBuffer(TLDCMDocumentManager.this).getLocation().toString(), root.toString()));
 				}
 				// check for "loops"
-				if (!getIncludes().contains(filePath) && filePath != null && !filePath.equals(TaglibController.getFileBuffer(TLDCMDocumentManager.this).getLocation())) {
+				if (!getIncludes().contains(fileLocation) && fileLocation != null && !fileLocation.equals(TaglibController.getFileBuffer(TLDCMDocumentManager.this).getLocation())) {
 					/*
 					 * Prevent slow performance when editing scriptlet part of
 					 * the JSP by only processing includes if they've been
@@ -268,13 +269,13 @@
 					 * prefix/tagdir allows us to just enable the CMDocument
 					 * when the previously parsed files.
 					 */
-					if (hasAnyIncludeBeenModified(filePath)) {
-						getIncludes().push(filePath);
+					if (hasAnyIncludeBeenModified(fileLocation.toString())) {
+						getIncludes().push(fileLocation);
 						if (getParser() != null) {
 							IncludeHelper includeHelper = new IncludeHelper(anchorStructuredDocumentRegion, getParser());
-							includeHelper.parse(filePath);
+							includeHelper.parse(FileBuffers.normalizeLocation(fileLocation).toString());
 							List references = includeHelper.taglibReferences;
-							fTLDCMReferencesMap.put(filePath.toString(), references);
+							fTLDCMReferencesMap.put(fileLocation.toString(), references);
 						}
 						else
 							Logger.log(Logger.WARNING, "Warning: parser text was requested by " + getClass().getName() + " but none was available; taglib support disabled"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -282,7 +283,7 @@
 					}
 					else {
 						// Add from that saved list of uris/prefixes/documents
-						List references = (List) fTLDCMReferencesMap.get(filePath.toString());
+						List references = (List) fTLDCMReferencesMap.get(fileLocation.toString());
 						for (int i = 0; references != null && i < references.size(); i++) {
 							TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(i);
 							enableTaglibFromURI(reference.prefix, reference.uri, includeStructuredDocumentRegion);
@@ -292,7 +293,7 @@
 				}
 				else {
 					if (Debug.debugTokenizer)
-						System.out.println("LOOP IN @INCLUDES FOUND: " + filePath); //$NON-NLS-1$
+						System.out.println("LOOP IN @INCLUDES FOUND: " + fileLocation); //$NON-NLS-1$
 				}
 			}
 		}
@@ -540,9 +541,9 @@
 			return ResourcesPlugin.getEncoding();
 		}
 
-		protected String getContents(IPath filePath) {
+		protected String getContents(String fileName) {
 			StringBuffer s = new StringBuffer();
-			IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
+			IFile iFile = FileBuffers.getWorkspaceFileAtLocation(new Path(fileName));
 			if (iFile != null && iFile.exists()) {
 				String charset = detectCharset(iFile);
 				InputStream contents = null;
@@ -558,7 +559,7 @@
 				}
 				catch (Exception e) {
 					if (Debug.debugStructuredDocument)
-						Logger.log(Logger.WARNING, "An exception occured while scanning " + filePath, e); //$NON-NLS-1$
+						Logger.log(Logger.WARNING, "An exception occured while scanning " + fileName, e); //$NON-NLS-1$
 				}
 				finally {
 					try {
@@ -578,7 +579,7 @@
 				File file = null;
 				FileInputStream fis = null;
 				try {
-					file = new File(filePath.toString());
+					file = new File(fileName);
 					length = (int) file.length();
 					fis = new FileInputStream(file);
 					while (((c = fis.read()) >= 0) && (count < length)) {
@@ -588,7 +589,7 @@
 				}
 				catch (FileNotFoundException e) {
 					if (Debug.debugStructuredDocument)
-						System.out.println("File not found : \"" + filePath + "\""); //$NON-NLS-2$//$NON-NLS-1$
+						System.out.println("File not found : \"" + fileName + "\""); //$NON-NLS-2$//$NON-NLS-1$
 				}
 				catch (ArrayIndexOutOfBoundsException e) {
 					if (Debug.debugStructuredDocument)
@@ -643,14 +644,19 @@
 			}
 		}
 
-		/**
-		 * @param path - the fullpath for the resource to be parsed 
-		 */
-		void parse(IPath path) {
+		public void parse(String filename) {
 			JSPSourceParser p = new JSPSourceParser();
 			fLocalParser = p;
 			List blockTags = fParentParser.getBlockMarkers();
-			String s = getContents(path);
+			String includedFilename = filename;
+			File baseFile = FileBuffers.getSystemFileAtLocation(new Path(includedFilename));
+			try {
+				if (baseFile != null)
+					includedFilename = baseFile.getCanonicalPath();
+			}
+			catch (IOException e) {
+			}
+			String s = getContents(includedFilename);
 			fLocalParser.addStructuredDocumentRegionHandler(this);
 			fLocalParser.reset(s);
 			for (int i = 0; i < blockTags.size(); i++) {
@@ -697,7 +703,7 @@
 	private Hashtable fDocuments = null;
 	// timestamp cache to prevent excessive reparsing
 	// of included files
-	// IPath (filepath) > Long (modification stamp)
+	// String (filepath) > Long (modification stamp)
 	HashMap fInclude2TimestampMap = new HashMap();
 	private Stack fIncludes = null;
 
@@ -890,20 +896,21 @@
 	}
 
 	/**
-	 * @param filePath the path to check for modification
+	 * @param fileLocation
+	 *            the "root" file
 	 */
-	boolean hasAnyIncludeBeenModified(IPath filePath) {
+	boolean hasAnyIncludeBeenModified(String fileLocation) {
 
 		boolean result = false;
 		// check the top level
-		if (hasBeenModified(filePath)) {
+		if (hasBeenModified(fileLocation)) {
 			result = true;
 		}
 		else {
 			// check all includees
 			Iterator iter = fInclude2TimestampMap.keySet().iterator();
 			while (iter.hasNext()) {
-				if (hasBeenModified((IPath) iter.next())) {
+				if (hasBeenModified((String) iter.next())) {
 					result = true;
 					break;
 				}
@@ -916,30 +923,32 @@
 	 * @param filename
 	 * @return
 	 */
-	boolean hasBeenModified(IPath filePath) {
+	boolean hasBeenModified(String filename) {
+
 		boolean result = false;
 		// quick filename/timestamp cache check here...
-		IFile f = null;
+		IPath filePath = new Path(filename);
+		IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(filePath);
 		if (f == null && filePath.segmentCount() > 1) {
 			f = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
 		}
 		if (f != null && f.exists()) {
 			Long currentStamp = new Long(f.getModificationStamp());
-			Object o = fInclude2TimestampMap.get(filePath);
+			Object o = fInclude2TimestampMap.get(filename);
 			if (o != null) {
 				Long previousStamp = (Long) o;
 				// stamps don't match, file changed
 				if (currentStamp.longValue() != previousStamp.longValue()) {
 					result = true;
 					// store for next time
-					fInclude2TimestampMap.put(filePath, currentStamp);
+					fInclude2TimestampMap.put(filename, currentStamp);
 				}
 			}
 			else {
 				// return true, since we've not encountered this file yet.
 				result = true;
 				// store for next time
-				fInclude2TimestampMap.put(filePath, currentStamp);
+				fInclude2TimestampMap.put(filename, currentStamp);
 			}
 		}
 		return result;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDInitParamImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDInitParamImpl.java
index 451b2a2..7edf467 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDInitParamImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDInitParamImpl.java
@@ -17,7 +17,7 @@
 package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
 
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDInitParam;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 
 public class TLDInitParamImpl implements TLDInitParam {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDListenerImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDListenerImpl.java
index 011ae6f..517b319 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDListenerImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDListenerImpl.java
@@ -17,7 +17,7 @@
 package org.eclipse.jst.jsp.core.internal.contentmodel.tld;
 
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDListener;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 
 public class TLDListenerImpl implements TLDListener {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDValidatorImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDValidatorImpl.java
index 16b6f20..55badba 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDValidatorImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDValidatorImpl.java
@@ -20,7 +20,7 @@
 import java.util.List;
 
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDValidator;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 
 public class TLDValidatorImpl implements TLDValidator {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDVariableImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDVariableImpl.java
index 7998305..f6c0525 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDVariableImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDVariableImpl.java
@@ -12,7 +12,7 @@
 
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDVariable;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 
 public class TLDVariableImpl implements TLDVariable {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDVariable.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDVariable.java
index 395cbab..d079058 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDVariable.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDVariable.java
@@ -21,18 +21,15 @@
 	 */
 	boolean getDeclare();
 
-	/**
-	 * @returnthe the description for this variable
-	 */
 	String getDescription();
 
 	/**
-	 * The name of an attribute whose (translation time) value will give the name of the variable, or null of the name is not to be obtained this way.
+	 * The name of an attribute whose (translation time) value will give the name of the variable.
 	 */
 	String getNameFromAttribute();
 
 	/**
-	 * The variable name given as a constant, or null of the name is not specified.
+	 * The variable name given as a constant
 	 */
 	String getNameGiven();
 	
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentproperties/JSPFContentProperties.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentproperties/JSPFContentProperties.java
deleted file mode 100644
index 2ece904..0000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentproperties/JSPFContentProperties.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentproperties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * Properties constants used by JSP Fragments. Clients should only read and
- * modify the JSP Fragment properties programmatically using this class.
- * 
- * @since 1.1
- */
-public class JSPFContentProperties {
-	static final String JSPCORE_ID = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
-	private static final String PROJECT_KEY = "<project>"; //$NON-NLS-1$
-
-	/**
-	 * A named key that controls the default language for JSP Fragments
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 * 
-	 * @since 1.1
-	 */
-	public static final String JSPLANGUAGE = "jsp-language"; //$NON-NLS-1$
-	/**
-	 * A named key that controls the default content type for JSP Fragments
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 * 
-	 * @since 1.1
-	 */
-	public static final String JSPCONTENTTYPE = "jsp-content-type"; //$NON-NLS-1$
-	/**
-	 * Indicates if JSP fragments should be compiled/validated. JSP fragments
-	 * will be validated when true.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 * 
-	 * @since 1.1
-	 */
-	public static final String VALIDATE_FRAGMENTS = "validateFragments";//$NON-NLS-1$
-
-	/**
-	 * Generates a preference key based on resourcePath
-	 * 
-	 * @param resourcePath
-	 *            the path the key will be based off of
-	 * @return preference key based on resourcePath (basically the
-	 *         resourcePath without the filename); PROJECT_KEY if resourcePath
-	 *         is null
-	 */
-	static String getKeyFor(IPath resourcePath) {
-		String key = PROJECT_KEY;
-		if (resourcePath != null && resourcePath.segmentCount() > 1) {
-			key = resourcePath.removeFirstSegments(1).toString();
-		}
-		return key;
-	}
-
-	/**
-	 * Get the preferences node associated with the given project scope and
-	 * preference key (subNode) If create is true, the preference node will be
-	 * created if one does not already exist
-	 * 
-	 * @param project
-	 *            the project the preference node is under
-	 * @param preferenceKey
-	 *            the subnode/category the preference node is located in
-	 * @param create
-	 *            if true, a preference node will be created if one does not
-	 *            already exist
-	 * @return Preferences associated with the given project scope and
-	 *         preference key. null if one could not be found and create is
-	 *         false
-	 */
-	static Preferences getPreferences(IProject project, String preferenceKey, boolean create) {
-		if (create)
-			// create all nodes down to the one we are interested in
-			return new ProjectScope(project).getNode(JSPCORE_ID).node(preferenceKey);
-		// be careful looking up for our node so not to create any nodes as
-		// side effect
-		Preferences node = Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE);
-		try {
-			// TODO once bug 90500 is fixed, should be as simple as this:
-			// String path = project.getName() + IPath.SEPARATOR +
-			// ResourcesPlugin.PI_RESOURCES + IPath.SEPARATOR +
-			// ENCODING_PREF_NODE;
-			// return node.nodeExists(path) ? node.node(path) : null;
-			// for now, take the long way
-			if (!node.nodeExists(project.getName()))
-				return null;
-			node = node.node(project.getName());
-			if (!node.nodeExists(JSPCORE_ID))
-				return null;
-			node = node.node(JSPCORE_ID);
-			if (!node.nodeExists(preferenceKey))
-				return null;
-			return node.node(preferenceKey);
-		}
-		catch (BackingStoreException e) {
-			// nodeExists failed
-			Logger.log(Logger.WARNING_DEBUG, "Could not retrieve preference node", e); //$NON-NLS-1$
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the value for the given key in the given context.
-	 * 
-	 * @param key
-	 *            The property key
-	 * @param resource
-	 *            The current context or <code>null</code> if no context is
-	 *            available and the workspace setting should be taken. Note
-	 *            that passing <code>null</code> should be avoided.
-	 * @param recurse
-	 *            whether the parent should be queried till property is found
-	 * @return Returns the current value for the key.
-	 * @since 1.1
-	 */
-	public static String getProperty(String key, IResource resource, boolean recurse) {
-		String val = null;
-		if (resource != null) {
-			IProject project = resource.getProject();
-			if (project != null) {
-				Preferences preferences = getPreferences(project, key, false);
-				if (preferences != null) {
-					val = internalGetProperty(resource, recurse, preferences);
-				}
-			}
-		}
-		// no preferences found - for performance reasons,
-		// short-circuit
-		// lookup by falling back to workspace's default
-		// setting
-		if (val == null && recurse)
-			val = getWorkbenchPreference(key);
-		return val;
-	}
-
-	private static String getWorkbenchPreference(String key) {
-		return Platform.getPreferencesService().getString(JSPCORE_ID, key, null, null);
-	}
-
-	private static String internalGetProperty(IResource resource, boolean recurse, Preferences preferences) {
-		String value = preferences.get(getKeyFor(resource.getFullPath()), null);
-		if (value == null && resource != resource.getProject() && recurse) {
-			value = preferences.get(getKeyFor(null), null);
-		}
-
-		return value;
-	}
-
-	/**
-	 * Sets the value for the given key in the given context.
-	 * 
-	 * @param key
-	 *            The property key
-	 * @param resource
-	 *            The current context. Note context cannot be
-	 *            <code>null</code>.
-	 * @param value
-	 *            The value to set for the key. If value is <code>null</code>
-	 *            the key is removed from properties.
-	 * @since 1.1
-	 */
-	public static void setProperty(String key, IResource resource, String value) throws CoreException {
-		if (resource != null) {
-			IProject project = resource.getProject();
-			if (project != null) {
-				Preferences preferences = getPreferences(project, key, true);
-				if (value == null || value.trim().length() == 0)
-					preferences.remove(getKeyFor(resource.getFullPath()));
-				else
-					preferences.put(getKeyFor(resource.getFullPath()), value);
-				try {
-					// save changes
-					preferences.flush();
-				}
-				catch (BackingStoreException e) {
-					throw new CoreException(new Status(IStatus.ERROR, JSPCORE_ID, IStatus.ERROR, "Unable to set property", e)); //$NON-NLS-1$
-				}
-			}
-		}
-		// Workbench preference may not be needed so leave out for now
-		// just set a preference in the instance scope
-		// if (!preferenceFound) {
-		// setWorkbenchPreference(key);
-		// }
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentproperties/JSPFContentPropertiesManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentproperties/JSPFContentPropertiesManager.java
deleted file mode 100644
index d3cd4cf..0000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentproperties/JSPFContentPropertiesManager.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.core.internal.contentproperties;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.Bundle;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-public class JSPFContentPropertiesManager {
-	public JSPFContentPropertiesManager() {
-		super();
-		fResourceChangeListener = new ResourceChangeListener();
-		fJob = new ContentPropertiesManagerJob();
-	}
-
-	private static JSPFContentPropertiesManager _instance = null;
-	private IResourceChangeListener fResourceChangeListener;
-	ContentPropertiesManagerJob fJob;
-
-	/**
-	 * This job implementation is used to allow the resource change listener
-	 * to schedule operations that need to modify the workspace.
-	 */
-	private class ContentPropertiesManagerJob extends Job {
-		private static final int PROPERTIES_UPDATE_DELAY = 500;
-		private List asyncChanges = new ArrayList();
-
-		public ContentPropertiesManagerJob() {
-			super(JSPCoreMessages.JSPFContentPropertiesManager_Updating);
-			setSystem(true);
-			setPriority(Job.INTERACTIVE);
-		}
-
-		public void addChanges(Set newChanges) {
-			if (newChanges.isEmpty())
-				return;
-			synchronized (asyncChanges) {
-				asyncChanges.addAll(newChanges);
-				asyncChanges.notify();
-			}
-			schedule(PROPERTIES_UPDATE_DELAY);
-		}
-
-		public IProject getNextChange() {
-			synchronized (asyncChanges) {
-				return asyncChanges.isEmpty() ? null : (IProject) asyncChanges.remove(asyncChanges.size() - 1);
-			}
-		}
-
-		protected IStatus run(IProgressMonitor monitor) {
-			MultiStatus result = new MultiStatus(JSPFContentProperties.JSPCORE_ID, IResourceStatus.FAILED_SETTING_CHARSET, JSPCoreMessages.JSPFContentPropertiesManager_Updating, null);
-			monitor = monitor == null ? new NullProgressMonitor() : monitor;
-			try {
-				monitor.beginTask(JSPCoreMessages.JSPFContentPropertiesManager_Updating, asyncChanges.size());
-				try {
-					IProject next;
-					while ((next = getNextChange()) != null) {
-						// just exit if the system is shutting down or has
-						// been shut down
-						// it is too late to change the workspace at this
-						// point anyway
-						if (Platform.getBundle("org.eclipse.osgi").getState() != Bundle.ACTIVE) //$NON-NLS-1$
-							return Status.OK_STATUS;
-						try {
-							// save the preferences nodes
-							if (next.isAccessible()) {
-								// save content type preferences
-								Preferences projectPrefs = JSPFContentProperties.getPreferences(next, JSPFContentProperties.JSPCONTENTTYPE, false);
-								if (projectPrefs != null)
-									projectPrefs.flush();
-								// save language preferences
-								projectPrefs = JSPFContentProperties.getPreferences(next, JSPFContentProperties.JSPLANGUAGE, false);
-								if (projectPrefs != null)
-									projectPrefs.flush();
-
-							}
-						}
-						catch (BackingStoreException e) {
-							// we got an error saving
-							String detailMessage = NLS.bind(JSPCoreMessages.JSPFContentPropertiesManager_Problems_Updating, next.getFullPath());
-							result.add(new Status(1 << (IResourceStatus.FAILED_SETTING_CHARSET % 100 / 33), ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_SETTING_CHARSET, detailMessage, e));
-						}
-					}
-					monitor.worked(1);
-				}
-				catch (OperationCanceledException e) {
-					throw e;
-				}
-			}
-			finally {
-				monitor.done();
-			}
-			return result;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
-		 */
-		public boolean shouldRun() {
-			synchronized (asyncChanges) {
-				return !asyncChanges.isEmpty();
-			}
-		}
-	}
-
-	class ResourceChangeListener implements IResourceChangeListener {
-		private void processEntryChanges(IResourceDelta projectDelta, Set projectsToSave) {
-			// check each resource with jsp fragment setting to see if it has
-			// been moved/deleted
-			boolean resourceChanges = false;
-			boolean resourceChanges2 = false;
-
-			// project affected
-			IProject currentProject = (IProject) projectDelta.getResource();
-
-			resourceChanges = processPreferences(currentProject, JSPFContentProperties.JSPCONTENTTYPE, projectDelta, projectsToSave);
-			resourceChanges2 = processPreferences(currentProject, JSPFContentProperties.JSPLANGUAGE, projectDelta, projectsToSave);
-
-			// if there was a preference key change, need to save preferences
-			if (resourceChanges || resourceChanges2)
-				projectsToSave.add(currentProject);
-		}
-
-		/**
-		 * Goes through all the resource-dependent preferences associated with
-		 * currentProject & key and updates the preference keys if needed
-		 * based on projectDelta
-		 * 
-		 * @param currentProject
-		 *            current project of the preferences to be looked at
-		 * @param key
-		 *            current key/subcategory of the preferences to be looked
-		 *            at
-		 * @param projectDelta
-		 *            the changes to process the preference keys against
-		 * @param projectsToSave
-		 *            the projects that need to be updated/saved
-		 * @return true if currentProject's preferences were modified
-		 */
-		private boolean processPreferences(IProject currentProject, String key, IResourceDelta projectDelta, Set projectsToSave) {
-			boolean resourceChanges = false;
-
-			// get the project-key preference node
-			Preferences projectPrefs = JSPFContentProperties.getPreferences(currentProject, key, false);
-			if (projectPrefs == null)
-				// no preferences for this project-key, just bail
-				return false;
-			String[] affectedResources;
-			try {
-				affectedResources = projectPrefs.keys();
-			}
-			catch (BackingStoreException e) {
-				// problems with the project scope... we gonna miss the
-				// changes (but will log)
-				Logger.log(Logger.WARNING_DEBUG, "Problem retreiving JSP Fragment preferences", e); //$NON-NLS-1$
-				return false;
-			}
-
-			// go through each preference key (which is really a file name)
-			for (int i = 0; i < affectedResources.length; i++) {
-				// see if preference key/file name was file that was changed
-				IResourceDelta memberDelta = projectDelta.findMember(new Path(affectedResources[i]));
-				// no changes for the given resource
-				if (memberDelta == null)
-					continue;
-				if (memberDelta.getKind() == IResourceDelta.REMOVED) {
-					resourceChanges = true;
-					// remove the setting for the original location
-					String currentValue = projectPrefs.get(affectedResources[i], null);
-					projectPrefs.remove(affectedResources[i]);
-					if ((memberDelta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
-						// if moving, copy the setting for the new location
-						IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getProject(memberDelta.getMovedToPath().segment(0));
-						Preferences targetPrefs = JSPFContentProperties.getPreferences(targetProject, key, true);
-						targetPrefs.put(JSPFContentProperties.getKeyFor(memberDelta.getMovedToPath()), currentValue);
-						if (targetProject != currentProject)
-							projectsToSave.add(targetProject);
-					}
-				}
-			}
-			return resourceChanges;
-		}
-
-		/**
-		 * For any change to the encoding file or any resource with encoding
-		 * set, just discard the cache for the corresponding project.
-		 */
-		public void resourceChanged(IResourceChangeEvent event) {
-			IResourceDelta delta = event.getDelta();
-			if (delta == null)
-				return;
-			IResourceDelta[] projectDeltas = delta.getAffectedChildren();
-			// process each project in the delta
-			Set projectsToSave = new HashSet();
-			for (int i = 0; i < projectDeltas.length; i++)
-				// nothing to do if a project has been added/removed/moved
-				if (projectDeltas[i].getKind() == IResourceDelta.CHANGED && (projectDeltas[i].getFlags() & IResourceDelta.OPEN) == 0)
-					processEntryChanges(projectDeltas[i], projectsToSave);
-			fJob.addChanges(projectsToSave);
-		}
-	}
-
-	public synchronized static void startup() {
-		_instance = new JSPFContentPropertiesManager();
-		ResourcesPlugin.getWorkspace().addResourceChangeListener(_instance.fResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
-	}
-
-	public synchronized static void shutdown() {
-		ResourcesPlugin.getWorkspace().removeResourceChangeListener(_instance.fResourceChangeListener);
-		_instance = null;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapter.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapter.java
index 831215b..e69d9cb 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapter.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapter.java
@@ -14,6 +14,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.internal.contentproperties.IContentSettingsListener;
 
 /**
  * Classes which implement this interface have two responsibilities. 
@@ -23,7 +24,7 @@
  * a change in embedded type is is made, it will signal 
  * the structuredModel that it needs to reinitialize itself.
  */
-public interface PageDirectiveAdapter extends INodeAdapter {
+public interface PageDirectiveAdapter extends INodeAdapter, IContentSettingsListener {
 
 	public String getContentType();
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterFactory.java
index f20707e..adb695f 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterFactory.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterFactory.java
@@ -15,6 +15,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.internal.contentproperties.ContentSettingsChangeSubject;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.w3c.dom.Node;
 
@@ -54,6 +55,7 @@
 			IDOMNode node = (IDOMNode) target;
 			if (node.getNodeType() == Node.DOCUMENT_NODE) {
 				result = getAdapterInstance(target);
+				ContentSettingsChangeSubject.getSubject().addListener(result);
 			}
 
 		}
@@ -62,6 +64,7 @@
 
 	public void release() {
 		if (pageDirectiveAdapterInstance != null) {
+			ContentSettingsChangeSubject.getSubject().removeListener(pageDirectiveAdapterInstance);
 			pageDirectiveAdapterInstance.release();
 		}
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
index 66a8b72..b388c1a 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
@@ -16,12 +16,13 @@
 import java.util.StringTokenizer;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.text.IDocumentExtension3;
 import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
 import org.eclipse.jst.jsp.core.internal.modelhandler.EmbeddedTypeStateData;
 import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP;
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
@@ -33,17 +34,18 @@
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
 import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 
 /**
- * This class has the responsibility to provide an embedded factory registry
- * for JSP Aware INodeAdapter Factories to use.
+ * This class has the responsibility to provide 
+ * an embedded factory registry for JSP Aware INodeAdapter Factories
+ * to use. 
  * 
- * Typically, the embedded type is to be considered a feature of the document,
- * so JSP Aware AdpaterFactories should call
- * getAdapter(PageDirectiveAdapter.class) directoy on the document (or owning
- * document) node.
+ * Typically, the embedded type is to be considered a feature of 
+ * the document, so JSP Aware AdpaterFactories should call
+ * getAdapter(PageDirectiveAdapter.class) directoy on the document
+ * (or owning document) node.
  */
 public class PageDirectiveAdapterImpl implements PageDirectiveAdapter {
 
@@ -59,7 +61,7 @@
 	public PageDirectiveAdapterImpl(INodeNotifier target) {
 		super();
 		notifierAtCreation = target;
-		// we need to remember our instance of model,
+		// we need to remember our instance of model, 
 		// in case we need to "signal" a re-init needed.
 		if (target instanceof IDOMNode) {
 			IDOMNode node = (IDOMNode) target;
@@ -69,11 +71,11 @@
 	}
 
 	/**
-	 * parses the full contentType value into its two parts the contentType,
-	 * and the charset, if present. Note: this method is a lightly modified
-	 * version of a method in AbstractHeadParser. There, we're mostly
-	 * interested in the charset part of contentTypeValue. Here, we're mostly
-	 * interested in the mimeType part.
+	 * parses the full contentType value into its two parts
+	 * the contentType, and the charset, if present. Note: this 
+	 * method is a lightly modified version of a method in AbstractHeadParser.
+	 * There, we're mostly interested in the charset part of contentTypeValue. 
+	 * Here, we're mostly interested in the mimeType part.
 	 */
 	private String getMimeTypeFromContentTypeValue(String contentTypeValue) {
 		if (contentTypeValue == null)
@@ -81,8 +83,7 @@
 		String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentTypeValue);
 		StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";= \t\n\r\f"); //$NON-NLS-1$
 		int tLen = tokenizer.countTokens();
-		// if contains encoding should have three tokens, the mimetype, the
-		// word 'charset', and the encoding value
+		// if contains encoding should have three tokens, the mimetype, the word 'charset', and the encoding value
 		String[] tokens = new String[tLen];
 		int j = 0;
 		while (tokenizer.hasMoreTokens()) {
@@ -90,9 +91,9 @@
 			j++;
 		}
 		// 
-		// Following is the common form for target expression
+		// Following is the common form for target expression		
 		// <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-		// But apparrently is also valid without the content type there,
+		// But apparrently is also valid without the content type there, 
 		// just the charset, as follows:
 		// <META http-equiv="Content-Type" content="charset=UTF-8">
 		// So we'll loop through tokens and key off of 'charset'
@@ -104,21 +105,21 @@
 				break;
 			}
 		}
-		// String charset = null;
+		//String charset = null;
 		String contentType = null;
 		if (charsetPos > -1) {
 			// case where charset was present
-			// int charsetValuePos = charsetPos + 1;
-			// if (charsetValuePos < tokens.length) {
-			// charset = tokens[charsetValuePos];
-			// }
+			//			int charsetValuePos = charsetPos + 1;
+			//			if (charsetValuePos < tokens.length) {
+			//				charset = tokens[charsetValuePos];
+			//			}
 			int contentTypeValuePos = charsetPos - 1;
 			if (contentTypeValuePos > -1) {
 				contentType = tokens[contentTypeValuePos];
 			}
 		}
 		else {
-			// charset was not present, so if there's
+			// charset was not present, so if there's 
 			// a value, we assume its the contentType value
 			if (tokens.length > 0) {
 				contentType = tokens[0];
@@ -136,6 +137,8 @@
 	private int firstLanguagePosition = -1;
 	private int firstContentTypePosition = -1;
 
+	private boolean reinitializing;
+
 	/*
 	 * @see INodeAdapter#isAdapterForType(Object)
 	 */
@@ -144,8 +147,7 @@
 	}
 
 	/*
-	 * @see INodeAdapter#notifyChanged(INodeNotifier, int, Object, Object,
-	 *      Object, int)
+	 * @see INodeAdapter#notifyChanged(INodeNotifier, int, Object, Object, Object, int)
 	 */
 	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
 	}
@@ -155,7 +157,7 @@
 		if (embeddedTypeHandler == handler) {
 			return;
 		}
-		// then one exists, and the new one is truely different, so we need to
+		// then one exists, and the new one is truely different, so we need to 
 		// release and remove current factories
 		if (embeddedTypeHandler != null) {
 			Iterator list = embeddedFactoryRegistry.iterator();
@@ -185,7 +187,7 @@
 	 */
 	public INodeAdapter adapt(INodeNotifier notifier, Object type) {
 		INodeAdapter result = null;
-		// if embeddedContentType hasn't been set,
+		// if embeddedContentType hasn't been set, 
 		// then we can not adapt it.
 		if (embeddedTypeHandler != null) {
 			if (embeddedFactoryRegistry != null) {
@@ -219,90 +221,77 @@
 		embeddedFactoryRegistry.add(factory);
 	}
 
-	// /**
-	// * Used by PageDirectiveWatchers to signal that some important attribute
-	// has changed, and
-	// * any cached values should be re-calcuated
-	// */
-	// void changed() {
-	// // we won't actually check if change is needed, if the model state is
-	// already changing.
-	// if (!model.isReinitializationNeeded()) {
-	// // go through our list of page watcher adapters, and updates the
-	// attributes
-	// // we're interested in, if and only if they are the earliest occurance
-	// in the resource
-	// String potentialContentType = null;
-	// String potentialLanguage = null;
-	// int contentTypePosition = -1;
-	// int languagePosition = -1;
-	// Iterator iterator = pageDirectiveWatchers.iterator();
-	// while (iterator.hasNext()) {
-	// PageDirectiveWatcher pdWatcher = (PageDirectiveWatcher)
-	// iterator.next();
-	// String contentType = pdWatcher.getContentType();
-	// String language = pdWatcher.getLanguage();
-	// int offset = pdWatcher.getOffset();
-	// if (potentialContentType == null || (hasValue(contentType) && (offset <
-	// contentTypePosition))) {
-	// potentialContentType = contentType;
-	// contentTypePosition = offset;
-	// }
-	// }
-	// // now we have the best candiates for cached values, let's see if
-	// they've really changed from
-	// // what we had. If so, note we go through the setters so side effects
-	// can take place there.
-	// potentialContentType =
-	// getMimeTypeFromContentTypeValue(potentialContentType);
-	// if (potentialContentType == null || potentialContentType.length() == 0)
-	// {
-	// //potentialContentType = getDefaultContentType();
-	// } else {
-	// setCachedContentType(potentialContentType);
-	// }
+	//	/**
+	//	 * Used by PageDirectiveWatchers to signal that some important attribute has changed, and 
+	//	 * any cached values should be re-calcuated
+	//	 */
+	//	void changed() {
+	//		// we won't actually check if change is needed, if the model state is already changing.
+	//		if (!model.isReinitializationNeeded()) {
+	//			// go through our list of page watcher adapters, and updates the attributes 
+	//			// we're interested in, if and only if they are the earliest occurance in the resource
+	//			String potentialContentType = null;
+	//			String potentialLanguage = null;
+	//			int contentTypePosition = -1;
+	//			int languagePosition = -1;
+	//			Iterator iterator = pageDirectiveWatchers.iterator();
+	//			while (iterator.hasNext()) {
+	//				PageDirectiveWatcher pdWatcher = (PageDirectiveWatcher) iterator.next();
+	//				String contentType = pdWatcher.getContentType();
+	//				String language = pdWatcher.getLanguage();
+	//				int offset = pdWatcher.getOffset();
+	//				if (potentialContentType == null || (hasValue(contentType) && (offset < contentTypePosition))) {
+	//					potentialContentType = contentType;
+	//					contentTypePosition = offset;
+	//				}
+	//			}
+	//			// now we have the best candiates for cached values, let's see if they've really changed from 
+	//			// what we had. If so, note we go through the setters so side effects can take place there.
+	//			potentialContentType = getMimeTypeFromContentTypeValue(potentialContentType);
+	//			if (potentialContentType == null || potentialContentType.length() == 0) {
+	//				//potentialContentType = getDefaultContentType();
+	//			} else {
+	//				setCachedContentType(potentialContentType);
+	//			}
 	//
-	// if (potentialLanguage != null && hasValue(potentialLanguage)) {
-	// setCachedLanguage(potentialLanguage);
-	// }
-	// }
-	// }
+	//			if (potentialLanguage != null && hasValue(potentialLanguage)) {
+	//				setCachedLanguage(potentialLanguage);
+	//			}
+	//		}
+	//	}
 	void changedContentType(int elementOffset, String newValue) {
-		// only need to process if this new value is
+		// only need to process if this new value is 
 		// earlier in the file than our current value
 		if (firstContentTypePosition == -1 || elementOffset <= firstContentTypePosition) {
-			// dw_TODO: update embedded partitioner in JSP document
-			// partitioner
-			// nsd_TODO: update embedded partitioner in JSP document
-			// partitioner
+			// dw_TODO: update embedded partitioner in JSP document partitioner
+			// nsd_TODO: update embedded partitioner in JSP document partitioner
 
-			// no need to change current value, if we're told some
+			// no need to change current value, if we're told some 
 			// earlier value is null or blank (sounds like an error, anyway)
 			if (hasValue(newValue)) {
 				firstContentTypePosition = elementOffset;
 				String potentialContentType = getMimeTypeFromContentTypeValue(newValue);
 				// only do the set processing if different
 				// from what it already is
-				// if (!potentialContentType.equalsIgnoreCase(cachedLanguage))
-				// {
+				//	if (!potentialContentType.equalsIgnoreCase(cachedLanguage)) {
 				setCachedContentType(potentialContentType);
-				// }
+				//	}
 			}
 		}
 	}
 
 	/**
-	 * Used by PageDirectiveWatchers to signal that some important attribute
-	 * has changed, and any cached values should be re-calcuated
+	 * Used by PageDirectiveWatchers to signal that some important attribute has changed, and 
+	 * any cached values should be re-calcuated
 	 */
 	void changedLanguage(int elementOffset, String newValue) {
-		// only need to process if this new value is
+		// only need to process if this new value is 
 		// earlier in the file than our current value
-		// has to be less than or equal to, in case our previous earliest one,
+		// has to be less than or equal to, in case our previous earliest one, 
 		// is itself changing!
 		if (firstLanguagePosition == -1 || elementOffset <= firstLanguagePosition) {
 
-			// no need to change current value, if we're told some
+			// no need to change current value, if we're told some 
 			// earlier value is null or blank (sounds like an error, anyway)
 			if (hasValue(newValue)) {
 				firstLanguagePosition = elementOffset;
@@ -319,21 +308,20 @@
 	}
 
 	/**
-	 * Used by PageDirectiveWatchers to signal that some important attribute
-	 * has changed, and any cached values should be re-calcuated
+	 * Used by PageDirectiveWatchers to signal that some important attribute has changed, and 
+	 * any cached values should be re-calcuated
 	 */
 	void changedPageEncoding(int elementOffset, String newValue) {
 
 		// we don't currently track active value, since
-		// just need during read and write (where its
-		// calculated. We will need in future, to
-		// acurately clone a model and to display
+		// just need during read and write (where its 
+		// calculated. We will need in future, to 
+		// acurately clone a model and to display 
 		// "current encoding" to user in status bar.
 	}
 
 	/**
 	 * Method hasValue.
-	 * 
 	 * @param contentType
 	 * @return boolean
 	 */
@@ -346,7 +334,6 @@
 
 	/**
 	 * Returns the cachedContentType.
-	 * 
 	 * @return String
 	 */
 	public String getContentType() {
@@ -358,23 +345,14 @@
 
 	/**
 	 * Method getDefaultContentType.
-	 * 
 	 * @return String
 	 */
 	private String getDefaultContentType() {
-		String type = null;
-		IFile file = getFile(model);
-		if (file != null) {
-			type = JSPFContentProperties.getProperty(JSPFContentProperties.JSPCONTENTTYPE, file, true);
-		}
-		else
-			type = "text/html"; //$NON-NLS-1$
-		return type;
+		return "text/html"; //$NON-NLS-1$
 	}
 
 	/**
 	 * Returns the cachedLanguage.
-	 * 
 	 * @return String
 	 */
 	public String getLanguage() {
@@ -385,81 +363,62 @@
 
 	/**
 	 * Method getDefaultLanguage.
-	 * 
 	 * @return String
 	 */
 	private String getDefaultLanguage() {
-		String language = null;
-		IFile file = getFile(model);
-		if (file != null) {
-			language = JSPFContentProperties.getProperty(JSPFContentProperties.JSPLANGUAGE, file, true);
-		}
-		else
-			language = "java"; //$NON-NLS-1$
-		return language;
+		return "java"; //$NON-NLS-1$
 	}
 
 	/**
 	 * Sets the cachedContentType.
-	 * 
-	 * @param cachedContentType
-	 *            The cachedContentType to set
+	 * @param cachedContentType The cachedContentType to set
 	 */
 	public void setCachedContentType(String newContentType) {
-		// if the passed in value is the same as existing, there's nothing to
-		// do.
+		// if the passed in value is the same as existing, there's nothing to do.
 		// if its different, then we need to change the contentHandler as well
 		// and, more to the point, signal a re-initializtation is needed.
-		// Note: if the value we're getting set to does not have a handler in
-		// the registry,
-		// we'll actually not set it to null or anything, we'll just continue
-		// on with the one
-		// we have. This is pretty important to avoid re-initializing on every
-		// key stroke if someone
-		// is typing in a new content type, but haven't yet finished the whole
-		// "word".
-		// However, if an contentType is not recognized, the registry returns
-		// the one
+		// Note: if the value we're getting set to does not have a handler in the registry, 
+		// we'll actually not set it to null or anything, we'll just continue on with the one
+		// we have. This is pretty important to avoid re-initializing on every key stroke if someone 
+		// is typing in a new content type, but haven't yet finished the whole "word".
+		// However, if an contentType is not recognized, the registry returns the one 
 		// for XML.
-		// if (this.cachedContentType != null &&
-		// this.cachedContentType.equalsIgnoreCase(newContentType)) { // then
-		// do nothing
-		// } else {
+		//		if (this.cachedContentType != null && this.cachedContentType.equalsIgnoreCase(newContentType)) { // then do nothing
+		//		} else {
 		this.cachedContentType = newContentType;
 		// see if we can update embedded handler
-		// if (this.cachedContentType == null ||
-		// this.cachedContentType.length() == 0) { // do nothing, don't can't
-		// get a new handler, so we'll keep what we have
-		// } else {
+		//		if (this.cachedContentType == null || this.cachedContentType.length() == 0) { // do nothing, don't can't get a new handler, so we'll keep what we have
+		//		} else {
 
-		// getHandler should always return something (never null), based
-		// on the rules in the factory.
+		// getHandler should always return something (never null), based 
+		// on the rules in the factory. 
 		EmbeddedTypeHandler handler = getHandlerFor(this.cachedContentType);
-		// we do this check for re-init here, instead of in setEmbeddedType,
-		// since setEmbeddedType is called during the normal initializtion
+		// we do this check for re-init here, instead of in setEmbeddedType, 
+		// since setEmbeddedType is called during the normal initializtion 
 		// process, when re-init is not needed (since there is no content)
 		if (embeddedTypeHandler != null && handler != null && embeddedTypeHandler != handler) {
-			// changing this embedded handler here may
+			// changing this embedded handler here may 
 			// be in the middle of anotify loop, not sure
 			// if that'll cause problems.
-
+			
 			// be sure to hold oldHandler in temp var
 			// or else setEmbeddedType will "reset" it
 			// before modelReinitNeeded(oldHandler, handler) is called
-			EmbeddedTypeHandler oldHandler = embeddedTypeHandler;
+		    EmbeddedTypeHandler oldHandler = embeddedTypeHandler;
 			setEmbeddedType(handler);
 			modelReinitNeeded(oldHandler, handler);
 		}
-		// }
+		//		}
 
-		// }
+		//		}
 
 	}
 
 	/**
-	 * This method is used to re-init based on embeddedTypeHandler changing.
-	 * It is given priority over the language change, since there its more
-	 * important to have old and new handlers's in the stateData field.
+	 * This method is used to re-init based on embeddedTypeHandler
+	 * changing. It is given priority over the language change, since
+	 * there its more important to have old and new handlers's in the 
+	 * stateData field.
 	 */
 	private void modelReinitNeeded(EmbeddedTypeHandler oldHandler, EmbeddedTypeHandler newHandler) {
 		if (model.isReinitializationNeeded()) {
@@ -480,8 +439,7 @@
 	 * Method modelReinitNeeded.
 	 */
 	private void modelReinitNeeded(String oldlanguage, String newLanguage) {
-		// bit of a short cut for now .... we dont' need language at the
-		// moment,
+		// bit of a short cut for now .... we dont' need language at the moment, 
 		// but should set the state data
 		if (model.isReinitializationNeeded()) {
 			if (Debug.displayWarnings) {
@@ -490,7 +448,7 @@
 		}
 		else {
 			try {
-				// if already being re-initialized, we don't want to
+				// if already being re-initialized, we don't want to 
 				// reset the data in the stateData field.
 				model.aboutToChangeModel();
 				model.setReinitializeStateData(newLanguage);
@@ -503,29 +461,15 @@
 	}
 
 	public void setCachedLanguage(String newLanguage) {
-		if (cachedLanguage != null && languageStateChanged(cachedLanguage, newLanguage)) { // a
-			// complete
-			// re-init
-			// overkill
-			// in
-			// current
-			// system,
-			// since
-			// really
-			// just
-			// need
-			// for
-			// the line style providers,
-			// BUT, a change in language could effect other things,
-			// and we don't expect to happen often so a little overkill isn't
-			// too bad.
-			// The deep problem is that there is no way to get at the "edit
-			// side" adpapters
+		if (cachedLanguage != null && languageStateChanged(cachedLanguage, newLanguage)) { // a complete re-init overkill in current system, since really just need for 
+			// the line style providers, 
+			// BUT, a change in language could effect other things, 
+			// and we don't expect to happen often so a little overkill isn't too bad.
+			// The deep problem is that there is no way to get at the "edit side" adpapters
 			// specifically here in model class.
-			// we have to do the model changed sequence to get the
+			// we have to do the model changed sequence to get the 
 			// screen to update.
-			// do not signal again, if signaled once (the reinit state data
-			// will be wrong.
+			// do not signal again, if signaled once (the reinit state data will be wrong.
 			// (this needs to be improved in future)
 			if (!model.isReinitializationNeeded()) {
 				modelReinitNeeded(cachedLanguage, newLanguage);
@@ -535,8 +479,8 @@
 	}
 
 	/**
-	 * This is public access method, used especially from loader, for JSP
-	 * Fragment support.
+	 * This is public access method, used especially
+	 * from loader, for JSP Fragment support. 
 	 */
 	public void setLanguage(String newLanguage) {
 		this.cachedLanguage = newLanguage;
@@ -548,14 +492,12 @@
 
 	/**
 	 * Method languageStateChange.
-	 * 
 	 * @param cachedLanguage
 	 * @param newLanguage
 	 * @return boolean
 	 */
 	private boolean languageStateChanged(String cachedLanguage, String newLanguage) {
-		boolean result = false; // languages are equal, then no change in
-		// state
+		boolean result = false; // languages are equal, then no change in state
 		if (!cachedLanguage.equalsIgnoreCase(newLanguage)) {
 			boolean oldLanguageKnown = languageKnown(cachedLanguage);
 			boolean newLanguageKnown = languageKnown(newLanguage);
@@ -566,7 +508,6 @@
 
 	/**
 	 * Method languageKnown.
-	 * 
 	 * @param cachedLanguage
 	 * @return boolean
 	 */
@@ -576,11 +517,9 @@
 
 	private IFile getFile(IStructuredModel model) {
 		String location = model.getBaseLocation();
-		if (location != null) {
-			IPath path = new Path(location);
-			if (!path.toFile().exists() && path.segmentCount() > 1) {
-				return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-			}
+		IPath path = new Path(location);
+		if (!path.toFile().exists() && path.segmentCount() > 1) {
+			return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
 		}
 		return null;
 	}
@@ -595,7 +534,6 @@
 
 	/**
 	 * Gets the embeddedContentTypeRegistry.
-	 * 
 	 * @return Returns a EmbeddedContentTypeRegistry
 	 */
 	private EmbeddedTypeRegistry getEmbeddedContentTypeRegistry() {
@@ -603,9 +541,11 @@
 	}
 
 	/**
-	 * For JSP files, text/html is the default content type. This may want
-	 * this different for types like jsv (jsp for voice xml) For now, hard
-	 * code to new instance. In future, should get instance from registry.
+	 * For JSP files, text/html is the default 
+	 * content type. This may want this different 
+	 * for types like jsv (jsp for voice xml)
+	 * For now, hard code to new instance.
+	 * In future, should get instance from registry.
 	 * 
 	 * Specification cites HTML as the default contentType.
 	 */
@@ -613,6 +553,43 @@
 		return getHandlerFor(getDefaultContentType());
 	}
 
+	public void contentSettingsChanged(IResource resource) {
+		// Note: we currently get notified multiple times, 
+		// I assume since there's mulitple fields in the properties.
+		// For now, I'll assume that once we get notified, all the 
+		// fields are accurate, so if we're reinitializing, don't 
+		// check any further. To NOT do this causes concurrent modification
+		// exceptions. To do it, may cause us to miss when user changes
+		// two fields at once. Will need to test. 
+		if (reinitializing)
+			return;
+		if (resource == null)
+			return;
+		IFile file = getFile(model);
+		if (file == null)
+			return;
+		//        String filename = null;
+		//        if (resource.FILE == resource.getType()) {
+		//        	filename = resource.getLocation().toString();
+		//        }
+		IProject project = file.getProject();
+		if (project == null)
+			return;
+		if (!project.equals(resource.getProject()))
+			return;
+		// Note: these change notifications appear to be coming 
+		// in based on any change in project. I'm not sure how
+		// to tell if they are for my particular file, or 
+		// if there's some other error I'm making in listeners.
+		// the setters below should be smart enough 
+		// to know if a meaningful change occurred, or 
+		// not. Note: we seem to get called a lot (for resources other than our own?)
+		// with lots of 'null' values. The logic below may prevent the correct unsetting
+		// of a property (such as changing from a language setting back to 'none'). 
+		// We may need a 'none' id, or something, to help detect that case, since we can't 
+		// always assume the 'null' is accurate.
+	}
+
 	public INodeNotifier getTarget() {
 		return notifierAtCreation;
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
index cdd117f..05d71b7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
@@ -82,8 +82,6 @@
 	private IProgressMonitor fProgressMonitor = null;
 	/** lock to synchronize access to the compilation unit **/
 	private byte[] fLock = null;
-	private String fMangledName;
-	private String fJspName;
 
 	public JSPTranslation(IJavaProject javaProj, JSPTranslator translator) {
 
@@ -347,57 +345,6 @@
 		}
 		return fCompilationUnit;
 	}
-
-	private String getMangledName() {
-		return fMangledName;
-	}
-	private void setMangledName(String mangledName) {
-		fMangledName = mangledName;
-	}
-	private String getJspName() {
-		return fJspName;
-	}
-
-	private void setJspName(String jspName) {
-		fJspName = jspName;
-	}
-
-	/**
-	 * Replaces mangled (servlet) name with jsp file name.
-	 * 
-	 * @param displayString
-	 * @return
-	 */
-	public String fixupMangledName(String displayString) {
-		
-		if(displayString == null)
-			return null;
-		
-		if(getJspName() == null || getMangledName() == null) {
-			// names not set yet
-			initJspAndServletNames();
-		}
-		return displayString.replaceAll(getMangledName(), getJspName());
-	}
-
-	private void initJspAndServletNames() {
-		ICompilationUnit cu = getCompilationUnit();
-		if(cu != null) {
-			String cuName = null;
-			synchronized(cu) {
-				// set some names for fixing up mangled name in proposals
-				// set mangled (servlet) name
-				 cuName = cu.getPath().lastSegment();
-			}
-			if(cuName != null) {
-				setMangledName(cuName.substring(0, cuName.lastIndexOf('.')));
-				// set name of jsp file
-				String unmangled = JSP2ServletNameUtil.unmangle(cuName);
-				setJspName(unmangled.substring(unmangled.lastIndexOf('/') + 1, unmangled.lastIndexOf('.')));
-			}
-		}
-	}
-
 	
 	/**
 	 * Originally from ReconcileStepForJava.  Creates an ICompilationUnit from the contents of the JSP document.
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
index 2570ea5..265259d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
@@ -15,7 +15,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.StringTokenizer;
 
 import org.eclipse.core.filebuffers.ITextFileBuffer;
 import org.eclipse.core.resources.IFile;
@@ -29,9 +28,7 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TextUtilities;
 import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.text.edits.DeleteEdit;
 import org.eclipse.text.edits.InsertEdit;
 import org.eclipse.text.edits.MalformedTreeException;
@@ -39,12 +36,9 @@
 import org.eclipse.text.edits.ReplaceEdit;
 import org.eclipse.text.edits.TextEdit;
 import org.eclipse.text.edits.UndoEdit;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 
 
 /**
@@ -187,11 +181,6 @@
 				}
 				else {
 					replaceText = newJavaText.substring(deltas[i].postOffset, deltas[i].postOffset + deltas[i].postLength);
-					
-					// get rid of pre and post white space or fine tuned adjustment later.
-					// fix text here...
-					replaceText = fixJspReplaceText(replaceText, jspPos.offset);
-					
 					jspEdits.add(new ReplaceEdit(jspPos.offset, jspPos.length, replaceText));
 				}
 				if(DEBUG) 
@@ -229,109 +218,6 @@
 		return allJspEdits;
 	}
 	
-	private String fixJspReplaceText(String replaceText, int jspOffset) {
-		
-		// result is the text inbetween the delimiters
-		// eg.
-		// 
-		// <%  result 
-		// %>
-		String result = replaceText.trim();
-		String preDelimiterWhitespace = "";
-		
-		IDocument jspDoc = getJspDocument();
-		if(jspDoc instanceof IStructuredDocument) {
-			IStructuredDocument sDoc = (IStructuredDocument)jspDoc;
-			IStructuredDocumentRegion[] regions = sDoc.getStructuredDocumentRegions(0, jspOffset);
-			IStructuredDocumentRegion lastRegion = regions[regions.length-1];
-			
-			// only specifically modify scriptlets
-			if(lastRegion != null && lastRegion.getType() == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN) {
-				for (int i = regions.length-1; i >= 0; i--) {
-					IStructuredDocumentRegion region = regions[i];
-					
-					// is there a better way to check whitespace?
-					if(region.getType() == DOMRegionContext.XML_CONTENT && region.getFullText().trim().equals("")) {
-						
-						preDelimiterWhitespace = region.getFullText();
-						preDelimiterWhitespace = preDelimiterWhitespace.replaceAll("\r", "");
-						preDelimiterWhitespace = preDelimiterWhitespace.replaceAll("\n", "");
-						
-						// need to determine indent for that first line...
-						 String initialIndent = getInitialIndent(result);
-						 
-						 // fix the first line of java code
-						result = TextUtilities.getDefaultLineDelimiter(sDoc) 
-									+ initialIndent 
-									+ result;
-						
-						result = adjustIndent(result, preDelimiterWhitespace, TextUtilities.getDefaultLineDelimiter(sDoc));
-						
-						// add whitespace before last delimiter to match
-					    // it w/ the opening delimiter
-						result = result + TextUtilities.getDefaultLineDelimiter(sDoc) + preDelimiterWhitespace;
-						break;
-					}
-				}
-			}
-		}
-		return result;
-	}
-	
-	private String adjustIndent(String textBefore, String indent, String delim) {
-		
-		// first replace multiple indent with single indent
-		// the triple indent occurs because the scriptlet code
-		// actually occurs under:
-		// 
-		//    class
-		//       method
-		//          code
-		// 
-		// in the translated java document
-		
-		textBefore = textBefore.replaceAll("\t\t\t", "\t");
-		
-		// get indent after 2nd line break
-		StringBuffer textAfter = new StringBuffer();
-		// will this work on mac?
-		textBefore = textBefore.replaceAll("\r", "");
-		StringTokenizer st = new StringTokenizer(textBefore, "\n", true);
-		while(st.hasMoreTokens()) {
-			String tok = st.nextToken();
-			if(tok.equals("\n")) {
-				textAfter.append(delim);
-			}
-			else {
-				// prepend each line w/ specified indent
-				textAfter.append(indent);
-				textAfter.append(tok);
-			}
-		}
-		return textAfter.toString();
-		
-	}
-	
-	private String getInitialIndent(String result) {
-		
-		// get indent after 2nd line break
-		String indent = "";
-		StringTokenizer st = new StringTokenizer(result, "\r\n", false);
-		if(st.countTokens() > 1) {
-			String tok = st.nextToken();
-			tok = st.nextToken();
-			int index =0;
-			if(tok != null) {
-				while(tok.charAt(index) == ' ' || tok.charAt(index) == '\t') {
-					indent += tok.charAt(index);
-					index++;
-				}
-			}
-		}
-		return indent;
-	}
-
-
 	/**
 	 * Combines an array of edits into one MultiTextEdit (with the appropriate coverage region)
 	 * @param edits
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
index 7b64c8d..d652586 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
@@ -21,8 +21,8 @@
 import org.eclipse.text.edits.MultiTextEdit;
 import org.eclipse.text.edits.ReplaceEdit;
 import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
index 639ec4f..41c770d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
@@ -46,17 +46,17 @@
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibVariable;
 import org.eclipse.jst.jsp.core.jspel.IJSPELTranslator;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
 import org.eclipse.wst.xml.core.internal.parser.ContextRegionContainer;
@@ -73,23 +73,22 @@
  * @author pavery
  */
 public class JSPTranslator {
+	
+	private static final String EL_TRANSLATOR_EXTENSION_NAME = "elTranslator"; //$NON-NLS-1$ 
 
-	// the name of the element in the extension point
-	private static final String EL_TRANSLATOR_EXTENSION_NAME = "elTranslator"; //$NON-NLS-1$
-
-	private static final String ELTRANSLATOR_PROP_NAME = "ELTranslator"; //$NON-NLS-1$
+	private static final String ELTRANSLATOR_PROP_NAME = "ELTranslator"; //$NON-NLS-1$ 
 
 	// Default EL Translator
-	private static final String DEFAULT_JSP_EL_TRANSLATOR_ID = "org.eclipse.jst.jsp.defaultJSP20"; //$NON-NLS-1$
-
+	private static final String DEFAULT_JSP_EL_TRANSLATOR_ID = "org.eclipse.jst.jsp.defaultJSP20"; //$NON-NLS-1$ 
+	
 	// handy plugin ID constant
-	private static final String JSP_CORE_PLUGIN_ID = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$
+	private static final String JSP_CORE_PLUGIN_ID = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$ 
 
 	// for debugging
 	private static final boolean DEBUG;
 
 	private IJSPELTranslator fELTranslator = null;
-
+	
 	static {
 		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspjavamapping"); //$NON-NLS-1$
 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
@@ -99,11 +98,11 @@
 
 	private String fClassHeader = "public class _JSPServlet extends "; //$NON-NLS-1$
 	private String fClassname = "_JSPServlet"; //$NON-NLS-1$
-
+    
 	private String fImplicitImports = "import javax.servlet.*;" + ENDL + //$NON-NLS-1$
-				"import javax.servlet.http.*;" + ENDL + //$NON-NLS-1$
-				"import javax.servlet.jsp.*;" + ENDL + ENDL; //$NON-NLS-1$
-
+										"import javax.servlet.http.*;" + ENDL +  //$NON-NLS-1$
+										"import javax.servlet.jsp.*;" + ENDL + ENDL; //$NON-NLS-1$
+    
 	private String fServiceHeader = "public void _jspService(javax.servlet.http.HttpServletRequest request," + //$NON-NLS-1$
 				" javax.servlet.http.HttpServletResponse response)" + ENDL + //$NON-NLS-1$
 				"\t\tthrows java.io.IOException, javax.servlet.ServletException {" + ENDL + //$NON-NLS-1$
@@ -163,7 +162,7 @@
 	protected final static int DECLARATION = 2;
 	protected final static int EXPRESSION = 4;
 	protected final static int SCRIPTLET = 8;
-
+	
 	/** used to avoid infinite looping include files */
 	private Stack fIncludes = null;
 	/** mostly for helper classes, so they parse correctly */
@@ -196,9 +195,9 @@
 	private HashMap fDeclarationRanges = new HashMap();
 
 	private HashMap fUseBeanRanges = new HashMap();
-
+	
 	private HashMap fUserELRanges = new HashMap();
-
+	
 	/**
 	 * ranges that don't directly map from java code to JSP code (eg.
 	 * <%@include file="included.jsp"%>
@@ -212,9 +211,9 @@
 	 * the file or strucdtured document depending what is available
 	 */
 	private StringBuffer fJspTextBuffer = new StringBuffer();
+	
 
-
-	/**
+	/** 
 	 * List of EL problems to be translated
 	 */
 	private ArrayList fELProblems = new ArrayList();
@@ -235,8 +234,10 @@
 		fProgressMonitor = monitor;
 		fStructuredModel = node.getModel();
 		String baseLocation = fStructuredModel.getBaseLocation();
-
+		
 		fELTranslatorID = getELTranslatorProperty(baseLocation);
+		
+		// fPositionNode = node;
 
 		fStructuredDocument = fStructuredModel.getStructuredDocument();
 
@@ -259,9 +260,8 @@
 		// fStructuredModel, fPositionNode, fModelQuery, fStructuredDocument
 		// are all null
 		fProgressMonitor = monitor;
-
+		
 		fELTranslatorID = getELTranslatorProperty(jspFile);
-
 		String className = createClassname(jspFile);
 		if (className.length() > 0) {
 			setClassname(className);
@@ -294,46 +294,39 @@
 	}
 
 	/**
-	 * Get the value of the ELTranslator property from a workspace relative
+	 * Get the value of the ELTranslator property from a workspace relative 
 	 * path string
 	 * 
-	 * @param baseLocation
-	 *            Workspace-relative string path
+	 * @param baseLocation Workspace-relative string path
 	 * @return Value of the ELTranslator property associated with the project.
 	 */
-	private String getELTranslatorProperty(String baseLocation) {
+	private String getELTranslatorProperty(String baseLocation){
 		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
 		String elTranslatorValue = null;
 		IFile file = workspaceRoot.getFile(new Path(baseLocation));
-		if (file != null) {
-			elTranslatorValue = getELTranslatorProperty(file);
-		}
+		elTranslatorValue = getELTranslatorProperty(file);
 		return elTranslatorValue;
 	}
 
 	/**
 	 * Get the value of the ELTranslator property from an IFile
-	 * 
-	 * @param file
-	 *            IFile
+	 *  
+	 * @param file IFile 
 	 * @return Value of the ELTranslator property associated with the project.
 	 */
 	private String getELTranslatorProperty(IFile file) {
 		String elTranslatorValue = null;
-		if (file != null) {
-			if (file.exists()) {
-				try {
-					elTranslatorValue = file.getPersistentProperty(new QualifiedName(JSP_CORE_PLUGIN_ID, ELTRANSLATOR_PROP_NAME));
-					if (null == elTranslatorValue) {
-
-						elTranslatorValue = file.getProject().getPersistentProperty(new QualifiedName(JSP_CORE_PLUGIN_ID, ELTRANSLATOR_PROP_NAME));
-					}
-				}
-				catch (CoreException e) {
-					// ISSUE: why do we log this here? Instead of allowing to throwup?
-					Logger.logException(e);
-				}
-
+		try {
+			elTranslatorValue = file.getPersistentProperty(new QualifiedName(JSP_CORE_PLUGIN_ID, ELTRANSLATOR_PROP_NAME)); //$NON-NLS-1$
+		} catch (CoreException e) {
+			Logger.logException(e);
+		}
+		
+		if(null == elTranslatorValue) {
+			try {
+				elTranslatorValue = file.getProject().getPersistentProperty(new QualifiedName(JSP_CORE_PLUGIN_ID, ELTRANSLATOR_PROP_NAME)); //$NON-NLS-1$
+			} catch (CoreException e) {
+				Logger.logException(e);
 			}
 		}
 		return elTranslatorValue;
@@ -447,9 +440,9 @@
 		fIndirectRanges.clear();
 
 		fJspTextBuffer = new StringBuffer();
-
+		
 		fELProblems = new ArrayList();
-
+		
 	}
 
 	/**
@@ -483,12 +476,12 @@
 					+ fUserCode.length() + fTryCatchEnd.length() // try/catch
 					// end
 					+ fFooter.length());
-
+		
 		int javaOffset = 0;
-
+		
 		fResult.append(fImplicitImports);
 		javaOffset += fImplicitImports.length();
-
+		
 		// updateRanges(fIndirectImports, javaOffset);
 		updateRanges(fImportRanges, javaOffset);
 		// user imports
@@ -505,7 +498,7 @@
 		// user declarations
 		append(fUserDeclarations);
 		javaOffset += fUserDeclarations.length();
-
+		
 		updateRanges(fUserELRanges, javaOffset);
 		append(fUserELExpressions);
 		javaOffset += fUserELExpressions.length();
@@ -540,7 +533,7 @@
 		fJava2JspRanges.putAll(fDeclarationRanges);
 		fJava2JspRanges.putAll(fCodeRanges);
 		fJava2JspRanges.putAll(fUserELRanges);
-
+		
 	}
 
 	/**
@@ -637,13 +630,13 @@
 
 	/**
 	 * Only valid after a configure(...), translate(...) or
-	 * translateFromFile(...) call
+	 * translateFromFile(...) call	
 	 * 
 	 * @return the current result (java translation) buffer
 	 */
 	public final StringBuffer getTranslation() {
 
-		if (DEBUG) {
+		if (DEBUG) {	
 			StringBuffer debugString = new StringBuffer();
 			try {
 				Iterator it = fJava2JspRanges.keySet().iterator();
@@ -663,7 +656,7 @@
 					debugString.append("\n"); //$NON-NLS-1$
 				}
 			}
-			catch (Exception e) {
+			catch(Exception e) {
 				Logger.logException("JSPTranslation error", e); //$NON-NLS-1$
 			}
 			Logger.log(Logger.INFO_DEBUG, debugString.toString());
@@ -681,13 +674,13 @@
 	public final String getJspText() {
 		return fJspTextBuffer.toString();
 	}
-
+	
 	protected void addTaglibVariables(String tagToAdd) {
 		IFile f = getFile();
-
-		if (f == null || !f.exists())
+		
+		if(f == null || !f.exists()) 
 			return;
-
+		
 		TaglibHelper helper = TaglibHelperManager.getInstance().getTaglibHelper(f);
 		IStructuredDocumentRegion customTag = getCurrentNode();
 		TaglibVariable[] taglibVars = helper.getTaglibVariables(tagToAdd, getStructuredDocument(), customTag);
@@ -697,16 +690,16 @@
 			appendToBuffer(decl, fUserCode, false, fCurrentNode);
 		}
 	}
-
+	
 	private IFile getFile() {
 		IFile f = null;
 		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getStructuredDocument());
 		try {
-			if (sModel != null)
+			if(sModel != null) 
 				f = FileBuffers.getWorkspaceFileAtLocation(new Path(sModel.getBaseLocation()));
 		}
 		finally {
-			if (sModel != null)
+			if(sModel != null)
 				sModel.releaseFromRead();
 		}
 		return f;
@@ -815,13 +808,13 @@
 
 		// custom tags need their own scope {}
 		handleScopingIfNecessary(containerRegion);
-
+		
 		Iterator regions = containerRegion.getRegions().iterator();
 		ITextRegion region = null;
 		while (regions.hasNext()) {
-
+			
 			region = (ITextRegion) regions.next();
-
+			
 			String type = region.getType();
 
 			// content assist was not showing up in JSP inside a javascript
@@ -857,31 +850,31 @@
 		// code within a custom tag gets its own scope
 		// so if we encounter a start of a custom tag, we add '{'
 		// and for the end of a custom tag we add '}'
-		if (containerRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
+		if(containerRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
 			// don't add '{' if it's a self closing tag
-			if (!isSelfClosingTag(containerRegion)) {
-				if (isCustomTag(containerRegion)) {
+			if(!isSelfClosingTag(containerRegion)) {
+				if(isCustomTag(containerRegion)) {
 					startScope();
 				}
 			}
 		}
-		else if (containerRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
-			if (isCustomTag(containerRegion)) {
+		else if(containerRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
+			if(isCustomTag(containerRegion)) {
 				endScope();
 			}
 		}
 	}
 
 	private void startScope() {
-		// fScopeDepth++;
+		//fScopeDepth++;
 		StringBuffer text = new StringBuffer();
-		// for(int i=0; i<fScopeDepth; i++) text.append(" "); //$NON-NLS-1$
+		//for(int i=0; i<fScopeDepth; i++) text.append(" "); //$NON-NLS-1$
 		text.append("{ // <"); //$NON-NLS-1$
 		text.append(getRegionName(fCurrentNode));
 		text.append(">\n"); //$NON-NLS-1$
 		appendToBuffer(text.toString(), fUserCode, false, fCurrentNode); //$NON-NLS-1$
 	}
-
+	
 	private void endScope() {
 		StringBuffer text = new StringBuffer();
 		text.append("} // </"); //$NON-NLS-1$
@@ -889,42 +882,41 @@
 		text.append(">\n"); //$NON-NLS-1$
 		appendToBuffer(text.toString(), fUserCode, false, fCurrentNode); //$NON-NLS-1$
 	}
-
+	
 	private boolean isSelfClosingTag(ITextRegionCollection containerRegion) {
-
-		if (containerRegion == null)
+		
+		if(containerRegion == null)
 			return false;
-
+		
 		ITextRegionList regions = containerRegion.getRegions();
-		ITextRegion r = regions.get(regions.size() - 1);
+		ITextRegion r = regions.get(regions.size()-1);
 		return r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
 	}
 
 	private boolean isCustomTag(ITextRegionCollection containerRegion) {
 		String tagName = getRegionName(containerRegion);
-
-		if (tagName == null)
+		
+		if(tagName == null)
 			return false;
-
-		if (tagName.indexOf(":") > 0 && !tagName.startsWith("jsp")) //$NON-NLS-1$  //$NON-NLS-2$
+		
+		if(tagName.indexOf(":") > 0 && !tagName.startsWith("jsp"))  //$NON-NLS-1$  //$NON-NLS-2$
 			return true;
-
+		
 		return false;
 	}
-
+	
 	private String getRegionName(ITextRegionCollection containerRegion) {
 		ITextRegionList regions = containerRegion.getRegions();
 		ITextRegion nameRegion = null;
 		for (int i = 0; i < regions.size(); i++) {
 			ITextRegion r = regions.get(i);
-			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+			if(r.getType() == DOMRegionContext.XML_TAG_NAME) {
 				nameRegion = r;
 				break;
 			}
 		}
 		return nameRegion != null ? containerRegion.getText(nameRegion).trim() : null;
 	}
-
 	/*
 	 * ////////////////////////////////////////////////////////////////////////////////// **
 	 * TEMP WORKAROUND FOR CMVC 241882 Takes a String and blocks out
@@ -941,6 +933,7 @@
 		helper.reset(blockText, startOfBlock);
 		// force parse
 		helper.forceParse();
+		helper.writeToBuffers();
 	}
 
 	/*
@@ -996,7 +989,7 @@
 		if (regions.hasNext()) {
 			r = (ITextRegion) regions.next();
 			// <jsp:directive.xxx > comes in as this
-			if (r.getType() == DOMRegionContext.XML_TAG_NAME || r.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME)
+			if (r.getType() == DOMRegionContext.XML_TAG_NAME || r.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) 
 
 			{
 				String fullTagName = container.getFullText(r).trim();
@@ -1008,7 +1001,7 @@
 				{
 					if (st.hasMoreTokens()) {
 						String jspTagName = st.nextToken();
-
+						
 						if (jspTagName.equals("scriptlet")) //$NON-NLS-1$
 						{
 							translateXMLJSPContent(SCRIPTLET);
@@ -1032,7 +1025,7 @@
 								else if (directiveName.equals("include")) { //$NON-NLS-1$
 
 									String fileLocation = ""; //$NON-NLS-1$
-
+									
 									// skip to required "file" attribute,
 									// should be safe because
 									// "file" is the only attribute for the
@@ -1053,7 +1046,7 @@
 									// setCurrentNode(getCurrentNode().getNext());
 									if (getCurrentNode() != null) {
 										// 'regions' contain the attrs
-										translatePageDirectiveAttributes(regions);
+										translatePageDirectiveAttributes(regions); 
 									}
 								}
 							}
@@ -1062,25 +1055,25 @@
 							// <jsp:include page="filename") />
 							checkAttributeValueContainer(regions, "page"); //$NON-NLS-1$
 						}
-						else if (jspTagName.equals("forward")) { //$NON-NLS-1$
+						else if(jspTagName.equals("forward")) { //$NON-NLS-1$
 							checkAttributeValueContainer(regions, "page"); //$NON-NLS-1$
 						}
-						else if (jspTagName.equals("param")) { //$NON-NLS-1$
+						else if(jspTagName.equals("param")) { //$NON-NLS-1$
 							checkAttributeValueContainer(regions, "value"); //$NON-NLS-1$
 						}
-						else if (jspTagName.equals("setProperty")) { //$NON-NLS-1$
+						else if(jspTagName.equals("setProperty")) { //$NON-NLS-1$
 							checkAttributeValueContainer(regions, "value"); //$NON-NLS-1$
 						}
 						else if (jspTagName.equals("useBean")) //$NON-NLS-1$
 						{
 							checkAttributeValueContainer(regions, "name"); //$NON-NLS-1$
 							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=103004
-							// advanceNextNode(); // get the content
+							//advanceNextNode(); // get the content
 							if (getCurrentNode() != null) {
 								translateUseBean(container); // 'regions'
 							}
 						}
-
+	
 					}
 				}
 				else {
@@ -1089,7 +1082,6 @@
 			}
 		}
 	}
-
 	/**
 	 * translates embedded containers for ALL attribute values
 	 * 
@@ -1126,10 +1118,9 @@
 			}
 		}
 	}
-
+	
 	/**
 	 * translates embedded container for specified attribute
-	 * 
 	 * @param regions
 	 * @param attrName
 	 */
@@ -1139,51 +1130,59 @@
 			r = (ITextRegion) regions.next();
 			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME && getCurrentNode().getText(r).equals(attrName)) { //$NON-NLS-1$
 				// skip to attribute value
-				while (regions.hasNext() && (r = (ITextRegion) regions.next()) != null) {
-					if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
+				while((r = (ITextRegion)regions.next()) != null) {
+					if( r.getType() ==  DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
 						break;
 				}
 				// forces embedded region to be translated
-				if (r instanceof ContextRegionContainer) {
-					translateEmbeddedJSPInAttribute((ContextRegionContainer) r);
+				if(r instanceof ContextRegionContainer) {
+					translateEmbeddedJSPInAttribute((ContextRegionContainer)r);
 				}
 				break;
 			}
 		}
 	}
-
-	/*
+	
+	/* 
 	 * example:
 	 * 
-	 * <jsp:scriptlet>scriptlet jsp-java content <![CDATA[ more jsp java ]]>
-	 * jsp-java content... <![CDATA[ more jsp java ]]> </jsp:scriptlet>
-	 * 
+	 * <jsp:scriptlet>scriptlet
+	 * jsp-java content
+	 * <![CDATA[ 
+	 *   more jsp java
+	 *  ]]>
+	 * jsp-java content...
+	 *   <![CDATA[ 
+	 *      more jsp java
+	 *    ]]>
+	 * </jsp:scriptlet>
+	 *
 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=93366
-	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=88590 translate
-	 * everything inbetween <scriptlet> tags, which may be more than one
-	 * region (esp. CDATA)
+	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=88590
+	 * translate everything inbetween <scriptlet> tags, which may 
+	 * be more than one region (esp. CDATA)
 	 * 
 	 */
 	private void translateXMLJSPContent(int type) {
-
+		
 		IStructuredDocumentRegion sdr = getCurrentNode().getNext();
 		int start = sdr.getStartOffset();
 		int end = sdr.getEndOffset();
 		String sdrText = ""; //$NON-NLS-1$
-
-		// read structured document regions until
+		
+		// read structured document regions until 
 		// </jsp:scriptlet> or EOF
-		while (sdr != null && sdr.getType() != DOMRegionContext.XML_TAG_NAME) {
-
+		while(sdr != null && sdr.getType() != DOMRegionContext.XML_TAG_NAME) {
+			
 			// setup for next region
 			start = sdr.getStartOffset();
 			sdrText = sdr.getText();
-
-			if (sdr.getType() == DOMRegionContext.XML_CDATA_TEXT) {
-
+			
+			if(sdr.getType() == DOMRegionContext.XML_CDATA_TEXT){
+				
 				// just to be safe, make sure CDATA start & end are there
-				if (sdrText.startsWith("<![CDATA[") && sdrText.endsWith("]]>")) { //$NON-NLS-1$ //$NON-NLS-2$
-
+				if(sdrText.startsWith("<![CDATA[") && sdrText.endsWith("]]>")) { //$NON-NLS-1$ //$NON-NLS-2$
+					
 					start = sdr.getStartOffset() + 9; // <![CDATA[
 					end = sdr.getEndOffset() - 3; // ]]>
 					sdrText = sdrText.substring(9, sdrText.length() - 3);
@@ -1191,9 +1190,9 @@
 				}
 			}
 			else {
-
+				
 				// handle entity references
-				sdrText = EscapedTextUtil.getUnescapedText(sdrText);
+				sdrText = EscapedTextUtil.getUnescapedText(sdrText);		
 				end = sdr.getEndOffset();
 				writeToBuffer(type, sdrText, start, end);
 			}
@@ -1204,15 +1203,15 @@
 	}
 
 	private void writeToBuffer(int type, String content, int jspStart, int jspEnd) {
-		switch (type) {
-			case SCRIPTLET :
-				translateScriptletString(content, getCurrentNode(), jspStart, jspEnd - jspStart);
+		switch(type) {
+			case SCRIPTLET:
+				translateScriptletString(content, getCurrentNode(), jspStart, jspEnd-jspStart);
 				break;
-			case EXPRESSION :
-				translateExpressionString(content, getCurrentNode(), jspStart, jspEnd - jspStart);
+			case EXPRESSION:
+				translateExpressionString(content, getCurrentNode(), jspStart, jspEnd-jspStart);
 				break;
-			case DECLARATION :
-				translateDeclarationString(content, getCurrentNode(), jspStart, jspEnd - jspStart);
+			case DECLARATION:
+				translateDeclarationString(content, getCurrentNode(), jspStart, jspEnd-jspStart);
 				break;
 		}
 	}
@@ -1271,67 +1270,57 @@
 				setCursorOwner(getJSPTypeForRegion(region));
 			}
 		}
-	}
+ }
 
-
+	
 	private void translateEL(String elText, String delim, IStructuredDocumentRegion currentNode, int contentStart, int contentLength) {
 		IJSPELTranslator translator = getELTranslator();
-		if (null != translator) {
+		if(null != translator) {
 			translator.translateEL(elText, delim, currentNode, contentStart, contentLength, fUserELExpressions, fUserELRanges, fStructuredDocument);
 		}
 	}
-
+	
 	/**
 	 * Discover and instantiate an EL translator.
 	 */
 	public IJSPELTranslator getELTranslator() {
-		if (fELTranslator == null) {
+		if(fELTranslator == null) {
+			
+			IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+					JSP_CORE_PLUGIN_ID, // name of plugin that exposes this extension point
+					EL_TRANSLATOR_EXTENSION_NAME); // - extension id
 
-			IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(JSP_CORE_PLUGIN_ID, // name
-						// of
-						// plugin
-						// that
-						// exposes
-						// this
-						// extension
-						// point
-						EL_TRANSLATOR_EXTENSION_NAME); // - extension id
-
-			// Iterate over all declared extensions of this extension point.
-			// A single plugin may extend the extension point more than once,
-			// although it's not recommended.
+			// Iterate over all declared extensions of this extension point.  
+			// A single plugin may extend the extension point more than once, although it's not recommended.
 			IConfigurationElement bestTranslator = null;
 			IExtension[] extensions = extensionPoint.getExtensions();
-			for (int curExtension = 0; curExtension < extensions.length; curExtension++) {
+			for(int curExtension=0; curExtension < extensions.length; curExtension++) {
 				IExtension extension = extensions[curExtension];
-
+				
 				IConfigurationElement[] translators = extension.getConfigurationElements();
-				for (int curTranslator = 0; curTranslator < translators.length; curTranslator++) {
-
+				for(int curTranslator = 0; curTranslator < translators.length; curTranslator++) {
+					
 					IConfigurationElement elTranslator = translators[curTranslator];
-
-					if (!EL_TRANSLATOR_EXTENSION_NAME.equals(elTranslator.getName())) { // -
-						// name
-						// of
-						// configElement
+					
+					if (!EL_TRANSLATOR_EXTENSION_NAME.equals(elTranslator.getName())) { // - name of configElement 
 						continue;
 					}
-
+					
 					String idString = elTranslator.getAttribute("id"); //$NON-NLS-1$
-					if (null != idString && idString.equals(fELTranslatorID) || (null == bestTranslator && DEFAULT_JSP_EL_TRANSLATOR_ID.equals(idString))) {
+					if(null != idString && idString.equals(fELTranslatorID) || 
+							(null == bestTranslator && DEFAULT_JSP_EL_TRANSLATOR_ID.equals(idString))) {
 						bestTranslator = elTranslator;
 					}
 				}
 			}
 
-			if (null != bestTranslator) {
+			if(null != bestTranslator) {
 				try {
 					Object execExt = bestTranslator.createExecutableExtension("class"); //$NON-NLS-1$
 					if (execExt instanceof IJSPELTranslator) {
-						return fELTranslator = (IJSPELTranslator) execExt;
-					}
-				}
-				catch (CoreException e) {
+						return fELTranslator = (IJSPELTranslator)execExt;
+					} 
+				} catch (CoreException e) {
 					Logger.logException(e);
 				}
 			}
@@ -1362,7 +1351,7 @@
 	 * for example: <a href="index.jsp?p=<%=abc%>b=<%=xyz%>">abc</a>
 	 */
 	private void translateEmbeddedJSPInAttribute(ITextRegionCollection embeddedContainer) {
-		// THIS METHOD IS A FIX FOR
+		// THIS METHOD IS A FIX FOR 
 		// jsp embedded in attribute regions
 		// loop all regions
 		ITextRegionList embeddedRegions = embeddedContainer.getRegions();
@@ -1380,7 +1369,7 @@
 				String regionType = embeddedRegions.get(i + 1).getType();
 				if (regionType == DOMJSPRegionContexts.JSP_CONTENT || regionType == DOMJSPRegionContexts.JSP_EL_CONTENT)
 					content = embeddedRegions.get(i + 1);
-
+				
 			}
 
 			if (content != null) {
@@ -1394,23 +1383,19 @@
 
 				if (type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN) {
 					fLastJSPType = EXPRESSION;
-					// translateExpressionString(embeddedContainer.getText(content),
-					// fCurrentNode, contentStart, content.getLength());
+					//translateExpressionString(embeddedContainer.getText(content), fCurrentNode, contentStart, content.getLength());
 					translateExpressionString(embeddedContainer.getText(content), embeddedContainer, contentStart, content.getLength());
 				}
 				else if (type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN) {
 					fLastJSPType = SCRIPTLET;
-					// translateScriptletString(embeddedContainer.getText(content),
-					// fCurrentNode, contentStart, content.getLength());
+					//translateScriptletString(embeddedContainer.getText(content), fCurrentNode, contentStart, content.getLength());
 					translateScriptletString(embeddedContainer.getText(content), embeddedContainer, contentStart, content.getLength());
 				}
 				else if (type == DOMJSPRegionContexts.JSP_DECLARATION_OPEN) {
 					fLastJSPType = DECLARATION;
-					// translateDeclarationString(embeddedContainer.getText(content),
-					// fCurrentNode, contentStart, content.getLength());
+					//translateDeclarationString(embeddedContainer.getText(content), fCurrentNode, contentStart, content.getLength());
 					translateDeclarationString(embeddedContainer.getText(content), embeddedContainer, contentStart, content.getLength());
-				}
-				else if (type == DOMJSPRegionContexts.JSP_EL_OPEN) {
+				} else if (type == DOMJSPRegionContexts.JSP_EL_OPEN) {
 					fLastJSPType = EXPRESSION;
 					translateEL(embeddedContainer.getText(content), embeddedContainer.getText(delim), fCurrentNode, contentStart, content.getLength());
 				}
@@ -1520,10 +1505,9 @@
 			while (it.hasNext()) {
 				tracker = (CMDocumentTracker) it.next();
 				sdRegion = tracker.getStructuredDocumentRegion();
-				// since may be call from another thread (like a background
-				// job)
+				// since may be call from another thread (like a background job)
 				// this check is to be safer
-				if (sdRegion != null && !sdRegion.isDeleted()) {
+				if(sdRegion != null && !sdRegion.isDeleted()) {
 					taglibRegions = sdRegion.getRegions().iterator();
 					while (sdRegion != null && !sdRegion.isDeleted() && taglibRegions.hasNext()) {
 						r = (ITextRegion) taglibRegions.next();
@@ -1650,6 +1634,7 @@
 				getIncludes().push(fileLocation);
 				JSPIncludeRegionHelper helper = new JSPIncludeRegionHelper(this);
 				helper.parse(fileLocation);
+				helper.writeToBuffers();
 				getIncludes().pop();
 			}
 		}
@@ -1755,9 +1740,9 @@
 	 * @param addToMap
 	 */
 	private void appendToBuffer(String newText, StringBuffer buffer, boolean addToMap, ITextRegionCollection jspReferenceRegion, int jspPositionStart, int jspPositionLength, boolean isIndirect) {
-
+		
 		int origNewTextLength = newText.length();
-
+		
 		// nothing to append
 		if (jspReferenceRegion == null)
 			return;
@@ -1816,9 +1801,6 @@
 		boolean isUseBean = false;
 		for (int i = 0; i < regions.size(); i++) {
 			r = regions.get(i);
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128490
-			// length of 11 is the length of jsp:useBean
-			// and saves the expensive getText.equals call
 			if(r.getType() == DOMRegionContext.XML_TAG_NAME) {
 				if (r.getTextLength() == 11 && jspReferenceRegion.getText(r).equals("jsp:useBean")) { //$NON-NLS-1$
 					isUseBean = true;
@@ -2172,7 +2154,7 @@
 		}
 		else if (r != null && r.getType() == DOMRegionContext.XML_CDATA_TEXT) {
 			if (r instanceof ITextRegionContainer) // only interested in
-			// contents
+													// contents
 			{
 				// navigate to next region container (which should be a JSP
 				// region)
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
index 583ec8c..6a7ae9d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
@@ -11,6 +11,7 @@
 package org.eclipse.jst.jsp.core.internal.java;
 
 import java.io.InputStream;
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
@@ -20,7 +21,6 @@
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jst.jsp.core.internal.Logger;
 import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
 import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
@@ -29,7 +29,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
@@ -47,6 +47,10 @@
 	protected String fTextToParse = null;
 	// need this if not at the start of the document (eg. parsing just a script block)
 	protected int fStartOfTextToParse = 0;
+	// buffers for text that this class parses	
+	protected List fScriptlets = new ArrayList();
+	protected List fExpressions = new ArrayList();
+	protected List fDeclarations = new ArrayList();
 	// name of the open tag that was last handled (if we are interested in it)
 	protected String fTagname = null;
 	protected String fTextBefore = ""; //$NON-NLS-1$
@@ -100,6 +104,23 @@
 		forceParse();
 	}
 
+	/*
+	 * writes out scriptlet, expression, and declaration buffers
+	 * to the ongoing buffers in the JSPTranslator (calls to outer JSPTranslator methods)
+	 */
+	public void writeToBuffers() {
+		IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
+		// currentNode should be the <%@page include="xxx"%> StructuredDocumentRegion
+		for (int i = 0; i < fScriptlets.size(); i++) {
+			this.fTranslator.translateScriptletString((String) fScriptlets.get(i), currentNode, currentNode.getStartOffset(), currentNode.getLength());
+		}
+		for (int i = 0; i < fExpressions.size(); i++) {
+			this.fTranslator.translateExpressionString((String) fExpressions.get(i), currentNode, currentNode.getStartOffset(), currentNode.getLength());
+		}
+		for (int i = 0; i < fDeclarations.size(); i++) {
+			this.fTranslator.translateDeclarationString((String) fDeclarations.get(i), currentNode, currentNode.getStartOffset(), currentNode.getLength());
+		}
+	}
 
 	/*
 	 * listens to parser node parsed events
@@ -118,23 +139,8 @@
 					fTagname = nameStr;
 				else
 					fTagname = null;
-				
-
-				// this section assumes important content (to translate)
-				// IS the opening tag
-				
-				// handle include and directive
-				if(fTagname != null && sdRegion.getFirstRegion().getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) {
-					processOtherRegions(sdRegion);	
-				}
-				// handle jsp:useBean
-				if(fTagname != null && fTagname.equals(JSP11Namespace.ElementName.USEBEAN)) {
-					processUseBean(sdRegion);
-				}
 			}
 			else if (sdRegion.getFirstRegion().getType() == DOMJSPRegionContexts.JSP_CONTENT || sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_CONTENT) {
-				// this section assumes important content (to translate)
-				// is AFTER the opening tag
 				if (fTagname != null) {
 					// assign contents to one of the tables
 					if (isScriptlet(fTagname)) {
@@ -146,8 +152,20 @@
 					else if (isDeclaration(fTagname)) {
 						processDeclaration(sdRegion);
 					}
+					else {
+						if (fTagname != null) {
+							processUseBean(sdRegion);
+							processOtherRegions(sdRegion);
+						}
+					}
 				}
 			}
+//			else if (sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_CONTENT) {
+//				if (fTagname != null) {
+//					processUseBean(sdRegion);
+//					processOtherRegions(sdRegion);
+//				}
+//			}
 			else {
 				fTagname = null;
 			}
@@ -199,23 +217,23 @@
 	}
 
 	private void startScope(String tagName) {
-		IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
+		//IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
 		StringBuffer text = new StringBuffer();
 		text.append("{ // <"); //$NON-NLS-1$
 		text.append(tagName);
 		text.append(">\n"); //$NON-NLS-1$
-		this.fTranslator.translateScriptletString(text.toString(), currentNode, currentNode.getStartOffset(), currentNode.getLength()); //$NON-NLS-1$
-
+		//this.fTranslator.translateScriptletString(text.toString(), currentNode, currentNode.getStartOffset(), currentNode.getLength()); //$NON-NLS-1$
+		fScriptlets.add(text.toString());
 	}
 
 	private void endScope(String tagName) {
-		IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
+		//IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
 		StringBuffer text = new StringBuffer();
 		text.append("} // </"); //$NON-NLS-1$
 		text.append(tagName);
 		text.append(">\n"); //$NON-NLS-1$
-		this.fTranslator.translateScriptletString(text.toString(), currentNode, currentNode.getStartOffset(), currentNode.getLength()); //$NON-NLS-1$
-
+		//this.fTranslator.translateScriptletString(text.toString(), currentNode, currentNode.getStartOffset(), currentNode.getLength()); //$NON-NLS-1$
+		fScriptlets.add(text.toString());
 	}
 
 	public void resetNodes() {
@@ -242,22 +260,19 @@
 
 	protected void processDeclaration(IStructuredDocumentRegion sdRegion) {
 		prepareText(sdRegion);
-		IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
-		this.fTranslator.translateDeclarationString(fStrippedText, currentNode, currentNode.getStartOffset(), currentNode.getLength());
+		fDeclarations.add(fStrippedText);
 		fPossibleOwner = JSPTranslator.DECLARATION;
 	}
 
 	protected void processExpression(IStructuredDocumentRegion sdRegion) {
 		prepareText(sdRegion);
-		IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
-		this.fTranslator.translateExpressionString(fStrippedText, currentNode, currentNode.getStartOffset(), currentNode.getLength());
+		fExpressions.add(fStrippedText);
 		fPossibleOwner = JSPTranslator.EXPRESSION;
 	}
 
 	protected void processScriptlet(IStructuredDocumentRegion sdRegion) {
 		prepareText(sdRegion);
-		IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
-		this.fTranslator.translateScriptletString(fStrippedText, currentNode, currentNode.getStartOffset(), currentNode.getLength());
+		fScriptlets.add(fStrippedText);
 		fPossibleOwner = JSPTranslator.SCRIPTLET;
 	}
 
@@ -274,7 +289,8 @@
 
 	protected void processUseBean(IStructuredDocumentRegion sdRegion) {
 		if (fTagname != null && isUseBean(fTagname)) {
-
+			// previous region has the actual attributes
+			sdRegion = sdRegion.getPrevious();
 			String beanClass, beanType, beanId, beanDecl = ""; //$NON-NLS-1$
 			beanClass = getAttributeValue("class", sdRegion); //$NON-NLS-1$
 			beanType = getAttributeValue("type", sdRegion); //$NON-NLS-1$
@@ -289,9 +305,8 @@
 					suffix = "new " + beanClass + "();\n"; //$NON-NLS-1$ //$NON-NLS-2$
 				beanDecl = prefix + suffix;
 			}	
-
-			IStructuredDocumentRegion currentNode = fTranslator.getCurrentNode();
-			this.fTranslator.translateScriptletString(beanDecl, currentNode, currentNode.getStartOffset(), currentNode.getLength());
+			
+			fScriptlets.add(beanDecl);
 			fPossibleOwner = JSPTranslator.SCRIPTLET;
 		}
 	}
@@ -367,7 +382,7 @@
 		while (it.hasNext()) {
 			nameRegion = (ITextRegion) it.next();
 			if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				textRegionText = sdRegionText.substring(nameRegion.getStart(), nameRegion.getTextEnd());
+				textRegionText = sdRegionText.substring(nameRegion.getStart(), nameRegion.getEnd());
 				if (textRegionText.equalsIgnoreCase(attrName)) {
 					while (it.hasNext()) {
 						valueRegion = (ITextRegion) it.next();
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
index e488b6a..8c92898 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
@@ -68,7 +68,7 @@
 	private StringBuffer fResult;
 	private Map fCodeMap;
 	private int fOffsetInUserCode;
-	private static int methodCounter = 0;
+	private int methodCounter = 0;
 	private IStructuredDocument fDocument = null;
 	private int fContentStart;
 	private static Map fOperatorMap;
@@ -199,10 +199,6 @@
 		return(node.childrenAccept(this, data));
 	}
 
-	static synchronized int getMethodCounter() {
-		return methodCounter++;
-	}
-	
 	/**
 	 * Handle top-level expression
 	 */
@@ -210,7 +206,7 @@
 		int start = node.getFirstToken().beginColumn - 1;
 		int end = node.lastToken.endColumn - 1;
 		append(fExpressionHeader1, start, start);
-		append(Integer.toString(getMethodCounter()), start, start);
+		append(Integer.toString(methodCounter++), start, start);
 		append(fExpressionHeader2, start, start);
 		
 		Object retval = node.childrenAccept(this, data);
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParserTokenManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParserTokenManager.java
index cc1e711..74a473d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParserTokenManager.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParserTokenManager.java
@@ -372,8 +372,7 @@
       if (curChar < 64)
       {
          long l = 1L << curChar;
-        // MatchLoop: 
-        	 do
+         do
          {
             switch(jjstateSet[--i])
             {
@@ -542,8 +541,7 @@
       else if (curChar < 128)
       {
          long l = 1L << (curChar & 077);
-         //MatchLoop: 
-        	 do
+         do
          {
             switch(jjstateSet[--i])
             {
@@ -623,8 +621,7 @@
          long l1 = 1L << (hiByte & 077);
          int i2 = (curChar & 0xff) >> 6;
          long l2 = 1L << (curChar & 077);
-         //MatchLoop: 
-        	 do
+         do
          {
             switch(jjstateSet[--i])
             {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
index 1964108..1db9f99 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
@@ -28,10 +28,10 @@
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslationExtension;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.exceptions.UnsupportedCharsetExceptionWithDetail;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
@@ -51,9 +51,7 @@
 	private String fJSPPathString = UNKNOWN_PATH;
 	private String fCUPath = UNKNOWN_PATH;
 	private SearchParticipant fParticipant = null;
-	private long fLastModifiedStamp;
-	private char[] fCachedCharContents;
-	
+
 	/**
 	 * @param file
 	 * @param participant
@@ -73,13 +71,8 @@
 	 * @see org.eclipse.jdt.core.search.SearchDocument#getCharContents()
 	 */
 	public char[] getCharContents() {
-		
-		if(fCachedCharContents == null || isDirty()) {
-		    JSPTranslation trans = getJSPTranslation();    
-		    fCachedCharContents = trans != null ? trans.getJavaText().toCharArray() : new char[0];
-		    fCUPath = trans.getJavaPath();
-		}
-		return fCachedCharContents;
+		JSPTranslation trans = getJSPTranslation();
+		return trans != null ? trans.getJavaText().toCharArray() : new char[0];
 	}
 
 	public String getJavaText() {
@@ -153,16 +146,12 @@
 	 * @see org.eclipse.jdt.core.search.SearchDocument#getPath()
 	 */
 	public String getPath() {
-	    // caching the path since it's expensive to get translation
-		// important that isDirty() check is second to cache modification stamp
-	    if(this.fCUPath == null || isDirty() || this.fCUPath == UNKNOWN_PATH) {
-	        JSPTranslation trans = getJSPTranslation();
-	        if(trans != null) {
-	            this.fCUPath = trans.getJavaPath();
-	            // save since it's expensive to calculate again later
-	            fCachedCharContents = trans.getJavaText().toCharArray();
-	        }
-	    }
+		JSPTranslation trans = getJSPTranslation();
+		// caching the path since it's expensive to get translation
+		if (this.fCUPath == null || this.fCUPath == UNKNOWN_PATH) {
+			if (trans != null)
+				this.fCUPath = trans.getJavaPath();
+		}
 		return fCUPath != null ? fCUPath : UNKNOWN_PATH;
 	}
 
@@ -208,19 +197,6 @@
 		return jspFile;
 	}
 
-	
-	private boolean isDirty() {
-		boolean modified = false;
-		IFile f = getFile();
-		if(f != null) {
-			long currentStamp = f.getModificationStamp();
-			if(currentStamp != fLastModifiedStamp)
-				modified = true;
-			fLastModifiedStamp = currentStamp;
-		}
-		return modified;
-	}
-	
 	public void release() {
 		// nothing to do now since JSPTranslation is created on the fly
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
index ce48e1a..f582593 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
@@ -284,7 +284,7 @@
      * @throws CoreException
      */
     public SearchDocument addJspFile(IFile file) {
-        if (JSPSearchSupport.getInstance().isCanceled() || !file.isAccessible()) {
+        if (JSPSearchSupport.getInstance().isCanceled()) {
             return null;
         }
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/JSPModelLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/JSPModelLoader.java
index b8a0765..12bdd4b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/JSPModelLoader.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/modelhandler/JSPModelLoader.java
@@ -18,9 +18,6 @@
 
 import org.eclipse.core.filebuffers.FileBuffers;
 import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.content.IContentDescription;
@@ -28,7 +25,6 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IDocumentPartitioner;
 import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
 import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapter;
 import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterFactory;
 import org.eclipse.jst.jsp.core.internal.document.PageDirectiveWatcherFactory;
@@ -112,19 +108,9 @@
 	 * 
 	 * Specification cites HTML as the default contentType.
 	 */
-	private EmbeddedTypeHandler getJSPDefaultEmbeddedType(IStructuredModel model) {
+	private EmbeddedTypeHandler getJSPDefaultEmbeddedType() {
 		EmbeddedTypeRegistry reg = getEmbeddedContentTypeRegistry();
-
-		String mimeType = null;
-		// default embedded type for fragments
-		if (model != null) {
-			IFile file = getFile(model);
-			if (file != null) {
-				mimeType = JSPFContentProperties.getProperty(JSPFContentProperties.JSPCONTENTTYPE, file, true);
-			}
-		}
-		mimeType = mimeType == null ? getDefaultMimeType() : mimeType;
-		return reg.getTypeFor(mimeType);
+		return reg.getTypeFor(getDefaultMimeType());
 	}
 
 	/**
@@ -156,7 +142,7 @@
 		// even though this is an "empty model" ... we want it to have at
 		// least the
 		// default embeddeded content type handler
-		EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType(null);
+		EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType();
 		embeddedType.initializeParser((JSPCapableParser) structuredDocument.getParser());
 		return structuredDocument;
 	}
@@ -279,19 +265,6 @@
 		return desc;
 	}
 
-	private IFile getFile(IStructuredModel model) {
-		if (model != null) {
-			String location = model.getBaseLocation();
-			if (location != null) {
-				IPath path = new Path(location);
-				if (!path.toFile().exists() && path.segmentCount() > 1) {
-					return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-				}
-			}
-		}
-		return null;
-	}
-
 	/**
 	 * Method getLanguage.
 	 * 
@@ -306,10 +279,6 @@
 		// language, we'll even return it,
 		// since who knows what future holds.
 
-		// get default language specified in properties page
-		IFile file = getFile(model);
-		result = JSPFContentProperties.getProperty(JSPFContentProperties.JSPLANGUAGE, file, true);
-
 		// always return something
 		if (result == null) {
 			result = DEFAULT_LANGUAGE;
@@ -512,7 +481,7 @@
 		}
 		else {
 			// use default embeddedType if it couldn't determine one
-			embeddedContentType = getJSPDefaultEmbeddedType(model);
+			embeddedContentType = getJSPDefaultEmbeddedType();
 			pageDirectiveAdapter.setEmbeddedType(embeddedContentType);
 			embeddedContentType.initializeFactoryRegistry(model.getFactoryRegistry());
 		}
@@ -521,7 +490,6 @@
 	protected void initEmbeddedTypePost(IStructuredModel model) {
 		// should already be initialized (from initEmbeddedTypePre)
 		// via IContentDescription
-		setLanguageInPageDirective(model);
 	}
 
 	/**
@@ -537,8 +505,8 @@
 		else {
 			// initEmbeddedType(newModel);
 			initCloneOfEmbeddedType(newModel, existingEmbeddedType, newEmbeddedContentType);
-			setLanguageInPageDirective(newModel);
 		}
+		setLanguageInPageDirective(newModel);
 	}
 
 	protected void setLanguageInPageDirective(IStructuredModel newModel) {
@@ -616,28 +584,28 @@
 		// For JSPs, the ModelQueryAdapter must be "attached" to the document
 		// before content is set in the model, so taglib initization can
 		// take place.
-		// In this "clone model" case, we create a ModelQuery adapter
-		// create a new instance from the old data. Note: I think this
-		// "forced fit" only works here since the implimentaiton of
-		// ModelQueryAdatper does not
-		// have to be released.
-
-		ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(model);
+		// In this "clone model" case, we create a ModelQuery adapter 
+		// create a new instance from the old data. Note: I think this 
+		// "forced fit" only works here since the implimentaiton of 
+		// ModelQueryAdatper does not 
+		// have to be released. 
+		
+		ModelQueryAdapter modelQueryAdapter =  getModelQueryAdapter(model);
 		if (modelQueryAdapter == null) {
 			modelQueryAdapter = getModelQueryAdapter(oldModel);
 			IDOMDocument document = ((IDOMModel) model).getDocument();
 			document.addAdapter(new JSPModelQueryAdapterImpl(modelQueryAdapter.getCMDocumentCache(), modelQueryAdapter.getModelQuery(), modelQueryAdapter.getIdResolver()));
-
+			
 		}
 
-
-
+		
+		
 		return model;
 	}
 
 	private ModelQueryAdapter getModelQueryAdapter(IStructuredModel model) {
 		IDOMDocument document = ((IDOMModel) model).getDocument();
-
+		
 		ModelQueryAdapter modelQueryAdapter = (ModelQueryAdapter) ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
 		return modelQueryAdapter;
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java
index fdb1db0..8ba4ecb 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPSourceParser.java
@@ -31,7 +31,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.text.IRegionComparible;
 import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
index 020ae97..2e921cc 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
@@ -27,7 +27,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.parser.ContextRegionContainer;
 import org.eclipse.wst.xml.core.internal.parser.IntStack;
 
@@ -873,7 +873,7 @@
 
 	private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();
 
-	//private static final String rcsver = "$Id: JSPTokenizer.java,v 1.13 2006/02/27 09:08:41 david_williams Exp $";//$NON-NLS-1$
+	//private static final String rcsver = "$Id: JSPTokenizer.java,v 1.12 2005/10/01 22:56:24 david_williams Exp $";//$NON-NLS-1$
 
 	/**
 	 * user method 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceInitializer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceInitializer.java
index a0f009e..45150ef 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005 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
@@ -27,7 +27,7 @@
 
 		// compiler/validation preferences
 		node.putBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true);
-
+		
 		// code generation preferences
 		node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
 		String defaultEnc = "ISO-8859-1";//$NON-NLS-1$
@@ -37,9 +37,5 @@
 		}
 		node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, defaultEnc);
 		node.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-
-		// this could be made smarter by actually looking up the content
-		// type's valid extensions
-		node.put(JSPCorePreferenceNames.DEFAULT_EXTENSION, "jsp"); //$NON-NLS-1$
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceNames.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceNames.java
index 04a4406..bda4dd0 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceNames.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/preferences/JSPCorePreferenceNames.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal.preferences;
 
 /**
@@ -20,15 +9,6 @@
 	}
 
 	/**
-	 * The default extension to use when none is specified in the New JSP File
-	 * Wizard.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-
-	/**
 	 * Indicates if JSP fragments should be compiled/validated. JSP fragments
 	 * will be validated when true.
 	 * <p>
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/provisional/text/IJSPPartitionTypes.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/provisional/text/IJSPPartitionTypes.java
index 179e3a5..1146bc8 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/provisional/text/IJSPPartitionTypes.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/provisional/text/IJSPPartitionTypes.java
@@ -6,7 +6,7 @@
  * It defines the partition types for JSP.
  * Clients should reference the partition type Strings defined here directly.
  * 
- * @deprecated use org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitions
+ * @plannedfor 1.0
  */
 public interface IJSPPartitionTypes {
 
@@ -18,7 +18,6 @@
 	String JSP_CONTENT_JAVA = JSP_SCRIPT_PREFIX + "JAVA"; //$NON-NLS-1$
 	String JSP_CONTENT_JAVASCRIPT = JSP_SCRIPT_PREFIX + "JAVASCRIPT"; //$NON-NLS-1$
 	String JSP_DEFAULT_EL = JSP_SCRIPT_PREFIX + "JSP_EL"; //$NON-NLS-1$
-	String JSP_DEFAULT_EL2 = JSP_SCRIPT_PREFIX + "JSP_EL2"; //$NON-NLS-1$
 	
 	String JSP_DIRECTIVE = "org.eclipse.jst.jsp.JSP_DIRECTIVE"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibClassLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibClassLoader.java
index 1bb1cda..a6a0278 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibClassLoader.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibClassLoader.java
@@ -16,10 +16,9 @@
 import org.eclipse.jst.jsp.core.internal.Logger;
 
 
-
 /**
- * Custom classloader which allows you to add source directories (folders
- * containing .class files) and jars to the classpath.
+ * Custom classloader which allows you to add source directories
+ * (folders containing .class files) and jars to the classpath.
  * 
  * @author pavery
  */
@@ -28,19 +27,15 @@
 	// for debugging
 	private static final boolean DEBUG;
 	static {
-		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibclassloader"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		String value= Platform.getDebugOption("com.ibm.sse.model.jsp/debug/taglibclassloader"); //$NON-NLS-1$
+		DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
 	}
-
+    
 	private List jarsList = new ArrayList();
 	private List dirsList = new ArrayList();
 	private List usedJars = new ArrayList();
 	private List usedDirs = new ArrayList();
-
-	private List failedClasses = new ArrayList(); // CL: added to optimize
-													// failed loading
-
-	// private List loadedClassFilenames = new ArrayList();
+	//private List loadedClassFilenames = new ArrayList();
 
 	public TaglibClassLoader(ClassLoader parentLoader) {
 		super(parentLoader);
@@ -49,59 +44,47 @@
 	/**
 	 * Adds a new jar to classpath.
 	 * 
-	 * @param filename -
-	 *            full path to the jar file
+	 * @param filename - full path to the jar file
 	 */
 	public void addJar(String filename) {
-		if (DEBUG)
-			System.out.println("trying to add: [" + filename + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
+	    if(DEBUG) System.out.println("trying to add: [" + filename + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
 		// don't add the same entry twice, or search times will get even worse
-		if (!jarsList.contains(filename)) {
+		if(!jarsList.contains(filename)) {
 			jarsList.add(filename);
-			failedClasses = new ArrayList();
-			if (DEBUG)
-				System.out.println(" + [" + filename + "] added to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
+			if(DEBUG) System.out.println( " + [" + filename + "] added to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
-	}
+	}		
 
 	/**
 	 * Removes a jar from the classpath.
 	 * 
-	 * @param filename -
-	 *            full path to the jar file
+	 * @param filename - full path to the jar file
 	 */
 	public void removeJar(String filename) {
 		jarsList.remove(filename);
-		failedClasses = new ArrayList();
-		if (DEBUG)
-			System.out.println("removed: [" + filename + "] from classpath"); //$NON-NLS-1$ //$NON-NLS-2$
+		if(DEBUG) System.out.println("removed: [" + filename + "] from classpath"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
-
+	
 	public void addDirectory(String dirPath) {
-		if (!dirsList.contains(dirPath)) {
-			dirsList.add(dirPath);
-			failedClasses = new ArrayList();
-			if (DEBUG)
-				System.out.println("added: [" + dirPath + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
+	    if(!dirsList.contains(dirPath)) {
+	        dirsList.add(dirPath);
+	        if(DEBUG) System.out.println("added: [" + dirPath + "] to classpath"); //$NON-NLS-1$ //$NON-NLS-2$
+	    }
 	}
 
 	/**
 	 * Removes a directory from the classpath.
 	 * 
-	 * @param dirPath -
-	 *            full path of the directory
+	 * @param dirPath - full path of the directory
 	 */
 	public void removeDirectory(String dirPath) {
 		dirsList.remove(dirPath);
-		failedClasses = new ArrayList();
-		if (DEBUG)
-			System.out.println("removed: [" + dirPath + "] from classpath"); //$NON-NLS-1$ //$NON-NLS-2$
+		if(DEBUG) System.out.println("removed: [" + dirPath + "] from classpath"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	/**
-	 * Returns the list of JARs on this loader's classpath that contain
-	 * classes that have been loaded.
+	 * Returns the list of JARs on this loader's classpath that contain classes
+	 * that have been loaded.
 	 * 
 	 * @return List - the list of JARs
 	 */
@@ -113,8 +96,7 @@
 	 * Returns a list of directories on this loader's classpath that contain
 	 * classes that have been loaded.
 	 * 
-	 * @return List - the list of directories (fully-qualified filename
-	 *         Strings)
+	 * @return List - the list of directories (fully-qualified filename Strings)
 	 */
 	public List getDirectoriesInUse() {
 		return usedDirs;
@@ -126,12 +108,13 @@
 	 * 
 	 * @return List - the list of class filenames
 	 */
-	// public List getClassFilenamesFromDirectories() {
-	// return loadedClassFilenames;
-	// }
+//	public List getClassFilenamesFromDirectories() {
+//		return loadedClassFilenames;
+//	}
+
 	/**
-	 * Searches for the given class name on the defined classpath -
-	 * directories are checked before JARs.
+	 * Searches for the given class name on the defined classpath - directories
+	 * are checked before JARs.
 	 * 
 	 * @param className -
 	 *            the name of the class to find
@@ -139,20 +122,8 @@
 	 * @throws ClassNotFoundException
 	 */
 	protected synchronized Class findClass(String className) throws ClassNotFoundException {
-		Class oldClass = findLoadedClass(className);
-		if (oldClass != null) {
-			if (DEBUG)
-				System.out.println(">> TaglibClassLoader " + this + " returning existing class: " + className); //$NON-NLS-1$
-			return oldClass;
-		}
-		if (failedClasses.contains(className)) {
-			if (DEBUG)
-				System.out.println(">> TaglibClassLoader " + this + " known missing class: " + className); //$NON-NLS-1$
-			throw new ClassNotFoundException();
-		}
-
-		if (DEBUG)
-			System.out.println(">> TaglibClassLoader " + this + " finding class: " + className); //$NON-NLS-1$
+	    
+	    if(DEBUG) System.out.println(">> TaglibClassLoader finding class: " + className); //$NON-NLS-1$
 
 		Class newClass = null;
 		JarFile jarfile = null;
@@ -170,14 +141,13 @@
 			while (dirs.hasNext()) {
 				dirName = (String) dirs.next();
 				fileToFind = dirName + "/" + fileName; //$NON-NLS-1$
-
+				
 				f = new File(fileToFind);
 				if (f.exists()) {
 					stream = new FileInputStream(f);
 					usedDirs.add(dirName);
-					// loadedClassFilenames.add(fileToFind);
-					if (DEBUG)
-						System.out.println(">> added file from dir: " + dirName + "/" + fileName); //$NON-NLS-1$ //$NON-NLS-2$
+					//loadedClassFilenames.add(fileToFind);
+					if(DEBUG) System.out.println(">> added file from dir: " + dirName + "/" + fileName); //$NON-NLS-1$ //$NON-NLS-2$
 					break;
 
 				}
@@ -192,33 +162,29 @@
 
 				byte[] byteArray = byteStream.toByteArray();
 				try {
-					if (DEBUG)
-						System.out.println(">> defining newClass:" + className); //$NON-NLS-1$
+				    if(DEBUG) System.out.println(">> defining newClass:" + className); //$NON-NLS-1$
 					newClass = defineClass(className, byteArray, 0, byteArray.length);
 					resolveClass(newClass);
 				}
-				catch (Throwable t) {
-
-					// j9 can give ClassCircularityError
-					// parent should already have the class then
+				catch (Throwable t){
+				    
+				    // j9 can give ClassCircularityError
+				    // parent should already have the class then
 					// try parent loader
-					try {
-						Class c = getParent().loadClass(className);
-						if (DEBUG)
-							System.out.println(">> loaded: " + className + " with: " + getParent()); //$NON-NLS-1$ //$NON-NLS-2$
-						return c;
-					}
-					catch (ClassNotFoundException cnf) {
-						if (DEBUG)
-							cnf.printStackTrace();
-					}
+				    try {
+				        Class c = getParent().loadClass(className);
+				        if(DEBUG) System.out.println(">> loaded: " + className + " with: " + getParent()); //$NON-NLS-1$ //$NON-NLS-2$
+				        return c;
+				    }
+				    catch (ClassNotFoundException cnf) {
+				        if(DEBUG) cnf.printStackTrace();
+			        }
 				}
 				stream.close();
 			}
 
 			if (stream == null) {
-				// still haven't found the class, so now try searching the
-				// jars
+				// still haven't found the class, so now try searching the jars
 				// search each of the jars until we find an entry matching the
 				// classname
 				Iterator jars = jarsList.iterator();
@@ -233,11 +199,10 @@
 						continue;
 					}
 					try {
-						jarfile = new JarFile(jarName);
+					    jarfile = new JarFile(jarName);
 					}
-					catch (IOException e) {
-						if (DEBUG)
-							Logger.logException("bad jar file", e); //$NON-NLS-1$
+					catch (IOException e){
+					    if(DEBUG) Logger.logException("bad jar file", e); //$NON-NLS-1$
 					}
 					if (jarfile == null) {
 						continue;
@@ -245,11 +210,9 @@
 
 					entry = jarfile.getJarEntry(fileName);
 
-					if (DEBUG)
-						System.out.println("looking for filename: " + fileName + " in: " + jarfile.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+					if(DEBUG) System.out.println("looking for filename: " + fileName + " in: " + jarfile.getName()); //$NON-NLS-1$ //$NON-NLS-2$
 					if (entry != null) {
-						if (DEBUG)
-							System.out.println("found the entry: " + entry + " for filename: " + fileName); //$NON-NLS-1$ //$NON-NLS-2$
+					    if(DEBUG) System.out.println("found the entry: " + entry + " for filename: " + fileName); //$NON-NLS-1$ //$NON-NLS-2$
 						// found the class
 						if (!usedJars.contains(jarName)) {
 							// add the jar to the list of in-use jars
@@ -279,38 +242,32 @@
 
 					byte[] byteArray = byteStream.toByteArray();
 					try {
-						if (DEBUG)
-							System.out.println(">> defining newClass:" + className); //$NON-NLS-1$
+					    if(DEBUG) System.out.println(">> defining newClass:" + className); //$NON-NLS-1$
 						// define the class from the byte array
 						newClass = defineClass(className, byteArray, 0, byteArray.length);
 						resolveClass(newClass);
 					}
-					catch (Throwable t) {
-						// j9 can give ClassCircularityError
-						// parent should already have the class then
-
+					catch(Throwable t) {
+					    // j9 can give ClassCircularityError
+					    // parent should already have the class then
+					    
 						// try parent
-						try {
-							Class c = getParent().loadClass(className);
-							if (DEBUG)
-								System.out.println(">> loaded: " + className + " with: " + getParent()); //$NON-NLS-1$ //$NON-NLS-2$
-							return c;
-						}
-						catch (ClassNotFoundException cnf) {
-							if (DEBUG)
-								cnf.printStackTrace();
-						}
-					}
+					    try {
+					        Class c = getParent().loadClass(className);
+					        if(DEBUG) System.out.println(">> loaded: " + className + " with: " + getParent()); //$NON-NLS-1$ //$NON-NLS-2$
+					        return c;
+					    }
+					    catch (ClassNotFoundException cnf) {
+					        if(DEBUG) cnf.printStackTrace();
+				        }
+					}					    			
 					stream.close();
 					jarfile.close();
 				}
 			}
-		}
-		catch (Throwable t) {
-			failedClasses.add(className);
+		} catch (Throwable t) {
 			return null;
-		}
-		finally {
+		} finally {
 			try {
 				if (stream != null) {
 					stream.close();
@@ -318,24 +275,21 @@
 				if (jarfile != null) {
 					jarfile.close();
 				}
-			}
-			catch (IOException ioe) {
+			} catch (IOException ioe) {
 				// ioe.printStackTrace();
 				// just trying to close down anyway - ignore
 			}
 		}
 
 		if (newClass != null) {
-			if (DEBUG)
-				System.out.println(">> loaded: " + newClass + " with: " + this); //$NON-NLS-1$ //$NON-NLS-2$
+		    if(DEBUG) System.out.println(">> loaded: " + newClass + " with: " + this); //$NON-NLS-1$ //$NON-NLS-2$
 			return newClass;
 		}
-
-		failedClasses.add(className);
+		
 		throw new ClassNotFoundException();
 	}
 
-	/**
+    /**
 	 * Replaces '.' in the classname with '/' and appends '.class' if needed.
 	 * 
 	 * @return String - the properly-formed class name
@@ -347,4 +301,4 @@
 		}
 		return buffer.toString();
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java
index 2315f4c..fdab556 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java
@@ -34,13 +34,13 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDAttributeDeclaration;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDVariable;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
@@ -56,524 +56,495 @@
  */
 public class TaglibHelper {
 
-	// for debugging
-	private static final boolean DEBUG;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibvars"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
+    // for debugging
+    private static final boolean DEBUG;
+    static {
+        String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibvars"); //$NON-NLS-1$
+        DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+    }
 
-	private IProject fProject = null;
-	private TaglibClassLoader fLoader = null;
+    private IProject fProject = null;
+    private TaglibClassLoader fLoader = null;
+    
+    private Set fProjectEntries = null;
+    private Set fContainerEntries = null;
+    
+    public TaglibHelper(IProject project) {
+        setProject(project);
+        fProjectEntries = new HashSet();
+        fContainerEntries = new HashSet();
+    }
 
-	private Set fProjectEntries = null;
-	private Set fContainerEntries = null;
+    /**
+     * @param tagToAdd
+     *            is the name of the tag whose variables we want
+     * @param structuredDoc
+     *            is the IStructuredDocument where the tag is found
+     * @param customTag
+     *            is the IStructuredDocumentRegion opening tag for the custom
+     *            tag
+     */
+    public TaglibVariable[] getTaglibVariables(String tagToAdd, IStructuredDocument structuredDoc, IStructuredDocumentRegion customTag) {
 
-	public TaglibHelper(IProject project) {
-		setProject(project);
-		fProjectEntries = new HashSet();
-		fContainerEntries = new HashSet();
-	}
-
-	/**
-	 * @param tagToAdd
-	 *            is the name of the tag whose variables we want
-	 * @param structuredDoc
-	 *            is the IStructuredDocument where the tag is found
-	 * @param customTag
-	 *            is the IStructuredDocumentRegion opening tag for the custom
-	 *            tag
-	 */
-	public TaglibVariable[] getTaglibVariables(String tagToAdd, IStructuredDocument structuredDoc, IStructuredDocumentRegion customTag) {
-
-		List results = new ArrayList();
-		ModelQuery mq = getModelQuery(structuredDoc);
-		if (mq != null) {
+        List results = new ArrayList();
+        ModelQuery mq = getModelQuery(structuredDoc);
+        if (mq != null) {
 			TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(structuredDoc);
-
-			// TaglibSupport support = ((TaglibModelQuery)
-			// mq).getTaglibSupport();
-			if (mgr == null)
-				return new TaglibVariable[0];
-
+			
+            //TaglibSupport support = ((TaglibModelQuery) mq).getTaglibSupport();
+            if (mgr == null)
+                return new TaglibVariable[0];
+			
 			List trackers = mgr.getCMDocumentTrackers(customTag.getEndOffset());
 			Iterator taglibs = trackers.iterator();
+			
+//            TaglibSupport support = ((TaglibModelQuery) mq).getTaglibSupport();
+//            if (support == null)
+//                return new TaglibVariable[0];
+//
+//            Iterator taglibs = support.getCMDocuments(customTag.getStartOffset()).iterator();
+            CMDocument doc = null;
+            CMNamedNodeMap elements = null;
+            while (taglibs.hasNext()) {
+                doc = (CMDocument) taglibs.next();
+                CMNode node = null;
+                if ((elements = doc.getElements()) != null && (node = elements.getNamedItem(tagToAdd)) != null && node.getNodeType() == CMNode.ELEMENT_DECLARATION) {
 
-			// TaglibSupport support = ((TaglibModelQuery)
-			// mq).getTaglibSupport();
-			// if (support == null)
-			// return new TaglibVariable[0];
-			//
-			// Iterator taglibs =
-			// support.getCMDocuments(customTag.getStartOffset()).iterator();
-			CMDocument doc = null;
-			CMNamedNodeMap elements = null;
-			while (taglibs.hasNext()) {
-				doc = (CMDocument) taglibs.next();
-				CMNode node = null;
-				if ((elements = doc.getElements()) != null && (node = elements.getNamedItem(tagToAdd)) != null && node.getNodeType() == CMNode.ELEMENT_DECLARATION) {
+                    if (node instanceof CMNodeWrapper) {
+                        node = ((CMNodeWrapper) node).getOriginNode();
+                    }
 
-					if (node instanceof CMNodeWrapper) {
-						node = ((CMNodeWrapper) node).getOriginNode();
-					}
+                    // 1.2+ taglib style
+                    addVariables(results, node);
 
-					// 1.2+ taglib style
-					addVariables(results, node, customTag);
+                    // for 1.1 need more info from taglib tracker
+                    if (doc instanceof TaglibTracker) {
+                        String uri = ((TaglibTracker) doc).getURI();
+                        String prefix = ((TaglibTracker) doc).getPrefix();
+                        // only for 1.1 taglibs
+                        addTEIVariables(customTag, results, (TLDElementDeclaration) node, prefix, uri);
+                    }
+                }
+            }
+        }
 
-					// for 1.1 need more info from taglib tracker
-					if (doc instanceof TaglibTracker) {
-						String uri = ((TaglibTracker) doc).getURI();
-						String prefix = ((TaglibTracker) doc).getPrefix();
-						// only for 1.1 taglibs
-						addTEIVariables(customTag, results, (TLDElementDeclaration) node, prefix, uri);
-					}
-				}
-			}
-		}
+        return (TaglibVariable[]) results.toArray(new TaglibVariable[results.size()]);
+    }
 
-		return (TaglibVariable[]) results.toArray(new TaglibVariable[results.size()]);
-	}
+    /**
+     * Adds 1.2 style TaglibVariables to the results list.
+     * 
+     * @param results
+     *            list where the <code>TaglibVariable</code> s are added
+     * @param node
+     */
+    private void addVariables(List results, CMNode node) {
 
-	/**
-	 * Adds 1.2 style TaglibVariables to the results list.
-	 * 
-	 * @param results
-	 *            list where the <code>TaglibVariable</code> s are added
-	 * @param node
-	 */
-	private void addVariables(List results, CMNode node, IStructuredDocumentRegion customTag) {
+        List list = ((TLDElementDeclaration) node).getVariables();
+        Iterator it = list.iterator();
+        while (it.hasNext()) {
+            TLDVariable var = (TLDVariable) it.next();
+            String varName = var.getNameGiven();
+            if (varName == null) {
+                varName = var.getNameFromAttribute();
+            }
+            if (varName != null) {
+                String varClass = "java.lang.String"; //$NON-NLS-1$ // the default class...
+                if (var.getVariableClass() != null) {
+                    varClass = var.getVariableClass();
+                }
+                results.add(new TaglibVariable(varClass, varName));
+            }
+        }
+    }
 
-		List list = ((TLDElementDeclaration) node).getVariables();
-		Iterator it = list.iterator();
-		while (it.hasNext()) {
-			TLDVariable var = (TLDVariable) it.next();
-			String varName = var.getNameGiven();
-			if (varName == null) {
-				String attrName = var.getNameFromAttribute();
-				/*
-				 * Iterate through the document region to find the
-				 * corresponding attribute name, and then use its value
-				 */
-				ITextRegionList regions = customTag.getRegions();
-				boolean attrNameFound = false;
-				for (int i = 2; i < regions.size(); i++) {
-					ITextRegion region = regions.get(i);
-					if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(region.getType())) {
-						attrNameFound = attrName.equals(customTag.getText(region));
-					}
-					if (attrNameFound && DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(region.getType())) {
-						varName = StringUtils.strip(customTag.getText(region));
-					}
-				}
-			}
-			if (varName != null) {
-				String varClass = "java.lang.String"; //$NON-NLS-1$ // the default class...
-				if (var.getVariableClass() != null) {
-					varClass = var.getVariableClass();
-				}
-				results.add(new TaglibVariable(varClass, varName));
-			}
-		}
-	}
+    /**
+     * Adds 1.1 style TaglibVariables (defined in a TagExtraInfo class) to the
+     * results list.
+     * 
+     * @param customTag
+     * @param results
+     *            list where the <code>TaglibVariable</code> s are added
+     * @param decl
+     *            TLDElementDelcaration for the custom tag
+     * @param prefix
+     *            custom tag prefix
+     * @param uri
+     *            URI where the tld can be found
+     */
+    private void addTEIVariables(IStructuredDocumentRegion customTag, List results, TLDElementDeclaration decl, String prefix, String uri) {
 
-	/**
-	 * Adds 1.1 style TaglibVariables (defined in a TagExtraInfo class) to the
-	 * results list.
-	 * 
-	 * @param customTag
-	 * @param results
-	 *            list where the <code>TaglibVariable</code> s are added
-	 * @param decl
-	 *            TLDElementDelcaration for the custom tag
-	 * @param prefix
-	 *            custom tag prefix
-	 * @param uri
-	 *            URI where the tld can be found
-	 */
-	private void addTEIVariables(IStructuredDocumentRegion customTag, List results, TLDElementDeclaration decl, String prefix, String uri) {
+        String teiClassname = decl.getTeiclass();
+        if (teiClassname == null || teiClassname.length() == 0)
+            return;
 
-		String teiClassname = decl.getTeiclass();
-		if (teiClassname == null || teiClassname.length() == 0)
-			return;
+        ClassLoader loader = getClassloader();
+    
+        Class teiClass = null;
+        try {
+            teiClass = Class.forName(teiClassname, true, loader);
+            if (teiClass != null) {
+                Object teiObject = teiClass.newInstance();
+                if (TagExtraInfo.class.isInstance(teiObject)) {
+                    TagExtraInfo tei = (TagExtraInfo) teiObject;
+                    Hashtable tagDataTable = extractTagData(customTag);
+                    TagInfo info = getTagInfo(decl, tei, prefix, uri);
+                    if (info != null) {
+                        tei.setTagInfo(info);
 
-		ClassLoader loader = getClassloader();
+                        // add to results
+                        TagData td = new TagData(tagDataTable);
+                        if (tei.isValid(td)) {
+                            VariableInfo[] vInfos = tei.getVariableInfo(td);
+                            if(vInfos != null) {
+	                            for (int i = 0; i < vInfos.length; i++) {
+	                                results.add(new TaglibVariable(vInfos[i].getClassName(), vInfos[i].getVarName()));
+	                            }
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (ClassNotFoundException e) {
+            // TEI class wasn't on classpath
+            if (DEBUG)
+                logException(teiClassname, e);
+        } catch (InstantiationException e) {
+            if (DEBUG)
+                logException(teiClassname, e);
+        } catch (IllegalAccessException e) {
+            if (DEBUG)
+                logException(teiClassname, e);
+        } catch (ClassCastException e) {
+            // TEI class wasn't really a subclass of TagExtraInfo
+            if (DEBUG)
+                logException(teiClassname, e);
+        } catch (Exception e) {
+            // this is 3rd party code, need to catch all exceptions
+            if (DEBUG)
+                logException(teiClassname, e);
+        } catch (Error e) {
+            // this is 3rd party code, need to catch all errors
+            if (DEBUG)
+                logException(teiClassname, e);
+        }
+        finally {
+           // Thread.currentThread().setContextClassLoader(oldLoader);
+        }
+    }
 
-		Class teiClass = null;
-		try {
-			teiClass = Class.forName(teiClassname, true, loader);
-			if (teiClass != null) {
-				Object teiObject = teiClass.newInstance();
-				if (TagExtraInfo.class.isInstance(teiObject)) {
-					TagExtraInfo tei = (TagExtraInfo) teiObject;
-					Hashtable tagDataTable = extractTagData(customTag);
-					TagInfo info = getTagInfo(decl, tei, prefix, uri);
-					if (info != null) {
-						tei.setTagInfo(info);
+    /**
+     * @param decl
+     * @return the TagInfo for the TLDELementDeclaration if the declaration is
+     *         valid, otherwise null
+     */
+    private TagInfo getTagInfo(TLDElementDeclaration decl, TagExtraInfo tei, String prefix, String uri) {
 
-						// add to results
-						TagData td = new TagData(tagDataTable);
-						if (tei.isValid(td)) {
-							VariableInfo[] vInfos = tei.getVariableInfo(td);
-							if (vInfos != null) {
-								for (int i = 0; i < vInfos.length; i++) {
-									results.add(new TaglibVariable(vInfos[i].getClassName(), vInfos[i].getVarName()));
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-		catch (ClassNotFoundException e) {
-			// TEI class wasn't on classpath
-			if (DEBUG)
-				logException(teiClassname, e);
-		}
-		catch (InstantiationException e) {
-			if (DEBUG)
-				logException(teiClassname, e);
-		}
-		catch (IllegalAccessException e) {
-			if (DEBUG)
-				logException(teiClassname, e);
-		}
-		catch (ClassCastException e) {
-			// TEI class wasn't really a subclass of TagExtraInfo
-			if (DEBUG)
-				logException(teiClassname, e);
-		}
-		catch (Exception e) {
-			// this is 3rd party code, need to catch all exceptions
-			if (DEBUG)
-				logException(teiClassname, e);
-		}
-		catch (Error e) {
-			// this is 3rd party code, need to catch all errors
-			if (DEBUG)
-				logException(teiClassname, e);
-		}
-		finally {
-			// Thread.currentThread().setContextClassLoader(oldLoader);
-		}
-	}
+        TagLibraryInfo libInfo = new TagLibraryInfo(prefix, uri) { /*dummy impl*/};
 
-	/**
-	 * @param decl
-	 * @return the TagInfo for the TLDELementDeclaration if the declaration is
-	 *         valid, otherwise null
-	 */
-	private TagInfo getTagInfo(TLDElementDeclaration decl, TagExtraInfo tei, String prefix, String uri) {
+        CMNamedNodeMap attrs = decl.getAttributes();
+        TagAttributeInfo[] attrInfos = new TagAttributeInfo[attrs.getLength()];
+        TLDAttributeDeclaration attr = null;
+        String type = ""; //$NON-NLS-1$ 
+        
+        // get tag attribute infos
+        for (int i = 0; i < attrs.getLength(); i++) {
+            attr = (TLDAttributeDeclaration) attrs.item(i);
+            type = attr.getType();
+            // default value for type is String
+            if (attr.getType() == null || attr.getType().equals(""))  //$NON-NLS-1$ 
+                type = "java.lang.String"; //$NON-NLS-1$ 
+            attrInfos[i] = new TagAttributeInfo(attr.getAttrName(), attr.isRequired(), type, false);
+        }
+        
+        String tagName = decl.getNodeName();
+        String tagClass = decl.getTagclass();
+        String bodyContent = decl.getBodycontent();
+        if (tagName != null && tagClass != null && bodyContent != null)
+            return new TagInfo(tagName, tagClass, bodyContent, decl.getInfo(), libInfo, tei, attrInfos);
+        return null;
 
-		TagLibraryInfo libInfo = new TagLibraryInfo(prefix, uri) { /*
-																	 * dummy
-																	 * impl
-																	 */
-		};
+    }
 
-		CMNamedNodeMap attrs = decl.getAttributes();
-		TagAttributeInfo[] attrInfos = new TagAttributeInfo[attrs.getLength()];
-		TLDAttributeDeclaration attr = null;
-		String type = ""; //$NON-NLS-1$ 
+    /**
+     * @param e
+     */
+    private void logException(String teiClassname, Throwable e) {
 
-		// get tag attribute infos
-		for (int i = 0; i < attrs.getLength(); i++) {
-			attr = (TLDAttributeDeclaration) attrs.item(i);
-			type = attr.getType();
-			// default value for type is String
-			if (attr.getType() == null || attr.getType().equals("")) //$NON-NLS-1$ 
-				type = "java.lang.String"; //$NON-NLS-1$ 
-			attrInfos[i] = new TagAttributeInfo(attr.getAttrName(), attr.isRequired(), type, false);
-		}
+        String message = "teiClassname: ["; //$NON-NLS-1$ 
+        if (teiClassname != null)
+            message += teiClassname;
+        message += "]"; //$NON-NLS-1$
+        Logger.logException(message, e);
+    }
 
-		String tagName = decl.getNodeName();
-		String tagClass = decl.getTagclass();
-		String bodyContent = decl.getBodycontent();
-		if (tagName != null && tagClass != null && bodyContent != null)
-			return new TagInfo(tagName, tagClass, bodyContent, decl.getInfo(), libInfo, tei, attrInfos);
-		return null;
+    /**
+     * Returns all attribute -> value pairs for the tag in a Hashtable.
+     * 
+     * @param customTag
+     * @return
+     */
+    private Hashtable extractTagData(IStructuredDocumentRegion customTag) {
 
-	}
+        Hashtable tagDataTable = new Hashtable();
+        ITextRegionList regions = customTag.getRegions();
+        ITextRegion r = null;
+        String attrName = ""; //$NON-NLS-1$
+        String attrValue = ""; //$NON-NLS-1$
+        for (int i = 0; i < regions.size(); i++) {
+            r = regions.get(i);
+            // check if attr name
+            if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+                attrName = customTag.getText(r);
+                // check equals is next region
+                if (regions.size() > ++i) {
+                    r = regions.get(i);
+                    if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && regions.size() > ++i) {
+                        // get attr value
+                        r = regions.get(i);
+                        if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+                            r = regions.get(i);
+                            // attributes in our document have quotes, so we
+                            // need to strip them
+                            attrValue = StringUtils.stripQuotes(customTag.getText(r));
+                            tagDataTable.put(attrName, attrValue);
+                        }
+                    }
+                }
+            }
+        }
+        return tagDataTable;
+    }
 
-	/**
-	 * @param e
-	 */
-	private void logException(String teiClassname, Throwable e) {
+    private ClassLoader getClassloader() {
+        
+        if(fLoader == null) {
+	        fLoader = new TaglibClassLoader(this.getClass().getClassLoader());
+	        fProjectEntries.clear();
+	        fContainerEntries.clear();
+	        addClasspathEntriesForProject(getProject(), fLoader);
+        }
+        return fLoader;
+    }
 
-		String message = "teiClassname: ["; //$NON-NLS-1$ 
-		if (teiClassname != null)
-			message += teiClassname;
-		message += "]"; //$NON-NLS-1$
-		Logger.logException(message, e);
-	}
-
-	/**
-	 * Returns all attribute -> value pairs for the tag in a Hashtable.
-	 * 
-	 * @param customTag
-	 * @return
-	 */
-	private Hashtable extractTagData(IStructuredDocumentRegion customTag) {
-
-		Hashtable tagDataTable = new Hashtable();
-		ITextRegionList regions = customTag.getRegions();
-		ITextRegion r = null;
-		String attrName = ""; //$NON-NLS-1$
-		String attrValue = ""; //$NON-NLS-1$
-		for (int i = 0; i < regions.size(); i++) {
-			r = regions.get(i);
-			// check if attr name
-			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				attrName = customTag.getText(r);
-				// check equals is next region
-				if (regions.size() > ++i) {
-					r = regions.get(i);
-					if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && regions.size() > ++i) {
-						// get attr value
-						r = regions.get(i);
-						if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-							r = regions.get(i);
-							// attributes in our document have quotes, so we
-							// need to strip them
-							attrValue = StringUtils.stripQuotes(customTag.getText(r));
-							tagDataTable.put(attrName, attrValue);
-						}
-					}
-				}
-			}
-		}
-		return tagDataTable;
-	}
-
-	private ClassLoader getClassloader() {
-
-		if (fLoader == null) {
-			fLoader = new TaglibClassLoader(this.getClass().getClassLoader());
-			fProjectEntries.clear();
-			fContainerEntries.clear();
-			addClasspathEntriesForProject(getProject(), fLoader);
-		}
-		return fLoader;
-	}
-
-	/**
-	 * @param loader
-	 */
-	private void addClasspathEntriesForProject(IProject p, TaglibClassLoader loader) {
-
-		// avoid infinite recursion and closed project
-		if (!p.isAccessible() || fProjectEntries.contains(p.getFullPath().toString()))
-			return;
-		fProjectEntries.add(p.getFullPath().toString());
-
-		// add things on classpath that we are interested in
-		if (p != null) {
-			try {
-				if (p.hasNature(JavaCore.NATURE_ID)) {
-
-					IJavaProject project = JavaCore.create(p);
-					IPath wkspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation();
-
-					try {
-						IClasspathEntry[] entries = project.getRawClasspath();
-						addDefaultDirEntry(loader, project, wkspaceRoot);
-						addClasspathEntries(loader, project, wkspaceRoot, entries);
-					}
-					catch (JavaModelException e) {
-						Logger.logException(e);
-					}
-				}
-			}
-			catch (CoreException e) {
-				Logger.logException(e);
-			}
-		}
-	}
+    /**
+     * @param loader
+     */
+    private void addClasspathEntriesForProject(IProject p, TaglibClassLoader loader) {
+       
+        // avoid infinite recursion and closed project
+        if(!p.isAccessible() || fProjectEntries.contains(p.getFullPath().toString()))
+            return;
+        fProjectEntries.add(p.getFullPath().toString());
+    
+       // add things on classpath that we are interested in
+        if (p != null) {
+        	try {
+	        	if(p.hasNature(JavaCore.NATURE_ID)) {
+	        		
+		            IJavaProject project = JavaCore.create(p);
+		            IPath wkspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation();
+		
+		            try {
+		                IClasspathEntry[] entries = project.getRawClasspath();
+		                addDefaultDirEntry(loader, project, wkspaceRoot);
+		                addClasspathEntries(loader, project, wkspaceRoot, entries);        
+		            } catch (JavaModelException e) {
+		            	Logger.logException(e);
+		            }
+	        	}
+        	}
+        	catch(CoreException e) {
+        		Logger.logException(e);
+        	}
+        }
+    }
 
 	private void addClasspathEntries(TaglibClassLoader loader, IJavaProject project, IPath wkspaceRoot, IClasspathEntry[] entries) throws JavaModelException {
 		IClasspathEntry entry;
 		for (int i = 0; i < entries.length; i++) {
 
-			entry = entries[i];
-			if (DEBUG)
-				System.out.println("current entry is: " + entry); //$NON-NLS-1$
-
-			switch (entry.getEntryKind()) {
-				case IClasspathEntry.CPE_SOURCE :
-					addSourceEntry(loader, wkspaceRoot, entry);
-					break;
-				case IClasspathEntry.CPE_LIBRARY :
-					addLibraryEntry(loader, wkspaceRoot, entry.getPath().toString());
-					break;
-				case IClasspathEntry.CPE_PROJECT :
-					addProjectEntry(loader, entry);
-					break;
-				case IClasspathEntry.CPE_VARIABLE :
-					addVariableEntry(loader, wkspaceRoot, entry);
-					break;
-				case IClasspathEntry.CPE_CONTAINER :
-					addContainerEntry(loader, project, wkspaceRoot, entry);
-					break;
-			}
+		    entry = entries[i];
+		    if(DEBUG)
+		        System.out.println("current entry is: " + entry); //$NON-NLS-1$
+		    
+		    switch (entry.getEntryKind()) {
+		        case IClasspathEntry.CPE_SOURCE:
+		            addSourceEntry(loader, wkspaceRoot, entry);
+		            break;
+		        case IClasspathEntry.CPE_LIBRARY:
+		            addLibraryEntry(loader, wkspaceRoot, entry.getPath().toString());
+		            break;
+		        case IClasspathEntry.CPE_PROJECT:
+		            addProjectEntry(loader, entry); 
+		            break;
+		        case IClasspathEntry.CPE_VARIABLE:
+		            addVariableEntry(loader, wkspaceRoot, entry);
+		            break;
+		        case IClasspathEntry.CPE_CONTAINER:
+		            addContainerEntry(loader, project, wkspaceRoot, entry);
+		            break;
+		    }
 		}
 	}
 
-	/**
-	 * @param loader
-	 * @param entry
-	 */
-	private void addVariableEntry(TaglibClassLoader loader, IPath wkspaceRoot, IClasspathEntry entry) {
+    /**
+     * @param loader
+     * @param entry
+     */
+    private void addVariableEntry(TaglibClassLoader loader, IPath wkspaceRoot, IClasspathEntry entry) {
 
-		if (DEBUG)
-			System.out.println(" -> adding variable entry: [" + entry + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+        if (DEBUG)
+            System.out.println(" -> adding variable entry: [" + entry + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+        
+        // variable should either be a project or a library entry
 
-		// variable should either be a project or a library entry
+        String variableName = entry.getPath().toString();
+        IPath variablePath = JavaCore.getClasspathVariable(variableName);
+        
+        // RATLC01076854 
+        // variable paths may not exist
+        // in that case null will be returned
+        if(variablePath != null) {
+	        if (variablePath.segments().length == 1) {
+	            IProject varProj = ResourcesPlugin.getWorkspace().getRoot().getProject(variablePath.toString());
+	            if (varProj != null && varProj.exists()) {
+	                addClasspathEntriesForProject(varProj, loader);
+	                return;
+	            }
+	        } 
+	        addLibraryEntry(loader, wkspaceRoot, variablePath.toString());
+        }
+    }
 
-		String variableName = entry.getPath().toString();
-		IPath variablePath = JavaCore.getClasspathVariable(variableName);
+    /**
+     * @param loader
+     * @param project
+     * @param wkspaceRoot
+     * @param entry
+     * @throws JavaModelException
+     */
+    private void addContainerEntry(TaglibClassLoader loader, IJavaProject project, IPath wkspaceRoot, IClasspathEntry entry) throws JavaModelException {
 
-		// RATLC01076854
-		// variable paths may not exist
-		// in that case null will be returned
-		if (variablePath != null) {
-			if (variablePath.segments().length == 1) {
-				IProject varProj = ResourcesPlugin.getWorkspace().getRoot().getProject(variablePath.toString());
-				if (varProj != null && varProj.exists()) {
-					addClasspathEntriesForProject(varProj, loader);
-					return;
-				}
-			}
-			addLibraryEntry(loader, wkspaceRoot, variablePath.toString());
-		}
-	}
+        IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
+        if(container != null) {
+        	// avoid infinite recursion
+            if(!fContainerEntries.contains(container.getPath().toString())) {                   
+                fContainerEntries.add(container.getPath().toString());
+                
+            	IClasspathEntry[] cpes = container.getClasspathEntries();
+            	// recursive call here
+            	addClasspathEntries(loader, project, wkspaceRoot, cpes);
+            }
+        }
+    }
 
-	/**
-	 * @param loader
-	 * @param project
-	 * @param wkspaceRoot
-	 * @param entry
-	 * @throws JavaModelException
-	 */
-	private void addContainerEntry(TaglibClassLoader loader, IJavaProject project, IPath wkspaceRoot, IClasspathEntry entry) throws JavaModelException {
+    /**
+     * @param loader
+     * @param entry
+     */
+    private void addProjectEntry(TaglibClassLoader loader, IClasspathEntry entry) {
 
-		IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
-		if (container != null) {
-			// avoid infinite recursion
-			if (!fContainerEntries.contains(container.getPath().toString())) {
-				fContainerEntries.add(container.getPath().toString());
+        if (DEBUG)
+            System.out.println(" -> project entry: [" + entry + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+        
+        IPath path = entry.getPath();
+        IProject refereceProj = ResourcesPlugin.getWorkspace().getRoot().getProject(path.toString());
+        if(refereceProj != null && refereceProj.exists())
+            addClasspathEntriesForProject(refereceProj, loader);
+    }
 
-				IClasspathEntry[] cpes = container.getClasspathEntries();
-				// recursive call here
-				addClasspathEntries(loader, project, wkspaceRoot, cpes);
-			}
-		}
-	}
+    /**
+     * @param loader
+     * @param project
+     * @param wkspaceRoot
+     * @throws JavaModelException
+     */
+    private void addDefaultDirEntry(TaglibClassLoader loader, IJavaProject project, IPath wkspaceRoot) throws JavaModelException {
 
-	/**
-	 * @param loader
-	 * @param entry
-	 */
-	private void addProjectEntry(TaglibClassLoader loader, IClasspathEntry entry) {
+        // add default bin directory for the project
+        IPath outputLocation = project.getOutputLocation();
+        if (!outputLocation.toFile().exists()) {
+            outputLocation = wkspaceRoot.append(outputLocation);
+        }
+        loader.addDirectory(outputLocation.toString());
+    }
 
-		if (DEBUG)
-			System.out.println(" -> project entry: [" + entry + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+    /**
+     * @param loader
+     * @param wkspaceRoot
+     * @param entry
+     */
+    private void addLibraryEntry(TaglibClassLoader loader, IPath wkspaceRoot, String libPath) {
 
-		IPath path = entry.getPath();
-		IProject refereceProj = ResourcesPlugin.getWorkspace().getRoot().getProject(path.toString());
-		if (refereceProj != null && refereceProj.exists())
-			addClasspathEntriesForProject(refereceProj, loader);
-	}
+        String jarPath = libPath;
+        File file = new File(jarPath);
+        
+        // if not absolute path, it's workspace relative
+        if (!file.exists()) {
+            jarPath = wkspaceRoot.append(jarPath).toString();
+        }
+        
+        if(jarPath.endsWith(".jar")) { //$NON-NLS-1$ 
+            loader.addJar(jarPath);
+        }
+        else if(file.isDirectory()) {
+            // it's actually a folder containing binaries
+            loader.addDirectory(jarPath);
+        }
+    }
 
-	/**
-	 * @param loader
-	 * @param project
-	 * @param wkspaceRoot
-	 * @throws JavaModelException
-	 */
-	private void addDefaultDirEntry(TaglibClassLoader loader, IJavaProject project, IPath wkspaceRoot) throws JavaModelException {
+    /**
+     * @param loader
+     * @param wkspaceRoot
+     * @param entry
+     */
+    private void addSourceEntry(TaglibClassLoader loader, IPath wkspaceRoot, IClasspathEntry entry) {
 
-		// add default bin directory for the project
-		IPath outputLocation = project.getOutputLocation();
-		if (!outputLocation.toFile().exists()) {
-			outputLocation = wkspaceRoot.append(outputLocation);
-		}
-		loader.addDirectory(outputLocation.toString());
-	}
+        // add bin directory for specific entry if it has
+        // one
+        if (entry.getOutputLocation() != null) {
+            String outputPath = entry.getOutputLocation().toString();
+            File file = entry.getOutputLocation().toFile();
+            // if not absolute path, it's workspace relative
+            if (!file.exists()) {
+                outputPath = wkspaceRoot.append(entry.getOutputLocation()).toString();
+            }
+            loader.addDirectory(outputPath);
+        }
+    }
 
-	/**
-	 * @param loader
-	 * @param wkspaceRoot
-	 * @param entry
-	 */
-	private void addLibraryEntry(TaglibClassLoader loader, IPath wkspaceRoot, String libPath) {
-
-		String jarPath = libPath;
-		File file = new File(jarPath);
-
-		// if not absolute path, it's workspace relative
-		if (!file.exists()) {
-			jarPath = wkspaceRoot.append(jarPath).toString();
-		}
-
-		if (jarPath.endsWith(".jar")) { //$NON-NLS-1$ 
-			loader.addJar(jarPath);
-		}
-		else if (file.isDirectory()) {
-			// it's actually a folder containing binaries
-			loader.addDirectory(jarPath);
-		}
-	}
-
-	/**
-	 * @param loader
-	 * @param wkspaceRoot
-	 * @param entry
-	 */
-	private void addSourceEntry(TaglibClassLoader loader, IPath wkspaceRoot, IClasspathEntry entry) {
-
-		// add bin directory for specific entry if it has
-		// one
-		if (entry.getOutputLocation() != null) {
-			String outputPath = entry.getOutputLocation().toString();
-			File file = entry.getOutputLocation().toFile();
-			// if not absolute path, it's workspace relative
-			if (!file.exists()) {
-				outputPath = wkspaceRoot.append(entry.getOutputLocation()).toString();
-			}
-			loader.addDirectory(outputPath);
-		}
-	}
-
-	/**
-	 * @return Returns the fModelQuery.
-	 */
-	public ModelQuery getModelQuery(IDocument doc) {
-		IStructuredModel model = null;
-		ModelQuery mq = null;
+    /**
+     * @return Returns the fModelQuery.
+     */
+    public ModelQuery getModelQuery(IDocument doc) {
+        IStructuredModel model = null;
+        ModelQuery mq = null;
 		try {
 			model = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
 			mq = ModelQueryUtil.getModelQuery(model);
 		}
 		finally {
-			if (model != null)
-				model.releaseFromRead();
+		    if(model != null)
+		        model.releaseFromRead();
 		}
-		return mq;
-	}
+        return mq;
+    }
 
 
-	/**
-	 * @return Returns the fFile.
-	 */
-	public IProject getProject() {
+    /**
+     * @return Returns the fFile.
+     */
+    public IProject getProject() {
 
-		return fProject;
-	}
+        return fProject;
+    }
 
-	/**
-	 * @param file
-	 *            The fFile to set.
-	 */
-	public void setProject(IProject p) {
-		fProject = p;
-	}
+    /**
+     * @param file
+     *            The fFile to set.
+     */
+    public void setProject(IProject p) {
+        fProject = p;
+    }
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
index f1ab794..24dd977 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
@@ -23,8 +23,8 @@
 import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
 import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
 import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandlerExtension;
@@ -37,7 +37,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
 
@@ -170,7 +170,7 @@
 	private static final String XHTML_MIME_TYPE = "text/xhtml"; //$NON-NLS-1$
 	private static final String XML_MIME_TYPE = "text/xml"; //$NON-NLS-1$
 
-	private final static String[] fConfiguredContentTypes = new String[]{IJSPPartitions.JSP_DEFAULT, IJSPPartitions.JSP_DEFAULT_EL, IJSPPartitions.JSP_DEFAULT_EL2, IJSPPartitions.JSP_DIRECTIVE, IJSPPartitions.JSP_CONTENT_DELIMITER, IJSPPartitions.JSP_CONTENT_JAVA, IJSPPartitions.JSP_CONTENT_JAVASCRIPT, IJSPPartitions.JSP_COMMENT};
+	private final static String[] fConfiguredContentTypes = new String[]{IJSPPartitionTypes.JSP_DEFAULT, IJSPPartitionTypes.JSP_DEFAULT_EL, IJSPPartitionTypes.JSP_DIRECTIVE, IJSPPartitionTypes.JSP_CONTENT_DELIMITER, IJSPPartitionTypes.JSP_CONTENT_JAVA, IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT, IJSPPartitionTypes.JSP_COMMENT};
 
 	/**
 	 * @return
@@ -362,19 +362,16 @@
 			result = getPartitionTypeForDocumentLanguage();
 		}
 		else if (region_type == DOMJSPRegionContexts.JSP_COMMENT_TEXT || region_type == DOMJSPRegionContexts.JSP_COMMENT_OPEN || region_type == DOMJSPRegionContexts.JSP_COMMENT_CLOSE)
-			result = IJSPPartitions.JSP_COMMENT;
+			result = IJSPPartitionTypes.JSP_COMMENT;
 		else if (region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME || region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN || region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE)
-			result = IJSPPartitions.JSP_DIRECTIVE;
+			result = IJSPPartitionTypes.JSP_DIRECTIVE;
 		else if (region_type == DOMJSPRegionContexts.JSP_CLOSE || region_type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN || region_type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN || region_type == DOMJSPRegionContexts.JSP_DECLARATION_OPEN)
-			result = IJSPPartitions.JSP_CONTENT_DELIMITER;
+			result = IJSPPartitionTypes.JSP_CONTENT_DELIMITER;
 		else if (region_type == DOMJSPRegionContexts.JSP_ROOT_TAG_NAME)
-			result = IJSPPartitions.JSP_DEFAULT;
+			result = IJSPPartitionTypes.JSP_DEFAULT;
 		else if (region_type == DOMJSPRegionContexts.JSP_EL_OPEN || region_type == DOMJSPRegionContexts.JSP_EL_CONTENT || region_type == DOMJSPRegionContexts.JSP_EL_CLOSE || region_type == DOMJSPRegionContexts.JSP_EL_DQUOTE
 					|| region_type == DOMJSPRegionContexts.JSP_EL_SQUOTE || region_type == DOMJSPRegionContexts.JSP_EL_QUOTED_CONTENT)
-			result = IJSPPartitions.JSP_DEFAULT_EL;
-		else if (region_type == DOMJSPRegionContexts.JSP_VBL_OPEN || region_type == DOMJSPRegionContexts.JSP_VBL_CONTENT || region_type == DOMJSPRegionContexts.JSP_VBL_CLOSE || region_type == DOMJSPRegionContexts.JSP_VBL_DQUOTE
-					|| region_type == DOMJSPRegionContexts.JSP_VBL_SQUOTE || region_type == DOMJSPRegionContexts.JSP_VBL_QUOTED_CONTENT)
-			result = IJSPPartitions.JSP_DEFAULT_EL2;
+			result = IJSPPartitionTypes.JSP_DEFAULT_EL;
 		else if (region_type == DOMRegionContext.XML_CONTENT) {
 			// possibly between <jsp:scriptlet>, <jsp:expression>,
 			// <jsp:declaration>
@@ -397,13 +394,13 @@
 	private String getPartitionTypeForDocumentLanguage() {
 		String result;
 		if (fLanguage == null || fLanguage.equalsIgnoreCase("java")) { //$NON-NLS-1$
-			result = IJSPPartitions.JSP_CONTENT_JAVA;
+			result = IJSPPartitionTypes.JSP_CONTENT_JAVA;
 		}
 		else if (fLanguage.equalsIgnoreCase("javascript")) { //$NON-NLS-1$
-			result = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+			result = IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT;
 		}
 		else {
-			result = IJSPPartitions.JSP_SCRIPT_PREFIX + getLanguage().toUpperCase(Locale.ENGLISH);
+			result = IJSPPartitionTypes.JSP_SCRIPT_PREFIX + getLanguage().toUpperCase(Locale.ENGLISH);
 		}
 		return result;
 	}
@@ -443,13 +440,13 @@
 		String documentRegionContext = sdRegion.getType();
 		if (containedChildRegion != null) {
 			if (documentRegionContext.equals(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) || documentRegionContext.equals(DOMJSPRegionContexts.JSP_ROOT_TAG_NAME)) {
-				setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitions.JSP_DIRECTIVE);
+				setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitionTypes.JSP_DIRECTIVE);
 				return true;
 			}
 			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=113346
 			if (fEnableJSPActionPartitions && isAction(sdRegion, offset) && !(containedChildRegion instanceof ITextRegionContainer)) {
 			//if (fEnableJSPActionPartitions && isAction(sdRegion, offset)) {
-				setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitions.JSP_DIRECTIVE);
+				setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitionTypes.JSP_DIRECTIVE);
 				return true;
 			}
 		}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java
index ccb52b4..c5a0789 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/DocumentProvider.java
@@ -12,12 +12,12 @@
 
 
 
-import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.StringReader;
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.StringTokenizer;
@@ -53,7 +53,7 @@
 	private ErrorHandler errorHandler = null;
 	private String fBaseReference;
 	private String fileName = null;
-	private boolean fValidating = false;
+	private boolean fValidating = true;
 	private InputStream inputStream = null;
 	private String jarFileName = null;
 	private EntityResolver resolver = null;
@@ -130,12 +130,8 @@
 	 * @return Document
 	 */
 	public Document getDocument() {
-		return getDocument(true);
-	}
-
-	public Document getDocument(boolean createEmptyOnFailure) {
 		if (document == null)
-			load(createEmptyOnFailure);
+			load();
 		return document;
 	}
 
@@ -169,7 +165,7 @@
 	public Element getElement(String name) {
 		Element result = null;
 		if (document == null)
-			load(false);
+			load();
 		if (document != null) {
 			result = (Element) getNode(getRootElement(), name);
 		}
@@ -185,7 +181,7 @@
 			resolver = new EntityResolver() {
 				public InputSource resolveEntity(String publicID, String systemID) throws SAXException, IOException {
 					InputSource result = null;
-					if (isValidating()) {
+					if (getBaseReference() != null) {
 						try {
 							URL spec = new URL("file://" + getBaseReference()); //$NON-NLS-1$
 							URL url = new URL(spec, systemID);
@@ -200,9 +196,8 @@
 							result = null;
 						}
 					}
-
 					if (result == null) {
-						result = new InputSource(new ByteArrayInputStream(new byte[0]));
+						result = new InputSource(new StringReader("")); //$NON-NLS-1$
 						result.setPublicId(publicID);
 						result.setSystemId(systemID != null ? systemID : "/_" + getClass().getName()); //$NON-NLS-1$
 					}
@@ -385,7 +380,7 @@
 		return fValidating;
 	}
 
-	void load(boolean createEmptyOnFailure) {
+	public void load() {
 		// rootElementName and fileName are expected to be defined at this
 		// point
 		document = getParsedDocument();
@@ -397,20 +392,18 @@
 		}
 
 		if (document == null || rootElement == null) {
-			if (createEmptyOnFailure) {
-				document = getNewDocument();
-				if (document != null) {
-					NodeList children = document.getChildNodes();
+			document = getNewDocument();
+			if (document != null) {
+				NodeList children = document.getChildNodes();
+				for (int i = 0; i < children.getLength(); i++) {
+					if (children.item(i).getNodeType() == Node.ELEMENT_NODE && children.item(i).getNodeName().equals(getRootElementName()))
+						rootElement =  children.item(i);
+				}
+				if (rootElement == null) {
 					for (int i = 0; i < children.getLength(); i++) {
-						if (children.item(i).getNodeType() == Node.ELEMENT_NODE && children.item(i).getNodeName().equals(getRootElementName()))
+						if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
 							rootElement = children.item(i);
-					}
-					if (rootElement == null) {
-						for (int i = 0; i < children.getLength(); i++) {
-							if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
-								rootElement = children.item(i);
-								break;
-							}
+							break;
 						}
 					}
 				}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java
deleted file mode 100644
index 250cf85..0000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package org.eclipse.jst.jsp.core.internal.validation;
-
-import java.io.IOException;
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-/**
- * Checks for: - duplicate taglib prefix values - reserved taglib prefix
- * values
- * 
- */
-public class JSPDirectiveValidator extends JSPValidator implements ISourceValidator {
-
-	private HashMap fReservedPrefixes = new HashMap();
-	private HashMap fDuplicatePrefixes = new HashMap();
-	private IDocument fDocument;
-
-	public JSPDirectiveValidator() {
-		fReservedPrefixes.put("jsp", ""); //$NON-NLS-1$ //$NON-NLS-2$
-		fReservedPrefixes.put("jspx", ""); //$NON-NLS-1$ //$NON-NLS-2$ 
-		fReservedPrefixes.put("javax", ""); //$NON-NLS-1$ //$NON-NLS-2$ 
-		fReservedPrefixes.put("servlet", ""); //$NON-NLS-1$ //$NON-NLS-2$ 
-		fReservedPrefixes.put("sun", ""); //$NON-NLS-1$ //$NON-NLS-2$ 
-		fReservedPrefixes.put("sunw", ""); //$NON-NLS-1$ //$NON-NLS-2$ 
-	}
-
-	/**
-	 * batch validation call
-	 */
-	protected void validateFile(IFile f, IReporter reporter) {
-
-		// when validating an entire file
-		// need to clear dupes or else you're comparing between files
-		fDuplicatePrefixes.clear();
-
-		// for batch validation
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getModelForRead(f);
-			if (sModel != null) {
-				IStructuredDocument sDoc = sModel.getStructuredDocument();
-				// need to set this for partial validate call to work
-				fDocument = sDoc;
-				// iterate all document regions
-				IStructuredDocumentRegion region = sDoc.getFirstStructuredDocumentRegion();
-				while (region != null && !reporter.isCancelled()) {
-					// only checking directives
-					if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
-						validateDirective(reporter, f, sDoc, region);
-					}
-					region = region.getNext();
-				}
-			}
-		}
-		catch (IOException e) {
-			Logger.logException(e);
-		}
-		catch (CoreException e) {
-			Logger.logException(e);
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-	}
-
-	public void connect(IDocument document) {
-		fDocument = document;
-	}
-
-	public void disconnect(IDocument document) {
-		fDuplicatePrefixes.clear();
-	}
-
-	/**
-	 * for as you type validation (partial document)
-	 */
-	public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
-		validate(dirtyRegion, helper, reporter, null);
-	}
-
-	private void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter, IFile file) {
-
-		// check for restricted and duplicate prefixes
-		if (fDocument instanceof IStructuredDocument) {
-			IStructuredDocument sDoc = (IStructuredDocument) fDocument;
-			IStructuredDocumentRegion[] regions = sDoc.getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
-			for (int i = 0; i < regions.length; i++) {
-				// only checking directives
-				if (regions[i].getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
-					validateDirective(reporter, file, sDoc, regions[i]);
-				}
-			}
-		}
-	}
-
-	private void validateDirective(IReporter reporter, IFile file, IStructuredDocument sDoc, IStructuredDocumentRegion sdRegion) {
-
-		// we only care about taglib directive
-		if (getDirectiveName(sdRegion).equals("taglib")) { //$NON-NLS-1$
-
-			ITextRegion valueRegion = getAttributeValueRegion(sdRegion, JSP11Namespace.ATTR_NAME_PREFIX);
-			if (valueRegion == null)
-				return;
-
-			String taglibPrefix = sdRegion.getText(valueRegion);
-			int start = sdRegion.getStartOffset(valueRegion);
-			// length before stripquotes
-			int length = taglibPrefix.length();
-			taglibPrefix = StringUtils.stripQuotes(taglibPrefix);
-
-			int sev = IMessage.HIGH_SEVERITY;
-			LocalizedMessage message = null;
-
-			// check for errors
-			// use file if available (for markers)
-			if (isReservedPrefix(taglibPrefix)) {
-
-				String msgText = "Reserved prefix  '" + taglibPrefix + "'";
-				message = (file == null ? new LocalizedMessage(sev, msgText) : new LocalizedMessage(sev, msgText, file));
-			}
-			else if (isDuplicatePrefix(sdRegion, taglibPrefix)) {
-
-				String msgText = "Duplicate prefix  '" + taglibPrefix + "'";
-				message = (file == null ? new LocalizedMessage(sev, msgText) : new LocalizedMessage(sev, msgText, file));
-			}
-
-			// if there's a message, there was an error found
-			if (message != null) {
-				int lineNo = sDoc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
-				message.setOffset(start);
-				message.setLength(length);
-
-				reporter.addMessage(this, message);
-			}
-		}
-	}
-
-	private boolean isDuplicatePrefix(IStructuredDocumentRegion region, String taglibPrefix) {
-		boolean dupe = false;
-		Object o = fDuplicatePrefixes.get(taglibPrefix);
-		if (o == null) {
-			// prefix doesn't exist, not a dupe
-			fDuplicatePrefixes.put(taglibPrefix, region);
-		}
-		else if (o instanceof IStructuredDocumentRegion) {
-			if (((IStructuredDocumentRegion) o).isDeleted()) {
-				// region was deleted, replace w/ new region
-				// not a dupe
-				fDuplicatePrefixes.put(taglibPrefix, region);
-			}
-			else if (region != o) {
-				// region exists and it's not this one
-				// it's a dupe
-				dupe = true;
-			}
-		}
-		return dupe;
-
-	}
-
-	public void cleanup(IReporter reporter) {
-		super.cleanup(reporter);
-		fDuplicatePrefixes.clear();
-	}
-
-	private boolean isReservedPrefix(String name) {
-		return fReservedPrefixes.get(name) != null;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
index 0522ac3..69f3653 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
@@ -11,54 +11,175 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal.validation;
 
+import java.io.IOException;
+import java.io.InputStream;
 import java.util.Iterator;
+import java.util.Locale;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP;
 import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser;
 import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException;
 import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
 import org.eclipse.jst.jsp.core.internal.java.jspel.TokenMgrError;
+import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.validation.internal.core.Message;
+import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
 
-public class JSPELValidator extends JSPValidator {
-	
-	protected void validateFile(IFile file, IReporter reporter) {
-		
-		IStructuredModel model = null;
-		try {
-			model = StructuredModelManager.getModelManager().getModelForRead(file);
-			DOMModelForJSP jspModel = (DOMModelForJSP) model;
-			IStructuredDocument structuredDoc = jspModel.getStructuredDocument();
-			IStructuredDocumentRegion curNode = structuredDoc.getFirstStructuredDocumentRegion();
-			while (null != curNode && !reporter.isCancelled()) {
-				if (curNode.getType() != DOMRegionContext.XML_COMMENT_TEXT && curNode.getType() != DOMRegionContext.XML_CDATA_TEXT && curNode.getType() != DOMRegionContext.UNDEFINED) {
-					validateRegionContainer(curNode, reporter, file);
-				}
-				curNode = curNode.getNext();
-			}
+public class JSPELValidator implements IValidator {
+
+	static private class LocalizedMessage extends Message {
+		private String _message = null;
+
+		public LocalizedMessage(int severity, String messageText) {
+			this(severity, messageText, null);
 		}
-		catch (Exception e) {
+
+		public LocalizedMessage(int severity, String messageText, IResource targetObject) {
+			this(severity, messageText, (Object) targetObject);
 		}
-		finally {
-			if (null != model)
-				model.releaseFromRead();
+
+		public LocalizedMessage(int severity, String messageText, Object targetObject) {
+			super(null, severity, null);
+			setLocalizedMessage(messageText);
+			setTargetObject(targetObject);
+		}
+
+		public void setLocalizedMessage(String message) {
+			_message = message;
+		}
+
+		public String getLocalizedMessage() {
+			return _message;
+		}
+
+		public String getText() {
+			return getLocalizedMessage();
+		}
+
+		public String getText(ClassLoader cl) {
+			return getLocalizedMessage();
+		}
+
+		public String getText(Locale l) {
+			return getLocalizedMessage();
+		}
+
+		public String getText(Locale l, ClassLoader cl) {
+			return getLocalizedMessage();
 		}
 	}
-	
+
+	static boolean shouldValidate(IFile file) {
+		IResource resource = file;
+		do {
+			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
+				return false;
+			}
+			resource = resource.getParent();
+		}
+		while ((resource.getType() & IResource.PROJECT) == 0);
+		return true;
+	}
+
+	/**
+	 * Determines if file is jsp fragment or not
+	 * 
+	 * @param file
+	 *            assumes file is not null and exists
+	 * @return true if file is jsp fragment, false otherwise
+	 */
+	private boolean isFragment(IFile file) {
+		boolean isFragment = false;
+		InputStream is = null;
+		try {
+			IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT);
+			// check this before description, it's less expensive
+			if (contentTypeJSP.isAssociatedWith(file.getName())) {
+
+				IContentDescription contentDescription = file.getContentDescription();
+				// it can be null
+				if (contentDescription == null) {
+					is = file.getContents();
+					contentDescription = Platform.getContentTypeManager().getDescriptionFor(is, file.getName(), new QualifiedName[]{IContentDescription.CHARSET});
+				}
+				if (contentDescription != null) {
+					String fileCtId = contentDescription.getContentType().getId();
+					isFragment = (fileCtId != null && ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT.equals(fileCtId));
+				}
+			}
+		}
+		catch (IOException e) {
+			// ignore, assume it's invalid JSP
+		}
+		catch (CoreException e) {
+			// ignore, assume it's invalid JSP
+		}
+		finally {
+			// must close input stream in case others need it
+			if (is != null)
+				try {
+					is.close();
+				}
+				catch (Exception e) {
+					// not sure how to recover at this point
+				}
+		}
+		return isFragment;
+	}
+
+	/**
+	 * Performs extra checks on the file to see if file should really be
+	 * validated.
+	 * 
+	 * @param file
+	 *            Assumes shouldValidate was already called on file so it
+	 *            should not be null and does exist
+	 * @return true if should validate file, false otherwise
+	 */
+	private boolean shouldValidate2(IFile file) {
+		// get preference for validate jsp fragments
+		boolean shouldValidate = Platform.getPreferencesService().getBoolean(JSPCorePlugin.getDefault().getBundle().getSymbolicName(), JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true, null);
+
+		/*
+		 * if jsp fragments should not be validated, check if file is jsp
+		 * fragment
+		 */
+		if (!shouldValidate) {
+			boolean isFragment = isFragment(file);
+			shouldValidate = !isFragment;
+		}
+
+		return shouldValidate;
+	}
+
 	protected void validateRegionContainer(ITextRegionCollection container, IReporter reporter, IFile file) {
+
 		ITextRegionCollection containerRegion = container;
 		Iterator regions = containerRegion.getRegions().iterator();
 		ITextRegion region = null;
@@ -102,4 +223,49 @@
 			reporter.addMessage(this, message);
 		}
 	}
+
+	public void cleanup(org.eclipse.wst.validation.internal.provisional.core.IReporter reporter) {
+		// TODO Auto-generated method stub
+
+	}
+
+	public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
+		String[] uris = helper.getURIs();
+		reporter.removeAllMessages(this);
+		// IValidationContext may return a null array
+		if (uris != null) {
+			for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
+				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uris[i]));
+				if (!shouldValidate(file)) {
+					continue;
+				}
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=87351
+				if (!shouldValidate2(file)) {
+					continue;
+				}
+
+			    Message message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, NLS.bind(JSPCoreMessages.MESSAGE_JSP_VALIDATING_MESSAGE_UI_, new String[]{file.getFullPath().toString()}));
+			    reporter.displaySubtask(this, message);
+				
+				IStructuredModel model = null;
+				try {
+					model = StructuredModelManager.getModelManager().getModelForRead(file);
+					DOMModelForJSP jspModel = (DOMModelForJSP) model;
+					IStructuredDocument structuredDoc = jspModel.getStructuredDocument();
+					IStructuredDocumentRegion curNode = structuredDoc.getFirstStructuredDocumentRegion();
+					while (null != (curNode = curNode.getNext()) && !reporter.isCancelled()) {
+						if (curNode.getType() != DOMRegionContext.XML_COMMENT_TEXT && curNode.getType() != DOMRegionContext.XML_CDATA_TEXT && curNode.getType() != DOMRegionContext.UNDEFINED) {
+							validateRegionContainer(curNode, reporter, file);
+						}
+					}
+				}
+				catch (Exception e) {
+				}
+				finally {
+					if (null != model)
+						model.releaseFromRead();
+				}
+			}
+		}
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java
deleted file mode 100644
index f63a07a..0000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package org.eclipse.jst.jsp.core.internal.validation;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.compiler.IProblem;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationExtension;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class JSPJavaValidator extends JSPValidator {
-	
-	/**
-	 * Validate one file. It's assumed that the file has JSP content type.
-	 * 
-	 * @param f
-	 * @param reporter
-	 */
-	protected void validateFile(IFile f, IReporter reporter) {
-		
-		IDOMModel model = null;
-		try {
-			// get jsp model, get tranlsation
-			model = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(f);
-			if (model != null) {
-
-				setupAdapterFactory(model);
-				IDOMDocument xmlDoc = model.getDocument();
-				JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
-				JSPTranslation translation = translationAdapter.getJSPTranslation();
-
-				translation.setProblemCollectingActive(true);
-				translation.reconcileCompilationUnit();
-				List problems = translation.getProblems();
-				// remove old messages
-				reporter.removeAllMessages(this, f);
-				// add new messages
-				for (int i = 0; i < problems.size() && !reporter.isCancelled(); i++) {
-					IMessage m = createMessageFromProblem((IProblem) problems.get(i), f, translation, model.getStructuredDocument());
-					if (m != null)
-						reporter.addMessage(this, m);
-				}
-			}
-		}
-		catch (IOException e) {
-			Logger.logException(e);
-		}
-		catch (CoreException e) {
-			Logger.logException(e);
-		}
-		finally {
-			if (model != null)
-				model.releaseFromRead();
-		}
-	}
-	
-	/**
-	 * When loading model from a file, you need to explicitly add adapter
-	 * factory.
-	 * 
-	 * @param sm
-	 */
-	private void setupAdapterFactory(IStructuredModel sm) {
-		JSPTranslationAdapterFactory factory = new JSPTranslationAdapterFactory();
-		sm.getFactoryRegistry().addFactory(factory);
-	}
-	
-	/**
-	 * Creates an IMessage from an IProblem
-	 * 
-	 * @param problem
-	 * @param f
-	 * @param translation
-	 * @param structuredDoc
-	 * @return message representation of the problem, or null if it could not
-	 *         create one
-	 */
-	private IMessage createMessageFromProblem(IProblem problem, IFile f, JSPTranslation translation, IStructuredDocument structuredDoc) {
-
-		int sourceStart = translation.getJspOffset(problem.getSourceStart());
-		int sourceEnd = translation.getJspOffset(problem.getSourceEnd());
-		if (sourceStart == -1)
-			return null;
-		
-		// line number for marker starts @ 1
-		// line number from document starts @ 0
-		int lineNo = structuredDoc.getLineOfOffset(sourceStart) + 1;
-
-		int sev = problem.isError() ? IMessage.HIGH_SEVERITY : IMessage.NORMAL_SEVERITY;
-
-		IMessage m = new LocalizedMessage(sev, problem.getMessage(), f);
-
-		m.setLineNo(lineNo);
-		m.setOffset(sourceStart);
-		m.setLength(sourceEnd - sourceStart + 1);
-
-		// need additional adjustment for problems from
-		// indirect (included) files
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=119633
-		if(translation.isIndirect(problem.getSourceStart())) {
-			adjustIndirectPosition(m, translation);
-		}
-		
-		return m;
-	}
-
-	/**
-	 * Assumed the message offset is an indirect position.
-	 * In other words, an error from an included file.
-	 * 
-	 * @param m
-	 * @param translation
-	 */
-	private void adjustIndirectPosition(IMessage m, JSPTranslation translation) {
-		
-		if(!(translation instanceof JSPTranslationExtension))
-			return;
-		
-		IDocument jspDoc = ((JSPTranslationExtension)translation).getJspDocument();
-		if(!(jspDoc instanceof IStructuredDocument))
-			return;
-		
-		IStructuredDocument sDoc = (IStructuredDocument)jspDoc;
-		IStructuredDocumentRegion[] regions = sDoc.getStructuredDocumentRegions(0, m.getOffset() + m.getLength());
-		// iterate backwards until you hit the include directive
-		for(int i=regions.length-1; i>=0; i--) {
-			
-			IStructuredDocumentRegion region = regions[i];
-			if(region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
-				if(getDirectiveName(region).equals("include")) { //$NON-NLS-1$
-					ITextRegion fileValueRegion = getAttributeValueRegion(region, "file"); //$NON-NLS-1$
-					m.setOffset(region.getStartOffset(fileValueRegion));
-					m.setLength(fileValueRegion.getTextLength());
-					break;
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
index a8ae23d..2e1ffb7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
@@ -14,41 +14,37 @@
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jdt.core.compiler.IProblem;
 import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory;
+import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
-/**
- * Performs some common JSP validation tasks
- */
-public class JSPValidator implements IValidatorJob {
+public class JSPValidator implements IValidator {
 
-	private static final String PLUGIN_ID_JSP_CORE = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$
-
-	protected class LocalizedMessage extends Message {
-
+	static private class LocalizedMessage extends Message {
 		private String _message = null;
 
 		public LocalizedMessage(int severity, String messageText) {
@@ -90,7 +86,26 @@
 		}
 	}
 
-	protected class JSPFileVisitor implements IResourceProxyVisitor {
+	static boolean shouldValidate(IFile file) {
+		IResource resource = file;
+		do {
+			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
+				return false;
+			}
+			resource = resource.getParent();
+		}
+		while ((resource.getType() & IResource.PROJECT) == 0);
+		return true;
+	}
+
+	// for debugging
+	static final boolean DEBUG;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspvalidator"); //$NON-NLS-1$
+		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+
+	private class JSPFileVisitor implements IResourceProxyVisitor {
 
 		private List fFiles = new ArrayList();
 		private IContentType fContentTypeJSP = null;
@@ -147,13 +162,7 @@
 			for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
 				currentFile = wsRoot.getFile(new Path(uris[i]));
 				if (currentFile != null && currentFile.exists()) {
-					if(shouldValidate(currentFile) && shouldValidate2(currentFile)) {
-
-					    Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(JSPCoreMessages.MESSAGE_JSP_VALIDATING_MESSAGE_UI_, new String[]{currentFile.getFullPath().toString()}));
-					    reporter.displaySubtask(this, message);
-					    
-						validateFile(currentFile, reporter);
-					}
+					validateFile(currentFile, reporter);
 					if (DEBUG)
 						System.out.println("validating: [" + uris[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
 				}
@@ -176,13 +185,7 @@
 				}
 				IFile[] files = visitor.getFiles();
 				for (int i = 0; i < files.length && !reporter.isCancelled(); i++) {
-					if(shouldValidate(files[i]) && shouldValidate2(files[i])) {
-						
-					    Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(JSPCoreMessages.MESSAGE_JSP_VALIDATING_MESSAGE_UI_, new String[]{files[i].getFullPath().toString()}));
-					    reporter.displaySubtask(this, message);
-					    
-						validateFile(files[i], reporter);
-					}
+					validateFile(files[i], reporter);
 					if (DEBUG)
 						System.out.println("validating: [" + files[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
 				}
@@ -196,59 +199,96 @@
 	 * @param f
 	 * @param reporter
 	 */
-	protected void validateFile(IFile f, IReporter reporter) {
-		// subclasses should implement (for batch validation)
-	}
-	
-	/**
-	 * 
-	 * @param sdr
-	 * @return the jsp directive name
-	 */
-	protected String getDirectiveName(IStructuredDocumentRegion sdr) {
-		String name = "";
-		ITextRegionList subRegions = sdr.getRegions();
-		for (int j = 0; j < subRegions.size(); j++) {
-			ITextRegion subRegion = subRegions.get(j);
-			if(subRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
-				name = sdr.getText(subRegion);
-				break;
-			}
+	private void validateFile(IFile f, IReporter reporter) {
+		if (!shouldValidate(f)) {
+			return;
 		}
-		return name;
-	}
-	
-	/**
-	 * 
-	 * @param sdr
-	 * @param attrName
-	 * @return the ITextRegion for the attribute value of the given attribute name
-	 */
-	protected ITextRegion getAttributeValueRegion(IStructuredDocumentRegion sdr, String attrName) {
-		ITextRegion valueRegion = null;
-		ITextRegionList subRegions = sdr.getRegions();
-		for (int i = 0; i < subRegions.size(); i++) {
-			ITextRegion subRegion = subRegions.get(i);
-			if(subRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME && sdr.getText(subRegion).equals(attrName)) {
-				
-				for(int j=i; j<subRegions.size(); j++) {
-					subRegion = subRegions.get(j);
-					if(subRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-						valueRegion = subRegion;
-						break;
-					}
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=87351
+		if (!shouldValidate2(f)) {
+			return;
+		}
+
+	    Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(JSPCoreMessages.MESSAGE_JSP_VALIDATING_MESSAGE_UI_, new String[]{f.getFullPath().toString()}));
+	    reporter.displaySubtask(this, message);
+		
+		IDOMModel model = null;
+		try {
+			// get jsp model, get tranlsation
+			model = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(f);
+			if (model != null) {
+
+				setupAdapterFactory(model);
+				IDOMDocument xmlDoc = model.getDocument();
+				JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				JSPTranslation translation = translationAdapter.getJSPTranslation();
+
+				translation.setProblemCollectingActive(true);
+				translation.reconcileCompilationUnit();
+				List problems = translation.getProblems();
+				// remove old messages
+				reporter.removeAllMessages(this, f);
+				// add new messages
+				for (int i = 0; i < problems.size() && !reporter.isCancelled(); i++) {
+					IMessage m = createMessageFromProblem((IProblem) problems.get(i), f, translation, model.getStructuredDocument());
+					if (m != null)
+						reporter.addMessage(this, m);
 				}
-				break;
 			}
 		}
-		return valueRegion;
+		catch (IOException e) {
+			if (DEBUG)
+				e.printStackTrace();
+		}
+		catch (CoreException e) {
+			if (DEBUG)
+				e.printStackTrace();
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
 	}
-	
-	protected String getAttributeValue(IStructuredDocumentRegion sdr, String attrName) {
-		ITextRegion r = getAttributeValueRegion(sdr, attrName);
-		if(r != null)
-			return sdr.getText(r).trim();
-		return "";
+
+	/**
+	 * Creates an IMessage from an IProblem
+	 * 
+	 * @param problem
+	 * @param f
+	 * @param translation
+	 * @param structuredDoc
+	 * @return message representation of the problem, or null if it could not
+	 *         create one
+	 */
+	private IMessage createMessageFromProblem(IProblem problem, IFile f, JSPTranslation translation, IStructuredDocument structuredDoc) {
+
+		int sourceStart = translation.getJspOffset(problem.getSourceStart());
+		int sourceEnd = translation.getJspOffset(problem.getSourceEnd());
+		if (sourceStart == -1)
+			return null;
+		// line number for marker starts @ 1
+		// line number from document starts @ 0
+		int lineNo = structuredDoc.getLineOfOffset(sourceStart) + 1;
+
+		int sev = problem.isError() ? IMessage.HIGH_SEVERITY : IMessage.NORMAL_SEVERITY;
+
+		IMessage m = new LocalizedMessage(sev, problem.getMessage(), f);
+
+		m.setLineNo(lineNo);
+		m.setOffset(sourceStart);
+		m.setLength(sourceEnd - sourceStart + 1);
+
+		return m;
+	}
+
+	/**
+	 * When loading model from a file, you need to explicitly add adapter
+	 * factory.
+	 * 
+	 * @param sm
+	 */
+	private void setupAdapterFactory(IStructuredModel sm) {
+		JSPTranslationAdapterFactory factory = new JSPTranslationAdapterFactory();
+		sm.getFactoryRegistry().addFactory(factory);
 	}
 
 	/**
@@ -296,26 +336,7 @@
 		}
 		return isFragment;
 	}
-	
-	private boolean shouldValidate(IFile file) {
-		IResource resource = file;
-		do {
-			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
-				return false;
-			}
-			resource = resource.getParent();
-		}
-		while ((resource.getType() & IResource.PROJECT) == 0);
-		return true;
-	}
 
-	// for debugging
-	static final boolean DEBUG;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspvalidator"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
-	
 	/**
 	 * Performs extra checks on the file to see if file should really be
 	 * validated.
@@ -325,9 +346,9 @@
 	 *            should not be null and does exist
 	 * @return true if should validate file, false otherwise
 	 */
-	 private boolean shouldValidate2(IFile file) {
+	private boolean shouldValidate2(IFile file) {
 		// get preference for validate jsp fragments
-		boolean shouldValidate = Boolean.valueOf(JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, file, true)).booleanValue();
+		boolean shouldValidate = Platform.getPreferencesService().getBoolean(JSPCorePlugin.getDefault().getBundle().getSymbolicName(), JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true, null);
 
 		/*
 		 * if jsp fragments should not be validated, check if file is jsp
@@ -340,20 +361,4 @@
 
 		return shouldValidate;
 	}
-	 
-	 public ISchedulingRule getSchedulingRule(IValidationContext helper) {
-		return null;
-	}
-	 
-	 public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
-		IStatus status = Status.OK_STATUS;
-		try{
-			validate(helper, reporter);
-		}
-		catch (ValidationException e){
-			Logger.logException(e);
-			status = new Status(IStatus.ERROR, PLUGIN_ID_JSP_CORE, IStatus.ERROR, e.getLocalizedMessage(),  e);
-		}
-		return status;
-	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
index 0727cb1..04bd47b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
@@ -143,10 +143,6 @@
 			return location;
 		}
 
-		public int getRecordType() {
-			return ITaglibRecord.JAR;
-		}
-
 		/**
 		 * @return Returns the recommended/default prefix if one was given.
 		 */
@@ -156,6 +152,10 @@
 			return info.shortName;
 		}
 
+		public int getRecordType() {
+			return ITaglibRecord.JAR;
+		}
+
 		/**
 		 * 
 		 */
@@ -273,16 +273,16 @@
 			return path;
 		}
 
-		public int getRecordType() {
-			return ITaglibRecord.TLD;
-		}
-
 		public String getShortName() {
 			if (info == null)
 				return null;
 			return info.shortName;
 		}
 
+		public int getRecordType() {
+			return ITaglibRecord.TLD;
+		}
+
 		/**
 		 * @return Returns the uri.
 		 */
@@ -316,10 +316,6 @@
 			return baseLocation;
 		}
 
-		public int getRecordType() {
-			return ITaglibRecord.URL;
-		}
-
 		/**
 		 * @return Returns the recommended/default prefix if one was given.
 		 */
@@ -329,6 +325,10 @@
 			return info.shortName;
 		}
 
+		public int getRecordType() {
+			return ITaglibRecord.URL;
+		}
+
 		/**
 		 * @return Returns the uri.
 		 */
@@ -911,17 +911,6 @@
 		}
 	}
 
-	/*
-	 * private void removeClasspathLibrary(String libraryLocation) { JarRecord
-	 * record = (JarRecord) fClasspathJars.remove(libraryLocation); if (record !=
-	 * null) { URLRecord[] records = (URLRecord[])
-	 * record.getURLRecords().toArray(new URLRecord[0]); for (int i = 0; i <
-	 * records.length; i++) {
-	 * fClasspathReferences.remove(records[i].getURI()); }
-	 * TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(record,
-	 * ITaglibRecordEvent.REMOVED)); } }
-	 */
-
 	private String readTextofChild(Node node, String childName) {
 		NodeList children = node.getChildNodes();
 		for (int i = 0; i < children.getLength(); i++) {
@@ -933,6 +922,17 @@
 		return ""; //$NON-NLS-1$
 	}
 
+	/*
+	 * private void removeClasspathLibrary(String libraryLocation) { JarRecord
+	 * record = (JarRecord) fClasspathJars.remove(libraryLocation); if (record !=
+	 * null) { URLRecord[] records = (URLRecord[])
+	 * record.getURLRecords().toArray(new URLRecord[0]); for (int i = 0; i <
+	 * records.length; i++) {
+	 * fClasspathReferences.remove(records[i].getURI()); }
+	 * TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(record,
+	 * ITaglibRecordEvent.REMOVED)); } }
+	 */
+
 	void removeJAR(IResource jar) {
 		if (_debugIndexCreation)
 			Logger.log(Logger.INFO_DEBUG, "removing records for JAR " + jar.getFullPath()); //$NON-NLS-1$
@@ -1064,8 +1064,6 @@
 				record = (ITaglibRecord) getImplicitReferences(webxmls[i].path.toString()).get(reference);
 			}
 		}
-
-
 		return record;
 	}
 
@@ -1112,7 +1110,6 @@
 	void updateJAR(IResource jar, int deltaKind) {
 		if (_debugIndexCreation)
 			Logger.log(Logger.INFO_DEBUG, "creating records for JAR " + jar.getFullPath()); //$NON-NLS-1$
-
 		String jarLocationString = jar.getLocation().toString();
 		String[] entries = JarUtilities.getEntryNames(jar);
 		JarRecord jarRecord = createJARRecord(jar);
@@ -1197,7 +1194,7 @@
 			provider.setValidating(false);
 			provider.setRootElementName("web-app"); //$NON-NLS-1$
 			provider.setBaseReference(webxml.getParent().getLocation().toString());
-			document = provider.getDocument(false);
+			document = provider.getDocument();
 		}
 		catch (CoreException e) {
 			Logger.logException(e);
@@ -1220,11 +1217,11 @@
 		webxmlRecord.path = webxml.getFullPath();
 		fWebXMLReferences.put(webxmlRecord.getWebXML().toString(), webxmlRecord);
 		NodeList taglibs = document.getElementsByTagName(JSP12TLDNames.TAGLIB);
-		for (int iTaglib = 0; iTaglib < taglibs.getLength(); iTaglib++) {
-			String taglibUri = readTextofChild(taglibs.item(iTaglib), "taglib-uri").trim(); //$NON-NLS-1$
+		for (int i = 0; i < taglibs.getLength(); i++) {
+			String taglibUri = readTextofChild(taglibs.item(i), "taglib-uri").trim(); //$NON-NLS-1$
 			// specified location is relative to root of the webapp
-			String taglibLocation = readTextofChild(taglibs.item(iTaglib), "taglib-location").trim(); //$NON-NLS-1$
-			IPath path = null; 
+			String taglibLocation = readTextofChild(taglibs.item(i), "taglib-location").trim(); //$NON-NLS-1$
+			IPath path = null;
 			if (taglibLocation.startsWith("/")) { //$NON-NLS-1$
 				path = new Path(getLocalRoot(webxml.getFullPath().toString()) + taglibLocation);
 			}
@@ -1281,4 +1278,4 @@
 			}
 		}
 	}
-}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
index 44e5693..57ea525 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
@@ -30,7 +30,6 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.ILock;
 import org.eclipse.jdt.core.ElementChangedEvent;
 import org.eclipse.jdt.core.IElementChangedListener;
 import org.eclipse.jdt.core.IJavaElement;
@@ -39,8 +38,7 @@
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.osgi.framework.Bundle;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 /**
  * A non-extendable index manager for taglibs similar to the previous J2EE
@@ -55,6 +53,7 @@
  * @since 1.0
  */
 public final class TaglibIndex {
+
 	class ClasspathChangeListener implements IElementChangedListener {
 		Stack classpathStack = new Stack();
 		List projectsIndexed = new ArrayList(1);
@@ -62,21 +61,12 @@
 		public void elementChanged(ElementChangedEvent event) {
 			if (!isIndexAvailable())
 				return;
-			try {
-				LOCK.acquire();
-				classpathStack.clear();
-				projectsIndexed.clear();
-				elementChanged(event.getDelta());
-			}
-			finally {
-				LOCK.release();
-			}
+			classpathStack.clear();
+			projectsIndexed.clear();
+			elementChanged(event.getDelta());
 		}
 
 		private void elementChanged(IJavaElementDelta delta) {
-			if (frameworkIsShuttingDown())
-				return;
-
 			if (delta.getElement().getElementType() == IJavaElement.JAVA_MODEL) {
 				IJavaElementDelta[] changed = delta.getChangedChildren();
 				for (int i = 0; i < changed.length; i++) {
@@ -86,15 +76,14 @@
 			else if (delta.getElement().getElementType() == IJavaElement.JAVA_PROJECT) {
 				if ((delta.getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) {
 					IJavaElement proj = delta.getElement();
-					handleClasspathChange((IJavaProject) proj);
+					synchronized (proj) {
+						handleClasspathChange((IJavaProject) proj);
+					}
 				}
 			}
 		}
 
 		private void handleClasspathChange(IJavaProject project) {
-			if (frameworkIsShuttingDown())
-				return;
-
 			/*
 			 * Loops in the build paths could cause us to pop more than we
 			 * push
@@ -102,35 +91,37 @@
 			if (classpathStack.contains(project.getElementName()))
 				return;
 
-			classpathStack.push(project.getElementName());
-			try {
-				/* Handle changes to this project's build path */
-				IResource resource = project.getCorrespondingResource();
-				if (resource.getType() == IResource.PROJECT && !projectsIndexed.contains(resource)) {
-					ProjectDescription description = getDescription((IProject) resource);
-					if (description != null && !frameworkIsShuttingDown()) {
+			synchronized (project) {
+				classpathStack.push(project.getElementName());
+				try {
+					/* Handle changes to this project's build path */
+					IResource resource = project.getCorrespondingResource();
+					if (resource.getType() == IResource.PROJECT && !projectsIndexed.contains(resource)) {
 						projectsIndexed.add(resource);
-						description.indexClasspath();
+						boolean classpathIndexIsOld = fProjectDescriptions.containsKey(resource);
+						ProjectDescription description = createDescription((IProject) resource);
+						if (classpathIndexIsOld) {
+							description.indexClasspath();
+						}
+					}
+					/*
+					 * Update indeces for projects who include this project in
+					 * their build path (e.g. toggling the "exportation" of a
+					 * taglib JAR in this project affects the JAR's visibility
+					 * in other projects)
+					 */
+					IJavaProject[] projects = project.getJavaModel().getJavaProjects();
+					for (int i = 0; i < projects.length; i++) {
+						IJavaProject otherProject = projects[i];
+						if (StringUtils.contains(otherProject.getRequiredProjectNames(), project.getElementName(), false) && !classpathStack.contains(otherProject.getElementName())) {
+							handleClasspathChange(otherProject);
+						}
 					}
 				}
-				/*
-				 * Update indeces for projects who include this project in
-				 * their build path (e.g. toggling the "exportation" of a
-				 * taglib JAR in this project affects the JAR's visibility in
-				 * other projects)
-				 */
-				IJavaProject[] projects = project.getJavaModel().getJavaProjects();
-				for (int i = 0; i < projects.length; i++) {
-					IJavaProject otherProject = projects[i];
-					if (StringUtils.contains(otherProject.getRequiredProjectNames(), project.getElementName(), false) && !classpathStack.contains(otherProject.getElementName()) && !frameworkIsShuttingDown()) {
-						handleClasspathChange(otherProject);
-					}
+				catch (JavaModelException e) {
 				}
+				classpathStack.pop();
 			}
-			catch (JavaModelException e) {
-			}
-			classpathStack.pop();
-
 		}
 	}
 
@@ -138,133 +129,127 @@
 		public void resourceChanged(IResourceChangeEvent event) {
 			if (!isIndexAvailable())
 				return;
-			try {
-				LOCK.acquire();
-				switch (event.getType()) {
-					case IResourceChangeEvent.PRE_CLOSE :
-					case IResourceChangeEvent.PRE_DELETE : {
-						try {
-							// pair deltas with projects
-							IResourceDelta[] deltas = new IResourceDelta[]{event.getDelta()};
-							IProject[] projects = null;
+			switch (event.getType()) {
+				case IResourceChangeEvent.PRE_CLOSE :
+				case IResourceChangeEvent.PRE_DELETE : {
+					try {
+						// pair deltas with projects
+						IResourceDelta[] deltas = new IResourceDelta[]{event.getDelta()};
+						IProject[] projects = null;
 
-							if (deltas != null && deltas.length > 0) {
-								IResource resource = null;
-								if (deltas[0] != null) {
-									resource = deltas[0].getResource();
+						if (deltas != null && deltas.length > 0) {
+							IResource resource = null;
+							if (deltas[0] != null) {
+								resource = deltas[0].getResource();
+							}
+							else {
+								resource = event.getResource();
+							}
+
+							if (resource != null) {
+								if (resource.getType() == IResource.ROOT) {
+									deltas = deltas[0].getAffectedChildren();
+									projects = new IProject[deltas.length];
+									for (int i = 0; i < deltas.length; i++) {
+										if (deltas[i].getResource().getType() == IResource.PROJECT) {
+											projects[i] = (IProject) deltas[i].getResource();
+										}
+									}
 								}
 								else {
-									resource = event.getResource();
-								}
-
-								if (resource != null) {
-									if (resource.getType() == IResource.ROOT) {
-										deltas = deltas[0].getAffectedChildren();
-										projects = new IProject[deltas.length];
-										for (int i = 0; i < deltas.length; i++) {
-											if (deltas[i].getResource().getType() == IResource.PROJECT) {
-												projects[i] = (IProject) deltas[i].getResource();
-											}
-										}
+									projects = new IProject[1];
+									if (resource.getType() != IResource.PROJECT) {
+										projects[0] = resource.getProject();
 									}
 									else {
-										projects = new IProject[1];
-										if (resource.getType() != IResource.PROJECT) {
-											projects[0] = resource.getProject();
-										}
-										else {
-											projects[0] = (IProject) resource;
-										}
-									}
-								}
-								for (int i = 0; i < projects.length; i++) {
-									if (_debugIndexCreation) {
-										Logger.log(Logger.INFO_DEBUG, "TaglibIndex noticed " + projects[i].getName() + " is about to be deleted/closed"); //$NON-NLS-1$ //$NON-NLS-2$
-									}
-									ProjectDescription description = (ProjectDescription) fProjectDescriptions.remove(projects[i]);
-									if (description != null) {
-										if (_debugIndexCreation) {
-											Logger.log(Logger.INFO_DEBUG, "removing index of " + description.fProject.getName()); //$NON-NLS-1$
-										}
-										description.clear();
+										projects[0] = (IProject) resource;
 									}
 								}
 							}
-						}
-						catch (Exception e) {
-							Logger.logException("Exception while processing resource deletion", e); //$NON-NLS-1$
+							for (int i = 0; i < projects.length; i++) {
+								if (_debugIndexCreation) {
+									Logger.log(Logger.INFO_DEBUG, "TaglibIndex noticed " + projects[i].getName() + " is about to be deleted/closed"); //$NON-NLS-1$ //$NON-NLS-2$
+								}
+								ProjectDescription description = (ProjectDescription) fProjectDescriptions.remove(projects[i]);
+								if (description != null) {
+									if (_debugIndexCreation) {
+										Logger.log(Logger.INFO_DEBUG, "removing index of " + description.fProject.getName()); //$NON-NLS-1$
+									}
+									description.clear();
+								}
+							}
 						}
 					}
-					case IResourceChangeEvent.POST_CHANGE : {
-						try {
-							// pair deltas with projects
-							IResourceDelta[] deltas = new IResourceDelta[]{event.getDelta()};
-							IProject[] projects = null;
-
-							if (deltas != null && deltas.length > 0) {
-								IResource resource = null;
-								if (deltas[0] != null) {
-									resource = deltas[0].getResource();
-								}
-								else {
-									resource = event.getResource();
-								}
-
-								if (resource != null) {
-									if (resource.getType() == IResource.ROOT) {
-										deltas = deltas[0].getAffectedChildren();
-										projects = new IProject[deltas.length];
-										for (int i = 0; i < deltas.length; i++) {
-											if (deltas[i].getResource().getType() == IResource.PROJECT) {
-												projects[i] = (IProject) deltas[i].getResource();
-											}
-										}
-									}
-									else {
-										projects = new IProject[1];
-										if (resource.getType() != IResource.PROJECT) {
-											projects[0] = resource.getProject();
-										}
-										else {
-											projects[0] = (IProject) resource;
-										}
-									}
-								}
-								for (int i = 0; i < projects.length; i++) {
-									try {
-										if (deltas[i] != null && deltas[i].getKind() != IResourceDelta.REMOVED && projects[i].isAccessible()) {
-											ProjectDescription description = getDescription(projects[i]);
-											if (description != null && !frameworkIsShuttingDown()) {
-												deltas[i].accept(description.getVisitor());
-											}
-										}
-										if (!projects[i].isAccessible() || (deltas[i] != null && deltas[i].getKind() == IResourceDelta.REMOVED)) {
-											if (_debugIndexCreation) {
-												Logger.log(Logger.INFO_DEBUG, "TaglibIndex noticed " + projects[i].getName() + " was removed or is no longer accessible"); //$NON-NLS-1$ //$NON-NLS-2$
-											}
-											ProjectDescription description = (ProjectDescription) fProjectDescriptions.remove(projects[i]);
-											if (description != null) {
-												if (_debugIndexCreation) {
-													Logger.log(Logger.INFO_DEBUG, "removing index of " + description.fProject.getName()); //$NON-NLS-1$
-												}
-												description.clear();
-											}
-										}
-									}
-									catch (CoreException e) {
-										Logger.logException(e);
-									}
-								}
-							}
-						}
-						catch (Exception e) {
-							Logger.logException("Exception while processing resource change", e); //$NON-NLS-1$
-						}
+					catch (Exception e) {
+						Logger.logException("Exception while processing resource deletion", e); //$NON-NLS-1$
 					}
 				}
-			}
-			finally {
-				LOCK.release();
+				case IResourceChangeEvent.POST_CHANGE : {
+					try {
+						// pair deltas with projects
+						IResourceDelta[] deltas = new IResourceDelta[]{event.getDelta()};
+						IProject[] projects = null;
+
+						if (deltas != null && deltas.length > 0) {
+							IResource resource = null;
+							if (deltas[0] != null) {
+								resource = deltas[0].getResource();
+							}
+							else {
+								resource = event.getResource();
+							}
+
+							if (resource != null) {
+								if (resource.getType() == IResource.ROOT) {
+									deltas = deltas[0].getAffectedChildren();
+									projects = new IProject[deltas.length];
+									for (int i = 0; i < deltas.length; i++) {
+										if (deltas[i].getResource().getType() == IResource.PROJECT) {
+											projects[i] = (IProject) deltas[i].getResource();
+										}
+									}
+								}
+								else {
+									projects = new IProject[1];
+									if (resource.getType() != IResource.PROJECT) {
+										projects[0] = resource.getProject();
+									}
+									else {
+										projects[0] = (IProject) resource;
+									}
+								}
+							}
+							for (int i = 0; i < projects.length; i++) {
+								try {
+									if (deltas[i] != null && deltas[i].getKind() != IResourceDelta.REMOVED && projects[i].isAccessible()) {
+										ProjectDescription description = createDescription(projects[i]);
+										synchronized (projects[i]) {
+											deltas[i].accept(description.getVisitor());
+										}
+									}
+									if (!projects[i].isAccessible() || (deltas[i] != null && deltas[i].getKind() == IResourceDelta.REMOVED)) {
+										if (_debugIndexCreation) {
+											Logger.log(Logger.INFO_DEBUG, "TaglibIndex noticed " + projects[i].getName() + " was removed or is no longer accessible"); //$NON-NLS-1$ //$NON-NLS-2$
+										}
+										ProjectDescription description = (ProjectDescription) fProjectDescriptions.remove(projects[i]);
+										if (description != null) {
+											if (_debugIndexCreation) {
+												Logger.log(Logger.INFO_DEBUG, "removing index of " + description.fProject.getName()); //$NON-NLS-1$
+											}
+											description.clear();
+										}
+									}
+								}
+								catch (CoreException e) {
+									Logger.logException(e);
+								}
+							}
+						}
+					}
+					catch (Exception e) {
+						Logger.logException("Exception while processing resource change", e); //$NON-NLS-1$
+					}
+				}
 			}
 		}
 	}
@@ -274,13 +259,9 @@
 	static boolean _debugEvents = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/events")); //$NON-NLS-1$ //$NON-NLS-2$
 
 	static boolean _debugIndexCreation = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/indexcreation")); //$NON-NLS-1$ //$NON-NLS-2$
-
 	static final boolean _debugResolution = "true".equals(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/resolve")); //$NON-NLS-1$ //$NON-NLS-2$
-
 	static TaglibIndex _instance;
-
-	static boolean ENABLED = false;
-	static ILock LOCK = null;
+	static boolean ENABLED = true;
 
 	/**
 	 * NOT API.
@@ -289,13 +270,7 @@
 	 *            the listener to be added
 	 */
 	public static void addTaglibIndexListener(ITaglibIndexListener listener) {
-		try {
-			LOCK.acquire();
-			_instance.internalAddTaglibIndexListener(listener);
-		}
-		finally {
-			LOCK.release();
-		}
+		_instance.internalAddTaglibIndexListener(listener);
 	}
 
 	static void fireTaglibRecordEvent(ITaglibRecordEvent event) {
@@ -319,9 +294,6 @@
 	 * Finds all of the visible ITaglibRecords for the given path in the
 	 * workspace. Taglib mappings from web.xml files are only visible to paths
 	 * within the web.xml's corresponding web content folder.
-	 * <p>
-	 * Values defined within the XML Catalog will not be returned.
-	 * </p>
 	 * 
 	 * @param fullPath -
 	 *            a path within the workspace
@@ -340,17 +312,10 @@
 	 * @deprecated - is not correct in flexible projects
 	 * @param path -
 	 *            a path under the web-app root
-	 * @return the IPath considered to be the web-app's root for the given
-	 *         path
+	 * @return
 	 */
 	public static IPath getContextRoot(IPath path) {
-		try {
-			LOCK.acquire();
-			return _instance.internalGetContextRoot(path);
-		}
-		finally {
-			LOCK.release();
-		}
+		return _instance.internalGetContextRoot(path);
 	}
 
 	/**
@@ -360,13 +325,7 @@
 	 *            the listener to be removed
 	 */
 	public static void removeTaglibIndexListener(ITaglibIndexListener listener) {
-		try {
-			LOCK.acquire();
-			_instance.internalRemoveTaglibIndexListener(listener);
-		}
-		finally {
-			LOCK.release();
-		}
+		_instance.internalRemoveTaglibIndexListener(listener);
 	}
 
 	/**
@@ -388,14 +347,7 @@
 	 * @See ITaglibRecord
 	 */
 	public static ITaglibRecord resolve(String basePath, String reference, boolean crossProjects) {
-		ITaglibRecord result = null;
-		try {
-			LOCK.acquire();
-			result = _instance.internalResolve(basePath, reference, crossProjects);
-		}
-		finally {
-			LOCK.release();
-		}
+		ITaglibRecord result = _instance.internalResolve(basePath, reference, crossProjects);
 		if (_debugResolution) {
 			if (result == null) {
 				Logger.log(Logger.INFO_DEBUG, "TaglibIndex could not resolve \"" + reference + "\" from " + basePath); //$NON-NLS-1$ //$NON-NLS-2$
@@ -449,12 +401,8 @@
 	private ClasspathChangeListener fClasspathChangeListener = null;
 
 	Map fProjectDescriptions;
-
 	private ResourceChangeListener fResourceChangeListener;
-
 	private ITaglibIndexListener[] fTaglibIndexListeners = null;
-	/** symbolic name for OSGI framework */
-	private final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
 
 	private TaglibIndex() {
 		super();
@@ -464,7 +412,6 @@
 			ResourcesPlugin.getWorkspace().addResourceChangeListener(fResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
 			JavaCore.addElementChangedListener(fClasspathChangeListener);
 		}
-		LOCK = Platform.getJobManager().newLock();
 		fProjectDescriptions = new Hashtable();
 	}
 
@@ -474,40 +421,21 @@
 	 */
 	ProjectDescription createDescription(IProject project) {
 		ProjectDescription description = null;
-		description = (ProjectDescription) fProjectDescriptions.get(project);
-		if (description == null) {
-			description = new ProjectDescription(project);
-			if (ENABLED) {
-				description.index();
-				description.indexClasspath();
+		synchronized (project) {
+			description = (ProjectDescription) fProjectDescriptions.get(project);
+			if (description == null) {
+				description = new ProjectDescription(project);
+				if (ENABLED) {
+					description.index();
+					description.indexClasspath();
+				}
+				fProjectDescriptions.put(project, description);
 			}
-			fProjectDescriptions.put(project, description);
 		}
 		return description;
 	}
 
-	/**
-	 * A check to see if the OSGI framework is shutting down.
-	 * 
-	 * @return true if the System Bundle is stopped (ie. the framework is
-	 *         shutting down)
-	 */
-	boolean frameworkIsShuttingDown() {
-		// in the Framework class there's a note:
-		// set the state of the System Bundle to STOPPING.
-		// this must be done first according to section 4.19.2 from the OSGi
-		// R3 spec.
-		boolean shuttingDown = !Platform.isRunning() || Platform.getBundle(OSGI_FRAMEWORK_ID).getState() == Bundle.STOPPING;
-		return shuttingDown;
-	}
-
-	ProjectDescription getDescription(IProject project) {
-		ProjectDescription description = null;
-		description = (ProjectDescription) fProjectDescriptions.get(project);
-		return description;
-	}
-
-	private void internalAddTaglibIndexListener(ITaglibIndexListener listener) {
+	private synchronized void internalAddTaglibIndexListener(ITaglibIndexListener listener) {
 		if (fTaglibIndexListeners == null) {
 			fTaglibIndexListeners = new ITaglibIndexListener[]{listener};
 		}
@@ -535,7 +463,7 @@
 			IProject project = baseResource.getProject();
 			ProjectDescription description = _instance.createDescription(project);
 			IPath rootPath = description.getLocalRoot(baseResource.getFullPath());
-			return rootPath;
+			return ResourcesPlugin.getWorkspace().getRoot().getLocation().append(rootPath);
 		}
 		// try to handle out-of-workspace paths
 		IPath root = path;
@@ -546,7 +474,7 @@
 		return root;
 	}
 
-	private void internalRemoveTaglibIndexListener(ITaglibIndexListener listener) {
+	private synchronized void internalRemoveTaglibIndexListener(ITaglibIndexListener listener) {
 		if (fTaglibIndexListeners != null) {
 			List listeners = new ArrayList(Arrays.asList(fTaglibIndexListeners));
 			listeners.remove(listener);
@@ -572,14 +500,16 @@
 		}
 		if (baseResource != null) {
 			project = baseResource.getProject();
-			ProjectDescription description = createDescription(project);
-			resolved = description.resolve(basePath, reference);
+			synchronized (project) {
+				ProjectDescription description = createDescription(project);
+				resolved = description.resolve(basePath, reference);
+			}
 		}
 		return resolved;
 	}
 
 	boolean isIndexAvailable() {
-		return _instance != null && ENABLED;
+		return _instance != null;
 	}
 
 	private void stop() {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java
deleted file mode 100644
index 8a37aac..0000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.eclipse.jst.jsp.core.text;
-
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types for JSP.
- * Clients should reference the partition type Strings defined here directly.
- * 
- * @since 1.1
- */
-public interface IJSPPartitions {
-
-	String JSP_DEFAULT = "org.eclipse.jst.jsp.DEFAULT_JSP"; //$NON-NLS-1$
-	String JSP_COMMENT = "org.eclipse.jst.jsp.JSP_COMMENT"; //$NON-NLS-1$
-	
-	String JSP_SCRIPT_PREFIX = "org.eclipse.jst.jsp.SCRIPT."; //$NON-NLS-1$
-	String JSP_CONTENT_DELIMITER = JSP_SCRIPT_PREFIX + "DELIMITER"; //$NON-NLS-1$
-	String JSP_CONTENT_JAVA = JSP_SCRIPT_PREFIX + "JAVA"; //$NON-NLS-1$
-	String JSP_CONTENT_JAVASCRIPT = JSP_SCRIPT_PREFIX + "JAVASCRIPT"; //$NON-NLS-1$
-	String JSP_DEFAULT_EL = JSP_SCRIPT_PREFIX + "JSP_EL"; //$NON-NLS-1$
-	String JSP_DEFAULT_EL2 = JSP_SCRIPT_PREFIX + "JSP_EL2"; //$NON-NLS-1$
-	
-	String JSP_DIRECTIVE = "org.eclipse.jst.jsp.JSP_DIRECTIVE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4e75d34..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:49 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
index 558df3d..04d30dc 100644
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Mar 02 00:35:30 EST 2006

+#Mon May 30 17:57:20 EDT 2005

 eclipse.preferences.version=1

 org.eclipse.jdt.core.builder.cleanOutputFolder=clean

 org.eclipse.jdt.core.builder.duplicateResourceTask=warning

@@ -62,7 +62,7 @@
 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore

 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled

 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled

-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error

+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning

 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning

 org.eclipse.jdt.core.compiler.source=1.3

 org.eclipse.jdt.core.incompatibleJDKLevel=ignore

diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
index 6208ecc..42fb716 100644
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:41:30 EDT 2006
-compilers.p.build=0
+#Fri May 27 23:56:32 EDT 2005
 compilers.p.deprecated=1
 compilers.p.illegal-att-value=0
 compilers.p.no-required-att=0
diff --git a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
index ce27f7c..879c78f 100644
--- a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
@@ -2,36 +2,35 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.jsp.ui; singleton:=true
-Bundle-Version: 1.1.0
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.jst.jsp.ui.internal.JSPUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jst.jsp.ui,
- org.eclipse.jst.jsp.ui.internal;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.autoedit;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.breakpointproviders;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.contentassist;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.contentproperties.ui;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.derived;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.editor;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.format;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.hyperlink;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.java.refactoring;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.java.search;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.java.search.ui;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.preferences;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.projection;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.registry;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.style;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.style.java;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.style.jspel;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.taginfo;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.templates;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.text;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.wizard;x-internal:=true,
+ org.eclipse.jst.jsp.ui.internal,
+ org.eclipse.jst.jsp.ui.internal.autoedit,
+ org.eclipse.jst.jsp.ui.internal.breakpointproviders,
+ org.eclipse.jst.jsp.ui.internal.contentassist,
+ org.eclipse.jst.jsp.ui.internal.derived,
+ org.eclipse.jst.jsp.ui.internal.editor,
+ org.eclipse.jst.jsp.ui.internal.format,
+ org.eclipse.jst.jsp.ui.internal.hyperlink,
+ org.eclipse.jst.jsp.ui.internal.java.refactoring,
+ org.eclipse.jst.jsp.ui.internal.java.search,
+ org.eclipse.jst.jsp.ui.internal.java.search.ui,
+ org.eclipse.jst.jsp.ui.internal.preferences,
+ org.eclipse.jst.jsp.ui.internal.preferences.ui,
+ org.eclipse.jst.jsp.ui.internal.projection,
+ org.eclipse.jst.jsp.ui.internal.registry,
+ org.eclipse.jst.jsp.ui.internal.style,
+ org.eclipse.jst.jsp.ui.internal.style.java,
+ org.eclipse.jst.jsp.ui.internal.taginfo,
+ org.eclipse.jst.jsp.ui.internal.templates,
+ org.eclipse.jst.jsp.ui.internal.text,
+ org.eclipse.jst.jsp.ui.internal.wizard,
  org.eclipse.jst.jsp.ui.views.contentoutline
 Require-Bundle: org.eclipse.ui.ide,
+ org.eclipse.ui.views,
  org.eclipse.jface.text,
  org.eclipse.ui.workbench.texteditor,
  org.eclipse.ui.editors,
@@ -57,4 +56,4 @@
  org.eclipse.wst.common.uriresolver,
  org.eclipse.ui.ide,
  org.eclipse.wst.javascript.ui
-Eclipse-LazyStart: true
+Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.properties b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
index 458db54..8620236 100644
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.properties
+++ b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
@@ -10,11 +10,13 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=SSE JSP Source Editor
+nlFeatureName=SSE JSP Source Editor NL Support
 JSP_Source_Page_Editor.name=JSP Editor
 JSP_Files.name=JSP Files
 JSP_Source.name=JSP Source
 JSP_Templates.name=JSP Templates
 JSP_Styles.name=JSP Styles
+JSP_Annotations.name=JSP Annotations
 
 # Snippets contributions for helping with JSP syntax
 jsp_scriptlet=<%..%> scriptlet
@@ -61,6 +63,7 @@
 AddBookmark.tooltip=Add Bookmark...
 SelectRuler.label=Select Ruler
 ## EL Error Message
+JSPEL_Syntax_Error=JSP EL Syntax Error
 ##
 CleanupDocument_label=Cleanup Document...
 CleanupDocument_tooltip=Cleanup Document
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.xml b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
index e8c23c3..6c28b24 100644
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.xml
+++ b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
@@ -5,7 +5,7 @@
 	<extension point="org.eclipse.ui.editors">
 		<editor
 			name="%JSP_Source_Page_Editor.name"
-			icon="$nl$/icons//full/obj16/sourceEditor.gif"
+			icon="icons//full/obj16/sourceEditor.gif"
 			extensions="jsp, jsf, jspf, jspx, tag, tagf"
 			contributorClass="org.eclipse.jst.jsp.ui.internal.editor.ActionContributorJSP"
 			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
@@ -391,7 +391,7 @@
 			name="%_UI_WIZARD_NAME"
 			class="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard"
 			category="org.eclipse.wst.web.ui"
-			icon="$nl$/icons/full/etool16/newjsp_wiz.gif">
+			icon="icons/full/etool16/newjsp_wiz.gif">
 			<description>%_UI_WIZARD_CREATE_NEW_FILE</description>
 			<selection class="org.eclipse.core.resources.IResource" />
 		</wizard>
@@ -400,20 +400,20 @@
 	<!-- Add new JSP wizard to J2EE Project Navigator -->
 	<extension
 		id="org.eclipse.jst.jsp.commonWizard.newJSP"
-		point="org.eclipse.ui.navigator.navigatorContent">
+		point="org.eclipse.wst.common.navigator.workbench.commonWizard">
 		<commonWizard
 			type="new"
 			wizardId="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard">
 			<enablement>
 				<or>
-					<instanceof
-						value="org.eclipse.core.resources.IProject" />
+					<objectClass
+						name="org.eclipse.core.resources.IProject" />
 
-					<instanceof
-						value="org.eclipse.core.resources.IFolder" />
+					<objectClass
+						name="org.eclipse.core.resources.IFolder" />
 
-					<instanceof
-						value="org.eclipse.core.resources.IFile" />
+					<objectClass
+						name="org.eclipse.core.resources.IFile" />
 
 				</or>
 			</enablement>
@@ -549,30 +549,4 @@
                id="org.eclipse.ui.texteditor.SelectRulerAction"/>
         </editorContribution>
 	</extension>
-	<!-- JSP Fragment Property Page -->
-	<extension point="org.eclipse.ui.propertyPages">
-		<!-- for j2ee web project -->
-		<page
-			objectClass="org.eclipse.core.resources.IProject"
-			adaptable="true"
-			name="%JSPFragmentContentSettings.name"
-			class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.ProjectJSPFContentSettingsPropertyPage"
-			id="org.eclipse.jst.jsp.ui.internal.contentproperties.ProjectJSPFContentSettingsPropertyPage">
-			<filter
-				name="nature"
-				value="org.eclipse.wst.common.project.facet.core.nature">
-			</filter>
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%JSPFragmentContentSettings.name"
-			class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.JSPFContentSettingsPropertyPage"
-			id="org.eclipse.jst.jsp.ui.internal.contentproperties.JSPFContentSettingsPropertyPage.jspf">
-			<filter
-				name="contentTypeId"
-				value="org.eclipse.jst.jsp.core.jspfragmentsource">
-			</filter>
-		</page>
-	</extension>
 </plugin>
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
index 149e892..0943cf6 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
@@ -29,8 +29,8 @@
 import org.eclipse.jface.text.information.IInformationPresenter;
 import org.eclipse.jface.text.information.IInformationProvider;
 import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
 import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.jst.jsp.ui.internal.autoedit.AutoEditStrategyForTabs;
 import org.eclipse.jst.jsp.ui.internal.autoedit.StructuredAutoEditStrategyJSP;
 import org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor;
@@ -44,23 +44,21 @@
 import org.eclipse.jst.jsp.ui.internal.style.LineStyleProviderForJSP;
 import org.eclipse.jst.jsp.ui.internal.style.java.LineStyleProviderForJava;
 import org.eclipse.jst.jsp.ui.internal.style.jspel.LineStyleProviderForJSPEL;
-import org.eclipse.jst.jsp.ui.internal.taginfo.JSPInformationProvider;
 import org.eclipse.jst.jsp.ui.internal.taginfo.JSPJavaJavadocHoverProcessor;
-import org.eclipse.jst.jsp.ui.internal.taginfo.JSPJavaJavadocInformationProvider;
 import org.eclipse.jst.jsp.ui.internal.taginfo.JSPTagInfoHoverProcessor;
 import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
 import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
 import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
 import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
 import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
 
 /**
@@ -116,7 +114,7 @@
 			// xml autoedit strategies
 			strategies = getXMLSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, contentType);
 		}
-		else if (contentType == IJSPPartitions.JSP_CONTENT_JAVA) {
+		else if (contentType == IJSPPartitionTypes.JSP_CONTENT_JAVA) {
 			// jsp java autoedit strategies
 			List allStrategies = new ArrayList(0);
 
@@ -131,7 +129,7 @@
 
 			strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
 		}
-		else if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION) {
+		else if (contentType == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.HTML_DECLARATION) {
 			// html and jsp autoedit strategies
 			List allStrategies = new ArrayList(0);
 
@@ -187,16 +185,16 @@
 	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
 		IContentAssistProcessor[] processors = null;
 
-		if (partitionType == IHTMLPartitions.SCRIPT) {
+		if (partitionType == IHTMLPartitionTypes.SCRIPT) {
 			// HTML JavaScript
 			IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
-			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(IHTMLPartitions.SCRIPT);
+			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(IHTMLPartitionTypes.SCRIPT);
 			processors = new IContentAssistProcessor[]{processor};
 		}
-		else if (partitionType == ICSSPartitions.STYLE) {
+		else if (partitionType == ICSSPartitionTypes.STYLE) {
 			// HTML CSS
 			IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
-			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(ICSSPartitions.STYLE);
+			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(ICSSPartitionTypes.STYLE);
 			processors = new IContentAssistProcessor[]{processor};
 		}
 		// // jspcontentassistprocessor handles this?
@@ -205,19 +203,19 @@
 		// processors = new IContentAssistProcessor[]{new
 		// HTMLContentAssistProcessor()};
 		// }
-		else if ((partitionType == IXMLPartitions.XML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_COMMENT) || (partitionType == IJSPPartitions.JSP_DEFAULT) || (partitionType == IJSPPartitions.JSP_DIRECTIVE) || (partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) || (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT) || (partitionType == IJSPPartitions.JSP_COMMENT)) {
+		else if ((partitionType == IXMLPartitions.XML_DEFAULT) || (partitionType == IHTMLPartitionTypes.HTML_DEFAULT) || (partitionType == IHTMLPartitionTypes.HTML_COMMENT) || (partitionType == IJSPPartitionTypes.JSP_DEFAULT) || (partitionType == IJSPPartitionTypes.JSP_DIRECTIVE) || (partitionType == IJSPPartitionTypes.JSP_CONTENT_DELIMITER) || (partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT) || (partitionType == IJSPPartitionTypes.JSP_COMMENT)) {
 			// jsp
 			processors = new IContentAssistProcessor[]{new JSPContentAssistProcessor()};
 		}
-		else if ((partitionType == IXMLPartitions.XML_CDATA) || (partitionType == IJSPPartitions.JSP_CONTENT_JAVA)) {
+		else if ((partitionType == IXMLPartitions.XML_CDATA) || (partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVA)) {
 			// jsp java
 			processors = new IContentAssistProcessor[]{new JSPJavaContentAssistProcessor()};
 		}
-		else if (partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
+		else if (partitionType == IJSPPartitionTypes.JSP_DEFAULT_EL) {
 			// jsp el
 			processors = new IContentAssistProcessor[]{new JSPELContentAssistProcessor()};
 		}
-		else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
+		else if (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION) {
 			// unknown
 			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessorForJSP()};
 		}
@@ -229,7 +227,7 @@
 		MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
 
 		formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
-		formatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitions.JSP_CONTENT_JAVA);
+		formatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitionTypes.JSP_CONTENT_JAVA);
 
 		return formatter;
 	}
@@ -238,14 +236,14 @@
 		ITextDoubleClickStrategy strategy = null;
 
 		// html or javascript
-		if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.SCRIPT)
+		if (contentType == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.SCRIPT)
 			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
-		else if (contentType == IJSPPartitions.JSP_CONTENT_JAVA || contentType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT)
+		else if (contentType == IJSPPartitionTypes.JSP_CONTENT_JAVA || contentType == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT)
 			// JSP Java or JSP JavaScript
 			strategy = getJavaSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
-		else if (contentType == IJSPPartitions.JSP_DEFAULT)
+		else if (contentType == IJSPPartitionTypes.JSP_DEFAULT)
 			// JSP (just treat like html)
-			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IHTMLPartitions.HTML_DEFAULT);
+			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IHTMLPartitionTypes.HTML_DEFAULT);
 		else
 			strategy = super.getDoubleClickStrategy(sourceViewer, contentType);
 
@@ -293,29 +291,21 @@
 
 	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
 		IInformationProvider provider = null;
-		if (partitionType == IHTMLPartitions.HTML_DEFAULT) {
+		if (partitionType == IHTMLPartitionTypes.HTML_DEFAULT) {
 			// HTML
 			IInformationPresenter htmlPresenter = getHTMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
-			provider = htmlPresenter.getInformationProvider(IHTMLPartitions.HTML_DEFAULT);
+			provider = htmlPresenter.getInformationProvider(IHTMLPartitionTypes.HTML_DEFAULT);
 		}
-		else if (partitionType == IHTMLPartitions.SCRIPT) {
+		else if (partitionType == IHTMLPartitionTypes.SCRIPT) {
 			// HTML JavaScript
 			IInformationPresenter htmlPresenter = getHTMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
-			provider = htmlPresenter.getInformationProvider(IHTMLPartitions.SCRIPT);
+			provider = htmlPresenter.getInformationProvider(IHTMLPartitionTypes.SCRIPT);
 		}
 		else if (partitionType == IXMLPartitions.XML_DEFAULT) {
 			// XML
 			IInformationPresenter xmlPresenter = getXMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
 			provider = xmlPresenter.getInformationProvider(IXMLPartitions.XML_DEFAULT);
 		}
-		else if ((partitionType == IJSPPartitions.JSP_DEFAULT) || (partitionType == IJSPPartitions.JSP_DIRECTIVE)) {
-			// JSP tags
-			provider = new JSPInformationProvider();
-		}
-		else if (partitionType == IJSPPartitions.JSP_CONTENT_JAVA) {
-			// JSP java
-			provider = new JSPJavaJavadocInformationProvider();
-		}
 		return provider;
 	}
 
@@ -338,25 +328,25 @@
 	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
 		LineStyleProvider[] providers = null;
 
-		if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.HTML_DEFAULT);
+		if (partitionType == IHTMLPartitionTypes.HTML_DEFAULT || partitionType == IHTMLPartitionTypes.HTML_COMMENT || partitionType == IHTMLPartitionTypes.HTML_DECLARATION) {
+			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitionTypes.HTML_DEFAULT);
 		}
-		else if (partitionType == IHTMLPartitions.SCRIPT || partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.SCRIPT);
+		else if (partitionType == IHTMLPartitionTypes.SCRIPT || partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT) {
+			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitionTypes.SCRIPT);
 		}
-		else if (partitionType == ICSSPartitions.STYLE) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, ICSSPartitions.STYLE);
+		else if (partitionType == ICSSPartitionTypes.STYLE) {
+			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, ICSSPartitionTypes.STYLE);
 		}
 		else if (partitionType == IXMLPartitions.XML_DEFAULT || partitionType == IXMLPartitions.XML_CDATA || partitionType == IXMLPartitions.XML_COMMENT || partitionType == IXMLPartitions.XML_DECLARATION || partitionType == IXMLPartitions.XML_PI) {
 			providers = getXMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IXMLPartitions.XML_DEFAULT);
 		}
-		else if (partitionType == IJSPPartitions.JSP_CONTENT_JAVA) {
+		else if (partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVA) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForJava()};
 		}
-		else if (partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
+		else if (partitionType == IJSPPartitionTypes.JSP_DEFAULT_EL) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForJSPEL()};
 		}
-		else if (partitionType == IJSPPartitions.JSP_COMMENT || partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER || partitionType == IJSPPartitions.JSP_DEFAULT || partitionType == IJSPPartitions.JSP_DIRECTIVE) {
+		else if (partitionType == IJSPPartitionTypes.JSP_COMMENT || partitionType == IJSPPartitionTypes.JSP_CONTENT_DELIMITER || partitionType == IJSPPartitionTypes.JSP_DEFAULT || partitionType == IJSPPartitionTypes.JSP_DIRECTIVE) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForJSP()};
 		}
 
@@ -387,7 +377,7 @@
 	public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
 		ITextHover hover = null;
 
-		if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.SCRIPT) {
+		if (contentType == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.SCRIPT) {
 			// html and javascript regions
 			hover = getHTMLSourceViewerConfiguration().getTextHover(sourceViewer, contentType, stateMask);
 		}
@@ -395,7 +385,7 @@
 			// xml regions
 			hover = getXMLSourceViewerConfiguration().getTextHover(sourceViewer, contentType, stateMask);
 		}
-		else if ((contentType == IJSPPartitions.JSP_DEFAULT) || (contentType == IJSPPartitions.JSP_DIRECTIVE) || (contentType == IJSPPartitions.JSP_CONTENT_JAVA)) {
+		else if ((contentType == IJSPPartitionTypes.JSP_DEFAULT) || (contentType == IJSPPartitionTypes.JSP_DIRECTIVE) || (contentType == IJSPPartitionTypes.JSP_CONTENT_JAVA)) {
 			TextHoverManager manager = SSEUIPlugin.getDefault().getTextHoverManager();
 			TextHoverManager.TextHoverDescriptor[] hoverDescs = manager.getTextHovers();
 			int i = 0;
@@ -403,7 +393,7 @@
 				if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
 					String hoverType = hoverDescs[i].getId();
 					if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
-						if ((contentType == IJSPPartitions.JSP_DEFAULT) || (contentType == IJSPPartitions.JSP_DIRECTIVE)) {
+						if ((contentType == IJSPPartitionTypes.JSP_DEFAULT) || (contentType == IJSPPartitionTypes.JSP_DIRECTIVE)) {
 							// JSP
 							hover = manager.createBestMatchHover(new JSPTagInfoHoverProcessor());
 						}
@@ -413,7 +403,7 @@
 						}
 					}
 					else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) {
-						if ((contentType == IJSPPartitions.JSP_DEFAULT) || (contentType == IJSPPartitions.JSP_DIRECTIVE)) {
+						if ((contentType == IJSPPartitionTypes.JSP_DEFAULT) || (contentType == IJSPPartitionTypes.JSP_DIRECTIVE)) {
 							// JSP
 							hover = new JSPTagInfoHoverProcessor();
 						}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
index 2be7daa..aeff150 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
@@ -22,22 +22,6 @@
 public class JSPUIMessages extends NLS {
 	private static final String BUNDLE_NAME = "org.eclipse.jst.jsp.ui.internal.JSPUIPluginResources";//$NON-NLS-1$
 	private static ResourceBundle fResourceBundle;
-	
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, JSPUIMessages.class);
-	}
-
-	public static ResourceBundle getResourceBundle() {
-		try {
-			if (fResourceBundle == null)
-				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
-		}
-		catch (MissingResourceException x) {
-			fResourceBundle = null;
-		}
-		return fResourceBundle;
-	}
 
 	public static String Sample_JSP_doc;
 	public static String JSP_Delimiters_UI_;
@@ -61,7 +45,6 @@
 	public static String _UI_WIZARD_NEW_HEADING;
 	public static String _UI_WIZARD_NEW_DESCRIPTION;
 	public static String _ERROR_FILENAME_MUST_END_JSP;
-	public static String ResourceGroup_nameExists;
 	public static String NewJSPTemplatesWizardPage_0;
 	public static String NewJSPTemplatesWizardPage_1;
 	public static String NewJSPTemplatesWizardPage_2;
@@ -94,10 +77,20 @@
 	public static String JSPColorPage_jsp_content;
 	public static String JSPFilesPreferencePage_0;
 	public static String JSPFilesPreferencePage_1;
-	public static String JSPFContentSettingsPropertyPage_0;
-	public static String JSPFContentSettingsPropertyPage_1;
-	public static String JSPFContentSettingsPropertyPage_2;
-	public static String JSPFContentSettingsPropertyPage_3;
-	public static String JSPFContentSettingsPropertyPage_4;
-	public static String ProjectJSPFContentSettingsPropertyPage_0;
+	
+	static {
+		// load message values from bundle file
+		NLS.initializeMessages(BUNDLE_NAME, JSPUIMessages.class);
+	}
+
+	public static ResourceBundle getResourceBundle() {
+		try {
+			if (fResourceBundle == null)
+				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
+		}
+		catch (MissingResourceException x) {
+			fResourceBundle = null;
+		}
+		return fResourceBundle;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
index e3550d9..a447662 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
@@ -37,7 +37,6 @@
 _UI_WIZARD_NEW_HEADING = JavaServer Page
 _UI_WIZARD_NEW_DESCRIPTION = Create a new JavaServer Page.
 _ERROR_FILENAME_MUST_END_JSP = The file name must end in one of the following extensions {0}.
-ResourceGroup_nameExists = The same name already exists.
 NewJSPTemplatesWizardPage_0=Select JSP Template
 NewJSPTemplatesWizardPage_1=Select a template as initial content in the JSP page.
 NewJSPTemplatesWizardPage_2=Name
@@ -73,10 +72,3 @@
 JSPColorPage_jsp_content=JSP Content
 JSPFilesPreferencePage_0=Validating files
 JSPFilesPreferencePage_1=Validate JSP fragments
-# JSP Fragments
-JSPFContentSettingsPropertyPage_0=none
-JSPFContentSettingsPropertyPage_1=The properties used instead of the page directive that cannot be specified in JSP fragment files.  The project setting is used if you specify "none."
-JSPFContentSettingsPropertyPage_2=Language:
-JSPFContentSettingsPropertyPage_3=Content Type:
-JSPFContentSettingsPropertyPage_4=Enable specific setting:
-ProjectJSPFContentSettingsPropertyPage_0=The properties for J2EE Web projects act as "project" default to be looked up when no properties are specified for a particular JSP fragment file.
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
index 26688c6..757faa7 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
@@ -21,8 +21,8 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 
 public class StructuredAutoEditStrategyJSP implements IAutoEditStrategy {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
index 31aedc0..2827c09 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
@@ -27,7 +27,7 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.ui.IEditorInput;
@@ -140,7 +140,7 @@
 						// custom
 						// tags,
 						// return that position
-						if (type == IJSPPartitions.JSP_CONTENT_JAVA || type == IJSPPartitions.JSP_DIRECTIVE) {
+						if (type == IJSPPartitionTypes.JSP_CONTENT_JAVA || type == IJSPPartitionTypes.JSP_DIRECTIVE) {
 							result = partitions[i].getOffset();
 						}
 					}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
deleted file mode 100644
index a4d8c14..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AutoImportProposal extends JSPCompletionProposal {
-	
-	// the import string, no quotes or colons
-	String fImportDeclaration;
-	
-	public AutoImportProposal(String importDeclaration, String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
-		super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
-		setImportDeclaration(importDeclaration);
-	}
-	
-	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
-		super.apply(viewer, trigger, stateMask, offset);
-		addImportDeclaration(viewer);
-	}
-	/**
-	 * adds the import declaration to the document in the viewer in the appropriate position
-	 * @param viewer
-	 */
-	private void addImportDeclaration(ITextViewer viewer) {
-		
-		IDocument doc = viewer.getDocument();
-		
-		// calculate once and pass along
-		boolean isXml = isXmlFormat(doc);
-		
-		int insertPosition = getInsertPosition(doc, isXml);
-		String insertText = createImportDeclaration(doc, isXml);
-		InsertEdit insert = new InsertEdit(insertPosition, insertText);
-		try {
-			insert.apply(doc);
-		}
-		catch (MalformedTreeException e) {
-			Logger.logException(e);
-		}
-		catch (BadLocationException e) {
-			Logger.logException(e);
-		}
-		
-		// make sure the cursor position after is correct
-		setCursorPosition(getCursorPosition() + insertText.length());
-	}
-	/**
-	 * 
-	 * @param doc
-	 * @param isXml
-	 * @return position after <jsp:root> if xml, otherwise right before the document element
-	 */
-	private int getInsertPosition(IDocument doc, boolean isXml) {
-		int pos = 0;
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
-		try {
-			if(sModel != null) {
-				if(sModel instanceof IDOMModel) {
-					IDOMDocument documentNode = ((IDOMModel)sModel).getDocument();
-					Node docElement = documentNode.getDocumentElement();
-					if(docElement != null && docElement instanceof IDOMElement) {
-						IStructuredDocumentRegion sdRegion = ((IDOMElement)docElement).getFirstStructuredDocumentRegion();
-						if(isXml) {
-							// insert right after document element
-							pos = sdRegion.getEndOffset();
-						}
-						else {
-							// insert before document element
-							pos = sdRegion.getStartOffset();
-						}
-					}
-				}
-			}
-		}
-		finally {
-			if(sModel != null)
-				sModel.releaseFromRead();
-		}
-		return pos;
-	}
-	/**
-	 * 
-	 * @param doc
-	 * @return true if this document is xml-jsp syntax, otherwise false
-	 */
-	private boolean isXmlFormat(IDocument doc) {
-		boolean isXml = false;
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
-		try {
-			if(sModel != null) {
-				if(!isXml) {
-					if(sModel instanceof IDOMModel) {
-						IDOMDocument documentNode = ((IDOMModel)sModel).getDocument();
-						Element docElement = documentNode.getDocumentElement();
-						isXml = docElement != null && ((docElement.getNodeName().equals("jsp:root")) || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null && ((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$
-					}
-				}				
-			}
-		}
-		finally {
-			if(sModel != null)
-				sModel.releaseFromRead();
-		}
-		return isXml;
-	}
-	/**
-	 * 
-	 * @param doc
-	 * @param isXml
-	 * @return appropriate import declaration string depending if document is xml or not
-	 */
-	private String createImportDeclaration(IDocument doc, boolean isXml) {
-		String delim = (doc instanceof IStructuredDocument) ? ((IStructuredDocument)doc).getLineDelimiter() : TextUtilities.getDefaultLineDelimiter(doc);
-		if(isXml)
-			return delim + "<jsp:directive.page import=\""+getImportDeclaration()+"\"/>"; //$NON-NLS-1$ //$NON-NLS-2$
-		return "<%@page import=\"" + getImportDeclaration() + "\"%>" + delim; //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	public String getImportDeclaration() {
-		return fImportDeclaration;
-	}
-	public void setImportDeclaration(String importDeclaration) {
-		fImportDeclaration = importDeclaration;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java
index c580bd4..d95c7fb 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java
@@ -16,7 +16,7 @@
 import org.eclipse.jface.text.templates.TemplateContext;
 import org.eclipse.jface.text.templates.TemplateProposal;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
 
 /**
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
index 7e72665..0741695 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
@@ -25,7 +25,7 @@
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
index 0229d51..e0e6c3b 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
@@ -2,7 +2,6 @@
 
 import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
 import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.contentassist.IContextInformation;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
@@ -14,16 +13,6 @@
  */
 public class JSPCompletionProposal extends CustomCompletionProposal implements IJavaCompletionProposal  {
 
-	/*
-	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
-	 * 
-	 * This is a wrapped proposal so we don't need to 
-	 * make "slow" calls to the java proposal up front, only when needed
-	 * for example, getAdditionalInfo() reads external javadoc, and it makes
-	 * no sense
-	 */ 
-	ICompletionProposal fJavaCompletionProposal = null;
-	
 	public JSPCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
 		super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
 	}
@@ -33,23 +22,6 @@
 	 */
 	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
 		super.apply(viewer, trigger, stateMask, offset);
-	}
-
-	final public ICompletionProposal getJavaCompletionProposal() {
-		return fJavaCompletionProposal;
-	}
-
-	final public void setJavaCompletionProposal(ICompletionProposal javaCompletionProposal) {
-		fJavaCompletionProposal = javaCompletionProposal;
-	}
-	
-	public String getAdditionalProposalInfo() {
-		
-		String additionalInfo = super.getAdditionalProposalInfo();
-		ICompletionProposal javaProposal = getJavaCompletionProposal();
-		if(javaProposal != null)
-			additionalInfo = javaProposal.getAdditionalProposalInfo();
-		
-		return additionalInfo;
+		viewer.setSelectedRange(getCursorPosition(), 0);
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
index 73e5afb..39858f5 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
@@ -34,8 +34,8 @@
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.Logger;
 import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
@@ -47,23 +47,23 @@
 import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
 import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
 import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
 import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
 import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
@@ -84,9 +84,9 @@
 import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
 import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
 import org.eclipse.wst.xml.ui.internal.contentassist.NonValidatingModelQueryAction;
@@ -147,15 +147,15 @@
 		XMLContentAssistProcessor xmlProcessor = new XMLContentAssistProcessor();
 		JavaScriptContentAssistProcessor javascriptProcessor = new JavaScriptContentAssistProcessor();
 
-		fPartitionToProcessorMap.put(IHTMLPartitions.HTML_DEFAULT, htmlProcessor);
+		fPartitionToProcessorMap.put(IHTMLPartitionTypes.HTML_DEFAULT, htmlProcessor);
 		fPartitionToProcessorMap.put(IXMLPartitions.XML_DEFAULT, xmlProcessor);
-		fPartitionToProcessorMap.put(IStructuredPartitions.DEFAULT_PARTITION, htmlProcessor);
-		fPartitionToProcessorMap.put(IJSPPartitions.JSP_DEFAULT, jspJavaProcessor);
-		fPartitionToProcessorMap.put(IJSPPartitions.JSP_DIRECTIVE, xmlProcessor);
-		fPartitionToProcessorMap.put(IHTMLPartitions.HTML_COMMENT, htmlProcessor);
-		fPartitionToProcessorMap.put(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, javascriptProcessor);
-		fPartitionToProcessorMap.put(IJSPPartitions.JSP_DEFAULT_EL, jspJavaProcessor);
-		fPartitionToProcessorMap.put(IHTMLPartitions.SCRIPT, javascriptProcessor); // default
+		fPartitionToProcessorMap.put(IStructuredPartitionTypes.DEFAULT_PARTITION, htmlProcessor);
+		fPartitionToProcessorMap.put(IJSPPartitionTypes.JSP_DEFAULT, jspJavaProcessor);
+		fPartitionToProcessorMap.put(IJSPPartitionTypes.JSP_DIRECTIVE, xmlProcessor);
+		fPartitionToProcessorMap.put(IHTMLPartitionTypes.HTML_COMMENT, htmlProcessor);
+		fPartitionToProcessorMap.put(IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT, javascriptProcessor);
+		fPartitionToProcessorMap.put(IJSPPartitionTypes.JSP_DEFAULT_EL, jspJavaProcessor);
+		fPartitionToProcessorMap.put(IHTMLPartitionTypes.SCRIPT, javascriptProcessor); // default
 		// to
 		// javascript
 		// for
@@ -385,8 +385,7 @@
 							if (provider.isFor(internalModel.getModelHandler())) {
 								provider.addAdapterFactories(internalModel);
 							}
-						}
-						catch (Exception e) {
+						} catch (Exception e) {
 							Logger.logException(e);
 						}
 					}
@@ -403,8 +402,7 @@
 						}
 					}
 				}
-			}
-			catch (Exception e) {
+			} catch (Exception e) {
 				Logger.logException("Error in embedded JSP Content Assist", e); //$NON-NLS-1$
 			}
 		}
@@ -424,8 +422,7 @@
 				Node nodeAlreadyAtIndex = children.item(childIndex);
 				if (nodeAlreadyAtIndex instanceof IDOMNode)
 					textInsertionOffset = ((IDOMNode) nodeAlreadyAtIndex).getEndOffset();
-			}
-			else {
+			} else {
 				textInsertionOffset = ((IDOMNode) node).getStartOffset();
 			}
 			TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(((IDOMNode) node).getStructuredDocument());
@@ -456,8 +453,9 @@
 
 			if (mqAdapter != null) {
 				CMDocument doc = mqAdapter.getModelQuery().getCorrespondingCMDocument(node);
-				if (doc != null) {
-
+				// this shouldn't have to have the prefix coded in
+				if (!(doc != null && (doc instanceof JSPCMDocument || doc instanceof CMNodeWrapper || node.getNodeName().startsWith("jsp:")))) { //$NON-NLS-1$
+					// get jsp namespace elements and insert their contents
 					CMDocument JCMDoc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP11_DOC_TYPE);
 					CMNamedNodeMap jspelements = JCMDoc.getElements();
 
@@ -470,36 +468,32 @@
 							domDoc = (Document) node;
 						else
 							domDoc = node.getOwnerDocument();
-						
 						// Show XML tag forms of JSP markers if jsp:root is
 						// the document element OR it's HTML but
 						// isn't really in the text.
 						// If the document isn't strictly XML, pull out the
-						// XML tag forms it is xml format
-						rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
-						rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
-						rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
-						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
-						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
-						rejectElements.add(JSP12Namespace.ElementName.TEXT);
-						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
-							
-						if (isXMLFormat(domDoc)) {
-
-							// jsp actions
+						// XML tag forms
+						if (!isXMLFormat(domDoc)) {
+							rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
+							rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
+							rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
+							rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
+							rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
+							rejectElements.add(JSP12Namespace.ElementName.TEXT);
+						}
+						// always exclude jsp:directive.taglib
+						if (isInternalAdapter) {
+							rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
+							rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
 							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
 							rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
-							rejectElements.add(JSP12Namespace.ElementName.GETPROPERTY);
 							rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
-							rejectElements.add(JSP12Namespace.ElementName.INCLUDE);
 							rejectElements.add(JSP12Namespace.ElementName.FORWARD);
 							rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
 							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-							rejectElements.add(JSP12Namespace.ElementName.PARAM);
 							rejectElements.add(JSP12Namespace.ElementName.PARAMS);
 						}
-						
-						
+
 						// don't show jsp:root if a document element already
 						// exists
 						Element docElement = domDoc.getDocumentElement();
@@ -512,7 +506,6 @@
 								continue;
 							elementDecls.add(ed);
 						}
-					
 					}
 				}
 			}
@@ -590,7 +583,7 @@
 	 */
 	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
 		fTemplateContexts.clear();
-
+		
 		IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion((StructuredTextViewer) viewer, documentPosition);
 		fViewer = viewer;
 		ICompletionProposal[] jspResults = EMPTY_PROPOSAL_SET;
@@ -598,14 +591,14 @@
 
 		// check the actual partition type
 		String partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition);
-		IStructuredDocument structuredDocument = (IStructuredDocument) viewer.getDocument();
-
+		IStructuredDocument structuredDocument = (IStructuredDocument)viewer.getDocument();
+		
 		IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
 
 		// ////////////////////////////////////////////////////////////////////////////
 		// ANOTHER WORKAROUND UNTIL PARTITIONING TAKES CARE OF THIS
 		// check for xml-jsp tags...
-		if (partitionType == IJSPPartitions.JSP_DIRECTIVE && fn != null) {
+		if (partitionType == IJSPPartitionTypes.JSP_DIRECTIVE && fn != null) {
 			IStructuredDocumentRegion possibleXMLJSP = ((fn.getType() == DOMRegionContext.XML_CONTENT) && fn.getPrevious() != null) ? fn.getPrevious() : fn;
 			ITextRegionList regions = possibleXMLJSP.getRegions();
 			if (regions.size() > 1) {
@@ -613,11 +606,9 @@
 				ITextRegion xmlOpenOrClose = regions.get(0);
 				if (xmlOpenOrClose.getType() == DOMRegionContext.XML_TAG_OPEN && documentPosition == possibleXMLJSP.getStartOffset()) {
 					// do regular jsp content assist
-				}
-				else if (xmlOpenOrClose.getType() == DOMRegionContext.XML_END_TAG_OPEN && documentPosition > possibleXMLJSP.getStartOffset()) {
+				} else if (xmlOpenOrClose.getType() == DOMRegionContext.XML_END_TAG_OPEN && documentPosition > possibleXMLJSP.getStartOffset()) {
 					// do regular jsp content assist
-				}
-				else {
+				} else {
 					// possible xml-jsp
 					ITextRegion nameRegion = regions.get(1);
 					String name = possibleXMLJSP.getText(nameRegion);
@@ -631,7 +622,7 @@
 		// ////////////////////////////////////////////////////////////////////////////
 		// ** THIS IS A TEMP FIX UNTIL PARTITIONING TAKES CARE OF THIS...
 		// check for XML-JSP in a <script> region
-		if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
+		if (partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitionTypes.SCRIPT) {
 			// fn should be block text
 			IStructuredDocumentRegion decodedSDRegion = decodeScriptBlock(fn.getFullText());
 			// System.out.println("decoded > " +
@@ -648,17 +639,14 @@
 						if (documentPosition >= fn.getStartOffset() + sdr.getStartOffset() && documentPosition <= fn.getStartOffset() + sdr.getEndOffset()) {
 							return getJSPJavaCompletionProposals(viewer, documentPosition);
 						}
-					}
-					else if (sdr.getType() == DOMRegionContext.XML_TAG_NAME) {
+					} else if (sdr.getType() == DOMRegionContext.XML_TAG_NAME) {
 						if (documentPosition > fn.getStartOffset() + sdr.getStartOffset() && documentPosition < fn.getStartOffset() + sdr.getEndOffset()) {
 							return EMPTY_PROPOSAL_SET;
-						}
-						else if (documentPosition == fn.getStartOffset() + sdr.getEndOffset() && sdr.getNext() != null && sdr.getNext().getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+						} else if (documentPosition == fn.getStartOffset() + sdr.getEndOffset() && sdr.getNext() != null && sdr.getNext().getType() == DOMJSPRegionContexts.JSP_CONTENT) {
 							// the end of an open tag <script>
 							// <jsp:scriptlet>| blah </jsp:scriptlet>
 							return getJSPJavaCompletionProposals(viewer, documentPosition);
-						}
-						else if (documentPosition == fn.getStartOffset() + sdr.getStartOffset() && sdr.getPrevious() != null && sdr.getPrevious().getType() == DOMRegionContext.XML_TAG_NAME) {
+						} else if (documentPosition == fn.getStartOffset() + sdr.getStartOffset() && sdr.getPrevious() != null && sdr.getPrevious().getType() == DOMRegionContext.XML_TAG_NAME) {
 							return getJSPJavaCompletionProposals(viewer, documentPosition);
 						}
 					}
@@ -668,7 +656,7 @@
 		}
 		// /////////////////////////////////////////////////////////////////////////
 		// check special JSP delimiter cases
-		if (fn != null && partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) {
+		if (fn != null && partitionType == IJSPPartitionTypes.JSP_CONTENT_DELIMITER) {
 			IStructuredDocumentRegion fnDelim = fn;
 
 			// if it's a nested JSP region, need to get the correct
@@ -698,8 +686,7 @@
 									partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
 									break;
 								}
-							}
-							else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
+							} else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
 								// JSP content assist
 								return getJSPJavaCompletionProposals(viewer, documentPosition);
 							}
@@ -719,15 +706,14 @@
 					// macros etc...
 					// return getHTMLCompletionProposals(viewer,
 					// documentPosition);
-				}
-				else if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN)) {
+				} else if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN)) {
 					// <jsp:scriptlet> |</jsp:scriptlet>
 					// check previous partition type to see if it's JAVASCRIPT
 					// if it is, we're just gonna let the embedded JAVASCRIPT
 					// adapter get the proposals
 					if (documentPosition > 0) {
 						String checkType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
-						if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { // this
+						if (checkType != IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT) { // this
 							// check
 							// is
 							// failing
@@ -738,16 +724,14 @@
 							// not
 							// javascript...)
 							return getJSPJavaCompletionProposals(viewer, documentPosition);
-						}
-						partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+						} 
+						partitionType = IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT;
 					}
-				}
-				else if ((firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN) && documentPosition >= fnDelim.getEndOffset()) {
+				} else if ((firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN) && documentPosition >= fnDelim.getEndOffset()) {
 					// anything else inbetween
 					return getJSPJavaCompletionProposals(viewer, documentPosition);
 				}
-			}
-			else if (XMLContentAssistUtilities.isJSPDelimiter(fnDelim)) {
+			} else if (XMLContentAssistUtilities.isJSPDelimiter(fnDelim)) {
 				// the delimiter <%, <%=, <%!, ...
 				if (XMLContentAssistUtilities.isJSPCloseDelimiter(fnDelim)) {
 					if (documentPosition == fnDelim.getStartOffset()) {
@@ -757,20 +741,18 @@
 						// JAVASCRIPT adapter get the proposals
 						if (documentPosition > 0) {
 							String checkType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
-							if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
+							if (checkType != IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT) {
 								return getJSPJavaCompletionProposals(viewer, documentPosition);
-							}
-							partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+							} 
+							partitionType = IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT;
 						}
 					}
-				}
-				else if (XMLContentAssistUtilities.isJSPOpenDelimiter(fnDelim)) {
+				} else if (XMLContentAssistUtilities.isJSPOpenDelimiter(fnDelim)) {
 					// if it's the first position of open delimiter
 					// use embedded HTML results
 					if (documentPosition == fnDelim.getStartOffset()) {
 						embeddedResults = getHTMLCompletionProposals(viewer, documentPosition);
-					}
-					else if (documentPosition == fnDelim.getEndOffset()) {
+					} else if (documentPosition == fnDelim.getEndOffset()) {
 						// it's at the EOF <%|
 						return getJSPJavaCompletionProposals(viewer, documentPosition);
 					}
@@ -821,8 +803,7 @@
 					if (XMLContentAssistUtilities.isJSPOpenDelimiter(testRegion.getType())) {
 						if (!(((ITextRegionContainer) attrContainer).getEndOffset(testRegion) <= documentPosition))
 							return EMPTY_PROPOSAL_SET;
-					}
-					else if (XMLContentAssistUtilities.isJSPCloseDelimiter(testRegion.getType())) {
+					} else if (XMLContentAssistUtilities.isJSPCloseDelimiter(testRegion.getType())) {
 						if (!(((ITextRegionContainer) attrContainer).getStartOffset(testRegion) >= documentPosition))
 							return EMPTY_PROPOSAL_SET;
 					}
@@ -838,7 +819,7 @@
 		if (p != null) {
 			embeddedResults = p.computeCompletionProposals(viewer, documentPosition);
 			// get bean methods, objects, and constants if there are any...
-			if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
+			if (partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitionTypes.SCRIPT) {
 				ICompletionProposal[] beanResults = getJSPJavaBeanProposals(viewer, documentPosition);
 				if (beanResults != null && beanResults.length > 0) {
 					ICompletionProposal[] added = new ICompletionProposal[beanResults.length + embeddedResults.length];
@@ -847,8 +828,7 @@
 					embeddedResults = added;
 				}
 			}
-		}
-		else {
+		} else {
 			// the partition type is probably not mapped
 		}
 
@@ -880,55 +860,15 @@
 
 		// fix for:
 		// check for |<%-- --%> first position of jsp comment
-		if (partitionType == IJSPPartitions.JSP_COMMENT) {
+		if (partitionType == IJSPPartitionTypes.JSP_COMMENT) {
 			if (sdRegion.getStartOffset() == documentPosition) {
 				ICompletionProposal[] htmlResults = getHTMLCompletionProposals(viewer, documentPosition);
 				jspResults = merge(jspResults, htmlResults);
 			}
 		}
-
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=86656
-		if (partitionType == IJSPPartitions.JSP_DIRECTIVE) {
-			ICompletionProposal[] importProposals = getImportProposals(viewer, documentPosition);
-			if (importProposals.length > 0)
-				jspResults = merge(jspResults, importProposals);
-		}
 		return jspResults;
 	}
 
-	private ICompletionProposal[] getImportProposals(ITextViewer viewer, int documentPosition) {
-		List importProposals = new ArrayList();
-		ICompletionProposal[] proposals = getJSPJavaCompletionProposals(viewer, documentPosition);
-		for (int i = 0; i < proposals.length; i++) {
-			if (proposals[i] instanceof JSPCompletionProposal) {
-
-				ICompletionProposal importProposal = adjustImportProposal((JSPCompletionProposal) proposals[i]);
-				importProposals.add(importProposal);
-			}
-		}
-		return (ICompletionProposal[]) importProposals.toArray(new ICompletionProposal[importProposals.size()]);
-	}
-
-
-	private ICompletionProposal adjustImportProposal(JSPCompletionProposal importProposal) {
-
-		// just need to remove the ";"
-		// and adjust offsets for the change
-		String newReplace = importProposal.getReplacementString().replaceAll(";", "");
-		importProposal.setReplacementString(newReplace);
-
-		String newDisplay = importProposal.getDisplayString().replaceAll(";", "");
-		importProposal.setDisplayString(newDisplay);
-
-		int newReplacementLength = importProposal.getReplacementLength() - 1;
-		importProposal.setReplacementLength(newReplacementLength);
-
-		int newCursorPosition = importProposal.getCursorPosition() - 1;
-		importProposal.setCursorPosition(newCursorPosition);
-
-		return importProposal;
-	}
-
 	/**
 	 * Adds 2 arrays of ICompletionProposals and sorts them with a
 	 * ProposalComparator.
@@ -1002,7 +942,7 @@
 	 */
 	private ICompletionProposal[] getHTMLCompletionProposals(ITextViewer viewer, int documentPosition) {
 
-		IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT);
+		IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitionTypes.HTML_DEFAULT);
 		return p.computeCompletionProposals(viewer, documentPosition);
 	}
 
@@ -1013,7 +953,7 @@
 	 * @return ICompletionProposal[]
 	 */
 	protected ICompletionProposal[] getJSPJavaCompletionProposals(ITextViewer viewer, int documentPosition) {
-		JSPJavaContentAssistProcessor p = (JSPJavaContentAssistProcessor) fPartitionToProcessorMap.get(IJSPPartitions.JSP_DEFAULT);
+		JSPJavaContentAssistProcessor p = (JSPJavaContentAssistProcessor) fPartitionToProcessorMap.get(IJSPPartitionTypes.JSP_DEFAULT);
 		return p.computeCompletionProposals(viewer, documentPosition);
 	}
 
@@ -1026,8 +966,7 @@
 		String partitionType = null;
 		try {
 			partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, viewer.modelOffset2WidgetOffset(documentPosition), false);
-		}
-		catch (BadLocationException e) {
+		} catch (BadLocationException e) {
 			partitionType = IDocument.DEFAULT_CONTENT_TYPE;
 		}
 		return partitionType;
@@ -1112,7 +1051,7 @@
 				Object key = null;
 				while (it.hasNext()) {
 					key = it.next();
-					if (map.get(key) instanceof IReleasable) {
+					if (map.get(key) instanceof IReleasable ) {
 						((IReleasable) map.get(key)).release();
 					}
 				}
@@ -1170,8 +1109,7 @@
 					if (directiveNames[i].startsWith(nameString) || documentPosition <= begin)
 						request.addProposal(new CustomCompletionProposal(directiveNames[i], begin, length, directiveNames[i].length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
 				}
-			}
-			else { // by default, JSP_DIRECTIVE_NAME
+			} else { // by default, JSP_DIRECTIVE_NAME
 				if (request == null)
 					request = newContentAssistRequest(xmlnode, xmlnode, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
 				for (int i = 0; i < directiveNames.length; i++) {
@@ -1179,8 +1117,7 @@
 						request.addProposal(new CustomCompletionProposal(directiveNames[i], request.getReplacementBeginPosition(), request.getReplacementLength(), directiveNames[i].length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
 				}
 			}
-		}
-		else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME && documentPosition > sdRegion.getTextEndOffset(completionRegion)) || (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE && documentPosition <= sdRegion.getStartOffset(completionRegion))) {
+		} else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME && documentPosition > sdRegion.getTextEndOffset(completionRegion)) || (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE && documentPosition <= sdRegion.getStartOffset(completionRegion))) {
 			if (request == null)
 				request = computeAttributeProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
 			super.addTagCloseProposals(request);
@@ -1207,7 +1144,7 @@
 				}
 			}
 		}
-
+		
 		// bug115927 use original document position for all/any region templates
 		addTemplates(request, TemplateContextTypeIdsJSP.ALL, documentPosition);
 		return request;
@@ -1235,11 +1172,12 @@
 	 * 
 	 * @param contentAssistRequest
 	 * @param context
+	 * @param startOffset
 	 */
 	private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
 		if (contentAssistRequest == null)
 			return;
-
+		
 		// if already adding template proposals for a certain context type, do
 		// not add again
 		if (!fTemplateContexts.contains(context)) {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
index 19f2aa5..cbab2b8 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
@@ -112,6 +112,12 @@
 		super.addTagNameProposals(contentAssistRequest, childPosition);
 	}
 
+
+	protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
+		super.addXMLProposal(contentAssistRequest);
+	}
+
+
 	protected boolean attributeInList(IDOMNode node, Node parent, CMNode cmnode) {
 		return super.attributeInList(node, parent, cmnode);
 	}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
index 2efe5ec..ecad40e 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
@@ -60,11 +60,6 @@
 			boolean updateLengthOnValidate = true;
 			
 			jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, additionalInfo, relevance, updateLengthOnValidate);
-			
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
-			// set wrapped java proposal so additional info can be calculated on demand
-			jspProposal.setJavaCompletionProposal(javaProposal);
-			
 			return jspProposal;
 		} else {
 			return null;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
index 69f2f51..177b99d 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
@@ -21,8 +21,8 @@
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
 import org.eclipse.jface.text.contentassist.IContextInformation;
 import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
@@ -212,7 +212,7 @@
 		if(dp != null) {
 			//IDocumentPartitioner dp = viewer.getDocument().getDocumentPartitioner();
 			String type = dp.getPartition(documentOffset).getType();
-			if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
+			if (type == IJSPPartitionTypes.JSP_DEFAULT || type == IJSPPartitionTypes.JSP_CONTENT_JAVA) {
 				// get context info from completion results...
 				ICompletionProposal[] proposals = computeCompletionProposals(viewer, documentOffset);
 				for (int i = 0; i < proposals.length; i++) {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
index 4e8719c..416ca67 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
@@ -22,14 +22,14 @@
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
 import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
index 95f6040..af7392d 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
@@ -12,6 +12,7 @@
 import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
 import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
 import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jst.jsp.core.internal.java.JSP2ServletNameUtil;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
 import org.eclipse.swt.graphics.Image;
 
@@ -27,12 +28,23 @@
  */
 public class JSPProposalCollector extends CompletionProposalCollector {
 
+	private String fJspName;
+	private String fMangledName;
 	private JSPTranslation fTranslation;
 	private Comparator fComparator;
 	
 	public JSPProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
 		super(cu);
-	
+		if(cu != null) {
+			// set some names for fixing up mangled name in proposals
+			// set mangled (servlet) name
+			String cuName = cu.getPath().lastSegment();
+			setMangledName(cuName.substring(0, cuName.lastIndexOf('.')));
+			// set name of jsp file
+			String unmangled = JSP2ServletNameUtil.unmangle(cuName);
+			setJspName(unmangled.substring(unmangled.lastIndexOf('/') + 1));
+		}
+		
 		if(translation == null)
 			throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
 		
@@ -73,100 +85,36 @@
 		
 		JSPCompletionProposal jspProposal = null;
 		
-		// ignore constructor proposals (they're not relevant for our JSP proposal list)
-		if(!proposal.isConstructor()) {
-			
-			if(proposal.getKind() == CompletionProposal.TYPE_REF) {
-				String signature = String.valueOf(proposal.getDeclarationSignature());
-				String completion = String.valueOf(proposal.getCompletion());
-				if(completion.indexOf(signature) != -1) {
-					jspProposal = createAutoImportProposal(proposal);			
-				}
-			}
-			
-			// default behavior
-			if(jspProposal == null)
-				jspProposal = createJspProposal(proposal);		
-		}
-		return jspProposal;
-	}
-
-	
-	
-	private JSPCompletionProposal createAutoImportProposal(CompletionProposal proposal) {
-		
-		JSPCompletionProposal jspProposal = null;
-
-		String signature = new String(proposal.getDeclarationSignature());
-		String completion = new String(proposal.getCompletion());
-		
-		// it's fully qualified so we should
-		// add an import statement
-		// create an autoimport proposal
-		String newCompletion = completion.replaceAll(signature + ".", "");
-		
-		// java offset
-		int offset = proposal.getReplaceStart();
-		// replacement length
-		int length = proposal.getReplaceEnd() - offset;
-		// translate offset from Java > JSP
-		offset = fTranslation.getJspOffset(offset);
-		// cursor position after must be calculated
-		int positionAfter = calculatePositionAfter(proposal, newCompletion, offset);
-		
-		// from java proposal
-		IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
-		proposal.getDeclarationSignature();
-		Image image = javaProposal.getImage();
-		String displayString = javaProposal.getDisplayString();
-		displayString = getTranslation().fixupMangledName(displayString);
-		IContextInformation contextInformation = javaProposal.getContextInformation();
-		// don't do this, it's slow
-		// String additionalInfo = javaProposal.getAdditionalProposalInfo();
-		int relevance = javaProposal.getRelevance();
-		
-		boolean updateLengthOnValidate = true;
-		
-		jspProposal = new AutoImportProposal(completion, newCompletion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
-		
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
-		// set wrapped java proposal so additional info can be calculated on demand
-		jspProposal.setJavaCompletionProposal(javaProposal);
-		
-		return jspProposal;
-	}
-
-	private JSPCompletionProposal createJspProposal(CompletionProposal proposal) {
-		
-		JSPCompletionProposal jspProposal;
+		// from proposal
 		String completion = String.valueOf(proposal.getCompletion());
-		// java offset
-		int offset = proposal.getReplaceStart();
-		// replacement length
-		int length = proposal.getReplaceEnd() - offset;
-		// translate offset from Java > JSP
-		offset = fTranslation.getJspOffset(offset);
-		// cursor position after must be calculated
-		int positionAfter = calculatePositionAfter(proposal, completion, offset);
+		String mangledName = getMangledName();
 		
-		// from java proposal
-		IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
-		proposal.getDeclarationSignature();
-		Image image = javaProposal.getImage();
-		String displayString = javaProposal.getDisplayString();
-		displayString = getTranslation().fixupMangledName(displayString);
-		IContextInformation contextInformation = javaProposal.getContextInformation();
-		// String additionalInfo = javaProposal.getAdditionalProposalInfo();
-		int relevance = javaProposal.getRelevance();
-		
-		boolean updateLengthOnValidate = true;
-		
-		jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
-		
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
-		// set wrapped java proposal so additional info can be calculated on demand
-		jspProposal.setJavaCompletionProposal(javaProposal);
-		
+		// ignore constructor proposals
+		// (they will include mangled servlet name)
+		if(mangledName != null && completion.indexOf(mangledName) == -1) {
+			
+			// java offset
+			int offset = proposal.getReplaceStart();
+			// replacement length
+			int length = proposal.getReplaceEnd() - offset;
+			// translate offset from Java > JSP
+			offset = fTranslation.getJspOffset(offset);
+			// cursor position after must be calculated
+			int positionAfter = calculatePositionAfter(proposal, completion, offset);
+			
+			// from java proposal
+			IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
+			Image image = javaProposal.getImage();
+			String displayString = javaProposal.getDisplayString();
+			displayString = fixupDisplayString(displayString);
+			IContextInformation contextInformation = javaProposal.getContextInformation();
+			String additionalInfo = javaProposal.getAdditionalProposalInfo();
+			int relevance = javaProposal.getRelevance();
+			
+			boolean updateLengthOnValidate = true;
+			
+			jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, additionalInfo, relevance, updateLengthOnValidate);
+		}
 		return jspProposal;
 	}
 
@@ -197,6 +145,43 @@
 		}
 		return positionAfter;
 	}
+
+	/**
+	 * Replaces mangled (servlet) name with jsp file name.
+	 * 
+	 * @param displayString
+	 * @return
+	 */
+	private String fixupDisplayString(String displayString) {
+		StringBuffer fixedName = new StringBuffer(displayString);
+		String mangledName = getMangledName();
+		if(mangledName != null) {
+			int index = displayString.indexOf(mangledName);
+			if(index != -1) {
+				fixedName = new StringBuffer();
+				fixedName.append(displayString.substring(0, index));
+				fixedName.append(getJspName());
+				fixedName.append(displayString.substring(index + mangledName.length()));
+			}
+		}
+		return fixedName.toString();
+	}
+	
+	private String getMangledName() {
+		return fMangledName;
+	}
+
+	private void setMangledName(String mangledName) {
+		fMangledName = mangledName;
+	}
+
+	private String getJspName() {
+		return fJspName;
+	}
+
+	private void setJspName(String jspName) {
+		fJspName = jspName;
+	}
 	
 	static char[] getTypeTriggers() {
 		return TYPE_TRIGGERS;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
index 15db25d..ac2997a 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
@@ -21,13 +21,13 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
index d8b4de7..f6d877a 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
@@ -28,7 +28,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
 import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
index d322938..43ca5b6 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
@@ -13,14 +13,14 @@
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
 import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 
 /**
  * @plannedfor 1.0
@@ -42,17 +42,17 @@
 		IContentAssistProcessor jspContentAssistProcessor = new JSPContentAssistProcessor();
 
 		// JSP
-		addPartitionProcessor(IStructuredPartitions.DEFAULT_PARTITION, jspContentAssistProcessor);
+		addPartitionProcessor(IStructuredPartitionTypes.DEFAULT_PARTITION, jspContentAssistProcessor);
 		addPartitionProcessor(IXMLPartitions.XML_DEFAULT, jspContentAssistProcessor);
-		addPartitionProcessor(IHTMLPartitions.HTML_DEFAULT, jspContentAssistProcessor);
-		addPartitionProcessor(IHTMLPartitions.HTML_COMMENT, jspContentAssistProcessor);
-		addPartitionProcessor(IJSPPartitions.JSP_DEFAULT, jspContentAssistProcessor);
-		addPartitionProcessor(IJSPPartitions.JSP_DIRECTIVE, jspContentAssistProcessor);
-		addPartitionProcessor(IJSPPartitions.JSP_CONTENT_DELIMITER, jspContentAssistProcessor);
-		addPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, jspContentAssistProcessor);
+		addPartitionProcessor(IHTMLPartitionTypes.HTML_DEFAULT, jspContentAssistProcessor);
+		addPartitionProcessor(IHTMLPartitionTypes.HTML_COMMENT, jspContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitionTypes.JSP_DEFAULT, jspContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitionTypes.JSP_DIRECTIVE, jspContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitionTypes.JSP_CONTENT_DELIMITER, jspContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT, jspContentAssistProcessor);
 
 		IContentAssistProcessor jspJavaContentAssistProcessor = new JSPJavaContentAssistProcessor();
-		addPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVA, jspJavaContentAssistProcessor);
+		addPartitionProcessor(IJSPPartitionTypes.JSP_CONTENT_JAVA, jspJavaContentAssistProcessor);
 
 	}
 
@@ -89,7 +89,7 @@
 		if (p == null) {
 			IStructuredDocumentRegion sdRegion = ((IStructuredDocument) viewer.getDocument()).getRegionAtCharacterOffset(documentOffset);
 			if (isJSPRegion(sdRegion))
-				p = getPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVA);
+				p = getPartitionProcessor(IJSPPartitionTypes.JSP_CONTENT_JAVA);
 		}
 		return p;
 	}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
deleted file mode 100644
index dc39d11..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-/**
- * JSP Fragment Property Page
- */
-public class JSPFContentSettingsPropertyPage extends PropertyPage {
-	private static final String SELECT_NONE = JSPUIMessages.JSPFContentSettingsPropertyPage_0;
-
-	// TODO: Figure out what to do with these strings/variables
-	private String[] fLanguages = {SELECT_NONE, "java", //$NON-NLS-1$
-				"javascript"}; //$NON-NLS-1$
-	private String[] fContentTypes = {SELECT_NONE, "application/xhtml+xml", //$NON-NLS-1$
-				"application/xml", //$NON-NLS-1$
-				"text/html", //$NON-NLS-1$
-				"text/xml"}; //$NON-NLS-1$
-
-	private class ButtonListener extends SelectionAdapter {
-		public void widgetSelected(SelectionEvent e) {
-			boolean specific = fSpecificSetting.getSelection();
-			updateButtons(specific);
-		}
-	}
-
-	private Combo fLanguageCombo;
-	private Combo fContentTypeCombo;
-	private Button fValidateFragments;
-	Button fSpecificSetting;
-	private SelectionListener fSpecificListener;
-
-	public JSPFContentSettingsPropertyPage() {
-		super();
-		setDescription(JSPUIMessages.JSPFContentSettingsPropertyPage_1);
-	}
-
-	private Composite createComposite(Composite parent, int numColumns) {
-		Composite composite = new Composite(parent, SWT.NULL);
-
-		// GridLayout
-		GridLayout layout = new GridLayout();
-		layout.numColumns = numColumns;
-		composite.setLayout(layout);
-
-		// GridData
-		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		composite.setLayoutData(data);
-
-		return composite;
-	}
-
-	protected Control createContents(Composite parent) {
-		Composite propertyPage = createComposite(parent, 2);
-
-		// fragment language control
-		Text languageLabel = new Text(propertyPage, SWT.READ_ONLY);
-		languageLabel.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_2);
-		fLanguageCombo = new Combo(propertyPage, SWT.NONE);
-		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		fLanguageCombo.setLayoutData(data);
-		fLanguageCombo.setItems(fLanguages);
-
-		// fragment content type control
-		Text contentTypeLabel = new Text(propertyPage, SWT.READ_ONLY);
-		contentTypeLabel.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_3);
-		fContentTypeCombo = new Combo(propertyPage, SWT.NONE);
-		data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		fContentTypeCombo.setLayoutData(data);
-		fContentTypeCombo.setItems(fContentTypes);
-
-		// create separator
-		Label label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
-		data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		data.horizontalSpan = 2;
-		data.verticalSpan = 8;
-		label.setLayoutData(data);
-
-		// specific setting
-		fSpecificSetting = new Button(propertyPage, SWT.CHECK | SWT.LEFT);
-		fSpecificSetting.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_4);
-		data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalSpan = 2;
-		fSpecificSetting.setLayoutData(data);
-
-		fSpecificListener = new ButtonListener();
-		fSpecificSetting.addSelectionListener(fSpecificListener);
-
-		// validate file
-		fValidateFragments = new Button(propertyPage, SWT.CHECK | SWT.LEFT);
-		fValidateFragments.setText(JSPUIMessages.JSPFilesPreferencePage_1);
-		data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalSpan = 2;
-		data.horizontalIndent = 5;
-		fValidateFragments.setLayoutData(data);
-
-		initializeValues();
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.JSP_FRAGMENT_HELPID);
-		return propertyPage;
-	}
-
-	void updateButtons(boolean enabled) {
-		fSpecificSetting.setSelection(enabled);
-		fValidateFragments.setEnabled(enabled);
-	}
-
-	/**
-	 * Get the resource this properties page is for
-	 * 
-	 * @return IResource for this properties page or null if there is no
-	 *         IResource
-	 */
-	private IResource getResource() {
-		IResource resource = null;
-		if (getElement() instanceof IResource) {
-			resource = (IResource) getElement();
-		}
-		return resource;
-	}
-
-	private void initializeValues() {
-		String language = JSPFContentProperties.getProperty(JSPFContentProperties.JSPLANGUAGE, getResource(), false);
-		if (language == null || language.length() == 0) {
-			// if null, use none
-			language = SELECT_NONE;
-		}
-		/*
-		 * If item is already part of combo, select it. Otherwise, add to the
-		 * combobox.
-		 */
-		int index = fLanguageCombo.indexOf(language);
-		if (index > -1)
-			fLanguageCombo.select(index);
-		else
-			fLanguageCombo.setText(language);
-
-		String contentType = JSPFContentProperties.getProperty(JSPFContentProperties.JSPCONTENTTYPE, getResource(), false);
-		if (contentType == null || contentType.length() == 0) {
-			// if null, use none
-			contentType = SELECT_NONE;
-		}
-		/*
-		 * If item is already part of combo, select it. Otherwise, add to the
-		 * combobox.
-		 */
-		index = fContentTypeCombo.indexOf(contentType);
-		if (index > -1)
-			fContentTypeCombo.select(index);
-		else
-			fContentTypeCombo.setText(contentType);
-
-		String validate = JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), false);
-		String validate2 = JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), true);
-		if (validate == null || validate.length() == 0) {
-			updateButtons(false);
-			fValidateFragments.setSelection(Boolean.valueOf(validate2).booleanValue());
-		}
-		else {
-			updateButtons(true);
-			fValidateFragments.setSelection(Boolean.valueOf(validate).booleanValue());
-		}
-	}
-
-	protected void performDefaults() {
-		int index = fLanguageCombo.indexOf(SELECT_NONE);
-		if (index > -1)
-			fLanguageCombo.select(index);
-
-		index = fContentTypeCombo.indexOf(SELECT_NONE);
-		if (index > -1)
-			fContentTypeCombo.select(index);
-
-		updateButtons(false);
-		fValidateFragments.setSelection(true);
-
-		super.performDefaults();
-	}
-
-	public boolean performOk() {
-		try {
-			// save the fragment language
-			String language = fLanguageCombo.getText();
-			if (language == null || language.length() == 0 || language.equalsIgnoreCase(SELECT_NONE)) {
-				// if none, use null
-				language = null;
-			}
-			JSPFContentProperties.setProperty(JSPFContentProperties.JSPLANGUAGE, getResource(), language);
-
-			// save fragment content type
-			String contentType = fContentTypeCombo.getText();
-			if (contentType == null || contentType.length() == 0 || contentType.equalsIgnoreCase(SELECT_NONE)) {
-				// if none, use null
-				contentType = null;
-			}
-			JSPFContentProperties.setProperty(JSPFContentProperties.JSPCONTENTTYPE, getResource(), contentType);
-
-			String validate = null;
-			if (fSpecificSetting.getSelection()) {
-				validate = Boolean.toString(fValidateFragments.getSelection());
-			}
-			JSPFContentProperties.setProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), validate);
-		}
-		catch (CoreException e) {
-			// maybe in future, let user know there was a problem saving file
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-		}
-
-		return super.performOk();
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java
deleted file mode 100644
index 31976b6..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;
-
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-
-public class ProjectJSPFContentSettingsPropertyPage extends JSPFContentSettingsPropertyPage {
-	public ProjectJSPFContentSettingsPropertyPage() {
-		setDescription(JSPUIMessages.ProjectJSPFContentSettingsPropertyPage_0);
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java
index de4af96..fec333c 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java
@@ -20,7 +20,6 @@
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.texteditor.RetargetTextEditorAction;
 import org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML;
 import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
@@ -28,22 +27,21 @@
 /**
  * ActionContributorJSP
  * 
- * This class should not be used inside multi page editor's
- * ActionBarContributor, since cascaded init() call from the
- * ActionBarContributor will causes exception and it leads to lose whole
- * toolbars.
- * 
- * Instead, use SourcePageActionContributor for source page contributor of
- * multi page editor.
+ * This class should not be used inside multi page editor's ActionBarContributor,
+ * since cascaded init() call from the ActionBarContributor
+ * will causes exception and it leads to lose whole toolbars. 
+ *
+ * Instead, use SourcePageActionContributor for source page contributor
+ * of multi page editor.
  * 
  * Note that this class is still valid for single page editor.
  */
 public class ActionContributorJSP extends ActionContributorHTML {
-
+	
 	private RetargetTextEditorAction renameElementAction = null;
 	private RetargetTextEditorAction moveElementAction = null;
 	private IMenuManager refactorMenu = null;
-
+	
 	private static final String[] EDITOR_IDS = {"org.eclipse.jst.jsp.core.jspsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
 
 	public ActionContributorJSP() {
@@ -52,41 +50,39 @@
 		ResourceBundle bundle = JSPUIMessages.getResourceBundle();
 		this.renameElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJSP.ACTION_NAME_RENAME_ELEMENT + StructuredTextEditorActionConstants.DOT);
 		this.renameElementAction.setActionDefinitionId(IActionDefinitionIdsJSP.RENAME_ELEMENT);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(this.renameElementAction, IHelpContextIds.JSP_REFACTORRENAME_HELPID);
-
+		
 		this.moveElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJSP.ACTION_NAME_MOVE_ELEMENT + StructuredTextEditorActionConstants.DOT);
 		this.moveElementAction.setActionDefinitionId(IActionDefinitionIdsJSP.MOVE_ELEMENT);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(this.moveElementAction, IHelpContextIds.JSP_REFACTORMOVE_HELPID);
-
+		
 		// the refactor menu, add the menu itself to add all refactor actions
 		this.refactorMenu = new MenuManager(JSPUIMessages.ActionContributorJSP_0, RefactorActionGroup.MENU_ID); //$NON-NLS-1$
 		refactorMenu.add(this.renameElementAction);
 		refactorMenu.add(this.moveElementAction);
 	}
-
+	
 
 	protected String[] getExtensionIDs() {
 		return EDITOR_IDS;
 	}
-
+	
 
 	protected void addToMenu(IMenuManager menu) {
 		super.addToMenu(menu);
 
 		menu.insertAfter(IWorkbenchActionConstants.M_EDIT, this.refactorMenu);
 	}
-
+	
 
 	public void setActiveEditor(IEditorPart activeEditor) {
-
+		
 		super.setActiveEditor(activeEditor);
 		this.renameElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJSP.ACTION_NAME_RENAME_ELEMENT));
 		this.moveElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJSP.ACTION_NAME_MOVE_ELEMENT));
 	}
-
+	
 
 	public void setViewerSpecificContributionsEnabled(boolean enabled) {
-
+		
 		super.setViewerSpecificContributionsEnabled(enabled);
 		this.renameElementAction.setEnabled(enabled);
 		this.moveElementAction.setEnabled(enabled);
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java
index 4cec591..a07242c 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java
@@ -15,39 +15,39 @@
 /**
  * Help context ids for the JSP Source Editor.
  * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
+ * This interface contains constants only; it is not intended to be implemented.
  * </p>
  * 
  */
 public interface IHelpContextIds {
 	// org.eclipse.jst.jsp.ui.
 	public static final String PREFIX = JSPUIPlugin.ID + "."; //$NON-NLS-1$
-
+	
 
 	// // figured out on the fly
 	// // JSP Source page editor
 	// public static final String JSP_SOURCEVIEW_HELPID =
 	// ContentTypeIdForJSP.ContentTypeID_JSP +"_source_HelpId"; //$NON-NLS-1$
-
+	
 	// JSP Files Preference page
 	public static final String JSP_PREFWEBX_FILES_HELPID = PREFIX + "webx0050"; //$NON-NLS-1$
 	// JSP Styles Preference page
 	public static final String JSP_PREFWEBX_STYLES_HELPID = PREFIX + "webx0051"; //$NON-NLS-1$
 	// JSP Templates Preference page
 	public static final String JSP_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0052"; //$NON-NLS-1$
+			
 
-
-	// JSP Fragment Property Page
-	public static final String JSP_FRAGMENT_HELPID = PREFIX + "jspf1000"; //$NON-NLS-1$
-
-	// JSP Source Editor Context Menu
-	// Refactor Rename
-	public static final String JSP_REFACTORRENAME_HELPID = PREFIX + "jspr0010"; //$NON-NLS-1$
-
-	// Refactor Move
-	public static final String JSP_REFACTORMOVE_HELPID = PREFIX + "jspr0020"; //$NON-NLS-1$
-
+	// // JSP Fragment Property Page
+	// public static final String JSP_FRAGMENT_HELPID = PREFIX + "jspf1000";
+	// //$NON-NLS-1$
+	
+//	// JSP Source Editor Context Menu
+//	// Refactor Rename
+//	public static final String JSP_REFACTORRENAME_HELPID = PREFIX + "jspr0010"; //$NON-NLS-1$
+//	
+//	// Refactor Move
+//	public static final String JSP_REFACTORMOVE_HELPID = PREFIX + "jspr0020"; //$NON-NLS-1$
+	
 	// JSP New File Wizard - Template Page
 	public static final String JSP_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "jspw0010"; //$NON-NLS-1$
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
index 088b648..be5c52d 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
@@ -24,8 +24,8 @@
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
 import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
index bd39186..3422b2d 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
@@ -16,17 +16,17 @@
 import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
 import org.eclipse.jface.text.hyperlink.URLHyperlink;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
 import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
 import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.w3c.dom.Attr;
@@ -48,7 +48,7 @@
 				try {
 					// check if jsp tag/directive first
 					ITypedRegion partition = TextUtilities.getPartition(doc, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, region.getOffset(), false);
-					if (partition != null && partition.getType() == IJSPPartitions.JSP_DIRECTIVE) {
+					if (partition != null && partition.getType() == IJSPPartitionTypes.JSP_DIRECTIVE) {
 						// check if jsp taglib directive
 						Node currentNode = getCurrentNode(doc, region.getOffset());
 						if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE && JSP11Namespace.ElementName.DIRECTIVE_TAGLIB.equalsIgnoreCase(currentNode.getNodeName())) {
@@ -130,7 +130,7 @@
 					int regLength = valueRegion.getTextLength();
 					String attValue = att.getValueRegionText();
 					if (StringUtils.isQuoted(attValue)) {
-						++regOffset;
+						regOffset = ++regOffset;
 						regLength = regLength - 2;
 					}
 					hyperRegion = new Region(regOffset, regLength);
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java
index fb4765c..3c60920 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java
@@ -18,11 +18,11 @@
 import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
 import org.eclipse.jface.text.hyperlink.URLHyperlink;
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
@@ -304,7 +304,7 @@
 					int regLength = valueRegion.getTextLength();
 					String attValue = att.getValueRegionText();
 					if (StringUtils.isQuoted(attValue)) {
-						++regOffset;
+						regOffset = ++regOffset;
 						regLength = regLength - 2;
 					}
 					hyperRegion = new Region(regOffset, regLength);
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
index 2891ad6..1ac5f8a 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
@@ -19,7 +19,7 @@
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
index b61d4bd..53a3d01 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
@@ -12,15 +12,29 @@
 
 package org.eclipse.jst.jsp.ui.internal.java.refactoring;
 
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor;
+import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter;
+import org.eclipse.jdt.internal.ui.refactoring.reorg.CreateTargetQueries;
+import org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgMoveWizard;
+import org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgQueries;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.ltk.core.refactoring.participants.MoveRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
 import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IActionDelegate2;
 import org.eclipse.ui.IEditorActionDelegate;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IViewActionDelegate;
 import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
 
 /**
@@ -31,15 +45,15 @@
  * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817 
  */
 public class JSPMoveElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
-	//private IEditorPart fEditor;
+	private IEditorPart fEditor;
 
 	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
-		//fEditor = targetEditor;
+		fEditor = targetEditor;
 	}
 
 	public void dispose() {
 		// nulling out just in case
-		//fEditor = null;
+		fEditor = null;
 	}
 
 	public void init(IAction action) {
@@ -54,53 +68,50 @@
 	}
 
 	public void run(IAction action) {
-		
-		// no-op until we know how we're supposed to use this 
-		// eclipse 3.2M5
-		// public move support: https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
-		
-//		IJavaElement[] elements = getSelectedElements();
-//		if (elements.length > 0) {
-//
-//			// need to check if it's movable
-//			try {
-//				JavaMoveProcessor processor = JavaMoveProcessor.create(getResources(elements), elements);
-//				
-//				Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
-//				MoveRefactoring refactoring = new MoveRefactoring(processor);
-//
-//				RefactoringWizard wizard = createWizard(refactoring);
-//
-//				/*
-//				 * We want to get the shell from the refactoring dialog but
-//				 * it's not known at this point, so we pass the wizard and
-//				 * then, once the dialog is open, we will have access to its
-//				 * shell.
-//				 */
-//
-//				processor.setCreateTargetQueries(new CreateTargetQueries(wizard));
-//				processor.setReorgQueries(new ReorgQueries(wizard));
-//				// String openRefactoringWizMsg =
-//				// RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring");
-//				// //$NON-NLS-1$
-//				String openRefactoringWizMsg = JSPUIMessages.MoveElementWizard; // "Move
-//																				// the
-//																				// selected
-//																				// elements";
-//																				// //$NON-NLS-1$
-//				new RefactoringStarter().activate(refactoring, wizard, parent, openRefactoringWizMsg, true);
-//
-//				PlatformStatusLineUtil.clearStatusLine();
-//
-//			}
-//			catch (JavaModelException e) {
-//				Logger.logException(e);
-//			}
-//		}
-//		else {
-//			PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPMoveElementAction_0); //$NON-NLS-1$
-//		}
-		
+		IJavaElement[] elements = getSelectedElements();
+		if (elements.length > 0) {
+
+			// need to check if it's movable
+			try {
+				JavaMoveProcessor processor = JavaMoveProcessor.create(getResources(elements), elements/*
+																										 * ,
+																										 * getCodeGenerationSettings()
+																										 */);
+				Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+
+				MoveRefactoring refactoring = new MoveRefactoring(processor);
+
+				RefactoringWizard wizard = createWizard(refactoring);
+
+				/*
+				 * We want to get the shell from the refactoring dialog but
+				 * it's not known at this point, so we pass the wizard and
+				 * then, once the dialog is open, we will have access to its
+				 * shell.
+				 */
+
+				processor.setCreateTargetQueries(new CreateTargetQueries(wizard));
+				processor.setReorgQueries(new ReorgQueries(wizard));
+				// String openRefactoringWizMsg =
+				// RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring");
+				// //$NON-NLS-1$
+				String openRefactoringWizMsg = JSPUIMessages.MoveElementWizard; // "Move
+																				// the
+																				// selected
+																				// elements";
+																				// //$NON-NLS-1$
+				new RefactoringStarter().activate(refactoring, wizard, parent, openRefactoringWizMsg, true);
+
+				PlatformStatusLineUtil.clearStatusLine();
+
+			}
+			catch (JavaModelException e) {
+				Logger.logException(e);
+			}
+		}
+		else {
+			PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPMoveElementAction_0); //$NON-NLS-1$
+		}
 	}
 
 	public void selectionChanged(IAction action, ISelection selection) {
@@ -111,6 +122,32 @@
 		// do nothing
 	}
 
+	private IJavaElement[] getSelectedElements() {
 
+		IJavaElement[] elements = new IJavaElement[0];
+		if (fEditor instanceof ITextEditor)
+			elements = JSPJavaSelectionProvider.getSelection((ITextEditor) fEditor);
+		return elements;
+	}
+
+	private IResource[] getResources(IJavaElement[] elements) {
+		IResource[] resources = new IResource[elements.length];
+		for (int i = 0; i < elements.length; i++) {
+			try {
+				resources[i] = elements[i].getPrimaryElement().getCorrespondingResource();// elements[i].getResource();
+			}
+			catch (JavaModelException e) {
+				Logger.logException(e);
+			}
+		}
+		return resources;
+	}
 	
+	/**
+	 * will change post 3.0 with public move support
+	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
+	 */
+	private RefactoringWizard createWizard(MoveRefactoring refactoring) {
+		return new ReorgMoveWizard(refactoring);
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
index 9ff15c3..a8742cb 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
@@ -19,11 +19,11 @@
 import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
@@ -36,7 +36,7 @@
 public class JSPFindOccurrencesProcessor extends FindOccurrencesProcessor {
 
 	protected String[] getPartitionTypes() {
-		return new String[]{IJSPPartitions.JSP_DEFAULT, IJSPPartitions.JSP_CONTENT_JAVA};
+		return new String[]{IJSPPartitionTypes.JSP_DEFAULT, IJSPPartitionTypes.JSP_CONTENT_JAVA};
 	}
 
 	protected String[] getRegionTypes() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
index 7e9eb80..1a9c56e 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
@@ -28,8 +28,8 @@
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
index f81c4e4..991a942 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004 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
@@ -10,13 +10,10 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.preferences.ui;
 
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
@@ -55,7 +52,7 @@
 	protected Control createContents(Composite parent) {
 		Control c = super.createContents(parent);
 
-		Group g = createGroup((Composite) c, 1);
+		Group g = createGroup((Composite)c, 1);
 		g.setText(JSPUIMessages.JSPFilesPreferencePage_0);
 		fValidateFragments = createCheckBox(g, JSPUIMessages.JSPFilesPreferencePage_1);
 		boolean validateFragments = getModelPreferences().getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS);
@@ -74,10 +71,6 @@
 		// no loading preferences
 	}
 
-	protected IContentType getContentType() {
-		return Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
-	}
-
 	/*
 	 * (non-Javadoc)
 	 * 
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
index ba3e93e..f4316f9 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
@@ -4,12 +4,12 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.source.projection.IProjectionListener;
 import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Document;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java
index 25dfb44..031b108 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java
@@ -17,7 +17,6 @@
 
 import org.eclipse.jst.jsp.ui.internal.Logger;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
 import org.eclipse.swt.graphics.RGB;
 import org.eclipse.swt.widgets.Display;
 
@@ -32,28 +31,34 @@
 	static RGB BG_COLOR_RGB = null;
 
 	static {
-		final Display display = Display.getDefault();
-		if (display != null && !display.isDisposed()) {
-			try {
+		// try to do in advance
+		getSystemBGColor();
+	}
+
+	private static RGB getSystemBGColor() {
+		RGB result = null;
+		if (BG_COLOR_RGB == null) {
+			final Display display = Display.getCurrent();
+			if (display != null && !display.isDisposed()) {
+
 				display.asyncExec(new Runnable() {
-					/*
-					 * @see java.lang.Runnable#run()
-					 */
 					public void run() {
-						BG_COLOR_RGB = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
+						if (display != null && !display.isDisposed()) {
+							BG_COLOR_RGB = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
+						}
 					}
 				});
-			}
-			catch (SWTError err) {
-				// see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=45294
-				if (err.code != SWT.ERROR_DEVICE_DISPOSED)
-					throw err;
+
 			}
 		}
+		else {
+			result = BG_COLOR_RGB;
+		}
+		return result;
 	}
 
 	private HTMLPrinter() {
-		// nothing
+		super();
 	}
 
 	private static String replace(String text, char c, String s) {
@@ -77,8 +82,6 @@
 	}
 
 	public static String convertToHTMLContent(String content) {
-		content = replace(content, '&', "&amp;"); //$NON-NLS-1$
-		content = replace(content, '"', "&quot;"); //$NON-NLS-1$
 		content = replace(content, '<', "&lt;"); //$NON-NLS-1$
 		return replace(content, '>', "&gt;"); //$NON-NLS-1$
 	}
@@ -98,7 +101,7 @@
 		}
 		catch (IOException x) {
 			// never expected
-			Logger.log(Logger.WARNING_DEBUG, x.getMessage(), x);
+			Logger.logException(x);
 		}
 
 		return null;
@@ -156,18 +159,22 @@
 	}
 
 	public static void insertPageProlog(StringBuffer buffer, int position) {
-		insertPageProlog(buffer, position, getBgColor());
+		insertPageProlog(buffer, position, getBgColor()); //$NON-NLS-1$
 	}
 
 	public static void insertPageProlog(StringBuffer buffer, int position, URL styleSheetURL) {
-		insertPageProlog(buffer, position, getBgColor(), styleSheetURL);
+		insertPageProlog(buffer, position, getBgColor(), styleSheetURL); //$NON-NLS-1$
 	}
 
-	private static RGB getBgColor() {
-		if (BG_COLOR_RGB != null)
-			return BG_COLOR_RGB;
-		// RGB value of info bg color on WindowsXP
-		return new RGB(255, 255, 225);
+	static RGB getBgColor() {
+		RGB result = getSystemBGColor();
+		if (result == null) {
+			// use RGB value of default info bg color
+			// on WindowsXP
+			result = new RGB(255, 255, 225);
+		}
+		return result;
+
 	}
 
 	public static void addPageProlog(StringBuffer buffer) {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java
deleted file mode 100644
index b2f680b..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.taginfo;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Provides context help for JSP tags (Show tooltip description)
- */
-public class JSPInformationProvider implements IInformationProvider, IInformationProviderExtension {
-	private ITextHover fTextHover = null;
-
-	public JSPInformationProvider() {
-		fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new JSPTagInfoHoverProcessor());
-	}
-
-	public IRegion getSubject(ITextViewer textViewer, int offset) {
-		return fTextHover.getHoverRegion(textViewer, offset);
-	}
-
-	public String getInformation(ITextViewer textViewer, IRegion subject) {
-		return (String) getInformation2(textViewer, subject);
-	}
-
-	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
-		return fTextHover.getHoverInfo(textViewer, subject);
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
index 88c6093..7ee1293 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004 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
@@ -18,127 +18,112 @@
 import org.eclipse.jdt.ui.JavaElementLabels;
 import org.eclipse.jdt.ui.JavadocContentAccess;
 import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.taginfo.AbstractHoverProcessor;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
 /**
  * Provides javadoc hover help documentation for java code inside JSPs
  */
-public class JSPJavaJavadocHoverProcessor extends AbstractHoverProcessor {
-	/*
-	 * Bulk of the work was copied from
-	 * org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover
-	 */
-	private final long LABEL_FLAGS = JavaElementLabels.ALL_FULLY_QUALIFIED | JavaElementLabels.M_PRE_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES | JavaElementLabels.M_EXCEPTIONS | JavaElementLabels.F_PRE_TYPE_SIGNATURE | JavaElementLabels.M_PRE_TYPE_PARAMETERS | JavaElementLabels.T_TYPE_PARAMETERS | JavaElementLabels.USE_RESOLVED;
-	private final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS & ~JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.F_POST_QUALIFIED;
-
-	private String getHoverInfo(IJavaElement[] result) {
-		StringBuffer buffer = new StringBuffer();
-		int nResults = result.length;
-		if (nResults == 0)
-			return null;
-
-		if (nResults > 1) {
-
-			for (int i = 0; i < result.length; i++) {
-				HTMLPrinter.startBulletList(buffer);
-				IJavaElement curr = result[i];
-				if (curr instanceof IMember || curr.getElementType() == IJavaElement.LOCAL_VARIABLE)
-					HTMLPrinter.addBullet(buffer, getInfoText(curr));
-				HTMLPrinter.endBulletList(buffer);
-			}
-
-		}
-		else {
-
-			IJavaElement curr = result[0];
-			if (curr instanceof IMember) {
-				IMember member = (IMember) curr;
-				HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
-				Reader reader;
-				try {
-					reader = JavadocContentAccess.getHTMLContentReader(member, true, true);
-				}
-				catch (JavaModelException ex) {
-					return null;
-				}
-				if (reader != null) {
-					HTMLPrinter.addParagraph(buffer, reader);
-				}
-			}
-			else if (curr.getElementType() == IJavaElement.LOCAL_VARIABLE || curr.getElementType() == IJavaElement.TYPE_PARAMETER)
-				HTMLPrinter.addSmallHeader(buffer, getInfoText(curr));
-		}
-
-		if (buffer.length() > 0) {
-			HTMLPrinter.insertPageProlog(buffer, 0);
-			HTMLPrinter.addPageEpilog(buffer);
-			return buffer.toString();
-		}
-
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
-		// get JSP translation object for this viewer's document
-		IDOMModel xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
-		try {
-			if (xmlModel != null) {
-				IDOMDocument xmlDoc = xmlModel.getDocument();
-				JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
-				if (adapter != null) {
-					JSPTranslation translation = adapter.getJSPTranslation();
-					
-					IJavaElement[] result = translation.getElementsFromJspRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
-					return translation.fixupMangledName(getHoverInfo(result));
-				}
-			}
-		}
-		finally {
-			if (xmlModel != null)
-				xmlModel.releaseFromRead();
-		}
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
-		return JavaWordFinder.findWord(textViewer.getDocument(), offset);
-	}
-
+public class JSPJavaJavadocHoverProcessor implements ITextHover {
+	private final long LABEL_FLAGS=  JavaElementLabels.ALL_FULLY_QUALIFIED
+	| JavaElementLabels.M_PRE_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES | JavaElementLabels.M_EXCEPTIONS 
+	| JavaElementLabels.F_PRE_TYPE_SIGNATURE;
+	
 	private String getInfoText(IJavaElement member) {
-		long flags = member.getElementType() == IJavaElement.LOCAL_VARIABLE ? LOCAL_VARIABLE_FLAGS : LABEL_FLAGS;
-		String label = JavaElementLabels.getElementLabel(member, flags);
-		StringBuffer buf = new StringBuffer();
-		for (int i = 0; i < label.length(); i++) {
-			char ch = label.charAt(i);
+		String label= JavaElementLabels.getElementLabel(member, LABEL_FLAGS);
+		StringBuffer buf= new StringBuffer();
+		for (int i= 0; i < label.length(); i++) {
+			char ch= label.charAt(i);
 			if (ch == '<') {
 				buf.append("&lt;"); //$NON-NLS-1$
-			}
-			else if (ch == '>') {
+			} else if (ch == '>') {
 				buf.append("&gt;"); //$NON-NLS-1$
-			}
-			else {
+			} else {
 				buf.append(ch);
 			}
 		}
 		return buf.toString();
 	}
+	
+	private String getHoverInfo(IJavaElement[] result) {
+		StringBuffer buffer= new StringBuffer();
+		int nResults= result.length;
+		if (nResults == 0)
+			return null;
+		
+		if (nResults > 1) {
+			
+			for (int i= 0; i < result.length; i++) {
+				HTMLPrinter.startBulletList(buffer);
+				IJavaElement curr= result[i];
+				if (curr instanceof IMember || curr.getElementType() == IJavaElement.LOCAL_VARIABLE)
+					HTMLPrinter.addBullet(buffer, getInfoText(curr));
+				HTMLPrinter.endBulletList(buffer);
+			}
+			
+		} else {
+			
+			IJavaElement curr= result[0];
+			if (curr instanceof IMember) {
+				IMember member= (IMember) curr;
+				HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
+				Reader reader;
+				try {
+					reader= JavadocContentAccess.getHTMLContentReader(member, true);
+				} catch (JavaModelException ex) {
+					return null;
+				}
+				if (reader != null) {
+					HTMLPrinter.addParagraph(buffer, reader);
+				}
+			} else if (curr.getElementType() == IJavaElement.LOCAL_VARIABLE)
+				HTMLPrinter.addSmallHeader(buffer, getInfoText(curr));
+		}
+		
+		if (buffer.length() > 0) {
+			HTMLPrinter.insertPageProlog(buffer, 0);
+			HTMLPrinter.addPageEpilog(buffer);
+			return buffer.toString();
+		}
+		
+		return null;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
+	 */
+	public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+		// get JSP translation object for this viewer's document
+		IDOMModel xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
+		try {
+			if(xmlModel != null) {
+				IDOMDocument xmlDoc = xmlModel.getDocument();
+				JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				if (adapter != null) {
+					JSPTranslation translation = adapter.getJSPTranslation();
+					IJavaElement[] result = translation.getElementsFromJspRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
+					return getHoverInfo(result);
+				}
+			}
+		}
+		finally {
+			if(xmlModel != null) 
+				xmlModel.releaseFromRead();
+		}
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer, int)
+	 */
+	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+		return JavaWordFinder.findWord(textViewer.getDocument(), offset);
+	}
+
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java
deleted file mode 100644
index 190f5aa..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.taginfo;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Provides javadoc context information for java code inside JSPs (Shows
- * tooltip description)
- */
-public class JSPJavaJavadocInformationProvider implements IInformationProvider, IInformationProviderExtension {
-	private ITextHover fTextHover = null;
-
-	public JSPJavaJavadocInformationProvider() {
-		fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new JSPJavaJavadocHoverProcessor());
-	}
-
-	public IRegion getSubject(ITextViewer textViewer, int offset) {
-		return fTextHover.getHoverRegion(textViewer, offset);
-	}
-
-	public String getInformation(ITextViewer textViewer, IRegion subject) {
-		return (String) getInformation2(textViewer, subject);
-	}
-
-	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
-		return fTextHover.getHoverInfo(textViewer, subject);
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
index f670de6..c96288e 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
@@ -1,13 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.wizard;
 
 import java.io.ByteArrayInputStream;
@@ -18,11 +8,8 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
 import org.eclipse.core.runtime.content.IContentType;
@@ -31,7 +18,6 @@
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.Logger;
@@ -51,107 +37,29 @@
 	private WizardNewFileCreationPage fNewFilePage;
 	private NewJSPTemplatesWizardPage fNewFileTemplatesPage;
 	private IStructuredSelection fSelection;
-	private IContentType fContentType;
 	private List fValidExtensions = null;
 
 	/**
-	 * Adds default extension to the filename
-	 * 
-	 * @param filename
-	 * @return
-	 */
-	String addDefaultExtension(String filename) {
-		StringBuffer newFileName = new StringBuffer(filename);
-
-		Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
-		String ext = preference.getString(JSPCorePreferenceNames.DEFAULT_EXTENSION);
-
-		newFileName.append("."); //$NON-NLS-1$
-		newFileName.append(ext);
-
-		return newFileName.toString();
-	}
-
-	/**
-	 * Get content type associated with this new file wizard
-	 * 
-	 * @return IContentType
-	 */
-	IContentType getContentType() {
-		if (fContentType == null)
-			fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
-		return fContentType;
-	}
-
-	/**
 	 * Get list of valid extensions for JSP Content type
 	 * 
 	 * @return
 	 */
 	List getValidExtensions() {
 		if (fValidExtensions == null) {
-			IContentType type = getContentType();
+			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
 			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
 		}
 		return fValidExtensions;
 	}
 
-	/**
-	 * Verifies if fileName is valid name for content type. Takes base content
-	 * type into consideration.
-	 * 
-	 * @param fileName
-	 * @return true if extension is valid for this content type
-	 */
-	boolean extensionValidForContentType(String fileName) {
-		boolean valid = false;
-
-		IContentType type = getContentType();
-		// there is currently an extension
-		if (fileName.lastIndexOf('.') != -1) {
-			// check what content types are associated with current extension
-			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
-			int i = 0;
-			while (i < types.length && !valid) {
-				valid = types[i].isKindOf(type);
-				++i;
-			}
-		}
-		else
-			valid = true; // no extension so valid
-		return valid;
-	}
-
 	public void addPages() {
 		fNewFilePage = new WizardNewFileCreationPage("JSPWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
 			protected boolean validatePage() {
-				String fileName = getFileName();
-				IPath fullPath = getContainerFullPath();
-				if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
-					// check that filename does not contain invalid extension
-					if (!extensionValidForContentType(fileName)) {
-						setErrorMessage(NLS.bind(JSPUIMessages._ERROR_FILENAME_MUST_END_JSP, getValidExtensions().toString()));
-						return false;
-					}
-					// no file extension specified so check adding default
-					// extension doesn't equal a file that already exists
-					if (fileName.lastIndexOf('.') == -1) {
-						String newFileName = addDefaultExtension(fileName);
-						IPath resourcePath = fullPath.append(newFileName);
-
-						IWorkspace workspace = ResourcesPlugin.getWorkspace();
-						IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
-						if (!result.isOK()) {
-							// path invalid
-							setErrorMessage(result.getMessage());
-							return false;
-						}
-
-						if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
-							setErrorMessage(JSPUIMessages.ResourceGroup_nameExists);
-							return false;
-						}
-					}
+				IPath handlePath = new Path(getFileName());
+				String extension = handlePath.getFileExtension();
+				if (extension == null || !getValidExtensions().contains(extension)) {
+					setErrorMessage(NLS.bind(JSPUIMessages._ERROR_FILENAME_MUST_END_JSP, getValidExtensions().toString()));
+					return false;
 				}
 				setErrorMessage(null);
 				return super.validatePage();
@@ -169,7 +77,7 @@
 	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
 		fSelection = aSelection;
 		setWindowTitle(JSPUIMessages._UI_WIZARD_NEW_TITLE);
-
+		
 		ImageDescriptor descriptor = JSPEditorPluginImageHelper.getInstance().getImageDescriptor(JSPEditorPluginImages.IMG_OBJ_WIZBAN_NEWJSPFILE);
 		setDefaultPageImageDescriptor(descriptor);
 	}
@@ -191,60 +99,43 @@
 	}
 
 	public boolean performFinish() {
-		boolean performedOK = false;
-
 		// save user options for next use
 		fNewFileTemplatesPage.saveLastSavedPreferences();
 
-		// no file extension specified so add default extension
-		String fileName = fNewFilePage.getFileName();
-		if (fileName.lastIndexOf('.') == -1) {
-			String newFileName = addDefaultExtension(fileName);
-			fNewFilePage.setFileName(newFileName);
-		}
-
 		// create a new empty file
 		IFile file = fNewFilePage.createNewFile();
 
-		// if there was problem with creating file, it will be null, so make
-		// sure to check
-		if (file != null) {
-			// put template contents into file
-			String templateString = fNewFileTemplatesPage.getTemplateString();
-			if (templateString != null) {
-				// determine the encoding for the new file
-				Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
-				String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+		// put template contents into file
+		String templateString = fNewFileTemplatesPage.getTemplateString();
+		if (templateString != null) {
+			// determine the encoding for the new file
+			Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
+			String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
 
-				try {
-					ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-					OutputStreamWriter outputStreamWriter = null;
-					if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
-						// just use default encoding
-						outputStreamWriter = new OutputStreamWriter(outputStream);
-					}
-					else {
-						outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
-					}
-					outputStreamWriter.write(templateString);
-					outputStreamWriter.flush();
-					outputStreamWriter.close();
-					ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
-					file.setContents(inputStream, true, false, null);
-					inputStream.close();
+			try {
+				ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+				OutputStreamWriter outputStreamWriter = null;
+				if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
+					// just use default encoding
+					outputStreamWriter = new OutputStreamWriter(outputStream);
+				} else {
+					outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
 				}
-				catch (Exception e) {
-					Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new JSP file", e); //$NON-NLS-1$
-				}
+				outputStreamWriter.write(templateString);
+				outputStreamWriter.flush();
+				outputStreamWriter.close();
+				ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
+				file.setContents(inputStream, true, false, null);
+				inputStream.close();
 			}
-
-			// open the file in editor
-			openEditor(file);
-
-			// everything's fine
-			performedOK = true;
+			catch (Exception e) {
+				Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new JSP file", e); //$NON-NLS-1$
+			}
 		}
-		return performedOK;
+
+		// open the file in editor
+		openEditor(file);
+		return true;
 	}
 
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 0fb6374..0000000
--- a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:37:26 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs
index cefb51a..42fb716 100644
--- a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:43:09 EDT 2006
-compilers.p.build=0
+#Fri May 27 23:56:32 EDT 2005
 compilers.p.deprecated=1
 compilers.p.illegal-att-value=0
 compilers.p.no-required-att=0
diff --git a/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
index 725eba4..b14badc 100644
--- a/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
@@ -2,41 +2,39 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.css.core; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.css.core.internal.CSSCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.css.core.internal;x-internal:=true,
- org.eclipse.wst.css.core.internal.cleanup;x-internal:=true,
- org.eclipse.wst.css.core.internal.contentmodel;x-internal:=true,
- org.eclipse.wst.css.core.internal.contentproperties;x-internal:=true,
- org.eclipse.wst.css.core.internal.contenttype;x-internal:=true,
- org.eclipse.wst.css.core.internal.document;x-internal:=true,
- org.eclipse.wst.css.core.internal.encoding;x-internal:=true,
- org.eclipse.wst.css.core.internal.event;x-internal:=true,
- org.eclipse.wst.css.core.internal.eventimpl;x-internal:=true,
- org.eclipse.wst.css.core.internal.format;x-internal:=true,
- org.eclipse.wst.css.core.internal.formatter;x-internal:=true,
- org.eclipse.wst.css.core.internal.metamodel;x-internal:=true,
- org.eclipse.wst.css.core.internal.metamodel.util;x-internal:=true,
- org.eclipse.wst.css.core.internal.metamodelimpl;x-internal:=true,
- org.eclipse.wst.css.core.internal.modelhandler;x-internal:=true,
- org.eclipse.wst.css.core.internal.parser;x-internal:=true,
- org.eclipse.wst.css.core.internal.parser.regions;x-internal:=true,
- org.eclipse.wst.css.core.internal.parserz;x-internal:=true,
- org.eclipse.wst.css.core.internal.preferences;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.adapters;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.contenttype;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.document;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.preferences;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.text;x-internal:=true,
- org.eclipse.wst.css.core.internal.tasks;x-internal:=true,
- org.eclipse.wst.css.core.internal.text;x-internal:=true,
- org.eclipse.wst.css.core.internal.util;x-internal:=true,
- org.eclipse.wst.css.core.internal.util.declaration;x-internal:=true,
- org.eclipse.wst.css.core.text
+Export-Package: org.eclipse.wst.css.core.internal,
+ org.eclipse.wst.css.core.internal.cleanup,
+ org.eclipse.wst.css.core.internal.contentmodel,
+ org.eclipse.wst.css.core.internal.contenttype,
+ org.eclipse.wst.css.core.internal.document,
+ org.eclipse.wst.css.core.internal.encoding,
+ org.eclipse.wst.css.core.internal.event,
+ org.eclipse.wst.css.core.internal.eventimpl,
+ org.eclipse.wst.css.core.internal.format,
+ org.eclipse.wst.css.core.internal.formatter,
+ org.eclipse.wst.css.core.internal.metamodel,
+ org.eclipse.wst.css.core.internal.metamodel.util,
+ org.eclipse.wst.css.core.internal.metamodelimpl,
+ org.eclipse.wst.css.core.internal.modelhandler,
+ org.eclipse.wst.css.core.internal.parser,
+ org.eclipse.wst.css.core.internal.parser.regions,
+ org.eclipse.wst.css.core.internal.parserz,
+ org.eclipse.wst.css.core.internal.preferences,
+ org.eclipse.wst.css.core.internal.provisional.adapters,
+ org.eclipse.wst.css.core.internal.provisional.contenttype,
+ org.eclipse.wst.css.core.internal.provisional.document,
+ org.eclipse.wst.css.core.internal.provisional.preferences,
+ org.eclipse.wst.css.core.internal.provisional.text,
+ org.eclipse.wst.css.core.internal.tasks,
+ org.eclipse.wst.css.core.internal.text,
+ org.eclipse.wst.css.core.internal.util,
+ org.eclipse.wst.css.core.internal.util.declaration
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.core.resources,
  org.eclipse.wst.xml.core,
  org.eclipse.wst.sse.core
-Eclipse-LazyStart: true; exceptions="org.eclipse.wst.css.core.internal.contenttype"
+Eclipse-AutoStart: true; exceptions="org.eclipse.wst.css.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.css.core/plugin.properties b/bundles/org.eclipse.wst.css.core/plugin.properties
index c527aa0..97e65bf 100644
--- a/bundles/org.eclipse.wst.css.core/plugin.properties
+++ b/bundles/org.eclipse.wst.css.core/plugin.properties
@@ -10,6 +10,7 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=Structured Source CSS Model
+nlFeatureName=Structured Source CSS Model NL Support
 cssprofile_css2.name=CSS2: Cascading Style Sheets, level 2
 cssprofile_css1.name=CSS1: Cascading Style Sheets, level 1
 cssprofile_mobile1_0.name=CSS Mobile Profile 1.0
diff --git a/bundles/org.eclipse.wst.css.core/plugin.xml b/bundles/org.eclipse.wst.css.core/plugin.xml
index e6c7cd1..15e9920 100644
--- a/bundles/org.eclipse.wst.css.core/plugin.xml
+++ b/bundles/org.eclipse.wst.css.core/plugin.xml
@@ -81,4 +81,5 @@
 		<initializer
 			class="org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceInitializer" />
 	</extension>
+	
 </plugin>
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
index 97761bb..9593893 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
@@ -32,8 +32,6 @@
 	public static String _6concat_ERROR_;
 	public static String _7concat_ERROR_;
 	public static String _8concat_ERROR_;
-	public static String CSSContentPropertiesManager_Updating;
-	public static String CSSContentPropertiesManager_Problems_Updating;
 
 	static {
 		// load message values from bundle file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
index 8693215..710b39a 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
@@ -13,8 +13,6 @@
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.css.core.internal.contentproperties.CSSContentPropertiesManager;
-import org.osgi.framework.BundleContext;
 
 /**
  * The main plugin class to be used in the desktop.
@@ -44,19 +42,4 @@
 	public static IWorkspace getWorkspace() {
 		return ResourcesPlugin.getWorkspace();
 	}
-	
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-
-		// listen for resource changes to update content properties keys
-		CSSContentPropertiesManager.startup();
-	}
-
-	public void stop(BundleContext context) throws Exception {
-		// stop listenning for resource changes to update content properties
-		// keys
-		CSSContentPropertiesManager.shutdown();
-
-		super.stop(context);
-	}
 }
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
index 762f57b..6e42bd3 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
@@ -21,6 +21,3 @@
 _6concat_ERROR_={0}first region is not in model.
 _7concat_ERROR_={0}last region is null.
 _8concat_ERROR_={0}last region is not in model.
-#
-CSSContentPropertiesManager_Updating=Updating CSS Content Settings
-CSSContentPropertiesManager_Problems_Updating=Problem saving CSS Content Settings for {0}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentProperties.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentProperties.java
deleted file mode 100644
index 3bbc582..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentProperties.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentproperties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * Properties constants used by CSS. Clients should only read and modify the
- * CSS properties programmatically using this class.
- * 
- * @since 1.1
- */
-public class CSSContentProperties {
-	static final String CSSCORE_ID = CSSCorePlugin.getDefault().getBundle().getSymbolicName();
-	private static final String PROJECT_KEY = "<project>"; //$NON-NLS-1$
-
-	/**
-	 * The default css profile to use when none is specified.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String CSS_PROFILE = "css-profile"; //$NON-NLS-1$
-
-	/**
-	 * Generates a preference key based on resourcePath
-	 * 
-	 * @param resourcePath
-	 *            the path the key will be based off of
-	 * @return preference key based on resourcePath (basically the
-	 *         resourcePath without the filename); PROJECT_KEY if resourcePath
-	 *         is null
-	 */
-	static String getKeyFor(IPath resourcePath) {
-		String key = PROJECT_KEY;
-		if (resourcePath != null && resourcePath.segmentCount() > 1) {
-			key = resourcePath.removeFirstSegments(1).toString();
-		}
-		return key;
-	}
-
-	/**
-	 * Get the preferences node associated with the given project scope and
-	 * preference key (subNode) If create is true, the preference node will be
-	 * created if one does not already exist
-	 * 
-	 * @param project
-	 *            the project the preference node is under
-	 * @param preferenceKey
-	 *            the subnode/category the preference node is located in
-	 * @param create
-	 *            if true, a preference node will be created if one does not
-	 *            already exist
-	 * @return Preferences associated with the given project scope and
-	 *         preference key. null if one could not be found and create is
-	 *         false
-	 */
-	static Preferences getPreferences(IProject project, String preferenceKey, boolean create) {
-		if (create)
-			// create all nodes down to the one we are interested in
-			return new ProjectScope(project).getNode(CSSCORE_ID).node(preferenceKey);
-		// be careful looking up for our node so not to create any nodes as
-		// side effect
-		Preferences node = Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE);
-		try {
-			// TODO once bug 90500 is fixed, should be as simple as this:
-			// String path = project.getName() + IPath.SEPARATOR +
-			// ResourcesPlugin.PI_RESOURCES + IPath.SEPARATOR +
-			// ENCODING_PREF_NODE;
-			// return node.nodeExists(path) ? node.node(path) : null;
-			// for now, take the long way
-			if (!node.nodeExists(project.getName()))
-				return null;
-			node = node.node(project.getName());
-			if (!node.nodeExists(CSSCORE_ID))
-				return null;
-			node = node.node(CSSCORE_ID);
-			if (!node.nodeExists(preferenceKey))
-				return null;
-			return node.node(preferenceKey);
-		}
-		catch (BackingStoreException e) {
-			// nodeExists failed
-			Logger.log(Logger.WARNING_DEBUG, "Could not retrieve preference node", e); //$NON-NLS-1$
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the value for the given key in the given context.
-	 * 
-	 * @param key
-	 *            The property key
-	 * @param resource
-	 *            The current context or <code>null</code> if no context is
-	 *            available and the workspace setting should be taken. Note
-	 *            that passing <code>null</code> should be avoided.
-	 * @param recurse
-	 *            whether the parent should be queried till property is found
-	 * @return Returns the current value for the key.
-	 * @since 1.1
-	 */
-	public static String getProperty(String key, IResource resource, boolean recurse) {
-		String val = null;
-		// boolean preferenceFound = false;
-		if (resource != null) {
-			IProject project = resource.getProject();
-			if (project != null) {
-				Preferences preferences = getPreferences(project, key, false);
-				if (preferences != null) {
-					val = internalGetProperty(resource, recurse, preferences);
-					// preferenceFound = true;
-				}
-			}
-		}
-		// Workbench preference may not be needed so leave out for now
-		// // no preferences found - for performance reasons,
-		// // short-circuit
-		// // lookup by falling back to workspace's default
-		// // setting
-		// if (!preferenceFound)
-		// val = getWorkbenchPreference(key);
-		return val;
-	}
-
-	private static String internalGetProperty(IResource resource, boolean recurse, Preferences preferences) {
-		String value = preferences.get(getKeyFor(resource.getFullPath()), null);
-		if (value == null && resource != resource.getProject() && recurse) {
-			value = preferences.get(getKeyFor(null), null);
-		}
-
-		// Workbench preference may not be needed so leave out for now
-		// // ensure we default to the workspace preference if none is found
-		// return value == null ? getWorkbenchPreference(key) : value;
-		return value;
-	}
-
-	/**
-	 * Sets the value for the given key in the given context.
-	 * 
-	 * @param key
-	 *            The property key
-	 * @param resource
-	 *            The current context. Note context cannot be
-	 *            <code>null</code>.
-	 * @param value
-	 *            The value to set for the key. If value is <code>null</code>
-	 *            the key is removed from properties.
-	 * @since 1.1
-	 */
-	public static void setProperty(String key, IResource resource, String value) throws CoreException {
-		if (resource != null) {
-			IProject project = resource.getProject();
-			if (project != null) {
-				Preferences preferences = getPreferences(project, key, true);
-				if (value == null || value.trim().length() == 0)
-					preferences.remove(getKeyFor(resource.getFullPath()));
-				else
-					preferences.put(getKeyFor(resource.getFullPath()), value);
-				try {
-					// save changes
-					preferences.flush();
-				}
-				catch (BackingStoreException e) {
-					throw new CoreException(new Status(IStatus.ERROR, CSSCORE_ID, IStatus.ERROR, "Unable to set property", e)); //$NON-NLS-1$
-				}
-			}
-		}
-		// Workbench preference may not be needed so leave out for now
-		// just set a preference in the instance scope
-		// if (!preferenceFound) {
-		// setWorkbenchPreference(key);
-		// }
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentPropertiesManager.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentPropertiesManager.java
deleted file mode 100644
index 25a4b8d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentPropertiesManager.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentproperties;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.css.core.internal.CSSCoreMessages;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.osgi.framework.Bundle;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-public class CSSContentPropertiesManager {
-	public CSSContentPropertiesManager() {
-		super();
-		fResourceChangeListener = new ResourceChangeListener();
-		fJob = new ContentPropertiesManagerJob();
-	}
-
-	private static CSSContentPropertiesManager _instance = null;
-	private IResourceChangeListener fResourceChangeListener;
-	ContentPropertiesManagerJob fJob;
-
-	/**
-	 * This job implementation is used to allow the resource change listener
-	 * to schedule operations that need to modify the workspace.
-	 */
-	private class ContentPropertiesManagerJob extends Job {
-		private static final int PROPERTIES_UPDATE_DELAY = 500;
-		private List asyncChanges = new ArrayList();
-
-		public ContentPropertiesManagerJob() {
-			super(CSSCoreMessages.CSSContentPropertiesManager_Updating);
-			setSystem(true);
-			setPriority(Job.INTERACTIVE);
-		}
-
-		public void addChanges(Set newChanges) {
-			if (newChanges.isEmpty())
-				return;
-			synchronized (asyncChanges) {
-				asyncChanges.addAll(newChanges);
-				asyncChanges.notify();
-			}
-			schedule(PROPERTIES_UPDATE_DELAY);
-		}
-
-		public IProject getNextChange() {
-			synchronized (asyncChanges) {
-				return asyncChanges.isEmpty() ? null : (IProject) asyncChanges.remove(asyncChanges.size() - 1);
-			}
-		}
-
-		protected IStatus run(IProgressMonitor monitor) {
-			MultiStatus result = new MultiStatus(CSSContentProperties.CSSCORE_ID, IResourceStatus.FAILED_SETTING_CHARSET, CSSCoreMessages.CSSContentPropertiesManager_Updating, null);
-			monitor = monitor == null ? new NullProgressMonitor() : monitor;
-			try {
-				monitor.beginTask(CSSCoreMessages.CSSContentPropertiesManager_Updating, asyncChanges.size());
-				try {
-					IProject next;
-					while ((next = getNextChange()) != null) {
-						// just exit if the system is shutting down or has
-						// been shut down
-						// it is too late to change the workspace at this
-						// point anyway
-						if (Platform.getBundle("org.eclipse.osgi").getState() != Bundle.ACTIVE) //$NON-NLS-1$
-							return Status.OK_STATUS;
-						try {
-							// save the preferences nodes
-							if (next.isAccessible()) {
-								// save css profile preferences
-								Preferences projectPrefs = CSSContentProperties.getPreferences(next, CSSContentProperties.CSS_PROFILE, false);
-								if (projectPrefs != null)
-									projectPrefs.flush();
-
-							}
-						}
-						catch (BackingStoreException e) {
-							// we got an error saving
-							String detailMessage = NLS.bind(CSSCoreMessages.CSSContentPropertiesManager_Problems_Updating, next.getFullPath());
-							result.add(new Status(1 << (IResourceStatus.FAILED_SETTING_CHARSET % 100 / 33), ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_SETTING_CHARSET, detailMessage, e));
-						}
-					}
-					monitor.worked(1);
-				}
-				catch (OperationCanceledException e) {
-					throw e;
-				}
-			}
-			finally {
-				monitor.done();
-			}
-			return result;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
-		 */
-		public boolean shouldRun() {
-			synchronized (asyncChanges) {
-				return !asyncChanges.isEmpty();
-			}
-		}
-	}
-
-	class ResourceChangeListener implements IResourceChangeListener {
-		private void processEntryChanges(IResourceDelta projectDelta, Set projectsToSave) {
-			// check each resource with css content setting to see if it has
-			// been moved/deleted
-			boolean resourceChanges = false;
-
-			// project affected
-			IProject currentProject = (IProject) projectDelta.getResource();
-
-			resourceChanges = processPreferences(currentProject, CSSContentProperties.CSS_PROFILE, projectDelta, projectsToSave);
-
-			// if there was a preference key change, need to save preferences
-			if (resourceChanges)
-				projectsToSave.add(currentProject);
-		}
-
-		/**
-		 * Goes through all the resource-dependent preferences associated with
-		 * currentProject & key and updates the preference keys if needed
-		 * based on projectDelta
-		 * 
-		 * @param currentProject
-		 *            current project of the preferences to be looked at
-		 * @param key
-		 *            current key/subcategory of the preferences to be looked
-		 *            at
-		 * @param projectDelta
-		 *            the changes to process the preference keys against
-		 * @param projectsToSave
-		 *            the projects that need to be updated/saved
-		 * @return true if currentProject's preferences were modified
-		 */
-		private boolean processPreferences(IProject currentProject, String key, IResourceDelta projectDelta, Set projectsToSave) {
-			boolean resourceChanges = false;
-
-			// get the project-key preference node
-			Preferences projectPrefs = CSSContentProperties.getPreferences(currentProject, key, false);
-			if (projectPrefs == null)
-				// no preferences for this project-key, just bail
-				return false;
-			String[] affectedResources;
-			try {
-				affectedResources = projectPrefs.keys();
-			}
-			catch (BackingStoreException e) {
-				// problems with the project scope... we gonna miss the
-				// changes (but will log)
-				Logger.log(Logger.WARNING_DEBUG, "Problem retreiving JSP Fragment preferences", e); //$NON-NLS-1$
-				return false;
-			}
-
-			// go through each preference key (which is really a file name)
-			for (int i = 0; i < affectedResources.length; i++) {
-				// see if preference key/file name was file that was changed
-				IResourceDelta memberDelta = projectDelta.findMember(new Path(affectedResources[i]));
-				// no changes for the given resource
-				if (memberDelta == null)
-					continue;
-				if (memberDelta.getKind() == IResourceDelta.REMOVED) {
-					resourceChanges = true;
-					// remove the setting for the original location
-					String currentValue = projectPrefs.get(affectedResources[i], null);
-					projectPrefs.remove(affectedResources[i]);
-					if ((memberDelta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
-						// if moving, copy the setting for the new location
-						IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getProject(memberDelta.getMovedToPath().segment(0));
-						Preferences targetPrefs = CSSContentProperties.getPreferences(targetProject, key, true);
-						targetPrefs.put(CSSContentProperties.getKeyFor(memberDelta.getMovedToPath()), currentValue);
-						if (targetProject != currentProject)
-							projectsToSave.add(targetProject);
-					}
-				}
-			}
-			return resourceChanges;
-		}
-
-		/**
-		 * For any change to the encoding file or any resource with encoding
-		 * set, just discard the cache for the corresponding project.
-		 */
-		public void resourceChanged(IResourceChangeEvent event) {
-			IResourceDelta delta = event.getDelta();
-			if (delta == null)
-				return;
-			IResourceDelta[] projectDeltas = delta.getAffectedChildren();
-			// process each project in the delta
-			Set projectsToSave = new HashSet();
-			for (int i = 0; i < projectDeltas.length; i++)
-				// nothing to do if a project has been added/removed/moved
-				if (projectDeltas[i].getKind() == IResourceDelta.CHANGED && (projectDeltas[i].getFlags() & IResourceDelta.OPEN) == 0)
-					processEntryChanges(projectDeltas[i], projectsToSave);
-			fJob.addChanges(projectsToSave);
-		}
-	}
-
-	public synchronized static void startup() {
-		_instance = new CSSContentPropertiesManager();
-		ResourcesPlugin.getWorkspace().addResourceChangeListener(_instance.fResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
-	}
-
-	public synchronized static void shutdown() {
-		ResourcesPlugin.getWorkspace().removeResourceChangeListener(_instance.fResourceChangeListener);
-		_instance = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
index 7b90807..208b951 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
@@ -24,8 +24,6 @@
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.TextRegionListImpl;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.css.CSSValue;
 
@@ -230,35 +228,31 @@
 		}
 		setCssValueTextCore(value);
 	}
-
 	private void setCssValueTextCore(String value) throws DOMException {
 		// use temporary document
-		synchronized (CSSStyleDeclarationImpl.class) {
+		synchronized(CSSStyleDeclarationImpl.class) {
 			if (sharedStructuredDocument == null) {
 				IDocumentLoader loader = new CSSDocumentLoader();
 				sharedStructuredDocument = (IStructuredDocument) loader.createNewStructuredDocument();
 				((CSSSourceParser) sharedStructuredDocument.getParser()).setParserMode(CSSSourceParser.MODE_DECLARATION_VALUE);
-
+				
 			}
 			sharedStructuredDocument.set(value);
 			IStructuredDocumentRegion node = sharedStructuredDocument.getFirstStructuredDocumentRegion();
-
+			
 			if (node == null) {
 				return;
 			}
 			if (node.getNext() != null) {
 				throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
 			}
-
+			
 			CSSDeclarationItemParser itemParser = new CSSDeclarationItemParser(getOwnerDocument());
 			itemParser.setStructuredDocumentTemporary(true);
-			// make a copy of nodelist because setupValues will destroy list
-			ITextRegionList nodeList = new TextRegionListImpl(node.getRegions());
-			itemParser.setupValues(this, node, nodeList);
+			itemParser.setupValues(this, node, node.getRegions());
 		}
 	}
-
-	private static IStructuredDocument sharedStructuredDocument;
+	private static IStructuredDocument sharedStructuredDocument; 
 
 	/**
 	 * @param newPriority
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java
index d03f797..62034c5 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java
@@ -22,7 +22,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 
 public class CSSDocumentCharsetDetector extends CSSResourceEncodingDetector implements IDocumentCharsetDetector {
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java
index dfb0f30..ed11f62 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java
@@ -10,20 +10,25 @@
  *******************************************************************************/
 package org.eclipse.wst.css.core.internal.metamodel.util;
 
+import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties;
 import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
 import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.internal.contentproperties.ContentSettingsCreator;
+import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
 
 
 public class CSSProfileFinder {
+
+	final static private String CSS_PROFILE = "css-profile"; //$NON-NLS-1$
+
 	/**
 	 * Constructor for CSSProfileFinder.
 	 */
@@ -71,12 +76,22 @@
 		CSSProfile profile = null;
 
 		if (baseLocation != null) {
+			IContentSettings cs = ContentSettingsCreator.create();
 			IPath path = new Path(baseLocation);
 			IResource resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
 			if (resource == null && path.segmentCount() > 1)
 				resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
 			if (resource != null) {
-				String profileID = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, resource, true);
+				IProject project = resource.getProject();
+				// at first, initialized with project settings
+				if (project != null) {
+					String profileID = cs.getProperty(project, CSS_PROFILE);
+					if (profileID != null && 0 < profileID.length()) {
+						profile = reg.getProfile(profileID);
+					}
+				}
+				// if resource settings exist, overwrite with project settings
+				String profileID = cs.getProperty(resource, CSS_PROFILE);
 				if (profileID != null && 0 < profileID.length()) {
 					profile = reg.getProfile(profileID);
 				}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
index 2056288..fc3997d 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005 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
@@ -44,11 +44,7 @@
 		}
 		node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, defaultEnc);
 		node.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-
-		// this could be made smarter by actually looking up the content
-		// type's valid extensions
-		node.put(CSSCorePreferenceNames.DEFAULT_EXTENSION, "css"); //$NON-NLS-1$
-
+		
 		// additional css core preferences
 		node.putInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM, 0);
 		node.putInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM, 1);
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
index d3fa08d..130389a 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005 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
@@ -39,15 +39,6 @@
 	public static final String CLEANUP_CASE_SELECTOR = "cleanupSelectorCase"; //$NON-NLS-1$
 
 	/**
-	 * The default extension to use when none is specified in the New CSS File
-	 * Wizard.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-	
-	/**
 	 * The maximum width of a line before a line split is needed.
 	 * <p>
 	 * Value is of type <code>Integer</code>.
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java
index fe95c77..3b8a4fa 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java
@@ -7,7 +7,7 @@
  * partitioning for CSS and all its partitions. Clients should reference the
  * partition type Strings defined here directly.
  * 
- * @deprecated org.eclipse.wst.css.core.text.ICSSPartitions
+ * @plannedfor 1.0
  */
 public interface ICSSPartitionTypes extends IStructuredPartitionTypes {
 
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
index 04451cd..47361db 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
@@ -11,20 +11,20 @@
 package org.eclipse.wst.css.core.internal.text;
 
 import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 
 public class StructuredTextPartitionerForCSS extends StructuredTextPartitioner {
 	
-	public final static String[] legalTypes = new String[]{ICSSPartitions.STYLE, IStructuredPartitions.DEFAULT_PARTITION};
+	public final static String[] legalTypes = new String[]{ICSSPartitionTypes.STYLE, IStructuredPartitionTypes.DEFAULT_PARTITION};
 
 	public StructuredTextPartitionerForCSS() {
 		super();
 	}
 
 	public String getDefaultPartitionType() {
-		return ICSSPartitions.STYLE;
+		return ICSSPartitionTypes.STYLE;
 	}
 
 	public String[] getLegalContentTypes() {
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java
index f72bb62..c25e9a2 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java
@@ -31,10 +31,10 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceAlreadyExists;
 import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceInUse;
 import org.eclipse.wst.sse.core.internal.util.PathHelper;
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java
deleted file mode 100644
index 1386b9c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.eclipse.wst.css.core.text;
-
-
-/**
- * This interface is not intended to be implemented. It defines the
- * partitioning for CSS and all its partitions. Clients should reference the
- * partition type Strings defined here directly.
- * 
- * @since 1.1
- */
-public interface ICSSPartitions {
-
-	String STYLE = "org.eclipse.wst.css.STYLE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 1ec642d..0000000
--- a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:37:38 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs
index 7f6d407..42fb716 100644
--- a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:43:13 EDT 2006
-compilers.p.build=0
+#Fri May 27 23:56:32 EDT 2005
 compilers.p.deprecated=1
 compilers.p.illegal-att-value=0
 compilers.p.no-required-att=0
diff --git a/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
index 825f1ee..06bc72a 100644
--- a/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
@@ -2,30 +2,30 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.css.ui; singleton:=true
-Bundle-Version: 1.0.100.qualifier
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.css.ui.internal.CSSUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.wst.css.ui,
- org.eclipse.wst.css.ui.internal;x-internal:=true,
- org.eclipse.wst.css.ui.internal.autoedit;x-internal:=true,
- org.eclipse.wst.css.ui.internal.contentassist;x-internal:=true,
- org.eclipse.wst.css.ui.internal.contentoutline;x-internal:=true,
- org.eclipse.wst.css.ui.internal.contentproperties;x-internal:=true,
- org.eclipse.wst.css.ui.internal.contentproperties.ui;x-internal:=true,
- org.eclipse.wst.css.ui.internal.edit.ui;x-internal:=true,
- org.eclipse.wst.css.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.css.ui.internal.image;x-internal:=true,
- org.eclipse.wst.css.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.css.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.wst.css.ui.internal.projection;x-internal:=true,
- org.eclipse.wst.css.ui.internal.properties;x-internal:=true,
- org.eclipse.wst.css.ui.internal.registry;x-internal:=true,
- org.eclipse.wst.css.ui.internal.selection;x-internal:=true,
- org.eclipse.wst.css.ui.internal.style;x-internal:=true,
- org.eclipse.wst.css.ui.internal.templates;x-internal:=true,
- org.eclipse.wst.css.ui.internal.text;x-internal:=true,
- org.eclipse.wst.css.ui.internal.wizard;x-internal:=true,
+ org.eclipse.wst.css.ui.internal,
+ org.eclipse.wst.css.ui.internal.autoedit,
+ org.eclipse.wst.css.ui.internal.contentassist,
+ org.eclipse.wst.css.ui.internal.contentoutline,
+ org.eclipse.wst.css.ui.internal.contentproperties,
+ org.eclipse.wst.css.ui.internal.contentproperties.ui,
+ org.eclipse.wst.css.ui.internal.edit.ui,
+ org.eclipse.wst.css.ui.internal.editor,
+ org.eclipse.wst.css.ui.internal.image,
+ org.eclipse.wst.css.ui.internal.preferences,
+ org.eclipse.wst.css.ui.internal.preferences.ui,
+ org.eclipse.wst.css.ui.internal.projection,
+ org.eclipse.wst.css.ui.internal.properties,
+ org.eclipse.wst.css.ui.internal.registry,
+ org.eclipse.wst.css.ui.internal.selection,
+ org.eclipse.wst.css.ui.internal.style,
+ org.eclipse.wst.css.ui.internal.templates,
+ org.eclipse.wst.css.ui.internal.text,
+ org.eclipse.wst.css.ui.internal.wizard,
  org.eclipse.wst.css.ui.views.contentoutline,
  org.eclipse.wst.css.ui.views.properties
 Require-Bundle: org.eclipse.ui.ide,
@@ -43,4 +43,4 @@
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
  org.eclipse.ui.ide
-Eclipse-LazyStart: true
+Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.properties b/bundles/org.eclipse.wst.css.ui/plugin.properties
index 3c0e4a2..265ddec 100644
--- a/bundles/org.eclipse.wst.css.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.css.ui/plugin.properties
@@ -10,6 +10,7 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=SSE CSS Source Editor
+nlFeatureName=SSE CSS Source Editor NL Support
 CSS_Source_Page_Editor.name=CSS Editor
 CSS_Files.name=CSS Files
 CSS_Source.name=CSS Source
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.xml b/bundles/org.eclipse.wst.css.ui/plugin.xml
index f9c05f6..21c0be8 100644
--- a/bundles/org.eclipse.wst.css.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.css.ui/plugin.xml
@@ -5,7 +5,7 @@
 	<extension point="org.eclipse.ui.editors">
 		<editor
 			name="%CSS_Source_Page_Editor.name"
-			icon="$nl$/icons/full/obj16/sourceEditor.gif"
+			icon="icons/full/obj16/sourceEditor.gif"
 			contributorClass="org.eclipse.wst.css.ui.internal.ActionContributorCSS"
 			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
 			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
@@ -81,18 +81,14 @@
 		</page>
 	</extension>
 
-	<!-- CSS Content Settings Property Page -->
 	<extension point="org.eclipse.ui.propertyPages">
 		<page
 			objectClass="org.eclipse.core.resources.IFile"
 			adaptable="true"
 			name="%WebContentSettings.name"
-			class="org.eclipse.wst.css.ui.internal.contentproperties.ui.CSSWebContentSettingsPropertyPage"
-			id="org.eclipse.wst.css.ui.internal.contentproperties.CSSWebContentSettingsPropertyPage.css">
-			<filter
-				name="contentTypeId"
-				value="org.eclipse.wst.css.core.csssource">
-			</filter>
+			nameFilter="*.css"
+			class="org.eclipse.wst.css.ui.internal.contentproperties.ui.CSSContentSettingsPropertyPage"
+			id="org.eclipse.wst.css.ui.csspropertypage">
 		</page>
 	</extension>
 
@@ -121,7 +117,7 @@
 			name="%_UI_WIZARD_NAME"
 			class="org.eclipse.wst.css.ui.internal.wizard.NewCSSWizard"
 			category="org.eclipse.wst.web.ui"
-			icon="$nl$/icons/full/etool16/newcss_wiz.gif">
+			icon="icons/full/etool16/newcss_wiz.gif">
 			<description>%_UI_WIZARD_CREATE_NEW_FILE</description>
 			<selection class="org.eclipse.core.resources.IResource" />
 		</wizard>
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
index 7504b6b..c41fe5c 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
@@ -21,11 +21,11 @@
 import org.eclipse.wst.css.core.internal.CSSCorePlugin;
 import org.eclipse.wst.css.core.internal.format.FormatProcessorCSS;
 import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
 import org.eclipse.wst.css.ui.internal.autoedit.StructuredAutoEditStrategyCSS;
 import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
 import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForCSS;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
 import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
@@ -67,7 +67,7 @@
 			allStrategies.add(superStrategies[i]);
 		}
 
-		if (contentType == ICSSPartitions.STYLE) {
+		if (contentType == ICSSPartitionTypes.STYLE) {
 			allStrategies.add(new StructuredAutoEditStrategyCSS());
 		}
 
@@ -76,7 +76,7 @@
 
 	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
 		if (fConfiguredContentTypes == null) {
-			fConfiguredContentTypes = new String[]{ICSSPartitions.STYLE, IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION};
+			fConfiguredContentTypes = new String[]{ICSSPartitionTypes.STYLE, IStructuredPartitionTypes.DEFAULT_PARTITION, IStructuredPartitionTypes.UNKNOWN_PARTITION};
 		}
 		return fConfiguredContentTypes;
 	}
@@ -84,7 +84,7 @@
 	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
 		IContentAssistProcessor[] processors = null;
 
-		if ((partitionType == ICSSPartitions.STYLE) || (partitionType == IStructuredPartitions.UNKNOWN_PARTITION)) {
+		if ((partitionType == ICSSPartitionTypes.STYLE) || (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION)) {
 			processors = new IContentAssistProcessor[]{new CSSContentAssistProcessor()};
 		}
 
@@ -92,7 +92,7 @@
 	}
 
 	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), ICSSPartitions.STYLE);
+		final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), ICSSPartitionTypes.STYLE);
 
 		formatter.setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorCSS()));
 
@@ -145,7 +145,7 @@
 	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
 		LineStyleProvider[] providers = null;
 
-		if (partitionType == ICSSPartitions.STYLE) {
+		if (partitionType == ICSSPartitionTypes.STYLE) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForCSS()};
 		}
 
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
index 94cec38..001bcc9 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
@@ -18,22 +18,6 @@
 	private static final String BUNDLE_NAME = "org.eclipse.wst.css.ui.internal.CSSUIPluginResources";//$NON-NLS-1$
 	private static ResourceBundle fResourceBundle;
 
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, CSSUIMessages.class);
-	}
-
-	public static ResourceBundle getResourceBundle() {
-		try {
-			if (fResourceBundle == null)
-				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
-		}
-		catch (MissingResourceException x) {
-			fResourceBundle = null;
-		}
-		return fResourceBundle;
-	}
-	
 	public static String INFO_Not_Categorized_1;
 	public static String PrefsLabel_WrappingWithoutAttr;
 	public static String PrefsLabel_WrappingInsertLineBreak;
@@ -104,7 +88,6 @@
 	public static String StructureSelectPrevious_tooltip;
 	public static String StructureSelectPrevious_description;
 	public static String Creating_files_encoding;
-	public static String ResourceGroup_nameExists;
 	public static String NewCSSTemplatesWizardPage_0;
 	public static String NewCSSTemplatesWizardPage_1;
 	public static String NewCSSTemplatesWizardPage_2;
@@ -112,6 +95,20 @@
 	public static String NewCSSTemplatesWizardPage_4;
 	public static String NewCSSTemplatesWizardPage_5;
 	public static String NewCSSTemplatesWizardPage_6;
-	public static String CSSContentSettingsPropertyPage_0;
-	public static String CSSContentSettingsPropertyPage_1;
+
+	static {
+		// load message values from bundle file
+		NLS.initializeMessages(BUNDLE_NAME, CSSUIMessages.class);
+	}
+
+	public static ResourceBundle getResourceBundle() {
+		try {
+			if (fResourceBundle == null)
+				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
+		}
+		catch (MissingResourceException x) {
+			fResourceBundle = null;
+		}
+		return fResourceBundle;
+	}
 }
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
index 64a1c80..dfa88c5 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
@@ -55,7 +55,7 @@
 _UI_WIZARD_NEW_TITLE = New Cascading Style Sheet
 _UI_WIZARD_NEW_HEADING = Cascading Style Sheet
 _UI_WIZARD_NEW_DESCRIPTION = Create a new CSS file.
-_ERROR_FILENAME_MUST_END_CSS = The file name must end in one of the following extensions {0}.
+_ERROR_FILENAME_MUST_END_CSS = The file name must end in .css
 #
 Title_InvalidValue=Invalid Value
 Message_InvalidValue=Invalid property value.
@@ -94,7 +94,6 @@
 StructureSelectPrevious_description=Expand selection to include previous sibling
 ##
 Creating_files_encoding=Creating files encoding preference
-ResourceGroup_nameExists = The same name already exists.
 NewCSSTemplatesWizardPage_0=Select CSS Template
 NewCSSTemplatesWizardPage_1=Select a template as initial content in the CSS page.
 NewCSSTemplatesWizardPage_2=Name
@@ -102,6 +101,3 @@
 NewCSSTemplatesWizardPage_4=Use CSS Template
 NewCSSTemplatesWizardPage_5=Preview:
 NewCSSTemplatesWizardPage_6=Templates are 'New CSS' templates found in the <a>CSS Templates</a> preference page.
-# CSS Content Settings
-CSSContentSettingsPropertyPage_0=The type of CSS to use.  The project setting is used if you specify "none."
-CSSContentSettingsPropertyPage_1=CSS Profile:
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
index d434cc0..2d30ad6 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
@@ -19,10 +19,10 @@
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
 import org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeIdsCSS;
 import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java
index e12c2c6..c0445fe 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java
@@ -15,10 +15,6 @@
 import org.eclipse.wst.css.ui.internal.CSSUIMessages;
 import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboList;
 
-/**
- * @deprecated This class only contains helper methods that you should
- *             actually implement yourself.
- */
 public final class ContentSettingsRegistry {
 	private static final String NONE = CSSUIMessages.UI_none;
 
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java
index 708d063..e83da28 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java
@@ -21,9 +21,6 @@
 import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
 import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
 
-/**
- * @deprecated Use CSSWebContentSettingsPropertyPage instead
- */
 public final class CSSContentSettingsPropertyPage extends ContentSettingsPropertyPage {
 
 	private final int N_CSS_PROFILE = 0;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java
deleted file mode 100644
index 6465fac..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2004 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 http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: IBM Corporation - initial API and implementation
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentproperties.ui;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-
-public final class CSSWebContentSettingsPropertyPage extends PropertyPage {
-	private static final String SELECT_NONE = CSSUIMessages.UI_none;
-
-	private Combo fProfileCombo;
-	private List fProfileIds;
-
-	public CSSWebContentSettingsPropertyPage() {
-		super();
-		setDescription(CSSUIMessages.CSSContentSettingsPropertyPage_0);
-	}
-
-	private Composite createComposite(Composite parent, int numColumns) {
-		Composite composite = new Composite(parent, SWT.NULL);
-
-		// GridLayout
-		GridLayout layout = new GridLayout();
-		layout.numColumns = numColumns;
-		composite.setLayout(layout);
-
-		// GridData
-		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		composite.setLayoutData(data);
-
-		return composite;
-	}
-
-	protected Control createContents(Composite parent) {
-		Composite propertyPage = createComposite(parent, 2);
-
-		// CSS Profile control
-		Text languageLabel = new Text(propertyPage, SWT.READ_ONLY);
-		languageLabel.setText(CSSUIMessages.CSSContentSettingsPropertyPage_1);
-		fProfileCombo = new Combo(propertyPage, SWT.READ_ONLY);
-		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		fProfileCombo.setLayoutData(data);
-
-		populateValues();
-		initializeValues();
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.CSS_CONTENT_SETTINGS_HELPID);
-		return propertyPage;
-	}
-
-	/**
-	 * Get the resource this properties page is for
-	 * 
-	 * @return IResource for this properties page or null if there is no
-	 *         IResource
-	 */
-	private IResource getResource() {
-		IResource resource = null;
-		if (getElement() instanceof IResource) {
-			resource = (IResource) getElement();
-		}
-		return resource;
-	}
-
-	private void initializeValues() {
-		int index = 0;
-		String profile = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, getResource(), false);
-		if (profile != null && profile.length() > 0) {
-			/*
-			 * If item is already part of combo, select it. Otherwise, select
-			 * none.
-			 */
-			index = fProfileIds.indexOf(profile);
-		}
-		index = index >= 0 ? index : 0;
-		fProfileCombo.select(index);
-	}
-
-	private void populateValues() {
-		fProfileIds = new ArrayList();
-		// add none first
-		fProfileCombo.add(SELECT_NONE);
-		fProfileIds.add(null);
-
-		CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
-		Iterator i = reg.getProfiles();
-		while (i.hasNext()) {
-			CSSProfile profile = (CSSProfile) i.next();
-			String id = profile.getProfileID();
-			String name = profile.getProfileName();
-			fProfileCombo.add(name);
-			fProfileIds.add(id);
-		}
-	}
-
-	protected void performDefaults() {
-		int index = fProfileCombo.indexOf(SELECT_NONE);
-		if (index > -1)
-			fProfileCombo.select(index);
-
-		super.performDefaults();
-	}
-
-	public boolean performOk() {
-		int index = fProfileCombo.getSelectionIndex();
-		if (index > -1) {
-			String id = (String) fProfileIds.get(index);
-			if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
-				// if none, use null
-				id = null;
-			}
-			try {
-				CSSContentProperties.setProperty(CSSContentProperties.CSS_PROFILE, getResource(), id);
-			}
-			catch (CoreException e) {
-				// maybe in future, let user know there was a problem saving
-				// file
-				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			}
-		}
-		return super.performOk();
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java
index f261af2..859efbc 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java
@@ -15,9 +15,9 @@
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.wst.css.core.internal.cleanup.CleanupProcessorCSS;
 import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 
 /**
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java
index e4f9123..d3df1ab 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java
@@ -24,8 +24,8 @@
 import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
 import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
 import org.eclipse.wst.css.ui.internal.style.IStyleConstantsCSS;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractColorPage;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java
index ab01fe8..36f3e38 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java
@@ -8,15 +8,12 @@
  ****************************************************************************/
 package org.eclipse.wst.css.ui.internal.preferences.ui;
 
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
 import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
 import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
 import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
@@ -39,8 +36,4 @@
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.CSS_PREFWEBX_FILES_HELPID);
 		return c;
 	}
-
-	protected IContentType getContentType() {
-		return Platform.getContentTypeManager().getContentType(ContentTypeIdForCSS.ContentTypeID_CSS);
-	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java
index 2c97adb..22e5551 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java
@@ -6,10 +6,10 @@
 import org.eclipse.jface.text.source.projection.ProjectionViewer;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
 
 /**
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java
index ddfbb99..a0deb92 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java
@@ -27,8 +27,8 @@
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
 import org.eclipse.wst.css.core.internal.util.CSSPathService;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 
 /**
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
index bb903a5..0e52ab1 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
@@ -54,7 +54,7 @@
 				if (regionStart <= start && start < regionEnd) {
 					TextAttribute attribute = getAttributeFor(token.kind);
 					if (attribute != null) {
-						holdResults.add(new StyleRange(start, token.length, attribute.getForeground(), attribute.getBackground(), attribute.getStyle()));
+						holdResults.add(new StyleRange(start, token.length, attribute.getForeground(), attribute.getBackground()));
 					}
 					else {
 						holdResults.add(new StyleRange(start, token.length, null, null));
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java
index e811db6..dad0429 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.css.ui.internal.wizard;
 
 import java.io.ByteArrayInputStream;
@@ -19,11 +8,8 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
 import org.eclipse.core.runtime.content.IContentType;
@@ -31,7 +17,6 @@
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPage;
@@ -40,7 +25,6 @@
 import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
 import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
 import org.eclipse.wst.css.ui.internal.CSSUIMessages;
 import org.eclipse.wst.css.ui.internal.Logger;
@@ -52,107 +36,29 @@
 	private WizardNewFileCreationPage fNewFilePage;
 	private NewCSSTemplatesWizardPage fNewFileTemplatesPage;
 	private IStructuredSelection fSelection;
-	private IContentType fContentType;
 	private List fValidExtensions = null;
 
 	/**
-	 * Adds default extension to the filename
-	 * 
-	 * @param filename
-	 * @return
-	 */
-	String addDefaultExtension(String filename) {
-		StringBuffer newFileName = new StringBuffer(filename);
-
-		Preferences preference = CSSCorePlugin.getDefault().getPluginPreferences();
-		String ext = preference.getString(CSSCorePreferenceNames.DEFAULT_EXTENSION);
-
-		newFileName.append("."); //$NON-NLS-1$
-		newFileName.append(ext);
-
-		return newFileName.toString();
-	}
-
-	/**
-	 * Get content type associated with this new file wizard
-	 * 
-	 * @return IContentType
-	 */
-	IContentType getContentType() {
-		if (fContentType == null)
-			fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForCSS.ContentTypeID_CSS);
-		return fContentType;
-	}
-
-	/**
 	 * Get list of valid extensions for CSS Content type
 	 * 
 	 * @return
 	 */
 	List getValidExtensions() {
 		if (fValidExtensions == null) {
-			IContentType type = getContentType();
+			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForCSS.ContentTypeID_CSS);
 			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
 		}
 		return fValidExtensions;
 	}
 	
-	/**
-	 * Verifies if fileName is valid name for content type. Takes base content
-	 * type into consideration.
-	 * 
-	 * @param fileName
-	 * @return true if extension is valid for this content type
-	 */
-	boolean extensionValidForContentType(String fileName) {
-		boolean valid = false;
-
-		IContentType type = getContentType();
-		// there is currently an extension
-		if (fileName.lastIndexOf('.') != -1) {
-			// check what content types are associated with current extension
-			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
-			int i = 0;
-			while (i < types.length && !valid) {
-				valid = types[i].isKindOf(type);
-				++i;
-			}
-		}
-		else
-			valid = true; // no extension so valid
-		return valid;
-	}
-
 	public void addPages() {
 		fNewFilePage = new WizardNewFileCreationPage("CSSWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
 			protected boolean validatePage() {
-				String fileName = getFileName();
-				IPath fullPath = getContainerFullPath();
-				if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
-					// check that filename does not contain invalid extension
-					if (!extensionValidForContentType(fileName)) {
-						setErrorMessage(NLS.bind(CSSUIMessages._ERROR_FILENAME_MUST_END_CSS, getValidExtensions().toString()));
-						return false;
-					}
-					// no file extension specified so check adding default
-					// extension doesn't equal a file that already exists
-					if (fileName.lastIndexOf('.') == -1) {
-						String newFileName = addDefaultExtension(fileName);
-						IPath resourcePath = fullPath.append(newFileName);
-
-						IWorkspace workspace = ResourcesPlugin.getWorkspace();
-						IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
-						if (!result.isOK()) {
-							// path invalid
-							setErrorMessage(result.getMessage());
-							return false;
-						}
-
-						if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
-							setErrorMessage(CSSUIMessages.ResourceGroup_nameExists);
-							return false;
-						}
-					}
+				IPath handlePath = new Path(getFileName());
+				String extension = handlePath.getFileExtension();
+				if (extension == null || !extension.equalsIgnoreCase("css")) { //$NON-NLS-1$
+					setErrorMessage(CSSUIMessages._ERROR_FILENAME_MUST_END_CSS); //$NON-NLS-1$
+					return false;
 				}
 				setErrorMessage(null);
 				return super.validatePage();
@@ -162,7 +68,7 @@
 		fNewFilePage.setDescription(CSSUIMessages._UI_WIZARD_NEW_DESCRIPTION); //$NON-NLS-1$
 
 		addPage(fNewFilePage);
-
+		
 		fNewFileTemplatesPage = new NewCSSTemplatesWizardPage();
 		addPage(fNewFileTemplatesPage);
 	}
@@ -191,59 +97,42 @@
 	}
 
 	public boolean performFinish() {
-		boolean performedOK = false;
-
 		// save user options for next use
 		fNewFileTemplatesPage.saveLastSavedPreferences();
-
-		// no file extension specified so add default extension
-		String fileName = fNewFilePage.getFileName();
-		if (fileName.lastIndexOf('.') == -1) {
-			String newFileName = addDefaultExtension(fileName);
-			fNewFilePage.setFileName(newFileName);
-		}
-
-		// create a new empty file
+		
 		IFile file = fNewFilePage.createNewFile();
+		
+		// put template contents into file
+		String templateString = fNewFileTemplatesPage.getTemplateString();
+		if (templateString != null) {
+			// determine the encoding for the new file
+			Preferences preference = CSSCorePlugin.getDefault().getPluginPreferences();
+			String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
 
-		// if there was problem with creating file, it will be null, so make
-		// sure to check
-		if (file != null) {
-			// put template contents into file
-			String templateString = fNewFileTemplatesPage.getTemplateString();
-			if (templateString != null) {
-				// determine the encoding for the new file
-				Preferences preference = CSSCorePlugin.getDefault().getPluginPreferences();
-				String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
-				try {
-					ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-					OutputStreamWriter outputStreamWriter = null;
-					if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
-						// just use default encoding
-						outputStreamWriter = new OutputStreamWriter(outputStream);
-					}
-					else {
-						outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
-					}
-					outputStreamWriter.write(templateString);
-					outputStreamWriter.flush();
-					outputStreamWriter.close();
-					ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
-					file.setContents(inputStream, true, false, null);
-					inputStream.close();
+			try {
+				ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+				OutputStreamWriter outputStreamWriter = null;
+				if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
+					// just use default encoding
+					outputStreamWriter = new OutputStreamWriter(outputStream);
+				} else {
+					outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
 				}
-				catch (Exception e) {
-					Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new CSS file", e); //$NON-NLS-1$
-				}
+				outputStreamWriter.write(templateString);
+				outputStreamWriter.flush();
+				outputStreamWriter.close();
+				ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
+				file.setContents(inputStream, true, false, null);
+				inputStream.close();
 			}
-			// open the file in editor
-			openEditor(file);
-
-			// everything's fine
-			performedOK = true;
+			catch (Exception e) {
+				Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new CSS file", e); //$NON-NLS-1$
+			}
 		}
-		return performedOK;
+
+		// open the file in editor
+		openEditor(file);
+		return true;
 	}
 
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
index 4912dc9..9b51b4e 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
@@ -21,10 +21,6 @@
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
 import org.w3c.dom.css.CSSRule;
 import org.w3c.dom.stylesheets.MediaList;
 
@@ -84,7 +80,6 @@
 	public Object[] getChildren(Object object) {
 		if (object instanceof ICSSNode) {
 			ICSSNode node = (ICSSNode) object;
-
 			short nodeType = node.getNodeType();
 			if (nodeType == ICSSNode.STYLERULE_NODE || nodeType == ICSSNode.PAGERULE_NODE || nodeType == ICSSNode.FONTFACERULE_NODE) {
 				for (node = node.getFirstChild(); node != null && !(node instanceof ICSSStyleDeclaration); node.getNextSibling()) {
@@ -97,13 +92,6 @@
 				if (!(child instanceof ICSSPrimitiveValue) && !(child instanceof MediaList)) {
 					children.add(child);
 				}
-				/*
-				 * Required to correctly connect the refreshing behavior to
-				 * the tree
-				 */
-				if (child instanceof INodeNotifier) {
-					((INodeNotifier) child).getAdapterFor(IJFaceNodeAdapter.class);
-				}
 				child = child.getNextSibling();
 			}
 			return children.toArray();
@@ -124,19 +112,7 @@
 			ArrayList v = new ArrayList();
 			// internalGetElements(object, v);
 			addElements(object, v);
-			Object[] elements = v.toArray();
-
-			for (int i = 0; i < elements.length; i++) {
-				/*
-				 * Required to correctly connect the refreshing behavior to
-				 * the tree
-				 */
-				if (elements[i] instanceof INodeNotifier) {
-					((INodeNotifier) elements[i]).getAdapterFor(IJFaceNodeAdapter.class);
-				}
-			}
-
-			return elements;
+			return v.toArray();
 		}
 		return new Object[0];
 
@@ -149,16 +125,15 @@
 	 * requested.
 	 */
 	public Object getParent(Object object) {
+		// IJFaceNodeAdapter adapter = getAdapter(object);
+		/*
+		 * ICSSNodeAdapter adapter = (ICSSNodeAdapter)getAdapter(object); if
+		 * (adapter != null) return adapter.getParent((ICSSNode) object); else
+		 * return null;
+		 */
 		if (object instanceof ICSSNode) {
 			ICSSNode node = ((ICSSNode) object).getParentNode();
 			if (node != null && node.getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
-				/*
-				 * Required to also correctly connect style declaration to the
-				 * refreshing behavior in the tree
-				 */
-				if (node instanceof INodeNotifier) {
-					((INodeNotifier) node).getAdapterFor(IJFaceNodeAdapter.class);
-				}
 				node = node.getParentNode();
 			}
 			return node;
@@ -173,14 +148,6 @@
 	public boolean hasChildren(Object object) {
 		// return getAdapter(object).hasChildren((ICSSNode) object);
 		if (object instanceof ICSSNode) {
-			/*
-			 * Required to correctly connect the refreshing behavior to the
-			 * tree
-			 */
-			if (object instanceof INodeNotifier) {
-				((INodeNotifier) object).getAdapterFor(IJFaceNodeAdapter.class);
-			}
-
 			if (object instanceof ICSSStyleDeclItem)
 				return false;
 			else
@@ -196,21 +163,6 @@
 	 *      java.lang.Object, java.lang.Object)
 	 */
 	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		if (oldInput != null && oldInput instanceof IStructuredModel) {
-			IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IStructuredModel) oldInput).getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
-			if (factory != null) {
-				factory.removeListener(viewer);
-			}
-		}
-		if (newInput != null && newInput instanceof IStructuredModel) {
-			IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IStructuredModel) newInput).getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
-			if (factory != null) {
-				factory.addListener(viewer);
-			}
-			if (newInput instanceof ICSSModel) {
-				((INodeNotifier) ((ICSSModel) newInput).getDocument()).getAdapterFor(IJFaceNodeAdapter.class);
-			}
-		}
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
index 44e5519..f7a45fd 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
@@ -14,6 +14,7 @@
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
@@ -90,7 +91,7 @@
 					}
 					break;
 				case ICSSNode.PAGERULE_NODE :
-					result = "@page";//$NON-NLS-1$
+					result = ((ICSSPageRule) element).getSelectors().getString();
 					break;
 				case ICSSNode.STYLEDECLARATION_NODE :
 					result = "properties";//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index ec22a14..0000000
--- a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:37:50 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs
index 6fb224d..50369da 100644
--- a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Tue Apr 04 03:19:49 EDT 2006

+#Sat Oct 01 09:01:07 EDT 2005

 eclipse.preferences.version=1

 org.eclipse.jdt.core.builder.cleanOutputFolder=clean

 org.eclipse.jdt.core.builder.duplicateResourceTask=warning

@@ -17,20 +17,17 @@
 org.eclipse.jdt.core.compiler.doc.comment.support=enabled

 org.eclipse.jdt.core.compiler.maxProblemPerUnit=500

 org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning

-org.eclipse.jdt.core.compiler.problem.autoboxing=error

 org.eclipse.jdt.core.compiler.problem.deprecation=warning

 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled

 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled

 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning

 org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning

-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning

 org.eclipse.jdt.core.compiler.problem.fieldHiding=warning

 org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore

 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error

 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error

 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning

 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning

-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning

 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error

 org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore

 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled

@@ -46,12 +43,10 @@
 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private

 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning

 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error

-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error

+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning

 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore

-org.eclipse.jdt.core.compiler.problem.nullReference=warning

 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning

-org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning

-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error

+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning

 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled

 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error

 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning

diff --git a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs
index de845b2..c9a18d3 100644
--- a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:43:18 EDT 2006

-compilers.p.build=0

+#Fri May 27 23:56:32 EDT 2005

 compilers.p.deprecated=1

 compilers.p.illegal-att-value=0

 compilers.p.no-required-att=0

diff --git a/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
index 4f0831b..3984f31 100644
--- a/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
@@ -2,32 +2,30 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.dtd.core; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.wst.dtd.core.internal.DTDCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.dtd.core.internal;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.content;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.contentmodel;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.emf;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.emf.impl;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.emf.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.encoding;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.event;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.modelhandler;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.parser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.preferences;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.provisional.contenttype;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.provisional.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.provisional.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.saxparser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.tasks;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.tokenizer;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.validation;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.text,
+Export-Package: org.eclipse.wst.dtd.core.internal,
+ org.eclipse.wst.dtd.core.internal.content,
+ org.eclipse.wst.dtd.core.internal.contentmodel,
+ org.eclipse.wst.dtd.core.internal.document,
+ org.eclipse.wst.dtd.core.internal.emf,
+ org.eclipse.wst.dtd.core.internal.emf.impl,
+ org.eclipse.wst.dtd.core.internal.emf.util,
+ org.eclipse.wst.dtd.core.internal.encoding,
+ org.eclipse.wst.dtd.core.internal.event,
+ org.eclipse.wst.dtd.core.internal.modelhandler,
+ org.eclipse.wst.dtd.core.internal.parser,
+ org.eclipse.wst.dtd.core.internal.provisional.contenttype,
+ org.eclipse.wst.dtd.core.internal.provisional.document,
+ org.eclipse.wst.dtd.core.internal.provisional.text,
+ org.eclipse.wst.dtd.core.internal.saxparser,
+ org.eclipse.wst.dtd.core.internal.tasks,
+ org.eclipse.wst.dtd.core.internal.text,
+ org.eclipse.wst.dtd.core.internal.tokenizer,
+ org.eclipse.wst.dtd.core.internal.util,
+ org.eclipse.wst.dtd.core.internal.validation,
  rose
 Require-Bundle: org.eclipse.core.resources,
  org.eclipse.core.runtime,
@@ -37,6 +35,5 @@
  org.eclipse.wst.common.uriresolver,
  org.eclipse.wst.sse.core,
  org.eclipse.wst.xml.core,
- com.ibm.icu,
  org.eclipse.wst.validation
-Eclipse-LazyStart: true
+Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
index 0d200db..a825514 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
@@ -12,7 +12,7 @@
 package org.eclipse.wst.dtd.core.internal.emf.impl;
 
 import java.text.CharacterIterator;
-import com.ibm.icu.text.StringCharacterIterator;
+import java.text.StringCharacterIterator;
 
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.common.notify.NotificationChain;
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.properties b/bundles/org.eclipse.wst.dtd.core/plugin.properties
index 5b557d4..50405a6 100644
--- a/bundles/org.eclipse.wst.dtd.core/plugin.properties
+++ b/bundles/org.eclipse.wst.dtd.core/plugin.properties
@@ -13,7 +13,7 @@
 
 providerName=Eclipse.org
 pluginName=Structured Source DTD Core
+nlFeatureName=Structured Source DTD Core NL Support
 #
 Structured_DTD_Document_Factory_Extension.name=Structured DTD Document Factory Extension
-DTD_Content_Type_Extension_Element.name=DTD
-_DTD_VALIDATOR_NAME               = DTD Validator
+DTD_Content_Type_Extension_Element.name=DTD
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.xml b/bundles/org.eclipse.wst.dtd.core/plugin.xml
index 3fb0ea4..cc6c541 100644
--- a/bundles/org.eclipse.wst.dtd.core/plugin.xml
+++ b/bundles/org.eclipse.wst.dtd.core/plugin.xml
@@ -79,53 +79,4 @@
 		</factory>
 	</extension>
 
-	<!-- initialize dtd core preferences -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer
-			class="org.eclipse.wst.dtd.core.internal.preferences.DTDCorePreferenceInitializer" />
-	</extension>
-	
-	<!-- ====================================================== -->
-	<!-- Register the DTD validator with the validation 		-->
-	<!-- framework. 										    -->
-	<!-- ====================================================== -->
-	<extension
-		id="dtdDTDValidator"
-		name="%_DTD_VALIDATOR_NAME"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.dtd">
-			</filter>
-			<helper
-				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
-			</helper>
-			<run
-         async="true"
-         class="org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator"
-         enabled="true"
-         fullBuild="true"
-         incremental="true">
-			</run>
-		</validator>
-	</extension>
-
-	<!-- ====================================================== -->
-	<!-- DTD as you type validation								-->
-	<!-- ====================================================== -->
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="total"
-			class="org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator"
-			id="org.eclipse.wst.dtd.dtdsourcevalidator">
-			<contentTypeIdentifier
-				id="org.eclipse.wst.dtd.core.dtdsource">
-				<partitionType id="org.eclipse.wst.dtd.DEFAULT">
-				</partitionType>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
-	
 </plugin>
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java
index 288496e..a143120 100644
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java
+++ b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java
@@ -28,7 +28,6 @@
 	public static String Missing_required_files_2;
 	public static String Missing_required_files_3;
 	public static String Missing_required_files_4;
-	public static String MESSAGE_DTD_VALIDATION_MESSAGE_UI_;
 
 	static {
 		// load message values from bundle file
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties
index 511b713..1986a3c 100644
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties
+++ b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties
@@ -25,5 +25,3 @@
 Missing_required_files_2=Download Xerces 2.6.2 and place xercesImpl.jar and xmlParserAPIs.jar in a folder entitled jars in the org.eclipse.wst.xml.validation plugin.\n\n
 Missing_required_files_3=For more information see www.eclipse.org/webtools/wst/components/xml/xercesInfo.xml.
 Missing_required_files_4=Missing Xerces
-
-MESSAGE_DTD_VALIDATION_MESSAGE_UI_=DTD Validator validating {0}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidator.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidator.java
deleted file mode 100644
index c7f5b00..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidator.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.validation;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * DTD validation.
- */
-public class DTDValidator {
-	/**
-	 * An entity resolver that wraps a URI resolver.
-	 */
-	class DTDEntityResolver implements EntityResolver {
-		private String fBaseLocation = null;
-		private URIResolver fURIResolver = null;
-
-		/**
-		 * Constructor.
-		 * 
-		 * @param idresolver
-		 *            The idresolver this entity resolver wraps.
-		 * @param baselocation
-		 *            The base location to resolve with.
-		 */
-		public DTDEntityResolver(URIResolver uriresolver, String baselocation) {
-			this.fURIResolver = uriresolver;
-            
-            // TODO cs: we never seem to set a URIResolver
-            // I create one here up front just incase
-            //
-            if (fURIResolver == null)
-            {
-              fURIResolver = URIResolverPlugin.createResolver();              
-            }  
-			this.fBaseLocation = baselocation;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
-		 *      java.lang.String)
-		 */
-		public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
-			String location = null;
-            
-            
-			if (fBaseLocation.equals(systemId)) {
-				location = systemId;
-			}
-			else {
-				location = fURIResolver.resolve(fBaseLocation, publicId, systemId);
-			}
-			InputSource is = null;
-			if (location != null && !location.equals("")) //$NON-NLS-1$
-			{
-			  // CS : while working on bug 113537 I noticed we're not using the LazyURLInputStream
-		      // so fixed this to avoid leaking file handles
-			  //
-              String physical = fURIResolver.resolvePhysicalLocation(fBaseLocation, publicId, location); 
-			  is = new InputSource(location);
-			  is.setByteStream(new LazyURLInputStream(physical));
-			}
-			return is;
-		}
-	}
-
-	/**
-	 * An error handler for DTD validation.
-	 * 
-	 * @author Lawrence Mandel, IBM
-	 */
-	class DTDErrorHandler implements ErrorHandler {
-
-		private final int ERROR = 0;
-		private final ValidationInfo fValidationInfo;
-
-		private final int WARNING = 1;
-
-		/**
-		 * Constructor.
-		 * 
-		 * @param valinfo
-		 *            The validation info object to use to register validation
-		 *            messages.
-		 */
-		public DTDErrorHandler(ValidationInfo valinfo) {
-			this.fValidationInfo = valinfo;
-		}
-
-		/**
-		 * Add a validation message with the given severity.
-		 * 
-		 * @param exception
-		 *            The exception that contains the information about the
-		 *            message.
-		 * @param severity
-		 *            The severity of the validation message.
-		 */
-		protected void addValidationMessage(SAXParseException exception, int severity) {
-			if (exception.getSystemId() != null) {
-				if (severity == WARNING) {
-					fValidationInfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
-				}
-				else {
-					fValidationInfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
-				}
-			}
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
-		 */
-		public void error(SAXParseException exception) throws SAXException {
-			addValidationMessage(exception, ERROR);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
-		 */
-		public void fatalError(SAXParseException exception) throws SAXException {
-			addValidationMessage(exception, ERROR);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
-		 */
-		public void warning(SAXParseException exception) throws SAXException {
-			addValidationMessage(exception, WARNING);
-		}
-	}
-
-	class MultiHandler extends DefaultHandler implements org.xml.sax.DTDHandler, ContentHandler, LexicalHandler, DeclHandler {
-		private static final String ELEMENT_MODIFIERS = "*+?"; //$NON-NLS-1$
-
-		private static final String MODEL_DELIMITERS = ",()| "; //$NON-NLS-1$
-
-		private List fElemDecls = new ArrayList();
-
-		private Hashtable fElemRefs = new Hashtable();
-
-		private List fIgnoreElemModel = new ArrayList();
-
-		private List fIgnoreElemRefs = new ArrayList();
-
-		private Locator fLocator = null;
-
-		public MultiHandler() {
-			fIgnoreElemRefs.add("#PCDATA"); //$NON-NLS-1$
-			fIgnoreElemModel.add("ANY"); //$NON-NLS-1$
-			fIgnoreElemModel.add("EMPTY"); //$NON-NLS-1$
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.DeclHandler#attributeDecl(java.lang.String,
-		 *      java.lang.String, java.lang.String, java.lang.String,
-		 *      java.lang.String)
-		 */
-		public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
-		 */
-		public void comment(char[] arg0, int arg1, int arg2) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String,
-		 *      java.lang.String)
-		 */
-		public void elementDecl(String name, String model) throws SAXException {
-			// Add this element to the list of declared elements.
-			fElemDecls.add(name);
-
-			// Return if the element model should be ignored. The model should
-			// be
-			// ignored in such cases as when it is equal to EMPTY or ANY.
-			if (fIgnoreElemModel.contains(model)) {
-				return;
-			}
-			// Add each referenced element to the list of referenced elements
-			int line = fLocator.getLineNumber();
-			int column = fLocator.getColumnNumber();
-			String uri = fLocator.getSystemId();
-
-			StringTokenizer strtok = new StringTokenizer(model, MODEL_DELIMITERS);
-			while (strtok.hasMoreTokens()) {
-				String token = strtok.nextToken();
-				int tokenlength = token.length();
-				if (ELEMENT_MODIFIERS.indexOf(token.charAt(tokenlength - 1)) != -1) {
-					token = token.substring(0, tokenlength - 1);
-					// If the token is now empty (it was only ?,* or +) then
-					// continue.
-					if (token.length() == 0) {
-						continue;
-					}
-				}
-				if (fIgnoreElemRefs.contains(token)) {
-					continue;
-				}
-				ElementRefLocation elemLoc = (ElementRefLocation) fElemRefs.get(token);
-				ElementRefLocation tokenLoc = new ElementRefLocation(line, column, uri, elemLoc);
-				fElemRefs.put(token, tokenLoc);
-			}
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#endCDATA()
-		 */
-		public void endCDATA() throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#endDTD()
-		 */
-		public void endDTD() throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#endEntity(java.lang.String)
-		 */
-		public void endEntity(String arg0) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(java.lang.String,
-		 *      java.lang.String, java.lang.String)
-		 */
-		public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException {
-			// No method impl.
-		}
-
-		/**
-		 * Get the list of element declarations.
-		 * 
-		 * @return The list of element declarations.
-		 */
-		public List getElementDeclarations() {
-			return fElemDecls;
-		}
-
-		/**
-		 * Get the element references hashtable.
-		 * 
-		 * @return The element references hashtable.
-		 */
-		public Hashtable getElementReferences() {
-			return fElemRefs;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(java.lang.String,
-		 *      java.lang.String)
-		 */
-		public void internalEntityDecl(String name, String value) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
-		 */
-		public void setDocumentLocator(Locator locator) {
-			super.setDocumentLocator(locator);
-			this.fLocator = locator;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#startCDATA()
-		 */
-		public void startCDATA() throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String,
-		 *      java.lang.String, java.lang.String)
-		 */
-		public void startDTD(String name, String publicId, String systemId) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#startEntity(java.lang.String)
-		 */
-		public void startEntity(String name) throws SAXException {
-			// No method impl.
-		}
-	}
-
-	
-
-	private URIResolver fResolver = null;
-
-	public DTDValidator() {
-		super();
-	}
-
-	/**
-	 * Set the URI resolver to use with XSD validation.
-	 * 
-	 * @param uriresolver
-	 *            The URI resolver to use.
-	 */
-	public void setURIResolver(URIResolver uriresolver) {
-		this.fResolver = uriresolver;
-	}
-
-	/**
-	 * Validate the DTD file located at the URI.
-	 * 
-	 * @param uri
-	 *            The URI of the file to validate.
-	 * @return A validation report for the validation.
-	 */
-	public ValidationReport validate(String uri) {
-		ValidationInfo valinfo = new ValidationInfo(uri);
-		try {
-			SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
-			XMLReader reader = parser.getXMLReader();
-			MultiHandler dtdHandler = new MultiHandler();
-			reader.setProperty("http://xml.org/sax/properties/declaration-handler", dtdHandler); //$NON-NLS-1$
-			reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtdHandler); //$NON-NLS-1$
-			reader.setContentHandler(dtdHandler);
-			reader.setDTDHandler(dtdHandler);
-			reader.setErrorHandler(new DTDErrorHandler(valinfo));
-			reader.setEntityResolver(new DTDEntityResolver(fResolver, uri));
-			String document = "<!DOCTYPE root SYSTEM \"" + uri + "\"><root/>"; //$NON-NLS-1$ //$NON-NLS-2$
-
-			reader.parse(new InputSource(new StringReader(document)));
-
-			List elemDecls = dtdHandler.getElementDeclarations();
-			Hashtable elemRefs = dtdHandler.getElementReferences();
-			validateElementReferences(elemDecls, elemRefs, valinfo);
-		}
-		catch (ParserConfigurationException e) {
-
-		}
-		catch (IOException e) {
-
-		}
-		catch (SAXException e) {
-
-		}
-		return valinfo;
-	}
-
-	/**
-	 * Validate the element references in the DTD. An element reference is
-	 * <!ELEMENT elem (elementReference)>
-	 * 
-	 * @param elemDecls
-	 *            A list of valid element declarations.
-	 * @param elemRefs
-	 *            A hashtable containing element references as keys and
-	 *            locations in the document as values.
-	 * @param valinfo
-	 *            The validation info object to store validation information.
-	 */
-	private void validateElementReferences(List elemDecls, Hashtable elemRefs, ValidationInfo valinfo) {
-		Enumeration keys = elemRefs.keys();
-		while (keys.hasMoreElements()) {
-			String elemRef = (String) keys.nextElement();
-			// If the element hasn't been declared create an error.
-			if (!elemDecls.contains(elemRef)) {
-				ElementRefLocation elemLoc = (ElementRefLocation) elemRefs.get(elemRef);
-				do {
-					valinfo.addError(NLS.bind(DTDValidationMessages._ERROR_REF_ELEMENT_UNDEFINED, "'" + elemRef + "'"), elemLoc.getLine(), elemLoc.getColumn(), elemLoc.getURI()); //$NON-NLS-1$ //$NON-NLS-2$
-					elemLoc = elemLoc.getNext();
-				}
-				while (elemLoc != null);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/Validator.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/Validator.java
new file mode 100644
index 0000000..289b46c
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/Validator.java
@@ -0,0 +1,460 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.dtd.core.internal.validation;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
+import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * DTD validation.
+ * 
+ * @author Lawrence Mandel, IBM
+ */
+public class Validator {
+	/**
+	 * An entity resolver that wraps a URI resolver.
+	 * 
+	 * @author Lawrence Mandel, IBM
+	 */
+	class DTDEntityResolver implements EntityResolver {
+		private String fBaseLocation = null;
+		private URIResolver fURIResolver = null;
+
+		/**
+		 * Constructor.
+		 * 
+		 * @param idresolver
+		 *            The idresolver this entity resolver wraps.
+		 * @param baselocation
+		 *            The base location to resolve with.
+		 */
+		public DTDEntityResolver(URIResolver uriresolver, String baselocation) {
+			this.fURIResolver = uriresolver;
+            
+            // TODO cs: we never seem to set a URIResolver
+            // I create one here up front just incase
+            //
+            if (fURIResolver == null)
+            {
+              fURIResolver = URIResolverPlugin.createResolver();              
+            }  
+			this.fBaseLocation = baselocation;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
+		 *      java.lang.String)
+		 */
+		public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+			String location = null;
+            
+            
+			if (fBaseLocation.equals(systemId)) {
+				location = systemId;
+			}
+			else {
+				location = fURIResolver.resolve(fBaseLocation, publicId, systemId);
+			}
+			InputSource is = null;
+			if (location != null && !location.equals("")) //$NON-NLS-1$
+			{
+			  // CS : while working on bug 113537 I noticed we're not using the LazyURLInputStream
+		      // so fixed this to avoid leaking file handles
+			  //
+              String physical = fURIResolver.resolvePhysicalLocation(fBaseLocation, publicId, location); 
+			  is = new InputSource(location);
+			  is.setByteStream(new LazyURLInputStream(physical));
+			}
+			return is;
+		}
+	}
+
+	/**
+	 * An error handler for DTD validation.
+	 * 
+	 * @author Lawrence Mandel, IBM
+	 */
+	class DTDErrorHandler implements ErrorHandler {
+
+		private final int ERROR = 0;
+		private final ValidationInfo fValidationInfo;
+
+		private final int WARNING = 1;
+
+		/**
+		 * Constructor.
+		 * 
+		 * @param valinfo
+		 *            The validation info object to use to register validation
+		 *            messages.
+		 */
+		public DTDErrorHandler(ValidationInfo valinfo) {
+			this.fValidationInfo = valinfo;
+		}
+
+		/**
+		 * Add a validation message with the given severity.
+		 * 
+		 * @param exception
+		 *            The exception that contains the information about the
+		 *            message.
+		 * @param severity
+		 *            The severity of the validation message.
+		 */
+		protected void addValidationMessage(SAXParseException exception, int severity) {
+			if (exception.getSystemId() != null) {
+				if (severity == WARNING) {
+					fValidationInfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
+				}
+				else {
+					fValidationInfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
+				}
+			}
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
+		 */
+		public void error(SAXParseException exception) throws SAXException {
+			addValidationMessage(exception, ERROR);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
+		 */
+		public void fatalError(SAXParseException exception) throws SAXException {
+			addValidationMessage(exception, ERROR);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
+		 */
+		public void warning(SAXParseException exception) throws SAXException {
+			addValidationMessage(exception, WARNING);
+		}
+	}
+
+	class MultiHandler extends DefaultHandler implements org.xml.sax.DTDHandler, ContentHandler, LexicalHandler, DeclHandler {
+		private static final String ELEMENT_MODIFIERS = "*+?"; //$NON-NLS-1$
+
+		private static final String MODEL_DELIMITERS = ",()| "; //$NON-NLS-1$
+
+		private List fElemDecls = new ArrayList();
+
+		private Hashtable fElemRefs = new Hashtable();
+
+		private List fIgnoreElemModel = new ArrayList();
+
+		private List fIgnoreElemRefs = new ArrayList();
+
+		private Locator fLocator = null;
+
+		public MultiHandler() {
+			fIgnoreElemRefs.add("#PCDATA"); //$NON-NLS-1$
+			fIgnoreElemModel.add("ANY"); //$NON-NLS-1$
+			fIgnoreElemModel.add("EMPTY"); //$NON-NLS-1$
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.DeclHandler#attributeDecl(java.lang.String,
+		 *      java.lang.String, java.lang.String, java.lang.String,
+		 *      java.lang.String)
+		 */
+		public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException {
+			// No method impl.
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
+		 */
+		public void comment(char[] arg0, int arg1, int arg2) throws SAXException {
+			// No method impl.
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String,
+		 *      java.lang.String)
+		 */
+		public void elementDecl(String name, String model) throws SAXException {
+			// Add this element to the list of declared elements.
+			fElemDecls.add(name);
+
+			// Return if the element model should be ignored. The model should
+			// be
+			// ignored in such cases as when it is equal to EMPTY or ANY.
+			if (fIgnoreElemModel.contains(model)) {
+				return;
+			}
+			// Add each referenced element to the list of referenced elements
+			int line = fLocator.getLineNumber();
+			int column = fLocator.getColumnNumber();
+			String uri = fLocator.getSystemId();
+
+			StringTokenizer strtok = new StringTokenizer(model, MODEL_DELIMITERS);
+			while (strtok.hasMoreTokens()) {
+				String token = strtok.nextToken();
+				int tokenlength = token.length();
+				if (ELEMENT_MODIFIERS.indexOf(token.charAt(tokenlength - 1)) != -1) {
+					token = token.substring(0, tokenlength - 1);
+					// If the token is now empty (it was only ?,* or +) then
+					// continue.
+					if (token.length() == 0) {
+						continue;
+					}
+				}
+				if (fIgnoreElemRefs.contains(token)) {
+					continue;
+				}
+				ElementRefLocation elemLoc = (ElementRefLocation) fElemRefs.get(token);
+				ElementRefLocation tokenLoc = new ElementRefLocation(line, column, uri, elemLoc);
+				fElemRefs.put(token, tokenLoc);
+			}
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.LexicalHandler#endCDATA()
+		 */
+		public void endCDATA() throws SAXException {
+			// No method impl.
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.LexicalHandler#endDTD()
+		 */
+		public void endDTD() throws SAXException {
+			// No method impl.
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.LexicalHandler#endEntity(java.lang.String)
+		 */
+		public void endEntity(String arg0) throws SAXException {
+			// No method impl.
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(java.lang.String,
+		 *      java.lang.String, java.lang.String)
+		 */
+		public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException {
+			// No method impl.
+		}
+
+		/**
+		 * Get the list of element declarations.
+		 * 
+		 * @return The list of element declarations.
+		 */
+		public List getElementDeclarations() {
+			return fElemDecls;
+		}
+
+		/**
+		 * Get the element references hashtable.
+		 * 
+		 * @return The element references hashtable.
+		 */
+		public Hashtable getElementReferences() {
+			return fElemRefs;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(java.lang.String,
+		 *      java.lang.String)
+		 */
+		public void internalEntityDecl(String name, String value) throws SAXException {
+			// No method impl.
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
+		 */
+		public void setDocumentLocator(Locator locator) {
+			super.setDocumentLocator(locator);
+			this.fLocator = locator;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.LexicalHandler#startCDATA()
+		 */
+		public void startCDATA() throws SAXException {
+			// No method impl.
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String,
+		 *      java.lang.String, java.lang.String)
+		 */
+		public void startDTD(String name, String publicId, String systemId) throws SAXException {
+			// No method impl.
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.xml.sax.ext.LexicalHandler#startEntity(java.lang.String)
+		 */
+		public void startEntity(String name) throws SAXException {
+			// No method impl.
+		}
+	}
+
+	private static Validator _instance = null;
+
+	public static Validator getInstance() {
+		if (_instance == null) {
+			_instance = new Validator();
+		}
+		return _instance;
+	}
+
+	private URIResolver fResolver = null;
+
+	private Validator() {
+		super();
+	}
+
+	/**
+	 * Set the URI resolver to use with XSD validation.
+	 * 
+	 * @param uriresolver
+	 *            The URI resolver to use.
+	 */
+	public void setURIResolver(URIResolver uriresolver) {
+		this.fResolver = uriresolver;
+	}
+
+	/**
+	 * Validate the DTD file located at the URI.
+	 * 
+	 * @param uri
+	 *            The URI of the file to validate.
+	 * @return A validation report for the validation.
+	 */
+	public ValidationReport validate(String uri) {
+		ValidationInfo valinfo = new ValidationInfo(uri);
+		try {
+			SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+			XMLReader reader = parser.getXMLReader();
+			MultiHandler dtdHandler = new MultiHandler();
+			reader.setProperty("http://xml.org/sax/properties/declaration-handler", dtdHandler); //$NON-NLS-1$
+			reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtdHandler); //$NON-NLS-1$
+			reader.setContentHandler(dtdHandler);
+			reader.setDTDHandler(dtdHandler);
+			reader.setErrorHandler(new DTDErrorHandler(valinfo));
+			reader.setEntityResolver(new DTDEntityResolver(fResolver, uri));
+			String document = "<!DOCTYPE root SYSTEM \"" + uri + "\"><root/>"; //$NON-NLS-1$ //$NON-NLS-2$
+
+			reader.parse(new InputSource(new StringReader(document)));
+
+			List elemDecls = dtdHandler.getElementDeclarations();
+			Hashtable elemRefs = dtdHandler.getElementReferences();
+			validateElementReferences(elemDecls, elemRefs, valinfo);
+		}
+		catch (ParserConfigurationException e) {
+
+		}
+		catch (IOException e) {
+
+		}
+		catch (SAXException e) {
+
+		}
+		return valinfo;
+	}
+
+	/**
+	 * Validate the element references in the DTD. An element reference is
+	 * <!ELEMENT elem (elementReference)>
+	 * 
+	 * @param elemDecls
+	 *            A list of valid element declarations.
+	 * @param elemRefs
+	 *            A hashtable containing element references as keys and
+	 *            locations in the document as values.
+	 * @param valinfo
+	 *            The validation info object to store validation information.
+	 */
+	private void validateElementReferences(List elemDecls, Hashtable elemRefs, ValidationInfo valinfo) {
+		Enumeration keys = elemRefs.keys();
+		while (keys.hasMoreElements()) {
+			String elemRef = (String) keys.nextElement();
+			// If the element hasn't been declared create an error.
+			if (!elemDecls.contains(elemRef)) {
+				ElementRefLocation elemLoc = (ElementRefLocation) elemRefs.get(elemRef);
+				do {
+					valinfo.addError(NLS.bind(DTDValidationMessages._ERROR_REF_ELEMENT_UNDEFINED, "'" + elemRef + "'"), elemLoc.getLine(), elemLoc.getColumn(), elemLoc.getURI()); //$NON-NLS-1$ //$NON-NLS-2$
+					elemLoc = elemLoc.getNext();
+				}
+				while (elemLoc != null);
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/DTDValidator.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/DTDValidator.java
deleted file mode 100644
index 9c44a64..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/DTDValidator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.validation.eclipse;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-
-/**
- * An DTD validator specific to Eclipse. This validator will wrap the internal
- * DTD validator to provide automatic URI resolution support.
- * Using this class is equivalent to using the internal DTD validator and registering
- * the URI resolver from the URI resolution framework.
- */
-public class DTDValidator extends
-		org.eclipse.wst.dtd.core.internal.validation.DTDValidator 
-{
-  private static DTDValidator _instance = null;
-  
-  /**
-   * Constructor. Registers URI resolution framework with the DTD validator.
-   */
-  protected DTDValidator()
-  {
-	super();
-	setURIResolver(URIResolverPlugin.createResolver());
-  }
-
-  /**
-   * Get the one and only instance of the Eclipse specific DTD validator.
-   * 
-   * @return
-   * 		The one and only instance of the Eclipse specific DTD validator.
-   */
-  public static DTDValidator getInstance() 
-  {
-	if (_instance == null) 
-	{
-	  _instance = new DTDValidator();
-	}
-	return _instance;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/Validator.java
deleted file mode 100644
index 8997b4c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/Validator.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.validation.eclipse;
-
-import java.io.InputStream;
-
-import org.eclipse.wst.dtd.core.internal.validation.DTDValidationMessages;
-import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-/**
- * DTD validator that is contributed to the validation framework.
- */
-public class Validator extends AbstractNestedValidator 
-{
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#getValidatorName()
-   */
-  protected String getValidatorName() 
-  {
-	return DTDValidationMessages.MESSAGE_DTD_VALIDATION_MESSAGE_UI_;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
-   */
-  public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context) 
-  {
-	DTDValidator validator = DTDValidator.getInstance();
-
-	ValidationReport valreport = null;
-	valreport = validator.validate(uri);
-	
-	return valreport;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceInitializer.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceInitializer.java
deleted file mode 100644
index c3fb65a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceInitializer.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.wst.dtd.core.internal.DTDCorePlugin;
-
-/**
- * Sets default values for DTD Core preferences
- */
-public class DTDCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		IEclipsePreferences node = new DefaultScope().getNode(DTDCorePlugin.getInstance().getBundle().getSymbolicName());
-
-		// this could be made smarter by actually looking up the content
-		// type's valid extensions
-		node.put(DTDCorePreferenceNames.DEFAULT_EXTENSION, "dtd"); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceNames.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceNames.java
deleted file mode 100644
index d348e0f..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceNames.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.preferences;
-
-/**
- * Common preference keys used by DTD core
- * 
- * @plannedfor 1.0
- */
-public class DTDCorePreferenceNames {
-	private DTDCorePreferenceNames() {
-		// empty private constructor so users cannot instantiate class
-	}
-
-	/**
-	 * The default extension to use when none is specified in the New File
-	 * Wizard.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java
index d36d342..1de8119 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java
@@ -16,7 +16,7 @@
  * It defines the partition types DTD.
  * Clients should reference the partition type Strings defined here directly.
  * 
- * @deprecated use org.eclipse.wst.dtd.core.text.IDTDPartitions
+ * @plannedfor 1.0
  */
 public interface IDTDPartitionTypes {
 	
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
index e793422..0dadbc9 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
@@ -12,9 +12,9 @@
  *******************************************************************************/
 package org.eclipse.wst.dtd.core.internal.text;
 
-import org.eclipse.wst.dtd.core.text.IDTDPartitions;
+import org.eclipse.wst.dtd.core.internal.provisional.text.IDTDPartitionTypes;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 
 public class StructuredTextPartitionerForDTD extends StructuredTextPartitioner {
 
@@ -28,7 +28,7 @@
 	 * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#getDefault()
 	 */
 	public String getDefaultPartitionType() {
-		return IDTDPartitions.DTD_DEFAULT;
+		return IDTDPartitionTypes.DTD_DEFAULT;
 	}
 
 	/*
@@ -37,6 +37,6 @@
 	 * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#initLegalContentTypes()
 	 */
 	protected void initLegalContentTypes() {
-		fSupportedTypes = new String[]{IDTDPartitions.DTD_DEFAULT, IStructuredPartitions.UNKNOWN_PARTITION};
+		fSupportedTypes = new String[]{IDTDPartitionTypes.DTD_DEFAULT, IStructuredPartitionTypes.UNKNOWN_PARTITION};
 	}
 }
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java
deleted file mode 100644
index a790f38..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.text;
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types DTD.
- * Clients should reference the partition type Strings defined here directly.
- * 
- * @since 1.1
- */
-public interface IDTDPartitions {
-	
-	String DTD_DEFAULT = "org.eclipse.wst.dtd.DEFAULT"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/.classpath b/bundles/org.eclipse.wst.dtd.ui/.classpath
index 118cbcb..ed58bc2 100644
--- a/bundles/org.eclipse.wst.dtd.ui/.classpath
+++ b/bundles/org.eclipse.wst.dtd.ui/.classpath
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-properties"/>
+	<classpathentry kind="src" path="src-validation"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4c4b425..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:37:58 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs
index a069ff0..416293a 100644
--- a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Tue Apr 04 03:19:49 EDT 2006
+#Sat Oct 01 04:04:48 EDT 2005
 eclipse.preferences.version=1
 org.eclipse.jdt.core.builder.cleanOutputFolder=clean
 org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -17,20 +17,17 @@
 org.eclipse.jdt.core.compiler.doc.comment.support=enabled
 org.eclipse.jdt.core.compiler.maxProblemPerUnit=500
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=error
 org.eclipse.jdt.core.compiler.problem.deprecation=warning
 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
 org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
 org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
 org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
@@ -46,12 +43,10 @@
 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
diff --git a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs
index 7b9c0f7..42fb716 100644
--- a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:43:22 EDT 2006
-compilers.p.build=0
+#Fri May 27 23:56:32 EDT 2005
 compilers.p.deprecated=1
 compilers.p.illegal-att-value=0
 compilers.p.no-required-att=0
diff --git a/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
index a88465f..3dc3da7 100644
--- a/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
@@ -2,24 +2,24 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.dtd.ui; singleton:=true
-Bundle-Version: 1.0.100.qualifier
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.wst.dtd.ui.internal.DTDUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.wst.dtd.ui,
- org.eclipse.wst.dtd.ui.internal;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.dnd;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.projection;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.properties.section;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.registry;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.style;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.templates;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.text;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.views.properties;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.wizard;x-internal:=true,
+ org.eclipse.wst.dtd.ui.internal,
+ org.eclipse.wst.dtd.ui.internal.dnd,
+ org.eclipse.wst.dtd.ui.internal.editor,
+ org.eclipse.wst.dtd.ui.internal.preferences,
+ org.eclipse.wst.dtd.ui.internal.projection,
+ org.eclipse.wst.dtd.ui.internal.registry,
+ org.eclipse.wst.dtd.ui.internal.style,
+ org.eclipse.wst.dtd.ui.internal.templates,
+ org.eclipse.wst.dtd.ui.internal.text,
+ org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions,
+ org.eclipse.wst.dtd.ui.internal.views.properties,
+ org.eclipse.wst.dtd.ui.internal.wizard,
+ org.eclipse.wst.dtd.ui.internal.validation,
  org.eclipse.wst.dtd.ui.views.contentoutline
 Require-Bundle: org.eclipse.core.resources,
  org.eclipse.core.runtime,
@@ -36,8 +36,5 @@
  org.eclipse.wst.sse.ui,
  org.eclipse.wst.xml.core,
  org.eclipse.wst.validation,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.common.ui.properties,
- org.eclipse.wst.common.ui,
- org.eclipse.wst.common.uriresolver
-Eclipse-LazyStart: true
+ org.eclipse.wst.xml.ui
+Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.dtd.ui/build.properties b/bundles/org.eclipse.wst.dtd.ui/build.properties
index ed00719..387f23d 100644
--- a/bundles/org.eclipse.wst.dtd.ui/build.properties
+++ b/bundles/org.eclipse.wst.dtd.ui/build.properties
@@ -21,5 +21,5 @@
                @dot/**,\
                temp.folder/**
 source.. = src/,\
-           src-properties/
+           src-validation/
 src.includes = build.properties
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif b/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif
deleted file mode 100644
index 64ee536..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/browsebutton.gif b/bundles/org.eclipse.wst.dtd.ui/icons/browsebutton.gif
deleted file mode 100644
index 13dae59..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/generate_xml.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/generate_xml.gif
deleted file mode 100644
index 0fd5dd8..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/generate_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.properties b/bundles/org.eclipse.wst.dtd.ui/plugin.properties
index 85c6a26..afc1c30 100644
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.dtd.ui/plugin.properties
@@ -15,6 +15,7 @@
 
 providerName=Eclipse.org
 pluginName=SSE DTD Source Editor
+nlFeatureName=SSE DTD Source Editor NL Support
 
 DTD_Source_Page_Editor.name=DTD Editor
 _UI_LABEL_DTD_FILES=DTD Files
@@ -30,9 +31,6 @@
 SelectRuler.label=Select Ruler
 
 _UI_MENU_VALIDATE_DTD               = &Validate DTD File
+_UI_XML_DTD_VALIDATOR                = DTD Validator
 
 DTD_New_context_type_Extension_Element.name=New DTD
-_UI_LABEL_GENERAL=General
-_UI_LABEL_OTHER=Other
-_UI_LABEL_ATTRIBUTES=Attributes
-_UI_LABEL_DOCUMENTATION=Documentation
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.xml b/bundles/org.eclipse.wst.dtd.ui/plugin.xml
index 1d64f00..e1ff99f 100644
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.dtd.ui/plugin.xml
@@ -3,12 +3,11 @@
 <plugin>
 
 	<extension point="org.eclipse.ui.editors">
-		<!-- class="org.eclipse.wst.sse.ui.StructuredTextEditor" -->
 		<editor
 			name="%DTD_Source_Page_Editor.name"
-			icon="$nl$/icons/full/obj16/DTDFile.gif"
+			icon="icons/full/obj16/DTDFile.gif"
 			contributorClass="org.eclipse.wst.dtd.ui.internal.editor.ActionContributorDTD"
-			class="org.eclipse.wst.dtd.ui.internal.DTDEditor"
+			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
 			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
 			id="org.eclipse.wst.dtd.core.dtdsource.source">
 			<contentTypeBinding
@@ -117,7 +116,7 @@
 			name="%_UI_WIZARD_NEW_DTD"
 			class="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"
 			category="org.eclipse.wst.XMLCategory"
-			icon="$nl$/icons/full/etool16/newdtd_wiz.gif">
+			icon="icons/full/etool16/newdtd_wiz.gif">
 			<description>%_UI_CREATE_NEW_DTD_FILE</description>
 			<selection class="org.eclipse.core.resources.IResource" />
 		</wizard>
@@ -152,6 +151,62 @@
 		</viewerContribution>
 	</extension>
 
+	<!-- ====================================================== -->
+	<!-- Define Assign Validate action on .dtd file             -->
+	<!-- ====================================================== -->
+	<extension point="org.eclipse.ui.popupMenus">
+		<objectContribution
+			objectClass="org.eclipse.core.resources.IFile"
+			nameFilter="*.dtd"
+			id="org.eclipse.wst.dtd.validation.dtdaction">
+			<action
+				label="%_UI_MENU_VALIDATE_DTD"
+				class="org.eclipse.wst.dtd.ui.internal.validation.ValidateDTDActionDelegate"
+				enablesFor="1"
+				id="org.eclipse.wst.dtd.ui.internal.validation.ValidateDTDActionDelegate">
+			</action>
+		</objectContribution>
+	</extension>
+
+	<!-- ====================================================== -->
+	<!-- Register the DTD validator with the validation 		-->
+	<!-- framework. 										    -->
+	<!-- ====================================================== -->
+	<extension
+		id="dtdDTDValidator"
+		name="%_UI_XML_DTD_VALIDATOR"
+		point="org.eclipse.wst.validation.validator">
+		<validator>
+			<filter
+				objectClass="org.eclipse.core.resources.IFile"
+				caseSensitive="false"
+				nameFilter="*.dtd">
+			</filter>
+			<helper
+				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
+			</helper>
+			<run
+				class="org.eclipse.wst.dtd.ui.internal.validation.DTDValidator">
+			</run>
+		</validator>
+	</extension>
+
+	<!-- ====================================================== -->
+	<!-- DTD as you type validation								-->
+	<!-- ====================================================== -->
+	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+		<validator
+			scope="total"
+			class="org.eclipse.wst.dtd.ui.internal.validation.DTDValidator"
+			id="org.eclipse.wst.dtd.dtdsourcevalidator">
+			<contentTypeIdentifier
+				id="org.eclipse.wst.dtd.core.dtdsource">
+				<partitionType id="org.eclipse.wst.dtd.DEFAULT">
+				</partitionType>
+			</contentTypeIdentifier>
+		</validator>
+	</extension>
+
 	<!-- Templates -->
 	<extension point="org.eclipse.ui.editors.templates">
 		<contextType
@@ -161,52 +216,4 @@
 		</contextType>
 	</extension>
 
-   <extension
-         point="org.eclipse.wst.common.ui.properties.propertyContributor">
-      <propertyContributor
-            contributorId="org.eclipse.wst.dtd.core.dtdsource.source"
-            sectionDescriptorProvider="org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionDescriptorProvider"
-            labelProvider="org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionLabelProvider">
-         <propertyCategory
-               category="general">
-         </propertyCategory>
-         <propertyCategory
-               category="other">
-         </propertyCategory>
-         <propertyCategory
-               category="attributes">
-         </propertyCategory>
-         <propertyCategory
-               category="documentation">
-         </propertyCategory>
-      </propertyContributor>
-   </extension>
-   
-   <extension
-         point="org.eclipse.wst.common.ui.properties.propertyTabs">
-      <propertyTabs
-            contributorId="org.eclipse.wst.dtd.core.dtdsource.source">
-         <propertyTab
-               label="%_UI_LABEL_GENERAL"
-               category="general"
-               id="org.eclipse.wst.dtd.ui.internal.general">
-         </propertyTab>
-         <propertyTab
-               label="%_UI_LABEL_OTHER"
-               category="other"
-               id="org.eclipse.wst.dtd.ui.internal.other">
-         </propertyTab>
-         <propertyTab
-               label="%_UI_LABEL_ATTRIBUTES"
-               category="attributes"
-               id="org.eclipse.wst.dtd.ui.internal.attributes">
-         </propertyTab>
-         <propertyTab
-               label="%_UI_LABEL_DOCUMENTATION"
-               category="documentation"
-               id="org.eclipse.wst.dtd.ui.internal.documentation">
-         </propertyTab>
-      </propertyTabs>
-   </extension>   
-
 </plugin>
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java
deleted file mode 100644
index 27aa8ec..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-/**
- * A DTD Editor subclass StructuredTextEditor, required to supply a complete
- * replacement for the property sheet page. When a better solution is found,
- * this class will be removed.
- */
-public class DTDEditor extends StructuredTextEditor {
-	private class DTDPropertySheetPageContributor implements ITabbedPropertySheetPageContributor {
-		/**
-		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor#getContributorId()
-		 */
-		public String getContributorId() {
-			return getEditorSite().getId();
-		}
-
-		/**
-		 * @return String[]
-		 */
-		public String[] getPropertyCategories() {
-			return new String[]{"general", "other", "attributes", "documentation"};
-		}
-
-	}
-
-	TabbedPropertySheetPage fPropertySheetPage;
-
-	public DTDEditor() {
-		super();
-	}
-
-	/*
-	 * @see IAdaptable#getAdapter(Class)
-	 */
-	public Object getAdapter(Class required) {
-		if (IPropertySheetPage.class.equals(required)) {
-			if (fPropertySheetPage == null) {
-				fPropertySheetPage = new TabbedPropertySheetPage(new DTDPropertySheetPageContributor());
-			}
-			return fPropertySheetPage;
-		}
-		return super.getAdapter(required);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
-	 *      org.eclipse.ui.IEditorInput)
-	 */
-	public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
-		super.init(site, editorInput);
-
-		IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		IWorkbenchPage page = dw.getActivePage();
-		try {
-			if (page != null) {
-				page.showView(IPageLayout.ID_PROP_SHEET);
-			}
-		}
-		catch (PartInitException e) {
-			Logger.logException(e);
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java
deleted file mode 100644
index 5ee6cbd..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-public class DTDPropertiesMessages extends NLS {
-
-	private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages"; //$NON-NLS-1$
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceSection.java
-	public static String _UI_ONCE;
-	public static String _UI_ONE_OR_MORE;
-	public static String _UI_OPTIONAL;
-	public static String _UI_ZERO_OR_MORE;
-	public static String _UI_LABEL_OCCURRENCE;
-	// org.eclipse.wst.dtd.ui.internal.properties.section.AttribueDefaultSection.java
-	public static String _UI_DEFAULT;
-	public static String _UI_LABEL_USAGE;
-	public static String _UI_LABEL_DEFAULT_VALUE;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelGroupSection.java
-	public static String _UI_SEQUENCE;
-	public static String _UI_CHOICE;
-	public static String _UI_LABEL_MODEL_GROUP;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameSection.java
-	public static String _UI_LABEL_CONTENT_MODEL;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelTypeSection.java
-	public static String _UI_LABEL_CONTENT_TYPE;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.NameSection.java
-	public static String _UI_LABEL_NAME;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.TypeSection.java
-	public static String _UI_LABEL_TYPE;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.EntityTypeSection.java
-	public static String _UI_LABEL_ENTITY_TYPE;
-	public static String _UI_LABEL_EXTERNAL_ENTITY;
-	public static String _UI_LABEL_PARAMETER_ENTITY;
-	public static String _UI_LABEL_GENERAL_ENTITY;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.EntityValueSection.java
-	public static String _UI_LABEL_ENTITY_VALUE;
-	public static String _UI_LABEL_PUBLIC_ID;
-	public static String _UI_LABEL_SYSTEM_ID;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionLabelProvider
-	public static String _UI_PROPERTIES_VIEW_TITLE_ELEMENT;
-	public static String _UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF;
-	public static String _UI_PROPERTIES_VIEW_TITLE_CHOICE;
-	public static String _UI_PROPERTIES_VIEW_TITLE_SEQUENCE;
-	public static String _UI_PROPERTIES_VIEW_TITLE_ATTRIBUTE;
-	public static String _UI_PROPERTIES_VIEW_TITLE_ATTLIST;
-	public static String _UI_PROPERTIES_VIEW_TITLE_COMMENT;
-	public static String _UI_PROPERTIES_VIEW_TITLE_ENTITY;
-	public static String _UI_PROPERTIES_VIEW_TITLE_NOTATION;
-
-	// org.eclipse.wst.dtd.ui.internal.properties.section.NewEntitySection
-	public static String _UI_FILEDIALOG_SELECT_DTD;
-	public static String _UI_FILEDIALOG_SELECT_DTD_DESC;
-
-	// New property tabs
-	public static String _UI_LABEL_GENERAL;
-	public static String _UI_LABEL_OTHER;
-	public static String _UI_LABEL_ATTRIBUTES;
-	public static String _UI_LABEL_DOCUMENTATION;
-
-	private static ResourceBundle fResourceBundle;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, DTDPropertiesMessages.class);
-	}
-
-	public static ResourceBundle getResourceBundle() {
-		try {
-			if (fResourceBundle == null)
-				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
-		}
-		catch (MissingResourceException x) {
-			fResourceBundle = null;
-		}
-		return fResourceBundle;
-	}
-
-	private DTDPropertiesMessages() {
-		super();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties
deleted file mode 100644
index 5f8cd7e..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties
+++ /dev/null
@@ -1,64 +0,0 @@
-! Properties file for component: XML tools DTD Editor
-! Packaged for translation in:  xml.zip
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceSection.java
-_UI_ONCE             = Just once (1)
-_UI_ONE_OR_MORE      = One or more (+)
-_UI_OPTIONAL         = Optional (?)
-_UI_ZERO_OR_MORE     = Zero or more (*)
-_UI_LABEL_OCCURRENCE = Occurrence
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.AttributeDefaultSection.java
-_UI_DEFAULT             = Default
-_UI_LABEL_USAGE         = Usage
-_UI_LABEL_DEFAULT_VALUE = Default Value
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelGroupSection.java
-_UI_SEQUENCE          = Sequence (,)
-_UI_CHOICE            = Choice (|)
-_UI_LABEL_MODEL_GROUP = Model Group
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameSection.java
-_UI_LABEL_CONTENT_MODEL = Content Model
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelTypeSection.java
-_UI_LABEL_CONTENT_TYPE = Content Type
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.NameSection.java
-_UI_LABEL_NAME = Name
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.TypeSection.java
-_UI_LABEL_TYPE = Type
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.EntityTypeSection.java
-_UI_LABEL_ENTITY_TYPE      = Entity Type
-_UI_LABEL_EXTERNAL_ENTITY  = External
-_UI_LABEL_PARAMETER_ENTITY = Parameter
-_UI_LABEL_GENERAL_ENTITY   = General
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.EntityValueSection.java
-_UI_LABEL_ENTITY_VALUE = Entity Value
-_UI_LABEL_PUBLIC_ID    = Public ID
-_UI_LABEL_SYSTEM_ID    = System ID
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionLabelProvider
-_UI_PROPERTIES_VIEW_TITLE_ELEMENT     = element
-_UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF = element reference
-_UI_PROPERTIES_VIEW_TITLE_CHOICE      = choice
-_UI_PROPERTIES_VIEW_TITLE_SEQUENCE    = sequence
-_UI_PROPERTIES_VIEW_TITLE_ATTRIBUTE   = attribute
-_UI_PROPERTIES_VIEW_TITLE_ATTLIST     = attribute list
-_UI_PROPERTIES_VIEW_TITLE_COMMENT     = comment
-_UI_PROPERTIES_VIEW_TITLE_ENTITY      = entity
-_UI_PROPERTIES_VIEW_TITLE_NOTATION    = notation
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.NewEntitySection
-_UI_FILEDIALOG_SELECT_DTD = Select DTD file
-_UI_FILEDIALOG_SELECT_DTD_DESC   = Select a DTD file from the Workbench projects
-
-! New property tabs
-_UI_LABEL_GENERAL       = General
-_UI_LABEL_OTHER         = Other
-_UI_LABEL_ATTRIBUTES    = Attributes
-_UI_LABEL_DOCUMENTATION = Documentation
-! end
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java
deleted file mode 100644
index 251c35a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.w3c.dom.Element;
-
-public class AbstractSection implements ISection, IPropertyChangeListener, Listener, SelectionListener {
-	private TabbedPropertySheetWidgetFactory factory;
-	protected IWorkbenchPart fWorkbenchPart;
-	protected ISelection fSelection;
-	protected Object fInput;
-	protected int rightMarginSpace;
-
-	public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
-		createControls(parent, tabbedPropertySheetPage.getWidgetFactory());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory aFactory) {
-		this.factory = aFactory;
-		GC gc = new GC(parent);
-		Point extent = gc.textExtent("  ...  ");
-		rightMarginSpace = extent.x;
-		gc.dispose();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#setInput(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public void setInput(IWorkbenchPart part, ISelection sel) {
-		Assert.isTrue(sel instanceof IStructuredSelection, "selection " + sel.getClass() + "is not structured");
-		this.fWorkbenchPart = part;
-		this.fSelection = sel;
-		this.fInput = ((IStructuredSelection) fSelection).getFirstElement();
-		/*
-		 * if (fInput instanceof XSDConcreteComponent) { xsdSchema =
-		 * ((XSDConcreteComponent)fInput).getSchema(); }
-		 */
-
-		// refresh();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeShown()
-	 */
-	public void aboutToBeShown() {
-		refresh();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeHidden()
-	 */
-	public void aboutToBeHidden() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#dispose()
-	 */
-	public void dispose() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#getMinimumHeight()
-	 */
-	public int getMinimumHeight() {
-		return SWT.DEFAULT;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	 */
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#refresh()
-	 */
-	public void refresh() {
-		// TODO Auto-generated method stub
-	}
-
-	public Object getInput() {
-		if (fInput instanceof Element) {
-			// fInput = xsdSchema.getCorrespondingComponent((Element)fInput);
-		}
-		return fInput;
-	}
-
-	/**
-	 * Get the widget factory.
-	 * 
-	 * @return the widget factory.
-	 */
-	public TabbedPropertySheetWidgetFactory getWidgetFactory() {
-		return factory;
-	}
-
-	public void propertyChange(PropertyChangeEvent event) {
-		refresh();
-	}
-
-	public void doWidgetDefaultSelected(SelectionEvent e) {
-	}
-
-	public void doWidgetSelected(SelectionEvent e) {
-	}
-
-	/**
-	 * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
-	 */
-	public void widgetDefaultSelected(SelectionEvent e) {
-		if (isListenerEnabled() && getInput() != null && !isInDoHandle) {
-			isInDoHandle = true;
-			doWidgetDefaultSelected(e);
-			isInDoHandle = false;
-		}
-
-	}
-
-	/**
-	 * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-	 */
-	public void widgetSelected(SelectionEvent e) {
-		if (isListenerEnabled() && getInput() != null && !isInDoHandle) {
-			isInDoHandle = true;
-			doWidgetSelected(e);
-			isInDoHandle = false;
-		}
-
-	}
-
-	boolean listenerEnabled = true;
-
-	/**
-	 * Get the value of listenerEnabled.
-	 * 
-	 * @return value of listenerEnabled.
-	 */
-	public boolean isListenerEnabled() {
-		return listenerEnabled;
-	}
-
-	/**
-	 * Set the value of listenerEnabled.
-	 * 
-	 * @param v
-	 *            Value to assign to listenerEnabled.
-	 */
-	public void setListenerEnabled(boolean v) {
-		this.listenerEnabled = v;
-	}
-
-	public void handleEvent(Event event) {
-		if (isListenerEnabled() && !isInDoHandle) {
-			isInDoHandle = true;
-			startDelayedEvent(event);
-			isInDoHandle = false;
-		} // end of if ()
-	}
-
-	public void doHandleEvent(Event event) {
-
-	}
-
-	protected DelayedEvent delayedTask;
-
-	protected void startDelayedEvent(Event e) {
-		if (delayedTask == null || delayedTask.getEvent() == null) {
-			delayedTask = new DelayedEvent();
-			delayedTask.setEvent(e);
-			Display.getDefault().timerExec(500, delayedTask);
-		}
-		else {
-			Event delayedEvent = delayedTask.getEvent();
-
-			if (e.widget == delayedEvent.widget && e.type == delayedEvent.type) {
-				// same event, just different data, delay new event
-				delayedTask.setEvent(null);
-			}
-			delayedTask = new DelayedEvent();
-			delayedTask.setEvent(e);
-			Display.getDefault().timerExec(500, delayedTask);
-		}
-	}
-
-	class DelayedEvent implements Runnable {
-		protected Event event;
-
-		/*
-		 * @see Runnable#run()
-		 */
-		public void run() {
-			if (event != null) {
-				isInDoHandle = true;
-				doHandleEvent(event);
-				isInDoHandle = false;
-				event = null;
-			}
-		}
-
-		/**
-		 * Gets the event.
-		 * 
-		 * @return Returns a Event
-		 */
-		public Event getEvent() {
-			return event;
-		}
-
-		/**
-		 * Sets the event.
-		 * 
-		 * @param event
-		 *            The event to set
-		 */
-		public void setEvent(Event e) {
-			this.event = e;
-		}
-
-	}
-
-	boolean isInDoHandle;
-
-	/**
-	 * Get the value of isInDoHandle.
-	 * 
-	 * @return value of isInDoHandle.
-	 */
-	public boolean isInDoHandle() {
-		return isInDoHandle;
-	}
-
-	static protected IEditorPart getActiveEditor() {
-		IWorkbench workbench = DTDUIPlugin.getDefault().getWorkbench();
-		IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-		IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-
-		return editorPart;
-	}
-
-	static protected IStatusLineManager getStatusLineManager(IEditorPart editorPart) {
-		IStatusLineManager result = null;
-		try {
-			EditorActionBarContributor contributor = (EditorActionBarContributor) editorPart.getEditorSite().getActionBarContributor();
-			result = contributor.getActionBars().getStatusLineManager();
-		}
-		catch (Exception e) {
-		}
-		return result;
-	}
-
-	DocumentImpl getDocument(Element element) {
-		return (DocumentImpl) element.getOwnerDocument();
-	}
-
-	public void beginRecording(String description, Element element) {
-		DocumentImpl doc = getDocument(element);
-		doc.getModel().beginRecording(this, description);
-	}
-
-	public void endRecording(Element element) {
-		DocumentImpl doc = getDocument(element);
-
-		doc.getModel().endRecording(this);
-	}
-
-	protected boolean validateName(String name) {
-		return true;
-	}
-
-	protected boolean validateLanguage(String lang) {
-		return true;
-	}
-
-	protected boolean validatePrefix(String prefix) {
-		return true;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSectionDescriptor.java
deleted file mode 100644
index 9335a09..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSectionDescriptor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITypeMapper;
-import org.w3c.dom.Element;
-
-public class AbstractSectionDescriptor implements ISectionDescriptor {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getFilter()
-	 */
-	public ITypeMapper getFilter() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		// list.add(XSDConcreteComponent.class);
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof StructuredSelection) {
-			StructuredSelection structuredSelection = (StructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			// System.out.println("fSelection is: " + object);
-			if (object instanceof Element) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
-	 */
-	public String getAfterSection() {
-		return "";
-	}
-
-	protected boolean inputEquals(Object input, String tagname, boolean isRef) {
-		return false;
-	}
-
-	public int getEnablesFor() {
-		return ENABLES_FOR_ANY;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java
deleted file mode 100644
index 7af0547..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class AttributeDefaultSection extends AbstractSection {
-
-	private final String IMPLIED = Attribute.IMPLIED;
-	private final String REQUIRED = Attribute.REQUIRED;
-	private final String FIXED = Attribute.FIXED;
-
-	private CCombo usageCombo;
-	private String[] usageComboValues = {IMPLIED, REQUIRED, FIXED, DTDPropertiesMessages._UI_DEFAULT};
-	private Text defaultValueText;
-	private CLabel defaultValueLabel;
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
-		usageCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		usageCombo.setLayoutData(data);
-		usageCombo.addSelectionListener(this);
-		usageCombo.setItems(usageComboValues);
-
-		CLabel usageLabel = getWidgetFactory().createCLabel(composite, DTDPropertiesMessages._UI_LABEL_USAGE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(usageCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(usageCombo, 0, SWT.CENTER);
-		usageLabel.setLayoutData(data);
-
-		defaultValueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(usageCombo, +ITabbedPropertyConstants.VSPACE);
-		defaultValueText.setLayoutData(data);
-		defaultValueText.addListener(SWT.Modify, this);
-
-		defaultValueLabel = getWidgetFactory().createCLabel(composite, DTDPropertiesMessages._UI_LABEL_DEFAULT_VALUE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(defaultValueText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(defaultValueText, 0, SWT.CENTER);
-		defaultValueLabel.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		Object input = getInput();
-		if (input != null) {
-			if (input instanceof Attribute) {
-				String kind = ((Attribute) input).getDefaultKind();
-				if ("".equals(kind))
-					usageCombo.setText(DTDPropertiesMessages._UI_DEFAULT);
-				else
-					usageCombo.setText(kind);
-
-				if ("".equals(kind) || FIXED.equals(kind)) {
-					defaultValueLabel.setVisible(true);
-					defaultValueText.setEnabled(true);
-					defaultValueText.setText(((Attribute) input).getDefaultValue());
-				}
-				else {
-					defaultValueText.setText("");
-					defaultValueLabel.setVisible(false);
-					defaultValueText.setEnabled(false);
-				}
-			}
-		}
-		setListenerEnabled(true);
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == usageCombo) {
-			Object input = getInput();
-			if (input instanceof Attribute) {
-				String usage = usageCombo.getText();
-				Attribute attribute = (Attribute) input;
-				if (usage.equals(DTDPropertiesMessages._UI_DEFAULT))
-					attribute.setDefaultKind("");
-				else
-					attribute.setDefaultKind(usage);
-
-				if (DTDPropertiesMessages._UI_DEFAULT.equals(usage) || FIXED.equals(usage)) {
-					defaultValueLabel.setVisible(true);
-					defaultValueText.setEnabled(true);
-				}
-				else {
-					defaultValueLabel.setVisible(false);
-					defaultValueText.setEnabled(false);
-				}
-			}
-		}
-	}
-
-	public void doHandleEvent(Event event) {
-		Object input = getInput();
-		if (input instanceof Attribute) {
-			if (event.widget == defaultValueText) {
-				String newValue = defaultValueText.getText();
-				((Attribute) input).setDefaultValue(newValue, usageCombo.getText().equals(FIXED));
-			}
-		}
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSectionDescriptor.java
deleted file mode 100644
index 8967a7b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSectionDescriptor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-
-public class AttributeDefaultSectionDescriptor extends AbstractSectionDescriptor {
-	private AttributeDefaultSection attributeDefaultSection;
-
-	public AttributeDefaultSectionDescriptor() {
-		super();
-		attributeDefaultSection = new AttributeDefaultSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.attributedefault";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return attributeDefaultSection;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof Attribute)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java
deleted file mode 100644
index e7912f7..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Comment;
-
-public class CommentSection extends AbstractSection {
-	private Text commentText;
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-		commentText = getWidgetFactory().createText(composite, "", SWT.MULTI | SWT.NONE);
-		commentText.addListener(SWT.Modify, CommentSection.this);
-
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		data.bottom = new FormAttachment(100, 0);
-		commentText.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		commentText.setEnabled(true);
-		Object input = getInput();
-		commentText.setText("");
-		if (input != null) {
-			if (input instanceof Comment)
-				commentText.setText(((Comment) input).getText());
-		}
-		setListenerEnabled(true);
-	}
-
-
-	public void doHandleEvent(Event event) {
-		Object input = getInput();
-		if (input != null) {
-			String newValue = commentText.getText();
-			if (newValue.length() > 0 && input instanceof Comment) {
-				Comment comment = (Comment) input;
-				comment.setText(newValue);
-			}
-		}
-
-	}
-
-	public boolean shouldUseExtraSpace() {
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSectionDescriptor.java
deleted file mode 100644
index 3c280f6..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSectionDescriptor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Comment;
-
-public class CommentSectionDescriptor extends AbstractSectionDescriptor {
-	/**
-	 * 
-	 */
-	public CommentSectionDescriptor() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.comment";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return new CommentSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof Comment)
-				return true;
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java
deleted file mode 100644
index 8aaff7a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class ContentModelGroupSection extends AbstractSection {
-	private final String SEQUENCE = DTDPropertiesMessages._UI_SEQUENCE;
-	private final String CHOICE = DTDPropertiesMessages._UI_CHOICE;
-	private final String MODEL_GROUP = DTDPropertiesMessages._UI_LABEL_MODEL_GROUP;
-
-	private CCombo modelGroupCombo;
-	private String[] modelGroupComboValues = {SEQUENCE, CHOICE};
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
-		modelGroupCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		modelGroupCombo.setLayoutData(data);
-		modelGroupCombo.addSelectionListener(this);
-		modelGroupCombo.setItems(modelGroupComboValues);
-
-		CLabel cLabel = getWidgetFactory().createCLabel(composite, MODEL_GROUP);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(modelGroupCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(modelGroupCombo, 0, SWT.CENTER);
-		cLabel.setLayoutData(data);
-
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		Object input = getInput();
-		if (input != null) {
-			if (input instanceof CMGroupNode) {
-				CMGroupNode node = (CMGroupNode) input;
-				char modelType = node.getConnector();
-				if (CMGroupNode.CHOICE == modelType)
-					modelGroupCombo.setText(CHOICE);
-				else if (CMGroupNode.SEQUENCE == modelType)
-					modelGroupCombo.setText(SEQUENCE);
-			}
-		}
-		setListenerEnabled(true);
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == modelGroupCombo) {
-			Object input = getInput();
-			if (input instanceof CMGroupNode) {
-				CMGroupNode node = (CMGroupNode) input;
-				if (CHOICE.equals(modelGroupCombo.getText()))
-					node.setConnector(CMGroupNode.CHOICE);
-				else if (SEQUENCE.equals(modelGroupCombo.getText()))
-					node.setConnector(CMGroupNode.SEQUENCE);
-			}
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSectionDescriptor.java
deleted file mode 100644
index 137e478..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSectionDescriptor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-
-public class ContentModelGroupSectionDescriptor extends AbstractSectionDescriptor {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.modelgroup";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return new ContentModelGroupSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof CMGroupNode)
-				return true;
-		}
-		return false;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java
deleted file mode 100644
index 0e215e9..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class ContentModelNameSection extends AbstractSection {
-	private final String CONTENT_MODEL = DTDPropertiesMessages._UI_LABEL_CONTENT_MODEL;
-
-	private CCombo typeCombo;
-	private String[] typeComboValues = {CMNode.PCDATA};
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
-		typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT | SWT.READ_ONLY);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		typeCombo.setLayoutData(data);
-		typeCombo.addSelectionListener(this);
-		typeCombo.setItems(typeComboValues);
-
-		CLabel cLabel = getWidgetFactory().createCLabel(composite, CONTENT_MODEL);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(typeCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-		cLabel.setLayoutData(data);
-
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		Object input = getInput();
-
-		if (input != null) {
-			if (input instanceof CMBasicNode) {
-				typeCombo.removeAll();
-				typeCombo.add(CMNode.PCDATA);
-				// NodeList list =
-				// ((CMBasicNode)fInput).getDTDFile().getElementsAndParameterEntityReferences();
-				Iterator iterator = ((CMBasicNode) input).getDTDFile().getNodes().iterator();
-				boolean isForRootContent = ((CMBasicNode) input).isRootElementContent();
-				while (iterator.hasNext()) {
-					DTDNode node = (DTDNode) iterator.next();
-					if (!isForRootContent && node instanceof Element)
-						typeCombo.add(node.getName());
-					if (node instanceof Entity && ((Entity) node).isParameterEntity())
-						typeCombo.add("%" + node.getName() + ";");
-				}
-
-				typeCombo.setText(((CMBasicNode) input).getName());
-			}
-		}
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == typeCombo) {
-			Object input = getInput();
-			if (input instanceof CMBasicNode) {
-				CMBasicNode node = (CMBasicNode) input;
-				String selected = typeCombo.getText();
-				// if (CMNode.PCDATA.equals(selected))
-				node.setName(selected);
-			}
-		}
-	}
-
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSectionDescriptor.java
deleted file mode 100644
index c1714cd..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSectionDescriptor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-
-public class ContentModelNameSectionDescriptor extends AbstractSectionDescriptor {
-	private ContentModelNameSection contentModelNameSection;
-
-	public ContentModelNameSectionDescriptor() {
-		super();
-		contentModelNameSection = new ContentModelNameSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.contentmodelname";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return contentModelNameSection;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof CMBasicNode && !((CMBasicNode) object).isRootElementContent())
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java
deleted file mode 100644
index 545f478..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class ContentModelTypeSection extends AbstractSection {
-	private final String CONTENT_TYPE = DTDPropertiesMessages._UI_LABEL_CONTENT_TYPE;
-
-	private CCombo typeCombo;
-	private String[] typeComboValues = {CMNode.ANY, CMNode.EMPTY, CMNode.PCDATA, CMNode.CHILDREN, CMNode.MIXED};
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		data.bottom = new FormAttachment(100, 0);
-
-		typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		typeCombo.setLayoutData(data);
-		typeCombo.addSelectionListener(this);
-		typeCombo.setItems(typeComboValues);
-
-		CLabel cLabel = getWidgetFactory().createCLabel(composite, CONTENT_TYPE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(typeCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-		cLabel.setLayoutData(data);
-
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		Object input = getInput();
-
-		if (input != null) {
-			if (input instanceof CMNode) {
-				typeCombo.removeAll();
-				typeCombo.add(CMNode.ANY);
-				typeCombo.add(CMNode.EMPTY);
-				typeCombo.add(CMNode.PCDATA);
-				typeCombo.add(CMNode.CHILDREN);
-				typeCombo.add(CMNode.MIXED);
-
-				Iterator iterator = ((CMNode) input).getDTDFile().getNodes().iterator();
-				String nodeName = null;
-				while (iterator.hasNext()) {
-					DTDNode node = (DTDNode) iterator.next();
-					nodeName = node.getName();
-					if (node instanceof Element && typeCombo.indexOf(nodeName) == -1)
-						typeCombo.add(nodeName);
-					else if (node instanceof Entity && ((Entity) node).isParameterEntity() && typeCombo.indexOf(nodeName) == -1)
-						typeCombo.add("%" + nodeName + ";");
-				}
-				if (input instanceof CMGroupNode)
-					typeCombo.setText(((CMGroupNode) input).getType());
-				else if (input instanceof CMBasicNode)
-					typeCombo.setText(((CMBasicNode) input).getType());
-			}
-		} // end if (fInput != null)
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == typeCombo) {
-			Object input = getInput();
-			if (input instanceof CMGroupNode || input instanceof CMBasicNode) {
-				CMNode node = (CMNode) input;
-				String selected = typeCombo.getText();
-				if (CMNode.MIXED.equals(selected))
-					node.setMixedContent();
-				else if (CMNode.CHILDREN.equals(selected))
-					node.setChildrenContent("");
-				else if (CMNode.EMPTY.equals(selected) || CMNode.ANY.equals(selected) || CMNode.PCDATA.equals(selected))
-					node.setContent(selected);
-				else
-					node.setChildrenContent(selected);
-			}
-		}
-	}
-
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSectionDescriptor.java
deleted file mode 100644
index e75a96b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSectionDescriptor.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-
-public class ContentModelTypeSectionDescriptor extends AbstractSectionDescriptor {
-	private ContentModelTypeSection contentModelTypeSection;
-
-	public ContentModelTypeSectionDescriptor() {
-		super();
-		contentModelTypeSection = new ContentModelTypeSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.contentmodeltype";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return contentModelTypeSection;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof CMGroupNode && ((CMGroupNode) object).isRootElementContent())
-				return true;
-			else if (object instanceof CMBasicNode && ((CMBasicNode) object).isRootElementContent()) // ANY,
-				// EMPTY,
-				// PCDATA
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionDescriptorProvider.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionDescriptorProvider.java
deleted file mode 100644
index d838230..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionDescriptorProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptorProvider;
-
-public class DTDSectionDescriptorProvider implements ISectionDescriptorProvider {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptorProvider#getSectionDescriptors()
-	 */
-	public ISectionDescriptor[] getSectionDescriptors() {
-		ISectionDescriptor[] descriptors = new ISectionDescriptor[11];
-
-		descriptors[0] = new NameSectionDescriptor();
-		descriptors[1] = new ContentModelTypeSectionDescriptor();
-		descriptors[2] = new TypeSectionDescriptor();
-		descriptors[3] = new AttributeDefaultSectionDescriptor();
-		descriptors[4] = new ContentModelGroupSectionDescriptor();
-		descriptors[5] = new ContentModelNameSectionDescriptor();
-		descriptors[6] = new OccurrenceSectionDescriptor();
-		descriptors[7] = new CommentSectionDescriptor();
-		descriptors[8] = new DocumentSectionDescriptor();
-		// descriptors[9] = new EntityTypeSectionDescriptor();
-		// descriptors[10]= new EntityValueSectionDescriptor();
-		descriptors[9] = new NotationSectionDescriptor();
-		descriptors[10] = new NewEntitySectionDescriptor();
-		// descriptors[11]= new EmptySectionDescriptor();
-		return descriptors;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
deleted file mode 100644
index e0391b8..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class DTDSectionLabelProvider extends LabelProvider {
-
-	/**
-	 * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-	 */
-	public Image getImage(Object object) {
-		if (object == null || object.equals(StructuredSelection.EMPTY)) {
-			return null;
-		}
-
-		Image result = null;
-		if (object instanceof StructuredSelection) {
-			Object selected = ((StructuredSelection) object).getFirstElement();
-			if (selected instanceof DTDFile) {
-				return null; // ((DTDFile) selected).getImage();
-			}
-			else if (selected instanceof DTDNode) {
-				if (selected instanceof ParameterEntityReference)
-					return null;
-				return ((DTDNode) selected).getImage();
-			}
-			else if (selected instanceof org.w3c.dom.Element) {
-				return null;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-	 */
-	public String getText(Object object) {
-		if (object == null || object.equals(StructuredSelection.EMPTY)) {
-			return null;
-		}
-
-		if (object instanceof StructuredSelection) {
-			Object selected = ((StructuredSelection) object).getFirstElement();
-			if (selected instanceof DTDFile) {
-				return null; // ((DTDFile) selected).getName();
-			}
-			else if (selected instanceof CMBasicNode) {
-				if (((CMBasicNode) selected).isReference())
-					return DTDPropertiesMessages._UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF;
-				else
-					return ((CMBasicNode) selected).getName();
-			}
-			else if (selected instanceof CMRepeatableNode) {
-				CMRepeatableNode node = (CMRepeatableNode) selected;
-				String name = node.getName();
-				if (node instanceof CMGroupNode) {
-					if (((CMGroupNode) node).getConnector() == CMGroupNode.CHOICE)
-						name = "choice";
-					else
-						name = "sequence";
-				}
-				char occurrence = node.getOccurrence();
-				switch (occurrence) {
-					case CMRepeatableNode.ONCE :
-						name += " [1..1]";
-						break;
-					case CMRepeatableNode.OPTIONAL :
-						name += " [0..1]";
-						break;
-					case CMRepeatableNode.ONE_OR_MORE :
-						name += " [1..*]";
-						break;
-					case CMRepeatableNode.ZERO_OR_MORE :
-						name += " [0..*]";
-						break;
-				}
-				return name;
-			}
-			else if (selected instanceof DTDNode) {
-				if (selected instanceof Element)
-					return "element";
-				else if (selected instanceof Attribute)
-					return "attribute";
-				else if (selected instanceof AttributeList)
-					return "attribute list";
-				else if (selected instanceof Comment)
-					return "comment";
-				else if (selected instanceof Entity)
-					return "entity";
-				else if (selected instanceof Notation)
-					return "notation";
-				else if (selected instanceof ParameterEntityReference)
-					// return "parameter entity reference";
-					return null;
-				else
-					return ((DTDNode) selected).getName();
-			}
-			else if (selected instanceof org.w3c.dom.Element) {
-				return ((org.w3c.dom.Element) selected).getLocalName();
-			}
-			else
-				return "";
-		}
-		else if (object instanceof TextSelection) {
-			return "";
-		}
-		else
-			return object.toString();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java
deleted file mode 100644
index f315313..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFilePage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDResource;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-/**
- * Extend the base wizard to select a file from the project or outside the
- * workbench and add error handling
- */
-class DTDSelectIncludeFileWizard extends Wizard implements INewWizard {
-	DTDSelectSingleFilePage filePage;
-
-	IFile resultFile;
-
-	public DTDSelectIncludeFileWizard(String title, String desc, ViewerFilter filter, IStructuredSelection selection) {
-		super();
-		setWindowTitle(title);
-		setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(DTDUIPlugin.getDefault().getBundle().getSymbolicName(), DTDResource.NEWDTD));
-
-		// Select File Page
-		filePage = new DTDSelectSingleFilePage(PlatformUI.getWorkbench(), selection, true);
-		filePage.setTitle(title);
-		filePage.setDescription(desc);
-		filePage.addFilter(filter);
-	}
-
-	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
-	}
-
-	public void addPages() {
-		addPage(filePage);
-	}
-
-	public boolean canFinish() {
-		return filePage.isPageComplete();
-	}
-
-	public boolean performFinish() {
-		resultFile = filePage.getFile();
-		return true;
-	}
-
-	public IFile getResultFile() {
-		return resultFile;
-	}
-
-	/**
-	 * Select DTD File
-	 */
-	class DTDSelectSingleFilePage extends SelectSingleFilePage {
-		public DTDSelectSingleFilePage(IWorkbench w, IStructuredSelection selection, boolean isFileMandatory) {
-			super(w, selection, isFileMandatory);
-		}
-
-		public boolean isPageComplete() {
-			return super.isPageComplete();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java
deleted file mode 100644
index e4f9dc7..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-public class DocumentSection extends AbstractSection {
-	private Text commentText;
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-		commentText = getWidgetFactory().createText(composite, "", SWT.MULTI | SWT.NONE);
-		commentText.addListener(SWT.Modify, this);
-
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		data.bottom = new FormAttachment(100, 0);
-		commentText.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		commentText.setEnabled(true);
-		Object input = getInput();
-		commentText.setText("");
-		if (input != null) {
-			if (input instanceof DTDNode) {
-				Comment comment = getCommentNode((DTDNode) input);
-				if (comment != null)
-					commentText.setText(comment.getText());
-			}
-		}
-		setListenerEnabled(true);
-	}
-
-	public void doHandleEvent(Event event) {
-		Object input = getInput();
-		if (input != null) {
-			String newValue = commentText.getText();
-			if (input instanceof DTDNode) {
-				Comment comment = getCommentNode((DTDNode) input);
-				if (comment != null)
-					comment.setText(newValue);
-				else {
-					// Create a new comment node.
-					((DTDNode) input).getDTDFile().createComment((DTDNode) input, newValue, false);
-				}
-			}
-		}
-
-	}
-
-	private Comment getCommentNode(DTDNode node) {
-		Iterator iterator = node.getDTDFile().getNodes().iterator();
-		DTDNode currentNode = null;
-		DTDNode prevNode = null;
-		while (iterator.hasNext()) {
-			currentNode = (DTDNode) iterator.next();
-			if (node == currentNode && prevNode != null && prevNode instanceof Comment)
-				return (Comment) prevNode;
-			else
-				prevNode = currentNode;
-		}
-		return null;
-	}
-
-	public boolean shouldUseExtraSpace() {
-		return true;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSectionDescriptor.java
deleted file mode 100644
index e912855..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSectionDescriptor.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-public class DocumentSectionDescriptor extends AbstractSectionDescriptor {
-	/**
-	 * 
-	 */
-	public DocumentSectionDescriptor() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.document";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return new DocumentSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.documentation";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			/*
-			 * if (object instanceof DTDNode) { DTDNode node =
-			 * (DTDNode)object; Iterator iterator =
-			 * node.getDTDFile().getNodes().iterator(); DTDNode currentNode =
-			 * null; DTDNode prevNode = null; while (iterator.hasNext()) {
-			 * currentNode = (DTDNode)iterator.next(); if (node == currentNode &&
-			 * prevNode != null && prevNode instanceof Comment) return true;
-			 * else prevNode = currentNode; }
-			 * 
-			 * return false; }
-			 */
-			if (object instanceof Element || object instanceof Entity || object instanceof AttributeList || object instanceof Notation)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java
deleted file mode 100644
index a3d661a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-
-public class EmptySection extends AbstractSection {
-	public void doHandleEvent(Event event) {
-		super.doHandleEvent(event);
-	}
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		super.refresh();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	 */
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySectionDescriptor.java
deleted file mode 100644
index 9feaab1..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySectionDescriptor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-public class EmptySectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.emptySection";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return new EmptySection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof DTDFile || object instanceof IndexedRegion)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java
deleted file mode 100644
index e90262c..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class EntityTypeSection extends AbstractSection {
-	private final String ENTITY_TYPE = DTDPropertiesMessages._UI_LABEL_ENTITY_TYPE;
-	private final String EXTERNAL_ENTITY = DTDPropertiesMessages._UI_LABEL_EXTERNAL_ENTITY;
-	private final String PARAMETER = DTDPropertiesMessages._UI_LABEL_PARAMETER_ENTITY;
-	private final String GENERAL = DTDPropertiesMessages._UI_LABEL_GENERAL_ENTITY;
-
-	private CCombo typeCombo;
-	private String[] typeComboValues = {PARAMETER, GENERAL};
-	private Button checkBox;
-
-	public static boolean isExternalEntity = false;
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
-		typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		typeCombo.setLayoutData(data);
-		typeCombo.addSelectionListener(this);
-		typeCombo.setItems(typeComboValues);
-
-		CLabel cLabel = getWidgetFactory().createCLabel(composite, ENTITY_TYPE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(typeCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-		cLabel.setLayoutData(data);
-
-		checkBox = getWidgetFactory().createButton(composite, EXTERNAL_ENTITY, SWT.CHECK);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(95, 0);
-		data.top = new FormAttachment(typeCombo, +ITabbedPropertyConstants.VSPACE);
-		checkBox.setLayoutData(data);
-		checkBox.addSelectionListener(this);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		Object input = getInput();
-
-		if (input != null) {
-			if (input instanceof Entity) {
-				Entity entity = (Entity) input;
-				if (entity.isParameterEntity())
-					typeCombo.setText(PARAMETER);
-				else
-					typeCombo.setText(GENERAL);
-
-				if (entity.isExternalEntity()) {
-					checkBox.setSelection(true);
-					isExternalEntity = true;
-				}
-				else {
-					checkBox.setSelection(false);
-					isExternalEntity = false;
-				}
-			}
-		}
-		setListenerEnabled(true);
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == typeCombo) {
-			Object input = getInput();
-			if (input instanceof Entity) {
-				Entity node = (Entity) input;
-				String selected = typeCombo.getText();
-				if (PARAMETER.equals(selected))
-					node.setParameterEntity(true);
-				else
-					node.setParameterEntity(false);
-			}
-		}
-		else if (e.widget == checkBox) {
-			Object input = getInput();
-			if (input instanceof Entity) {
-				Entity node = (Entity) input;
-				boolean selected = checkBox.getSelection();
-				if (selected) {
-					node.setExternalEntity(true);
-					isExternalEntity = true;
-				}
-				else {
-					node.setExternalEntity(false);
-					isExternalEntity = false;
-				}
-			}
-		}
-	}
-
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSectionDescriptor.java
deleted file mode 100644
index d7555ce..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSectionDescriptor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Entity;
-
-public class EntityTypeSectionDescriptor extends AbstractSectionDescriptor {
-	private EntityTypeSection entityTypeSection;
-
-	public EntityTypeSectionDescriptor() {
-		super();
-		entityTypeSection = new EntityTypeSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.entitytype";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return entityTypeSection;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof Entity)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java
deleted file mode 100644
index 9ad8351..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class EntityValueSection extends AbstractSection {
-	private final String VALUE = DTDPropertiesMessages._UI_LABEL_ENTITY_VALUE;
-	private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
-	private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
-	private Text valueText;
-	private Text publicIdText;
-	private Text systemIdText;
-
-	private CLabel valueLabel;
-	private CLabel publicIdLabel;
-	private CLabel systemIdLabel;
-
-	public void doHandleEvent(Event event) {
-		if (event.widget == valueText) {
-			Object input = getInput();
-			String newValue = valueText.getText();
-			if (input instanceof Entity) {
-				Entity entity = (Entity) input;
-				entity.setValue(newValue);
-			}
-		}
-		else if (event.widget == publicIdText) {
-			Object input = getInput();
-			String newValue = publicIdText.getText();
-			if (input instanceof Entity) {
-				Entity entity = (Entity) input;
-				entity.setPublicID(newValue);
-			}
-		}
-		else if (event.widget == systemIdText) {
-			Object input = getInput();
-			String newValue = systemIdText.getText();
-			if (input instanceof Entity) {
-				Entity entity = (Entity) input;
-				entity.setSystemID(newValue);
-			}
-		}
-	}
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		// Entity Value
-		valueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		valueText.setLayoutData(data);
-		valueText.addListener(SWT.Modify, this);
-
-		valueLabel = getWidgetFactory().createCLabel(composite, VALUE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(valueText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(valueText, 0, SWT.CENTER);
-		valueLabel.setLayoutData(data);
-
-		// Public ID
-		publicIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(valueText, +ITabbedPropertyConstants.VSPACE);
-		publicIdText.setLayoutData(data);
-		publicIdText.addListener(SWT.Modify, this);
-
-		publicIdLabel = getWidgetFactory().createCLabel(composite, PUBLIC_ID);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(publicIdText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(publicIdText, 0, SWT.CENTER);
-		publicIdLabel.setLayoutData(data);
-
-		// System ID
-		systemIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(publicIdText, +ITabbedPropertyConstants.VSPACE);
-		systemIdText.setLayoutData(data);
-		systemIdText.addListener(SWT.Modify, this);
-
-		systemIdLabel = getWidgetFactory().createCLabel(composite, SYSTEM_ID);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(systemIdText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(systemIdText, 0, SWT.CENTER);
-		systemIdLabel.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		Object input = getInput();
-		if (isExternalEntity()) {
-			valueLabel.setVisible(false);
-			valueText.setVisible(false);
-			publicIdLabel.setVisible(true);
-			publicIdText.setVisible(true);
-			systemIdLabel.setVisible(true);
-			systemIdText.setVisible(true);
-
-			publicIdText.setText("");
-			systemIdText.setText("");
-			if (input != null && input instanceof Entity) {
-				Entity entity = (Entity) input;
-				publicIdText.setText((entity).getPublicID());
-				systemIdText.setText((entity).getSystemID());
-			}
-		}
-		else {
-			valueLabel.setVisible(true);
-			valueText.setVisible(true);
-			publicIdLabel.setVisible(false);
-			publicIdText.setVisible(false);
-			systemIdLabel.setVisible(false);
-			systemIdText.setVisible(false);
-
-			valueText.setText("");
-			if (input != null && input instanceof Entity)
-				valueText.setText(((Entity) input).getValue());
-		}
-		setListenerEnabled(true);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	 */
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-
-	private boolean isExternalEntity() {
-		return EntityTypeSection.isExternalEntity;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSectionDescriptor.java
deleted file mode 100644
index ed8f553..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSectionDescriptor.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.dtd.core.internal.Entity;
-
-public class EntityValueSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.entityValue";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return new EntityValueSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.other";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof Entity)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java
deleted file mode 100644
index 2f24d7d..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class NameSection extends AbstractSection {
-	private final String NAME = DTDPropertiesMessages._UI_LABEL_NAME;
-	private Text nameText;
-
-	public void doHandleEvent(Event event) {
-		if (event.widget == nameText) {
-			Object input = getInput();
-			String newValue = nameText.getText();
-			if (newValue.length() > 0 && input instanceof DTDNode) {
-				DTDNode dtdNode = (DTDNode) input;
-				dtdNode.setName(newValue);
-			}
-		}
-	}
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		nameText.setLayoutData(data);
-		nameText.addListener(SWT.Modify, this);
-
-		CLabel nameLabel = getWidgetFactory().createCLabel(composite, NAME);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(nameText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(nameText, 0, SWT.CENTER);
-		nameLabel.setLayoutData(data);
-
-		// listener.startListeningForEnter(nameText);
-		// listener.startListeningTo(nameText);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		nameText.setEnabled(true);
-		Object input = getInput();
-		nameText.setText("");
-		if (input != null) {
-			if (input instanceof DTDNode)
-				nameText.setText(((DTDNode) input).getName());
-		}
-		setListenerEnabled(true);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	 */
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSectionDescriptor.java
deleted file mode 100644
index 2df605e..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSectionDescriptor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-public class NameSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.name";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	/*
-	 * public List getInputTypes() { List list = new ArrayList();
-	 * list.add(DTDNode.class); return list; }
-	 */
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return new NameSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof Element
-			// || object instanceof Entity
-						|| object instanceof Attribute || object instanceof AttributeList || object instanceof Notation)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java
deleted file mode 100644
index 45d67fa..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-public class NewEntitySection extends AbstractSection {
-	private final String NAME = DTDPropertiesMessages._UI_LABEL_NAME;
-	private final String ENTITY_TYPE = DTDPropertiesMessages._UI_LABEL_ENTITY_TYPE;
-	private final String EXTERNAL_ENTITY = DTDPropertiesMessages._UI_LABEL_EXTERNAL_ENTITY;
-	private final String PARAMETER = DTDPropertiesMessages._UI_LABEL_PARAMETER_ENTITY;
-	private final String GENERAL = DTDPropertiesMessages._UI_LABEL_GENERAL_ENTITY;
-	private final String VALUE = DTDPropertiesMessages._UI_LABEL_ENTITY_VALUE;
-	private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
-	private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
-	private Text systemIdText;
-	private Text publicIdText;
-	private Text nameText;
-	private Button wizardButton;
-
-	private Text entityValueText;
-	private Button checkBox;
-
-	private CCombo typeCombo;
-	private String[] typeComboValues = {PARAMETER, GENERAL};
-	private PageBook pageBook;
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
-		createEntityCommonComposite(composite);
-
-		pageBook = new PageBook(composite, SWT.FLAT);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(entityCommonComposite, 0);
-		data.bottom = new FormAttachment(100, 0);
-		pageBook.setLayoutData(data);
-
-		createExternalEntityComposite(pageBook);
-		createInternalEntityComposite(pageBook);
-
-		pageBook.showPage(externalEntityComposite);
-	}
-
-	private Composite entityCommonComposite;
-
-	private Composite createEntityCommonComposite(Composite parent) {
-		entityCommonComposite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		entityCommonComposite.setLayoutData(data);
-
-		nameText = getWidgetFactory().createText(entityCommonComposite, "", SWT.NONE); //$NON-NLS-1$    
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(0, 0);
-		nameText.setLayoutData(data);
-		nameText.addListener(SWT.Modify, this);
-
-		CLabel nameLabel = getWidgetFactory().createCLabel(entityCommonComposite, NAME); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(nameText, +ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(nameText, 0, SWT.CENTER);
-		nameLabel.setLayoutData(data);
-
-		// Create Checkbox
-		checkBox = getWidgetFactory().createButton(entityCommonComposite, EXTERNAL_ENTITY, SWT.CHECK); //$NON-NLS-1$
-		checkBox.addSelectionListener(this);
-
-		// Create CCombo
-		typeCombo = getWidgetFactory().createCCombo(entityCommonComposite, SWT.FLAT | SWT.READ_ONLY);
-		typeCombo.addSelectionListener(this);
-		typeCombo.setItems(typeComboValues);
-		typeCombo.setText(PARAMETER);
-
-		FormData checkBoxFormData = new FormData();
-		checkBoxFormData.left = new FormAttachment(90, -rightMarginSpace + 2);
-		checkBoxFormData.right = new FormAttachment(100, 0);
-		checkBoxFormData.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-		checkBox.setLayoutData(checkBoxFormData);
-
-		FormData typeComboFormData = new FormData();
-		typeComboFormData.left = new FormAttachment(0, 100);
-		typeComboFormData.right = new FormAttachment(checkBox, 0);
-		typeComboFormData.top = new FormAttachment(nameText, +ITabbedPropertyConstants.VSPACE);
-		typeCombo.setLayoutData(typeComboFormData);
-
-		CLabel cLabel = getWidgetFactory().createCLabel(entityCommonComposite, ENTITY_TYPE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(typeCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-		cLabel.setLayoutData(data);
-
-		return entityCommonComposite;
-	}
-
-	private Composite internalEntityComposite;
-
-	private Composite createInternalEntityComposite(Composite parent) {
-		internalEntityComposite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(entityCommonComposite, +ITabbedPropertyConstants.VSPACE);
-		// data.bottom = new FormAttachment(100,0);
-		internalEntityComposite.setLayoutData(data);
-
-		entityValueText = getWidgetFactory().createText(internalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
-		entityValueText.setEditable(true);
-		entityValueText.addListener(SWT.Modify, this);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(0, 0);
-		entityValueText.setLayoutData(data);
-
-		CLabel entityValueLabel = getWidgetFactory().createCLabel(internalEntityComposite, VALUE); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(entityValueText, 0);
-		data.top = new FormAttachment(entityValueText, 0, SWT.CENTER);
-		entityValueLabel.setLayoutData(data);
-
-		return internalEntityComposite;
-	}
-
-	private Composite externalEntityComposite;
-
-	private Composite createExternalEntityComposite(Composite parent) {
-		externalEntityComposite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(entityCommonComposite, +ITabbedPropertyConstants.VSPACE);
-		// data.bottom = new FormAttachment(100,0);
-		externalEntityComposite.setLayoutData(data);
-
-		publicIdText = getWidgetFactory().createText(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
-		publicIdText.setEditable(true);
-		publicIdText.addListener(SWT.Modify, this);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		// data.top = new FormAttachment(nameText,
-		// +ITabbedPropertyConstants.VSPACE);
-		data.top = new FormAttachment(0, 0);
-		publicIdText.setLayoutData(data);
-
-		CLabel publicIdLabel = getWidgetFactory().createCLabel(externalEntityComposite, PUBLIC_ID); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(publicIdText, 0);
-		data.top = new FormAttachment(publicIdText, 0, SWT.CENTER);
-		publicIdLabel.setLayoutData(data);
-
-		// Create Wizard Button
-		wizardButton = getWidgetFactory().createButton(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
-		wizardButton.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(DTDUIPlugin.getDefault().getBundle().getSymbolicName(), "icons/browsebutton.gif").createImage()); //$NON-NLS-1$
-
-		// Create System ID Text
-		systemIdText = getWidgetFactory().createText(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
-		// systemIdText.setEditable(false);
-
-		FormData buttonFormData = new FormData();
-		buttonFormData.left = new FormAttachment(100, -rightMarginSpace + 2);
-		buttonFormData.right = new FormAttachment(100, 0);
-		buttonFormData.top = new FormAttachment(systemIdText, 0, SWT.CENTER);
-		wizardButton.setLayoutData(buttonFormData);
-		wizardButton.addSelectionListener(this);
-
-		FormData systemIdData = new FormData();
-		systemIdData.left = new FormAttachment(0, 100);
-		systemIdData.right = new FormAttachment(wizardButton, 0);
-		systemIdData.top = new FormAttachment(publicIdText, +ITabbedPropertyConstants.VSPACE);
-		systemIdText.setLayoutData(systemIdData);
-		systemIdText.addListener(SWT.Modify, this);
-
-		// Create System ID Label
-		CLabel systemIdLabel = getWidgetFactory().createCLabel(externalEntityComposite, SYSTEM_ID); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(systemIdText, 0);
-		data.top = new FormAttachment(systemIdText, 0, SWT.CENTER);
-		systemIdLabel.setLayoutData(data);
-
-		return externalEntityComposite;
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == typeCombo) {
-			Object input = getInput();
-			if (input instanceof Entity) {
-				Entity node = (Entity) input;
-				String selected = typeCombo.getText();
-				if (PARAMETER.equals(selected))
-					node.setParameterEntity(true);
-				else
-					node.setParameterEntity(false);
-			}
-		}
-		else if (e.widget == checkBox) {
-			Object input = getInput();
-			if (input instanceof Entity) {
-				Entity node = (Entity) input;
-				boolean selected = checkBox.getSelection();
-				if (selected) {
-					node.setExternalEntity(true);
-					pageBook.showPage(externalEntityComposite);
-				}
-				else {
-					node.setExternalEntity(false);
-					pageBook.showPage(internalEntityComposite);
-				}
-			}
-		}
-		else if (e.widget == wizardButton) {
-			Shell shell = Display.getCurrent().getActiveShell();
-			IFile currentIFile = ((IFileEditorInput) getActiveEditor().getEditorInput()).getFile();
-			ViewerFilter filter = new ResourceFilter(new String[]{".dtd"}, new IFile[]{currentIFile}, null);
-
-			DTDSelectIncludeFileWizard fileSelectWizard = new DTDSelectIncludeFileWizard(DTDPropertiesMessages._UI_FILEDIALOG_SELECT_DTD, DTDPropertiesMessages._UI_FILEDIALOG_SELECT_DTD_DESC, filter, (IStructuredSelection) fSelection);
-
-			WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
-			wizardDialog.create();
-			wizardDialog.setBlockOnOpen(true);
-			int result = wizardDialog.open();
-			if (result == Window.OK) {
-				String value = systemIdText.getText();
-				IFile selectedIFile = fileSelectWizard.getResultFile();
-				String dtdFileString = value;
-				if (selectedIFile != null) {
-					dtdFileString = URIHelper.getRelativeURI(selectedIFile.getFullPath(), currentIFile.getFullPath());
-				}
-				systemIdText.setText(dtdFileString);
-			}
-		}
-
-	}
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		Object input = getInput();
-		nameText.setText("");
-		if (input != null) {
-			if (input instanceof Entity) {
-				Entity entity = (Entity) input;
-				nameText.setText(entity.getName());
-
-				if (entity.isParameterEntity())
-					typeCombo.setText(PARAMETER);
-				else
-					typeCombo.setText(GENERAL);
-
-				if (entity.isExternalEntity()) {
-					checkBox.setSelection(true);
-					pageBook.showPage(externalEntityComposite);
-					publicIdText.setText(entity.getPublicID());
-					systemIdText.setText(entity.getSystemID());
-				}
-				else {
-					checkBox.setSelection(false);
-					pageBook.showPage(internalEntityComposite);
-					entityValueText.setText(entity.getValue());
-				}
-			}
-		}
-		setListenerEnabled(true);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	 */
-	public boolean shouldUseExtraSpace() {
-		return true;
-	}
-
-	public void doHandleEvent(Event event) {
-		if (event.widget == nameText) {
-			Object input = getInput();
-			String newValue = nameText.getText();
-			if (newValue.length() > 0 && input instanceof Entity) {
-				Entity entity = (Entity) input;
-				entity.setName(newValue);
-			}
-		}
-		else if (event.widget == entityValueText) {
-			Object input = getInput();
-			String newValue = entityValueText.getText();
-			if (input instanceof Entity) {
-				Entity entity = (Entity) input;
-				entity.setValue(newValue);
-			}
-		}
-		else if (event.widget == publicIdText) {
-			Object input = getInput();
-			String newValue = publicIdText.getText();
-			if (input instanceof Entity) {
-				Entity entity = (Entity) input;
-				entity.setPublicID(newValue);
-			}
-		}
-		else if (event.widget == systemIdText) {
-			Object input = getInput();
-			String newValue = systemIdText.getText();
-			if (input instanceof Entity) {
-				Entity entity = (Entity) input;
-				entity.setSystemID(newValue);
-			}
-		}
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySectionDescriptor.java
deleted file mode 100644
index f07dd3a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySectionDescriptor.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Entity;
-
-public class NewEntitySectionDescriptor extends AbstractSectionDescriptor {
-	NewEntitySection entitySection;
-
-	/**
-	 * 
-	 */
-	public NewEntitySectionDescriptor() {
-		super();
-		entitySection = new NewEntitySection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.newEntitySection";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return entitySection;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof Entity)
-				return true;
-			else
-				return false;
-		}
-
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java
deleted file mode 100644
index 0e2ac1b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class NotationSection extends AbstractSection {
-	private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
-	private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
-	private Text publicIdText;
-	private Text systemIdText;
-
-	private CLabel publicIdLabel;
-	private CLabel systemIdLabel;
-
-	public void doHandleEvent(Event event) {
-		if (event.widget == publicIdText) {
-			Object input = getInput();
-			String newValue = publicIdText.getText();
-			if (input instanceof Notation) {
-				Notation notation = (Notation) input;
-				notation.setPublicID(newValue);
-			}
-		}
-		else if (event.widget == systemIdText) {
-			Object input = getInput();
-			String newValue = systemIdText.getText();
-			if (input instanceof Notation) {
-				Notation notation = (Notation) input;
-				notation.setSystemID(newValue);
-			}
-		}
-	}
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		// Public ID
-		publicIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		publicIdText.setLayoutData(data);
-		publicIdText.addListener(SWT.Modify, this);
-
-		publicIdLabel = getWidgetFactory().createCLabel(composite, PUBLIC_ID);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(publicIdText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(publicIdText, 0, SWT.CENTER);
-		publicIdLabel.setLayoutData(data);
-
-		// System ID
-		systemIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(publicIdText, +ITabbedPropertyConstants.VSPACE);
-		systemIdText.setLayoutData(data);
-		systemIdText.addListener(SWT.Modify, this);
-
-		systemIdLabel = getWidgetFactory().createCLabel(composite, SYSTEM_ID);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(systemIdText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(systemIdText, 0, SWT.CENTER);
-		systemIdLabel.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		Object input = getInput();
-		publicIdText.setText("");
-		systemIdText.setText("");
-
-		if (input != null && input instanceof Notation) {
-			Notation notation = (Notation) input;
-			publicIdText.setText((notation).getPublicID());
-			systemIdText.setText((notation).getSystemID());
-		}
-
-		setListenerEnabled(true);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	 */
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSectionDescriptor.java
deleted file mode 100644
index 0fde616..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSectionDescriptor.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-public class NotationSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.notation";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return new NotationSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof Notation)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java
deleted file mode 100644
index 68f677e..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class OccurrenceSection extends AbstractSection {
-	private final String ONCE = DTDPropertiesMessages._UI_ONCE;
-	private final String ONE_OR_MORE = DTDPropertiesMessages._UI_ONE_OR_MORE;
-	private final String OPTIONAL = DTDPropertiesMessages._UI_OPTIONAL;
-	private final String ZERO_OR_MORE = DTDPropertiesMessages._UI_ZERO_OR_MORE;
-	private final String OCCURENCE = DTDPropertiesMessages._UI_LABEL_OCCURRENCE;
-
-	private CCombo occurrenceCombo;
-	private String[] occurrenceComboValues = {ONCE, ONE_OR_MORE, OPTIONAL, ZERO_OR_MORE};
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
-		occurrenceCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		occurrenceCombo.setLayoutData(data);
-		occurrenceCombo.addSelectionListener(this);
-		occurrenceCombo.setItems(occurrenceComboValues);
-
-		CLabel usageLabel = getWidgetFactory().createCLabel(composite, OCCURENCE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(occurrenceCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(occurrenceCombo, 0, SWT.CENTER);
-		usageLabel.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		setListenerEnabled(false);
-		Object input = getInput();
-		if (input instanceof CMRepeatableNode) {
-			char occurence = ((CMRepeatableNode) input).getOccurrence();
-			if (CMRepeatableNode.ONCE == occurence)
-				occurrenceCombo.setText(ONCE);
-			else if (CMRepeatableNode.ONE_OR_MORE == occurence)
-				occurrenceCombo.setText(ONE_OR_MORE);
-			else if (CMRepeatableNode.OPTIONAL == occurence)
-				occurrenceCombo.setText(OPTIONAL);
-			else if (CMRepeatableNode.ZERO_OR_MORE == occurence)
-				occurrenceCombo.setText(ZERO_OR_MORE);
-			else
-				occurrenceCombo.setText(ONCE);
-		}
-		setListenerEnabled(true);
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		Object input = getInput();
-		if (input instanceof CMRepeatableNode) {
-			setListenerEnabled(false);
-			CMRepeatableNode node = (CMRepeatableNode) input;
-			String occurrence = occurrenceCombo.getText();
-			if (ONCE.equals(occurrence))
-				node.setOccurrence(CMRepeatableNode.ONCE);
-			else if (ONE_OR_MORE.equals(occurrence))
-				node.setOccurrence(CMRepeatableNode.ONE_OR_MORE);
-			else if (OPTIONAL.equals(occurrence))
-				node.setOccurrence(CMRepeatableNode.OPTIONAL);
-			else if (ZERO_OR_MORE.equals(occurrence))
-				node.setOccurrence(CMRepeatableNode.ZERO_OR_MORE);
-			setListenerEnabled(true);
-		}
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSectionDescriptor.java
deleted file mode 100644
index d4f40b2..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSectionDescriptor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
-
-public class OccurrenceSectionDescriptor extends AbstractSectionDescriptor {
-	private OccurrenceSection occurenceSection;
-
-	public OccurrenceSectionDescriptor() {
-		super();
-		occurenceSection = new OccurrenceSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.occurence";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return occurenceSection;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-			if (object instanceof CMBasicNode && ((CMBasicNode) object).isEmptyAnyOrPCData())
-				return false;
-			else if (object instanceof CMRepeatableNode)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java
deleted file mode 100644
index 4d43647..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class TypeSection extends AbstractSection {
-	private final String TYPE = DTDPropertiesMessages._UI_LABEL_TYPE;
-
-	private CCombo typeCombo;
-	private String[] typeComboValues = {Attribute.CDATA, Attribute.ID, Attribute.IDREF, Attribute.IDREFS, Attribute.ENTITY, Attribute.ENTITIES, Attribute.NMTOKEN, Attribute.NMTOKENS, Attribute.ENUMERATED_NAME, Attribute.ENUMERATED_NOTATION};
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-	 *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		data.bottom = new FormAttachment(100, 0);
-
-		typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		typeCombo.setLayoutData(data);
-		typeCombo.addSelectionListener(this);
-		typeCombo.setItems(typeComboValues);
-
-		CLabel cLabel = getWidgetFactory().createCLabel(composite, TYPE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(typeCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-		cLabel.setLayoutData(data);
-
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh() {
-		Object input = getInput();
-
-		if (input != null) {
-			if (input instanceof Attribute)
-				typeCombo.setText(((Attribute) input).getType());
-		}
-
-	}
-
-	/**
-	 * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-	 */
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == typeCombo) {
-			Object input = getInput();
-			if (input instanceof Attribute) {
-				Attribute attribute = (Attribute) input;
-				attribute.setType(typeCombo.getText());
-			}
-		}
-	}
-
-	public boolean shouldUseExtraSpace() {
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSectionDescriptor.java
deleted file mode 100644
index fd1a495..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSectionDescriptor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-
-public class TypeSectionDescriptor extends AbstractSectionDescriptor {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	 */
-	public String getId() {
-		return "org.eclipse.wst.dtd.ui.internal.section.type";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	 */
-	public List getInputTypes() {
-		List list = new ArrayList();
-		return list;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	 */
-	public ISection getSectionClass() {
-		return new TypeSection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	 */
-	public String getTargetTab() {
-		return "org.eclipse.wst.dtd.ui.internal.general";
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
-		Object object = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			object = structuredSelection.getFirstElement();
-
-			if (object instanceof Attribute)
-				return true;
-			else
-				return false;
-		}
-		return false;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/DTDValidator.java b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/DTDValidator.java
new file mode 100644
index 0000000..b06f8a5
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/DTDValidator.java
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.dtd.ui.internal.validation;
+
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Locale;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
+import org.eclipse.wst.validation.internal.core.Message;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.IRuleGroup;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+
+
+public class DTDValidator implements IValidator {
+	private final String GET_FILE = "getFile"; //$NON-NLS-1$
+	public final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
+
+	static boolean shouldValidate(IFile file) {
+		IResource resource = file;
+		do {
+			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
+				return false;
+			}
+			resource = resource.getParent();
+		}
+		while ((resource.getType() & IResource.PROJECT) == 0);
+		return true;
+	}
+	
+	class LocalizedMessage extends Message {
+		private String _message = null;
+
+		public LocalizedMessage(int severity, String messageText) {
+			this(severity, messageText, null);
+		}
+
+		public LocalizedMessage(int severity, String messageText, IResource targetObject) {
+			this(severity, messageText, (Object) targetObject);
+		}
+
+		public LocalizedMessage(int severity, String messageText, Object targetObject) {
+			super(null, severity, null);
+			setLocalizedMessage(messageText);
+			setTargetObject(targetObject);
+		}
+
+		public void setLocalizedMessage(String message) {
+			_message = message;
+		}
+
+		public String getLocalizedMessage() {
+			return _message;
+		}
+
+		public String getText() {
+			return getLocalizedMessage();
+		}
+
+		public String getText(ClassLoader cl) {
+			return getLocalizedMessage();
+		}
+
+		public String getText(Locale l) {
+			return getLocalizedMessage();
+		}
+
+		public String getText(Locale l, ClassLoader cl) {
+			return getLocalizedMessage();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wtp.validation.core.IValidator#cleanup(org.eclipse.wtp.validation.core.IReporter)
+	 */
+	public void cleanup(IReporter reporter) {
+	}
+
+	public void validate(IFile file) {
+		ValidateDTDAction validateAction = new ValidateDTDAction(file, false);
+		validateAction.setValidator(this);
+		validateAction.run();
+	}
+
+	public void validate(IFile file, IReporter reporter, int ruleGroup) {
+		ValidateDTDAction validateAction = new ValidateDTDAction(file, false);
+		validateAction.setValidator(this);
+		validateAction.run();
+	}
+
+	/**
+	 * This is the method which performs the validation on the MOF model. <br>
+	 * <br>
+	 * <code>context</code> and <code>reporter</code> may not be null.
+	 * <code>changedFiles</code> may be null, if a full build is desired.
+	 * <br>
+	 * <br>
+	 * <code>helper</code> returns the ifile for the given information in
+	 * the IFileDelta array <br>
+	 * <br>
+	 * <code>reporter</code> is an instance of an IReporter interface, which
+	 * is used for interaction with the user. <br>
+	 * <br>
+	 * <code>changedFiles</code> is an array of file names which have
+	 * changed since the last validation. If <code>changedFiles</code> is
+	 * null, or if it is an empty array, then a full build is performed.
+	 * Otherwise, validation on just the files listed in the Vector is
+	 * performed.
+	 */
+	public void validate(IValidationContext context, IReporter reporter) throws ValidationException {
+		String[] changedFiles = context.getURIs();
+		if (changedFiles != null && changedFiles.length > 0) {
+			for (int i = 0; i < changedFiles.length; i++) {
+				String changedFileName = changedFiles[i];
+				if (changedFileName != null) {
+					Object[] parms = {changedFileName};
+
+					IFile file = (IFile) context.loadModel(GET_FILE, parms);
+					if (file != null && shouldValidate(file)) {
+						validateIfNeeded(file, context, reporter);
+					}
+				}
+			}
+		}
+		else {
+			Object[] parms = {this.getClass().getName()};
+			Collection files = (Collection) context.loadModel(GET_PROJECT_FILES, parms);
+			Iterator iter = files.iterator();
+			while (iter.hasNext()) {
+				IFile file = (IFile) iter.next();
+				if(shouldValidate(file)) {
+					validateIfNeeded(file, context, reporter);
+				}
+			}
+		}
+	}
+
+
+	protected void validateIfNeeded(IFile file, IValidationContext context, IReporter reporter) {
+	    Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(DTDUIMessages.MESSAGE_DTD_VALIDATION_MESSAGE_UI_, new String[]{file.getFullPath().toString()}));
+	    reporter.displaySubtask(this, message);
+
+		Integer ruleGroupInt = (Integer) context.loadModel(IRuleGroup.PASS_LEVEL, null);
+		/*
+		 * pass in a "null" so that loadModel doesn't attempt to cast the
+		 * result into a RefObject
+		 */
+		int ruleGroup = (ruleGroupInt == null) ? IRuleGroup.PASS_FULL : ruleGroupInt.intValue();
+
+		validate(file, reporter, ruleGroup);
+	}
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDAction.java b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDAction.java
new file mode 100644
index 0000000..00e4873
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDAction.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.dtd.ui.internal.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.dtd.core.internal.validation.DTDValidationMessages;
+import org.eclipse.wst.dtd.core.internal.validation.Validator;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
+import org.eclipse.wst.xml.ui.internal.validation.core.ValidateAction;
+
+
+/**
+ * This class managers the 'UI' related details of validation Here's a quick
+ * overview of the details : - manages Marker creation based on the results of
+ * the validation - (optionally) displays dialog to summarize the results of
+ * validation - temporarily copies XML to a temp file to workaround a xerces
+ * bug (InputSource from InputStream bug)
+ */
+public class ValidateDTDAction extends ValidateAction {
+	/**
+	 * Constructor.
+	 * 
+	 * @param file
+	 *            The file to validate.
+	 * @param showDialog
+	 *            Whether or not to show dialogs during validation.
+	 */
+	public ValidateDTDAction(IFile file, boolean showDialog) {
+		super(file, showDialog);
+	}
+
+	protected void validate(final IFile fileToValidate) {
+		final ValidationOutcome validationOutcome = new ValidationOutcome();
+		IPath path = fileToValidate.getLocation();
+		final String uri = createURIForFilePath(path.toString());
+		Validator dtdValidator = Validator.getInstance();
+
+		clearMarkers(fileToValidate);
+
+		ValidationReport valreport = dtdValidator.validate(uri);
+		validationOutcome.isValid = valreport.isValid();
+		if (valreport.getValidationMessages().length == 0) {
+			validationOutcome.hasMessages = false;
+		}
+		else {
+			validationOutcome.hasMessages = true;
+		}
+		createMarkers(fileToValidate, valreport.getValidationMessages());
+
+		try {
+			fileToValidate.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
+		}
+		catch (CoreException e) {
+		}
+
+
+		if (showDialog) {
+			if (!validationOutcome.isValid) {
+				String title = DTDValidationMessages._UI_DIALOG_DTD_INVALID_TITLE;
+				String message = DTDValidationMessages._UI_DIALOG_DTD_INVALID_TEXT;
+				openErrorDialog(title, message);
+			}
+			else {
+				String title = DTDValidationMessages._UI_DIALOG_DTD_VALID_TITLE;
+				String message = DTDValidationMessages._UI_DIALOG_DTD_VALID_TEXT;
+				openValidDialog(title, message);
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDActionDelegate.java b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDActionDelegate.java
new file mode 100644
index 0000000..e1a7ebb
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDActionDelegate.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.dtd.ui.internal.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.wst.dtd.core.internal.validation.DTDValidationMessages;
+
+/**
+ * Validate schema - from popup
+ */
+public class ValidateDTDActionDelegate implements IActionDelegate {
+	protected ISelection selection;
+
+	public void run(IAction action) {
+		try {
+			// CS.. for now the following line tests to ensure the user has
+			// xerces jars installed
+			// so that we can perform some 'fail fast' behaviour
+			//
+			Class theClass = Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader()); //$NON-NLS-1$
+			if (theClass == null) {
+				throw (new Exception("Missing Xerces jars in plugin's 'jars' folder")); //$NON-NLS-1$
+			}
+
+			IFile fileResource = null;
+			if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
+				IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+				Object element = structuredSelection.getFirstElement();
+
+				if (element instanceof IFile) {
+					fileResource = (IFile) element;
+				}
+				else {
+					return;
+				}
+			}
+			ValidateDTDAction validateaction = new ValidateDTDAction(fileResource, true);
+			validateaction.setValidator(new DTDValidator());
+			validateaction.run();
+		}
+		catch (Exception e) {
+			// CS..here's where we need to pop up a dialog to tell the user
+			// that xerces is not available
+			//
+			String xercesLine1 = DTDValidationMessages.Missing_required_files_1;
+			String xercesLine2 = DTDValidationMessages.Missing_required_files_2;
+			String xercesLine3 = DTDValidationMessages.Missing_required_files_3;
+			MessageDialog.openError(Display.getDefault().getActiveShell(), DTDValidationMessages.Missing_required_files_4, xercesLine1 + xercesLine2 + xercesLine3);
+		}
+	}
+
+	public void selectionChanged(IAction action, ISelection selection) {
+		this.selection = selection;
+	}
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
index c52c1e8..ca4e7a4 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
@@ -13,9 +13,9 @@
 package org.eclipse.wst.dtd.ui;
 
 import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.dtd.core.text.IDTDPartitions;
+import org.eclipse.wst.dtd.core.internal.provisional.text.IDTDPartitionTypes;
 import org.eclipse.wst.dtd.ui.internal.style.LineStyleProviderForDTD;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProviderForNoOp;
@@ -56,7 +56,7 @@
 
 	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
 		if (fConfiguredContentTypes == null) {
-			fConfiguredContentTypes = new String[]{IDTDPartitions.DTD_DEFAULT, IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION};
+			fConfiguredContentTypes = new String[]{IDTDPartitionTypes.DTD_DEFAULT, IStructuredPartitionTypes.DEFAULT_PARTITION, IStructuredPartitionTypes.UNKNOWN_PARTITION};
 		}
 		return fConfiguredContentTypes;
 	}
@@ -64,10 +64,10 @@
 	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
 		LineStyleProvider[] providers = null;
 
-		if (partitionType == IDTDPartitions.DTD_DEFAULT || partitionType == IStructuredPartitions.DEFAULT_PARTITION) {
+		if (partitionType == IDTDPartitionTypes.DTD_DEFAULT || partitionType == IStructuredPartitionTypes.DEFAULT_PARTITION) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForCSS()};
 		}
-		else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
+		else if (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForNoop()};
 		}
 
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
index 3576542..80eee08 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
@@ -36,9 +36,6 @@
 	public static String _UI_MOVE_NODE;
 	public static String _UI_MOVE_NODES;
 	public static String _ERROR_FILENAME_MUST_END_DTD;
-	public static String Creating_files;
-	public static String DTDFilesPreferencePage_ExtensionLabel;
-	public static String DTDFilesPreferencePage_ExtensionError;
 	public static String DTDColorPage_0;
 	public static String DTDColorPage_1;
 	public static String DTDColorPage_2;
@@ -56,7 +53,6 @@
 	public static String _UI_WIZARD_NEW_DTD_TITLE;
 	public static String _UI_WIZARD_NEW_DTD_EXPL;
 	public static String _UI_LABEL_DTD_FILE_DELETE;
-	public static String ResourceGroup_nameExists;
 	public static String NewDTDTemplatesWizardPage_0;
 	public static String NewDTDTemplatesWizardPage_1;
 	public static String NewDTDTemplatesWizardPage_2;
@@ -65,6 +61,8 @@
 	public static String NewDTDTemplatesWizardPage_5;
 	public static String NewDTDTemplatesWizardPage_6;
 
+	public static String MESSAGE_DTD_VALIDATION_MESSAGE_UI_;
+
 	static {
 		// load message values from bundle file
 		NLS.initializeMessages(BUNDLE_NAME, DTDUIMessages.class);
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
index 94476c7..b74fd8a 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
@@ -38,12 +38,7 @@
 _UI_MOVE_NODE=Move Node
 _UI_MOVE_NODES=Move Nodes
 
-_ERROR_FILENAME_MUST_END_DTD=The file name must end in one of the following extensions {0}.
-
-#DTD File page
-Creating_files=Creating files
-DTDFilesPreferencePage_ExtensionLabel=Add this suffix (if not specified):
-DTDFilesPreferencePage_ExtensionError=Suffix must be one of the following {0}.
+_ERROR_FILENAME_MUST_END_DTD=The file name must end in .dtd
 
 #DTD Style page
 DTDColorPage_0=<!ELEMENT Main (One,Two+)>\r\n<!ELEMENT One (Three,Four)>\r\n<!ATTLIST One\r\n oneone CDATA #REQUIRED\r\n>\r\n<!-- You need this -->\r\n<!ELEMENT Two (moremore*)>\r\n<!ATTLIST Two\r\n twotwo CDATA #REQUIRED\r\n twothree (aaa | bbb) "aaa"\r\n>\r\n
@@ -67,7 +62,6 @@
 # copied from dtd core
 _UI_LABEL_DTD_FILE_DELETE=Delete
 ##
-ResourceGroup_nameExists = The same name already exists.
 NewDTDTemplatesWizardPage_0=Select DTD Template
 NewDTDTemplatesWizardPage_1=Select a template as initial content in the DTD page.
 NewDTDTemplatesWizardPage_2=Name
@@ -77,3 +71,5 @@
 NewDTDTemplatesWizardPage_6=Templates are 'New DTD' templates found in the <a>DTD Templates</a> preference page.
 
 SourceMenu_label=Source
+
+MESSAGE_DTD_VALIDATION_MESSAGE_UI_=DTD Validator validating {0}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java
index 0a2a3ea..5bd028b 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java
@@ -28,8 +28,8 @@
 import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
 import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
 import org.eclipse.wst.dtd.ui.internal.style.IStyleConstantsDTD;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractColorPage;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java
index 90ffffd..e8df96f 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java
@@ -12,57 +12,31 @@
  *******************************************************************************/
 package org.eclipse.wst.dtd.ui.internal.preferences;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.dtd.core.internal.DTDCorePlugin;
-import org.eclipse.wst.dtd.core.internal.preferences.DTDCorePreferenceNames;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
 import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
 import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
 
 
 public class DTDFilesPreferencePage extends AbstractPreferencePage {
-	private Text fDefaultSuffix = null;
-	private List fValidExtensions = null;
 
 	protected Control createContents(Composite parent) {
+		noDefaultAndApplyButton();
+		
 		Composite composite = (Composite) super.createContents(parent);
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.DTD_PREFWEBX_FILES_HELPID);
 
-		Group creatingGroup = createGroup(composite, 2);
-		creatingGroup.setText(DTDUIMessages.Creating_files);
-
-		// Default extension for New file Wizard
-		createLabel(creatingGroup, DTDUIMessages.DTDFilesPreferencePage_ExtensionLabel);
-		fDefaultSuffix = createTextField(creatingGroup);
-		fDefaultSuffix.addModifyListener(this);
-
 		setSize(composite);
 		loadPreferences();
 
 		return composite;
 	}
 
-	public void dispose() {
-		fDefaultSuffix.removeModifyListener(this);
-		super.dispose();
-	}
-
 	protected IPreferenceStore doGetPreferenceStore() {
 		return DTDUIPlugin.getDefault().getPreferenceStore();
 	}
@@ -71,28 +45,6 @@
 		DTDCorePlugin.getInstance().savePluginPreferences(); // model
 	}
 
-	/**
-	 * Get content type associated with this new file wizard
-	 * 
-	 * @return IContentType
-	 */
-	private IContentType getContentType() {
-		return Platform.getContentTypeManager().getContentType(ContentTypeIdForDTD.ContentTypeID_DTD);
-	}
-
-	/**
-	 * Get list of valid extensions
-	 * 
-	 * @return List
-	 */
-	private List getValidExtensions() {
-		if (fValidExtensions == null) {
-			IContentType type = getContentType();
-			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
-		}
-		return fValidExtensions;
-	}
-
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -102,18 +54,6 @@
 		return DTDCorePlugin.getInstance().getPluginPreferences();
 	}
 
-	protected void initializeValues() {
-		String suffix = getModelPreferences().getString(DTDCorePreferenceNames.DEFAULT_EXTENSION);
-		fDefaultSuffix.setText(suffix);
-	}
-
-	protected void performDefaults() {
-		String suffix = getModelPreferences().getDefaultString(DTDCorePreferenceNames.DEFAULT_EXTENSION);
-		fDefaultSuffix.setText(suffix);
-
-		super.performDefaults();
-	}
-
 	public boolean performOk() {
 		boolean result = super.performOk();
 
@@ -121,27 +61,4 @@
 
 		return result;
 	}
-
-	protected void storeValues() {
-		String suffix = fDefaultSuffix.getText();
-		getModelPreferences().setValue(DTDCorePreferenceNames.DEFAULT_EXTENSION, suffix);
-	}
-
-	protected void validateValues() {
-		boolean isValid = false;
-		Iterator i = getValidExtensions().iterator();
-		while (i.hasNext() && !isValid) {
-			String extension = (String) i.next();
-			isValid = extension.equalsIgnoreCase(fDefaultSuffix.getText());
-		}
-
-		if (!isValid) {
-			setErrorMessage(NLS.bind(DTDUIMessages.DTDFilesPreferencePage_ExtensionError, getValidExtensions().toString()));
-			setValid(false);
-		}
-		else {
-			setErrorMessage(null);
-			setValid(true);
-		}
-	}
 }
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java
index 0f17159..2bdf4f6 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java
@@ -27,9 +27,9 @@
 import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
 import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
 import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
 import org.w3c.dom.Node;
 
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
index 3dd8f0b..05aa06b 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
@@ -25,10 +25,10 @@
 import org.eclipse.swt.custom.StyleRange;
 import org.eclipse.swt.graphics.RGB;
 import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.core.text.IDTDPartitions;
+import org.eclipse.wst.dtd.core.internal.provisional.text.IDTDPartitionTypes;
 import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
@@ -121,7 +121,7 @@
 	 *      int, int, java.util.Collection)
 	 */
 	public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
-		if (!IDTDPartitions.DTD_DEFAULT.equals(typedRegion.getType())) {
+		if (!IDTDPartitionTypes.DTD_DEFAULT.equals(typedRegion.getType())) {
 			// compute an internal DTD model and return linestyles for it
 			ITextRegion dtdContentRegion = null;
 			IStructuredDocumentRegion doctype = fDocument.getRegionAtCharacterOffset(typedRegion.getOffset());
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
index de09787..0cec6ef 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005 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
@@ -19,11 +19,8 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
 import org.eclipse.core.runtime.content.IContentType;
@@ -31,7 +28,6 @@
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPage;
@@ -40,7 +36,6 @@
 import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.wst.dtd.core.internal.DTDCorePlugin;
-import org.eclipse.wst.dtd.core.internal.preferences.DTDCorePreferenceNames;
 import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
 import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
 import org.eclipse.wst.dtd.ui.internal.Logger;
@@ -52,117 +47,39 @@
 	private WizardNewFileCreationPage fNewFilePage;
 	private NewDTDTemplatesWizardPage fNewFileTemplatesPage;
 	private IStructuredSelection fSelection;
-	private IContentType fContentType;
 	private List fValidExtensions = null;
 
 	/**
-	 * Adds default extension to the filename
-	 * 
-	 * @param filename
-	 * @return
-	 */
-	String addDefaultExtension(String filename) {
-		StringBuffer newFileName = new StringBuffer(filename);
-
-		Preferences preference = DTDCorePlugin.getInstance().getPluginPreferences();
-		String ext = preference.getString(DTDCorePreferenceNames.DEFAULT_EXTENSION);
-
-		newFileName.append("."); //$NON-NLS-1$
-		newFileName.append(ext);
-
-		return newFileName.toString();
-	}
-
-	/**
-	 * Get content type associated with this new file wizard
-	 * 
-	 * @return IContentType
-	 */
-	IContentType getContentType() {
-		if (fContentType == null)
-			fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForDTD.ContentTypeID_DTD);
-		return fContentType;
-	}
-
-	/**
 	 * Get list of valid extensions for DTD Content type
 	 * 
 	 * @return
 	 */
 	List getValidExtensions() {
 		if (fValidExtensions == null) {
-			IContentType type = getContentType();
+			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForDTD.ContentTypeID_DTD);
 			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
 		}
 		return fValidExtensions;
 	}
-
-	/**
-	 * Verifies if fileName is valid name for content type. Takes base content
-	 * type into consideration.
-	 * 
-	 * @param fileName
-	 * @return true if extension is valid for this content type
-	 */
-	boolean extensionValidForContentType(String fileName) {
-		boolean valid = false;
-
-		IContentType type = getContentType();
-		// there is currently an extension
-		if (fileName.lastIndexOf('.') != -1) {
-			// check what content types are associated with current extension
-			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
-			int i = 0;
-			while (i < types.length && !valid) {
-				valid = types[i].isKindOf(type);
-				++i;
-			}
-		}
-		else
-			valid = true; // no extension so valid
-		return valid;
-	}
 	
 	public void addPages() {
 		fNewFilePage = new WizardNewFileCreationPage("DTDWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
 			protected boolean validatePage() {
-				String fileName = getFileName();
-				IPath fullPath = getContainerFullPath();
-				if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
-					// check that filename does not contain invalid extension
-					if (!extensionValidForContentType(fileName)) {
-						setErrorMessage(NLS.bind(DTDUIMessages._ERROR_FILENAME_MUST_END_DTD, getValidExtensions().toString()));
-						return false;
-					}
-					// no file extension specified so check adding default
-					// extension doesn't equal a file that already exists
-					if (fileName.lastIndexOf('.') == -1) {
-						String newFileName = addDefaultExtension(fileName);
-						IPath resourcePath = fullPath.append(newFileName);
-
-						IWorkspace workspace = ResourcesPlugin.getWorkspace();
-						IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
-						if (!result.isOK()) {
-							// path invalid
-							setErrorMessage(result.getMessage());
-							return false;
-						}
-
-						if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
-							setErrorMessage(DTDUIMessages.ResourceGroup_nameExists);
-							return false;
-						}
-					}
+				IPath handlePath = new Path(getFileName());
+				String extension = handlePath.getFileExtension();
+				if (extension == null || !extension.equalsIgnoreCase("dtd")) { //$NON-NLS-1$
+					setErrorMessage(DTDUIMessages._ERROR_FILENAME_MUST_END_DTD); //$NON-NLS-1$
+					return false;
 				}
 				setErrorMessage(null);
 				return super.validatePage();
 			}
 		};
-		fNewFilePage.setTitle(DTDUIMessages._UI_CREATE_NEW_DTD_FILE);
-		fNewFilePage.setDescription(DTDUIMessages._UI_WIZARD_NEW_DTD_EXPL);
+		fNewFilePage.setTitle(DTDUIMessages._UI_CREATE_NEW_DTD_FILE); 
+		fNewFilePage.setDescription(DTDUIMessages._UI_WIZARD_NEW_DTD_EXPL); 
 
 		addPage(fNewFilePage);
-
+		
 		fNewFileTemplatesPage = new NewDTDTemplatesWizardPage();
 		addPage(fNewFileTemplatesPage);
 	}
@@ -170,7 +87,7 @@
 	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
 		fSelection = aSelection;
 		setWindowTitle(DTDUIMessages._UI_WIZARD_NEW_DTD_TITLE); //$NON-NLS-1$
-
+		
 		ImageDescriptor descriptor = DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_WIZBAN_NEWDTDFILE);
 		setDefaultPageImageDescriptor(descriptor);
 	}
@@ -192,60 +109,42 @@
 	}
 
 	public boolean performFinish() {
-		boolean performedOK = false;
-
 		// save user options for next use
 		fNewFileTemplatesPage.saveLastSavedPreferences();
-
-		// no file extension specified so add default extension
-		String fileName = fNewFilePage.getFileName();
-		if (fileName.lastIndexOf('.') == -1) {
-			String newFileName = addDefaultExtension(fileName);
-			fNewFilePage.setFileName(newFileName);
-		}
-
-		// create a new empty file
+		
 		IFile file = fNewFilePage.createNewFile();
+		
+		// put template contents into file
+		String templateString = fNewFileTemplatesPage.getTemplateString();
+		if (templateString != null) {
+			// determine the encoding for the new file
+			Preferences preference = DTDCorePlugin.getInstance().getPluginPreferences();
+			String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
 
-		// if there was problem with creating file, it will be null, so make
-		// sure to check
-		if (file != null) {
-			// put template contents into file
-			String templateString = fNewFileTemplatesPage.getTemplateString();
-			if (templateString != null) {
-				// determine the encoding for the new file
-				Preferences preference = DTDCorePlugin.getInstance().getPluginPreferences();
-				String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
-				try {
-					ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-					OutputStreamWriter outputStreamWriter = null;
-					if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
-						// just use default encoding
-						outputStreamWriter = new OutputStreamWriter(outputStream);
-					}
-					else {
-						outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
-					}
-					outputStreamWriter.write(templateString);
-					outputStreamWriter.flush();
-					outputStreamWriter.close();
-					ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
-					file.setContents(inputStream, true, false, null);
-					inputStream.close();
+			try {
+				ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+				OutputStreamWriter outputStreamWriter = null;
+				if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
+					// just use default encoding
+					outputStreamWriter = new OutputStreamWriter(outputStream);
+				} else {
+					outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
 				}
-				catch (Exception e) {
-					Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new DTD file", e); //$NON-NLS-1$
-				}
+				outputStreamWriter.write(templateString);
+				outputStreamWriter.flush();
+				outputStreamWriter.close();
+				ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
+				file.setContents(inputStream, true, false, null);
+				inputStream.close();
 			}
-
-			// open the file in editor
-			openEditor(file);
-
-			// everything's fine
-			performedOK = true;
+			catch (Exception e) {
+				Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new DTD file", e); //$NON-NLS-1$
+			}
 		}
-		return performedOK;
+
+		// open the file in editor
+		openEditor(file);
+		return true;
 	}
 
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6f0f54e..0000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Thu Mar 23 02:41:04 EST 2006
-eclipse.preferences.version=1
-encoding//src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java=ISO-8859-1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
index 7eb8851..c9a18d3 100644
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:43:26 EDT 2006

-compilers.p.build=0

+#Fri May 27 23:56:32 EDT 2005

 compilers.p.deprecated=1

 compilers.p.illegal-att-value=0

 compilers.p.no-required-att=0

diff --git a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
index 49c3585..e6b6b31 100644
--- a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
@@ -2,35 +2,33 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.html.core; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.html.core.internal;x-internal:=true,
- org.eclipse.wst.html.core.internal.cleanup;x-internal:=true,
- org.eclipse.wst.html.core.internal.commentelement.handlers;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel.chtml;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel.ssi;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentproperties;x-internal:=true,
- org.eclipse.wst.html.core.internal.contenttype;x-internal:=true,
- org.eclipse.wst.html.core.internal.document;x-internal:=true,
- org.eclipse.wst.html.core.internal.encoding;x-internal:=true,
- org.eclipse.wst.html.core.internal.format;x-internal:=true,
- org.eclipse.wst.html.core.internal.htmlcss;x-internal:=true,
- org.eclipse.wst.html.core.internal.modelhandler;x-internal:=true,
- org.eclipse.wst.html.core.internal.modelquery;x-internal:=true,
- org.eclipse.wst.html.core.internal.preferences;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional.contenttype;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional.text;x-internal:=true,
- org.eclipse.wst.html.core.internal.text;x-internal:=true,
- org.eclipse.wst.html.core.internal.validate;x-internal:=true,
- org.eclipse.wst.html.core.text
+Export-Package: org.eclipse.wst.html.core.internal,
+ org.eclipse.wst.html.core.internal.cleanup,
+ org.eclipse.wst.html.core.internal.commentelement.handlers,
+ org.eclipse.wst.html.core.internal.contentmodel,
+ org.eclipse.wst.html.core.internal.contentmodel.chtml,
+ org.eclipse.wst.html.core.internal.contentmodel.ssi,
+ org.eclipse.wst.html.core.internal.contenttype,
+ org.eclipse.wst.html.core.internal.document,
+ org.eclipse.wst.html.core.internal.encoding,
+ org.eclipse.wst.html.core.internal.format,
+ org.eclipse.wst.html.core.internal.htmlcss,
+ org.eclipse.wst.html.core.internal.modelhandler,
+ org.eclipse.wst.html.core.internal.modelquery,
+ org.eclipse.wst.html.core.internal.preferences,
+ org.eclipse.wst.html.core.internal.provisional,
+ org.eclipse.wst.html.core.internal.provisional.contenttype,
+ org.eclipse.wst.html.core.internal.provisional.text,
+ org.eclipse.wst.html.core.internal.text,
+ org.eclipse.wst.html.core.internal.validate
 Require-Bundle: org.eclipse.wst.css.core,
  org.eclipse.wst.sse.core,
  org.eclipse.wst.xml.core,
  org.eclipse.wst.common.uriresolver,
  org.eclipse.core.resources,
  org.eclipse.core.runtime
-Eclipse-LazyStart: true; exceptions="org.eclipse.wst.html.core.internal.contenttype"
+Eclipse-AutoStart: true; exceptions="org.eclipse.wst.html.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.html.core/plugin.properties b/bundles/org.eclipse.wst.html.core/plugin.properties
index c355a38..3711dbf 100644
--- a/bundles/org.eclipse.wst.html.core/plugin.properties
+++ b/bundles/org.eclipse.wst.html.core/plugin.properties
@@ -10,5 +10,6 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=Structured Source HTML Model
+nlFeatureName=Structured Source HTML Model NL Support
 Structured_HTML_Document_Factory_Extension.name=Structured HTML Document Factory Extension
 HTML_Content_Type_Extension_Element.name=HTML
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
index 931654c..550c2f9 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
@@ -47,8 +47,6 @@
 	public static String CDATA_section_not_closed__ERROR_;
 	public static String _ERROR_Tag___0___should_be_an_empty_element_tag_1;
 	public static String _ERROR_Attribute_value___0___not_closed__1;
-	public static String HTMLContentPropertiesManager_Updating;
-	public static String HTMLContentPropertiesManager_Problems_Updating;
 
 	static {
 		// load message values from bundle file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
index 1299c4f..fc73123 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
@@ -13,15 +13,13 @@
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentPropertiesManager;
-import org.osgi.framework.BundleContext;
 
 /**
  * The main plugin class to be used in the desktop.
  */
 public class HTMLCorePlugin extends Plugin {
-	// The shared instance.
-	private static HTMLCorePlugin plugin;
+	//The shared instance.
+	private static HTMLCorePlugin plugin;	
 
 	/**
 	 * The constructor.
@@ -44,19 +42,4 @@
 	public static IWorkspace getWorkspace() {
 		return ResourcesPlugin.getWorkspace();
 	}
-
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-
-		// listen for resource changes to update content properties keys
-		HTMLContentPropertiesManager.startup();
-	}
-
-	public void stop(BundleContext context) throws Exception {
-		// stop listenning for resource changes to update content properties
-		// keys
-		HTMLContentPropertiesManager.shutdown();
-
-		super.stop(context);
-	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
index 3bc2fad..584ad91 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
@@ -37,6 +37,3 @@
 # From here, the new messages are added for V5
 _ERROR_Tag___0___should_be_an_empty_element_tag_1=Tag ({0}) should be an empty-element tag.
 _ERROR_Attribute_value___0___not_closed__1=Attribute value ({0}) not closed.
-#
-HTMLContentPropertiesManager_Updating=Updating Web Content Settings
-HTMLContentPropertiesManager_Problems_Updating=Problem saving Web Content Settings for {0}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
index 32d20db..bd5b56f 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
@@ -33,7 +33,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
@@ -171,13 +171,15 @@
 			IDOMNode eachAttr = (IDOMNode) attributes.item(i);
 			String oldAttrName = eachAttr.getNodeName();
 			String newAttrName = oldAttrName;
-			/*
-			 * 254961 - all HTML tag names and attribute names should be in
-			 * English even for HTML files in other languages like Japanese or
-			 * Turkish. English locale should be used to convert between
-			 * uppercase and lowercase (otherwise "link" would be converted to
-			 * Turkish "I Overdot Capital").
-			 */
+			// 254961 - all HTML tag names and attribute names should be in
+			// English
+			// even for HTML files in other languages like Japanese or
+			// Turkish.
+			// English locale should be used to convert between uppercase and
+			// lowercase
+			// (otherwise "link" would be converted to "L�NK" in Turkish,
+			// where '?' in "L�NK"
+			// is the "I Overdot Capital" in Turkish).
 			if (attrNameCase == HTMLCorePreferenceNames.LOWER)
 				newAttrName = oldAttrName.toLowerCase(Locale.US);
 			else if (attrNameCase == HTMLCorePreferenceNames.UPPER)
@@ -212,13 +214,14 @@
 		String newTagName = oldTagName;
 		IDOMNode newNode = node;
 
-		/*
-		 * 254961 - all HTML tag names and attribute names should be in
-		 * English even for HTML files in other languages like Japanese or
-		 * Turkish. English locale should be used to convert between uppercase
-		 * and lowercase (otherwise "link" would be converted to Turkish "I
-		 * Overdot Capital").
-		 */
+		// 254961 - all HTML tag names and attribute names should be in
+		// English
+		// even for HTML files in other languages like Japanese or Turkish.
+		// English locale should be used to convert between uppercase and
+		// lowercase
+		// (otherwise "link" would be converted to "L�NK" in Turkish, where
+		// '?' in "L�NK"
+		// is the "I Overdot Capital" in Turkish).
 		if (tagNameCase == HTMLCorePreferenceNames.LOWER)
 			newTagName = oldTagName.toLowerCase(Locale.US);
 		else if (tagNameCase == HTMLCorePreferenceNames.UPPER)
@@ -658,14 +661,12 @@
 
 
 	protected ModelQuery getModelQuery(Node node) {
-		ModelQuery result = null;
 		if (node.getNodeType() == Node.DOCUMENT_NODE) {
-			result = ModelQueryUtil.getModelQuery((Document) node);
+			return ModelQueryUtil.getModelQuery((Document) node);
 		}
 		else {
-			result = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
+			return ModelQueryUtil.getModelQuery(node.getOwnerDocument());
 		}
-		return result;
 	}
 
 	protected List getRequiredAttrs(Node node) {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
index f4e6340..53d29b9 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
@@ -45,9 +45,8 @@
 
 	/**
 	 * Create an attribute declaration.
-	 * 
-	 * @param attrName
-	 *            java.lang.String
+
+	 * @param attrName java.lang.String
 	 */
 	private HTMLAttrDeclImpl create(String attrName) {
 		HTMLAttrDeclImpl attr = null;
@@ -406,8 +405,7 @@
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAME)) {
 			// (frame %TFrame; #IMPLIED)
-			// %TFrame; is
-			// (void|above|below|hsides|lhs|rhs|vsides|box|border).
+			// %TFrame; is (void|above|below|hsides|lhs|rhs|vsides|box|border).
 			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = {ATTR_VALUE_VOID, ATTR_VALUE_ABOVE, ATTR_VALUE_BELOW, ATTR_VALUE_HSIDES, ATTR_VALUE_LHS, ATTR_VALUE_RHS, ATTR_VALUE_VSIDES, ATTR_VALUE_BOX, ATTR_VALUE_BORDER};
 			atype.setEnumValues(values);
@@ -422,13 +420,13 @@
 			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
 
-			// <<D215684
+			//<<D215684
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAMESPACING)) {
 			// (framespacing CDATA; #IMPLIED)
 			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMESPACING, atype, CMAttributeDeclaration.OPTIONAL);
-			// D215684
+			//D215684
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_HEADERS)) {
 			// (HEADERS IDREFS; #IMPLIED)
@@ -660,7 +658,7 @@
 
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFOCUS)) {
-			// (onfocus %Script; #IMPLIED)
+			//	(onfocus %Script; #IMPLIED)
 			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
 
@@ -916,8 +914,8 @@
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_SRC)) {
 			// (src %URI; #IMPLIED)
 			// NOTE: "src" attributes are defined in several elements.
-			// The definition of IMG is different from others.
-			// So, it should be locally defined.
+			//		 The definition of IMG is different from others.
+			//		 So, it should be locally defined.
 			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.OPTIONAL);
 
@@ -959,8 +957,8 @@
 
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_TEXT)) {
-			// (text %Color; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
+			// (text CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_TEXT, atype, CMAttributeDeclaration.OPTIONAL);
 
 		}
@@ -1110,9 +1108,9 @@
 	}
 
 	/**
-	 * Get align attribute which has %CAlign; as values.. At this time
-	 * (4/19/2001), it is identical to %LAlign;.
-	 * 
+	 * Get align attribute which has %CAlign; as values..
+	 * At this time (4/19/2001), it is identical to %LAlign;.
+	 *
 	 */
 	public static final HTMLAttrDeclImpl createAlignForCaption() {
 		// align (local)
@@ -1154,12 +1152,13 @@
 	}
 
 	/**
-	 * Create an attribute declaration for <code>align</code> in several
-	 * elements, like <code>P</code>, <code>DIV</code>. The values are
-	 * different from attributes those have the same name in other elements (<code>IMG</code>
-	 * and <code>TABLE</code>). So, it can't treat as global attributes.
-	 * <strong>NOTE: These attribute declaration has no owner CMDocument
-	 * instance.</strong>
+	 * Create an attribute declaration for <code>align</code>
+	 * in several elements, like <code>P</code>, <code>DIV</code>.
+	 * The values are different from attributes those have the same name
+	 * in other elements (<code>IMG</code> and <code>TABLE</code>).
+	 * So, it can't treat as global attributes.
+	 * <strong>NOTE: These attribute declaration has
+	 * no owner CMDocument instance.</strong>
 	 */
 	public static final HTMLAttrDeclImpl createAlignForParagraph() {
 		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
@@ -1172,8 +1171,8 @@
 	}
 
 	/**
-	 * Get %attrs; declarations. %attrs; consists of %coreattrs;, %i18n, and
-	 * %events;.
+	 * Get %attrs; declarations.
+	 * %attrs; consists of %coreattrs;, %i18n, and %events;.
 	 */
 	public void getAttrs(CMNamedNodeMapImpl declarations) {
 		// %coreattrs;
@@ -1196,9 +1195,11 @@
 	}
 
 	/**
-	 * Get %cellhalign; declarations. %cellhaligh; consists of: - (align
-	 * (left|center|right|justify|char) #IMPLIED) - (char %Character;
-	 * #IMPLIED) - (charoff %Length; #IMPLIED)
+	 * Get %cellhalign; declarations.
+	 * %cellhaligh; consists of:
+	 *  - (align (left|center|right|justify|char) #IMPLIED)
+	 *  - (char %Character; #IMPLIED)
+	 *  - (charoff %Length; #IMPLIED)
 	 */
 	public void getCellhalign(CMNamedNodeMapImpl declarations) {
 		// (align (left|center|right|justify|char) #IMPLIED) should be defined
@@ -1217,8 +1218,9 @@
 	}
 
 	/**
-	 * Get %cellvalign; declarations. %cellhaligh; is: - (valign
-	 * (top|middle|bottom|baseline) #IMPLIED)
+	 * Get %cellvalign; declarations.
+	 * %cellhaligh; is:
+	 *  - (valign (top|middle|bottom|baseline) #IMPLIED)
 	 */
 	public void getCellvalign(CMNamedNodeMapImpl declarations) {
 		HTMLAttributeDeclaration dec = getDeclaration(HTML40Namespace.ATTR_NAME_VALIGN);
@@ -1236,9 +1238,7 @@
 
 	/**
 	 * Get a global attribute declaration.
-	 * 
-	 * @param attrName
-	 *            java.lang.String
+	 * @param attrName java.lang.String
 	 */
 	public HTMLAttributeDeclaration getDeclaration(String attrName) {
 		CMNode cmnode = getNamedItem(attrName);
@@ -1254,9 +1254,7 @@
 
 	/**
 	 * Get declarations which are specified by names.
-	 * 
-	 * @param names
-	 *            java.util.Iterator
+	 * @param names java.util.Iterator
 	 */
 	public void getDeclarations(CMNamedNodeMapImpl declarations, Iterator names) {
 		while (names.hasNext()) {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java
deleted file mode 100644
index 4c7a41b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentproperties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * Properties constants used by HTML. Clients should only read and modify the
- * HTML properties programmatically using this class.
- * 
- * @since 1.1
- */
-public class HTMLContentProperties {
-	static final String HTMLCORE_ID = HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
-	private static final String PROJECT_KEY = "<project>"; //$NON-NLS-1$
-
-	/**
-	 * The default document type to use when none is specified.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String DOCUMENT_TYPE = "document-type"; //$NON-NLS-1$
-
-	/**
-	 * Generates a preference key based on resourcePath
-	 * 
-	 * @param resourcePath
-	 *            the path the key will be based off of
-	 * @return preference key based on resourcePath (basically the
-	 *         resourcePath without the filename); PROJECT_KEY if resourcePath
-	 *         is null
-	 */
-	static String getKeyFor(IPath resourcePath) {
-		String key = PROJECT_KEY;
-		if (resourcePath != null && resourcePath.segmentCount() > 1) {
-			key = resourcePath.removeFirstSegments(1).toString();
-		}
-		return key;
-	}
-
-	/**
-	 * Get the preferences node associated with the given project scope and
-	 * preference key (subNode) If create is true, the preference node will be
-	 * created if one does not already exist
-	 * 
-	 * @param project
-	 *            the project the preference node is under
-	 * @param preferenceKey
-	 *            the subnode/category the preference node is located in
-	 * @param create
-	 *            if true, a preference node will be created if one does not
-	 *            already exist
-	 * @return Preferences associated with the given project scope and
-	 *         preference key. null if one could not be found and create is
-	 *         false
-	 */
-	static Preferences getPreferences(IProject project, String preferenceKey, boolean create) {
-		if (create)
-			// create all nodes down to the one we are interested in
-			return new ProjectScope(project).getNode(HTMLCORE_ID).node(preferenceKey);
-		// be careful looking up for our node so not to create any nodes as
-		// side effect
-		Preferences node = Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE);
-		try {
-			// TODO once bug 90500 is fixed, should be as simple as this:
-			// String path = project.getName() + IPath.SEPARATOR +
-			// ResourcesPlugin.PI_RESOURCES + IPath.SEPARATOR +
-			// ENCODING_PREF_NODE;
-			// return node.nodeExists(path) ? node.node(path) : null;
-			// for now, take the long way
-			if (!node.nodeExists(project.getName()))
-				return null;
-			node = node.node(project.getName());
-			if (!node.nodeExists(HTMLCORE_ID))
-				return null;
-			node = node.node(HTMLCORE_ID);
-			if (!node.nodeExists(preferenceKey))
-				return null;
-			return node.node(preferenceKey);
-		}
-		catch (BackingStoreException e) {
-			// nodeExists failed
-			Logger.log(Logger.WARNING_DEBUG, "Could not retrieve preference node", e); //$NON-NLS-1$
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the value for the given key in the given context.
-	 * 
-	 * @param key
-	 *            The property key
-	 * @param resource
-	 *            The current context or <code>null</code> if no context is
-	 *            available and the workspace setting should be taken. Note
-	 *            that passing <code>null</code> should be avoided.
-	 * @param recurse
-	 *            whether the parent should be queried till property is found
-	 * @return Returns the current value for the key.
-	 * @since 1.1
-	 */
-	public static String getProperty(String key, IResource resource, boolean recurse) {
-		String val = null;
-		// boolean preferenceFound = false;
-		if (resource != null) {
-			IProject project = resource.getProject();
-			if (project != null) {
-				Preferences preferences = getPreferences(project, key, false);
-				if (preferences != null) {
-					val = internalGetProperty(resource, recurse, preferences);
-					// preferenceFound = true;
-				}
-			}
-		}
-		// Workbench preference may not be needed so leave out for now
-		// // no preferences found - for performance reasons,
-		// // short-circuit
-		// // lookup by falling back to workspace's default
-		// // setting
-		// if (!preferenceFound)
-		// val = getWorkbenchPreference(key);
-		return val;
-	}
-
-	private static String internalGetProperty(IResource resource, boolean recurse, Preferences preferences) {
-		String value = preferences.get(getKeyFor(resource.getFullPath()), null);
-		if (value == null && resource != resource.getProject() && recurse) {
-			value = preferences.get(getKeyFor(null), null);
-		}
-
-		// Workbench preference may not be needed so leave out for now
-		// // ensure we default to the workspace preference if none is found
-		// return value == null ? getWorkbenchPreference(key) : value;
-		return value;
-	}
-
-	/**
-	 * Sets the value for the given key in the given context.
-	 * 
-	 * @param key
-	 *            The property key
-	 * @param resource
-	 *            The current context. Note context cannot be
-	 *            <code>null</code>.
-	 * @param value
-	 *            The value to set for the key. If value is <code>null</code>
-	 *            the key is removed from properties.
-	 * @since 1.1
-	 */
-	public static void setProperty(String key, IResource resource, String value) throws CoreException {
-		if (resource != null) {
-			IProject project = resource.getProject();
-			if (project != null) {
-				Preferences preferences = getPreferences(project, key, true);
-				if (value == null || value.trim().length() == 0)
-					preferences.remove(getKeyFor(resource.getFullPath()));
-				else
-					preferences.put(getKeyFor(resource.getFullPath()), value);
-				try {
-					// save changes
-					preferences.flush();
-				}
-				catch (BackingStoreException e) {
-					throw new CoreException(new Status(IStatus.ERROR, HTMLCORE_ID, IStatus.ERROR, "Unable to set property", e)); //$NON-NLS-1$
-				}
-			}
-		}
-		// Workbench preference may not be needed so leave out for now
-		// just set a preference in the instance scope
-		// if (!preferenceFound) {
-		// setWorkbenchPreference(key);
-		// }
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java
deleted file mode 100644
index 41f03c8..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentproperties;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.HTMLCoreMessages;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.osgi.framework.Bundle;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-public class HTMLContentPropertiesManager {
-	public HTMLContentPropertiesManager() {
-		super();
-		fResourceChangeListener = new ResourceChangeListener();
-		fJob = new ContentPropertiesManagerJob();
-	}
-
-	private static HTMLContentPropertiesManager _instance = null;
-	private IResourceChangeListener fResourceChangeListener;
-	ContentPropertiesManagerJob fJob;
-
-	/**
-	 * This job implementation is used to allow the resource change listener
-	 * to schedule operations that need to modify the workspace.
-	 */
-	private class ContentPropertiesManagerJob extends Job {
-		private static final int PROPERTIES_UPDATE_DELAY = 500;
-		private List asyncChanges = new ArrayList();
-
-		public ContentPropertiesManagerJob() {
-			super(HTMLCoreMessages.HTMLContentPropertiesManager_Updating);
-			setSystem(true);
-			setPriority(Job.INTERACTIVE);
-		}
-
-		public void addChanges(Set newChanges) {
-			if (newChanges.isEmpty())
-				return;
-			synchronized (asyncChanges) {
-				asyncChanges.addAll(newChanges);
-				asyncChanges.notify();
-			}
-			schedule(PROPERTIES_UPDATE_DELAY);
-		}
-
-		public IProject getNextChange() {
-			synchronized (asyncChanges) {
-				return asyncChanges.isEmpty() ? null : (IProject) asyncChanges.remove(asyncChanges.size() - 1);
-			}
-		}
-
-		protected IStatus run(IProgressMonitor monitor) {
-			MultiStatus result = new MultiStatus(HTMLContentProperties.HTMLCORE_ID, IResourceStatus.FAILED_SETTING_CHARSET, HTMLCoreMessages.HTMLContentPropertiesManager_Updating, null);
-			monitor = monitor == null ? new NullProgressMonitor() : monitor;
-			try {
-				monitor.beginTask(HTMLCoreMessages.HTMLContentPropertiesManager_Updating, asyncChanges.size());
-				try {
-					IProject next;
-					while ((next = getNextChange()) != null) {
-						// just exit if the system is shutting down or has
-						// been shut down
-						// it is too late to change the workspace at this
-						// point anyway
-						if (Platform.getBundle("org.eclipse.osgi").getState() != Bundle.ACTIVE) //$NON-NLS-1$
-							return Status.OK_STATUS;
-						try {
-							// save the preferences nodes
-							if (next.isAccessible()) {
-								// save document type preferences
-								Preferences projectPrefs = HTMLContentProperties.getPreferences(next, HTMLContentProperties.DOCUMENT_TYPE, false);
-								if (projectPrefs != null)
-									projectPrefs.flush();
-							}
-						}
-						catch (BackingStoreException e) {
-							// we got an error saving
-							String detailMessage = NLS.bind(HTMLCoreMessages.HTMLContentPropertiesManager_Problems_Updating, next.getFullPath());
-							result.add(new Status(1 << (IResourceStatus.FAILED_SETTING_CHARSET % 100 / 33), ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_SETTING_CHARSET, detailMessage, e));
-						}
-					}
-					monitor.worked(1);
-				}
-				catch (OperationCanceledException e) {
-					throw e;
-				}
-			}
-			finally {
-				monitor.done();
-			}
-			return result;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
-		 */
-		public boolean shouldRun() {
-			synchronized (asyncChanges) {
-				return !asyncChanges.isEmpty();
-			}
-		}
-	}
-
-	class ResourceChangeListener implements IResourceChangeListener {
-		private void processEntryChanges(IResourceDelta projectDelta, Set projectsToSave) {
-			// check each resource with web content setting to see if it has
-			// been moved/deleted
-			boolean resourceChanges = false;
-
-			// project affected
-			IProject currentProject = (IProject) projectDelta.getResource();
-
-			resourceChanges = processPreferences(currentProject, HTMLContentProperties.DOCUMENT_TYPE, projectDelta, projectsToSave);
-
-			// if there was a preference key change, need to save preferences
-			if (resourceChanges)
-				projectsToSave.add(currentProject);
-		}
-
-		/**
-		 * Goes through all the resource-dependent preferences associated with
-		 * currentProject & key and updates the preference keys if needed
-		 * based on projectDelta
-		 * 
-		 * @param currentProject
-		 *            current project of the preferences to be looked at
-		 * @param key
-		 *            current key/subcategory of the preferences to be looked
-		 *            at
-		 * @param projectDelta
-		 *            the changes to process the preference keys against
-		 * @param projectsToSave
-		 *            the projects that need to be updated/saved
-		 * @return true if currentProject's preferences were modified
-		 */
-		private boolean processPreferences(IProject currentProject, String key, IResourceDelta projectDelta, Set projectsToSave) {
-			boolean resourceChanges = false;
-
-			// get the project-key preference node
-			Preferences projectPrefs = HTMLContentProperties.getPreferences(currentProject, key, false);
-			if (projectPrefs == null)
-				// no preferences for this project-key, just bail
-				return false;
-			String[] affectedResources;
-			try {
-				affectedResources = projectPrefs.keys();
-			}
-			catch (BackingStoreException e) {
-				// problems with the project scope... we gonna miss the
-				// changes (but will log)
-				Logger.log(Logger.WARNING_DEBUG, "Problem retreiving JSP Fragment preferences", e); //$NON-NLS-1$
-				return false;
-			}
-
-			// go through each preference key (which is really a file name)
-			for (int i = 0; i < affectedResources.length; i++) {
-				// see if preference key/file name was file that was changed
-				IResourceDelta memberDelta = projectDelta.findMember(new Path(affectedResources[i]));
-				// no changes for the given resource
-				if (memberDelta == null)
-					continue;
-				if (memberDelta.getKind() == IResourceDelta.REMOVED) {
-					resourceChanges = true;
-					// remove the setting for the original location
-					String currentValue = projectPrefs.get(affectedResources[i], null);
-					projectPrefs.remove(affectedResources[i]);
-					if ((memberDelta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
-						// if moving, copy the setting for the new location
-						IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getProject(memberDelta.getMovedToPath().segment(0));
-						Preferences targetPrefs = HTMLContentProperties.getPreferences(targetProject, key, true);
-						targetPrefs.put(HTMLContentProperties.getKeyFor(memberDelta.getMovedToPath()), currentValue);
-						if (targetProject != currentProject)
-							projectsToSave.add(targetProject);
-					}
-				}
-			}
-			return resourceChanges;
-		}
-
-		/**
-		 * For any change to the encoding file or any resource with encoding
-		 * set, just discard the cache for the corresponding project.
-		 */
-		public void resourceChanged(IResourceChangeEvent event) {
-			IResourceDelta delta = event.getDelta();
-			if (delta == null)
-				return;
-			IResourceDelta[] projectDeltas = delta.getAffectedChildren();
-			// process each project in the delta
-			Set projectsToSave = new HashSet();
-			for (int i = 0; i < projectDeltas.length; i++)
-				// nothing to do if a project has been added/removed/moved
-				if (projectDeltas[i].getKind() == IResourceDelta.CHANGED && (projectDeltas[i].getFlags() & IResourceDelta.OPEN) == 0)
-					processEntryChanges(projectDeltas[i], projectsToSave);
-			fJob.addChanges(projectsToSave);
-		}
-	}
-
-	public synchronized static void startup() {
-		_instance = new HTMLContentPropertiesManager();
-		ResourcesPlugin.getWorkspace().addResourceChangeListener(_instance.fResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
-	}
-
-	public synchronized static void shutdown() {
-		ResourcesPlugin.getWorkspace().removeResourceChangeListener(_instance.fResourceChangeListener);
-		_instance = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
index 207c2fd..4207f6f 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
@@ -20,10 +20,10 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
 import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
index 147b6dd..4241bbc 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
@@ -13,12 +13,17 @@
 
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentProperties;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.internal.contentproperties.ContentSettings;
+import org.eclipse.wst.sse.internal.contentproperties.ContentSettingsChangeSubject;
+import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
+import org.eclipse.wst.sse.internal.contentproperties.IContentSettingsListener;
 import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
 import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapterImpl;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
@@ -31,7 +36,7 @@
 
 /**
  */
-public class HTMLDocumentTypeAdapter extends DocumentTypeAdapterImpl implements HTMLDocumentTypeConstants {
+public class HTMLDocumentTypeAdapter extends DocumentTypeAdapterImpl implements IContentSettingsListener, HTMLDocumentTypeConstants {
 
 	private HTMLDocumentTypeAdapterFactory fFactory = null;
 	private HTMLDocumentTypeEntry entry = null;
@@ -56,6 +61,30 @@
 
 		// initialize
 		documentTypeChanged();
+
+		ContentSettingsChangeSubject.getSubject().addListener(this);
+	}
+
+	/**
+	 */
+	public void contentSettingsChanged(IResource resource) {
+		if (resource == null)
+			return;
+		IDOMDocument document = getDocument();
+		if (document == null)
+			return;
+		IDOMModel model = document.getModel();
+		if (model == null)
+			return;
+		IFile file = getFile(model);
+		if (file == null)
+			return;
+		IProject project = file.getProject();
+		if (project == null)
+			return;
+		if (!project.equals(resource.getProject()))
+			return;
+		documentTypeChanged();
 	}
 
 	/**
@@ -75,10 +104,9 @@
 		DocumentType newDocumentType = findDocumentType(document);
 		if (newDocumentType != null) {
 			publicId = newDocumentType.getPublicId();
-		}
-		else {
+		} else {
 			// lookup default set by contentsettings
-			publicId = HTMLContentProperties.getProperty(HTMLContentProperties.DOCUMENT_TYPE, file, true);
+			publicId = getDefaultPublicId(file);
 		}
 
 		// lookup DOCTYPE registry
@@ -121,8 +149,7 @@
 				else
 					newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_XHTML);
 
-			}
-			else {
+			} else {
 				newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_HTML);
 			}
 			if (newEntry == null)
@@ -190,6 +217,25 @@
 		return this.fFactory.getAttrNameCase();
 	}
 
+	/**
+	 */
+	private String getDefaultPublicId(IFile file) {
+		if (file == null)
+			return null;
+		IProject project = file.getProject();
+		if (project == null)
+			return null;
+		IContentSettings settings = ContentSettings.getInstance();
+		if (settings == null)
+			return null;
+		String publicId = settings.getProperty(file, IContentSettings.HTML_DOCUMENT_TYPE);
+		if (publicId == null || publicId.length() == 0) {
+			// look up project default
+			publicId = settings.getProperty(project, IContentSettings.HTML_DOCUMENT_TYPE);
+		}
+		return publicId;
+	}
+
 	private IFile getFile(IStructuredModel model) {
 		IFile result = null;
 		String location = model.getBaseLocation();
@@ -241,8 +287,7 @@
 		if (notifier instanceof IDOMDocument) {
 			if (eventType != INodeNotifier.STRUCTURE_CHANGED)
 				return;
-		}
-		else {
+		} else {
 			if (eventType != INodeNotifier.CHANGE)
 				return;
 		}
@@ -252,6 +297,7 @@
 	/**
 	 */
 	public void release() {
+		ContentSettingsChangeSubject.getSubject().removeListener(this);
 		super.release();
 	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
index 67c3a7e..27fcc9b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
@@ -28,7 +28,6 @@
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.w3c.dom.Attr;
 import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
 
 // nakamori_TODO: check and remove CSS formatting
 
@@ -59,14 +58,6 @@
 	/**
 	 */
 	private void formatEndTag(IDOMElement element, HTMLFormatContraints contraints) {
-		Node lastChild = element.getLastChild();
-
-		if (lastChild != null && lastChild instanceof IDOMElement && lastChild.getNodeName().equals("jsp:scriptlet")) { //$NON-NLS-1$
-			insertBreakAfter((IDOMElement) lastChild, contraints);
-			return;
-		}
-
-
 		IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
 		if (endStructuredDocumentRegion == null)
 			return;
@@ -103,12 +94,10 @@
 			removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
 		}
 
-		// BUG123890 (end tag length was already prefactored into
-		// formatStartTag so no need to do it here)
-		// String newEndTag = endStructuredDocumentRegion.getText();
-		// if (newEndTag != null && newEndTag.length() > 0) {
-		// setWidth(contraints, newEndTag);
-		//		}
+		String newEndTag = endStructuredDocumentRegion.getText();
+		if (newEndTag != null && newEndTag.length() > 0) {
+			setWidth(contraints, newEndTag);
+		}
 	}
 
 	/**
@@ -128,12 +117,6 @@
 	/**
 	 */
 	private void formatStartTag(IDOMElement element, HTMLFormatContraints contraints) {
-
-		if (element.getNodeName().equals("jsp:scriptlet")) { //$NON-NLS-1$
-			insertBreakBefore(element, contraints);
-			return;
-		}
-
 		IStructuredDocumentRegion startStructuredDocumentRegion = element.getStartStructuredDocumentRegion();
 		if (startStructuredDocumentRegion == null)
 			return;
@@ -262,11 +245,8 @@
 				compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
 				count++;
 			}
-			else {
+			else
 				removeTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
-				// BUG123890 (pre-factor in end tag)
-				count += element.getTagName().length() + 3;
-			}
 			addWidth(contraints, count);
 		}
 		else {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
index 6ab979c..83baf5b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
@@ -29,10 +29,10 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceAlreadyExists;
 import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceInUse;
 import org.eclipse.wst.sse.core.internal.util.PathHelper;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
index 1021cc7..1683e1c 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005 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
@@ -55,9 +55,5 @@
 
 		node.putInt(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
 		node.putInt(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
-
-		// this could be made smarter by actually looking up the content
-		// type's valid extensions
-		node.put(HTMLCorePreferenceNames.DEFAULT_EXTENSION, "html"); //$NON-NLS-1$
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
index 606783d..90e1d78 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005 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
@@ -23,15 +23,6 @@
 	}
 
 	/**
-	 * The default extension to use when none is specified in the New HTML
-	 * File Wizard.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-
-	/**
 	 * The maximum width of a line before a line split is needed.
 	 * <p>
 	 * Value is of type <code>Integer</code>.
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
index 7fa8822..a8131c6 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
@@ -6,7 +6,7 @@
  * types for HTML. Clients should reference the partition type Strings defined
  * here directly.
  * 
- * @deprecated use org.eclipse.wst.html.core.text.IHTMLPartitions
+ * @plannedfor 1.0
  */
 public interface IHTMLPartitionTypes {
 
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
index 3c93d42..3153e81 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
@@ -13,9 +13,9 @@
 import java.util.Locale;
 
 import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
 import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
@@ -23,7 +23,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.text.rules.IStructuredTypedRegion;
 import org.eclipse.wst.sse.core.internal.util.ScriptLanguageKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
 
@@ -34,7 +34,7 @@
  */
 public class StructuredTextPartitionerForHTML extends StructuredTextPartitionerForXML implements IStructuredTextPartitioner {
 
-	private final static String[] configuredContentTypes = new String[]{IHTMLPartitions.HTML_DEFAULT, IHTMLPartitions.HTML_DECLARATION, IHTMLPartitions.HTML_COMMENT, IHTMLPartitions.SCRIPT, ICSSPartitions.STYLE};
+	private final static String[] configuredContentTypes = new String[]{IHTMLPartitionTypes.HTML_DEFAULT, IHTMLPartitionTypes.HTML_DECLARATION, IHTMLPartitionTypes.HTML_COMMENT, IHTMLPartitionTypes.SCRIPT, ICSSPartitionTypes.STYLE};
 
 	public static final String JAVASCRIPT = "javascript"; //$NON-NLS-1$
 	public static final String JAVASCRIPT_APPLICATION = "application/x-javascript"; //$NON-NLS-1$
@@ -44,7 +44,7 @@
 	}
 
 	public IStructuredTypedRegion createPartition(int offset, int length, String type) {
-		if (type == IHTMLPartitions.SCRIPT) {
+		if (type == IHTMLPartitionTypes.SCRIPT) {
 			IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
 			if (node != null) {
 				String stype = getScriptingPartitionType(node);
@@ -56,7 +56,7 @@
 
 	protected void setInternalPartition(int offset, int length, String type) {
 		String localType = type;
-		if (type == IHTMLPartitions.SCRIPT) {
+		if (type == IHTMLPartitionTypes.SCRIPT) {
 			IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
 			if (node != null) {
 				localType = getScriptingPartitionType(node);
@@ -68,7 +68,7 @@
 	private String getScriptingPartitionType(IStructuredDocumentRegion coreNode) {
 		String language = null;
 		String type = null;
-		String result = IHTMLPartitions.SCRIPT;
+		String result = IHTMLPartitionTypes.SCRIPT;
 		IStructuredDocumentRegion node = coreNode;
 		ITextRegion attrNameRegion = null;
 		while (node != null && isValidScriptingRegionType(node.getType())) {
@@ -116,23 +116,23 @@
 	private String lookupScriptType(String type) {
 		for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS.length; i++)
 			if (ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS[i].equalsIgnoreCase(type))
-				return IHTMLPartitions.SCRIPT;
-		return IHTMLPartitions.SCRIPT + ".type." + type.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
+				return IHTMLPartitionTypes.SCRIPT;
+		return IHTMLPartitionTypes.SCRIPT + ".type." + type.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
 	}
 
 	private String lookupScriptLanguage(String language) {
 		for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS.length; i++)
 			if (ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS[i].equalsIgnoreCase(language))
-				return IHTMLPartitions.SCRIPT;
-		return IHTMLPartitions.SCRIPT + ".language." + language.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
+				return IHTMLPartitionTypes.SCRIPT;
+		return IHTMLPartitionTypes.SCRIPT + ".language." + language.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
 	}
 
 	public String getPartitionType(ITextRegion region, int offset) {
 		String result = null;
 		if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT || region.getType() == DOMRegionContext.XML_COMMENT_OPEN)
-			result = IHTMLPartitions.HTML_COMMENT;
+			result = IHTMLPartitionTypes.HTML_COMMENT;
 		else if (region.getType() == DOMRegionContext.XML_DOCTYPE_DECLARATION || region.getType() == DOMRegionContext.XML_DECLARATION_OPEN)
-			result = IHTMLPartitions.HTML_DECLARATION;
+			result = IHTMLPartitionTypes.HTML_DECLARATION;
 		else
 			result = super.getPartitionType(region, offset);
 		return result;
@@ -159,7 +159,7 @@
 		}
 		
 		if(previousStartTagNameRegion == null || nextEndTagNameRegion == null)
-			return IHTMLPartitions.HTML_DEFAULT;
+			return IHTMLPartitionTypes.HTML_DEFAULT;
 		
 		String name1 = previousNode.getText(previousStartTagNameRegion);
 		String name2 = nextNode.getText(nextEndTagNameRegion);
@@ -167,7 +167,7 @@
 			//			return ST_SCRIPT;
 			return getScriptingPartitionType(fStructuredDocument.getRegionAtCharacterOffset(previousNode.getStartOffset(previousStartTagNameRegion)));
 		else if (name1.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) && name2.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
-			return ICSSPartitions.STYLE;
+			return ICSSPartitionTypes.STYLE;
 		return super.getPartitionTypeBetween(previousNode, nextNode);
 	}
 
@@ -181,9 +181,9 @@
 			result = getUnknown();
 		}
 		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
-			result = IHTMLPartitions.SCRIPT;
+			result = IHTMLPartitionTypes.SCRIPT;
 		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
-			result = ICSSPartitions.STYLE;
+			result = ICSSPartitionTypes.STYLE;
 		else
 			result = super.getPartitionType(region, offset);
 
@@ -191,7 +191,7 @@
 	}
 
 	public String getDefaultPartitionType() {
-		return IHTMLPartitions.HTML_DEFAULT;
+		return IHTMLPartitionTypes.HTML_DEFAULT;
 	}
 
 	public IDocumentPartitioner newInstance() {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java
deleted file mode 100644
index 661904a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.wst.html.core.text;
-
-
-/**
- * This interface is not intended to be implemented. It defines the partition
- * types for HTML. Clients should reference the partition type Strings defined
- * here directly.
- * 
- * @since 1.1
- */
-public interface IHTMLPartitions {
-
-	String HTML_DEFAULT = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
-	String HTML_DECLARATION = "org.eclipse.wst.html.HTML_DECLARATION"; //$NON-NLS-1$
-	String HTML_COMMENT = "org.eclipse.wst.html.HTML_COMMENT"; //$NON-NLS-1$
-
-	String SCRIPT = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$
-	String STYLE = "org.eclipse.wst.html.STYLE"; //$NON-NLS-1$
-
-	// ISSUE: I think meta tag areas are here too?
-}
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 9e0f535..0000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:38:10 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
index 9f08499..42fb716 100644
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:43:31 EDT 2006
-compilers.p.build=0
+#Fri May 27 23:56:32 EDT 2005
 compilers.p.deprecated=1
 compilers.p.illegal-att-value=0
 compilers.p.no-required-att=0
diff --git a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
index 8d48ac5..92311f0 100644
--- a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
@@ -2,34 +2,35 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.html.ui; singleton:=true
-Bundle-Version: 1.0.100.qualifier
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.html.ui.internal.HTMLUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.html.internal.validation;x-internal:=true,
- org.eclipse.wst.html.ui,
- org.eclipse.wst.html.ui.internal;x-internal:=true,
- org.eclipse.wst.html.ui.internal.autoedit;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentassist;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentoutline;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentproperties.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.correction;x-internal:=true,
- org.eclipse.wst.html.ui.internal.derived;x-internal:=true,
- org.eclipse.wst.html.ui.internal.edit.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.html.ui.internal.hyperlink;x-internal:=true,
- org.eclipse.wst.html.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.html.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.projection;x-internal:=true,
- org.eclipse.wst.html.ui.internal.registry;x-internal:=true,
- org.eclipse.wst.html.ui.internal.search;x-internal:=true,
- org.eclipse.wst.html.ui.internal.style;x-internal:=true,
- org.eclipse.wst.html.ui.internal.taginfo;x-internal:=true,
- org.eclipse.wst.html.ui.internal.templates;x-internal:=true,
- org.eclipse.wst.html.ui.internal.text;x-internal:=true,
- org.eclipse.wst.html.ui.internal.wizard;x-internal:=true,
+Export-Package: org.eclipse.wst.html.ui,
+ org.eclipse.wst.html.internal.validation,
+ org.eclipse.wst.html.ui.internal,
+ org.eclipse.wst.html.ui.internal.autoedit,
+ org.eclipse.wst.html.ui.internal.contentassist,
+ org.eclipse.wst.html.ui.internal.contentoutline,
+ org.eclipse.wst.html.ui.internal.contentproperties.ui,
+ org.eclipse.wst.html.ui.internal.correction,
+ org.eclipse.wst.html.ui.internal.derived,
+ org.eclipse.wst.html.ui.internal.edit.ui,
+ org.eclipse.wst.html.ui.internal.editor,
+ org.eclipse.wst.html.ui.internal.hyperlink,
+ org.eclipse.wst.html.ui.internal.preferences,
+ org.eclipse.wst.html.ui.internal.preferences.ui,
+ org.eclipse.wst.html.ui.internal.projection,
+ org.eclipse.wst.html.ui.internal.registry,
+ org.eclipse.wst.html.ui.internal.search,
+ org.eclipse.wst.html.ui.internal.style,
+ org.eclipse.wst.html.ui.internal.taginfo,
+ org.eclipse.wst.html.ui.internal.templates,
+ org.eclipse.wst.html.ui.internal.text,
+ org.eclipse.wst.html.ui.internal.wizard,
  org.eclipse.wst.html.ui.views.contentoutline
 Require-Bundle: org.eclipse.ui.ide,
+ org.eclipse.ui.views,
  org.eclipse.jface.text,
  org.eclipse.ui.workbench.texteditor,
  org.eclipse.ui.editors,
@@ -46,4 +47,4 @@
  org.eclipse.wst.common.uriresolver,
  org.eclipse.wst.validation,
  org.eclipse.wst.javascript.ui
-Eclipse-LazyStart: true
+Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.properties b/bundles/org.eclipse.wst.html.ui/plugin.properties
index 6617d96..306240d 100644
--- a/bundles/org.eclipse.wst.html.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.html.ui/plugin.properties
@@ -10,6 +10,7 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=HTML UI Source Editor
+nlFeatureName=HTML UI NL Support
 HTML_Source_Page_Editor.name=HTML Editor
 HTML_Files.name=HTML Files
 HTML_Source.name=HTML Source
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.xml b/bundles/org.eclipse.wst.html.ui/plugin.xml
index 785e6a2..1516fd2 100644
--- a/bundles/org.eclipse.wst.html.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.html.ui/plugin.xml
@@ -7,7 +7,7 @@
 	<extension point="org.eclipse.ui.editors">
 		<editor
 			name="%HTML_Source_Page_Editor.name"
-			icon="$nl$/icons/full/obj16/sourceEditor.gif"
+			icon="icons/full/obj16/sourceEditor.gif"
 			default="true"
 			contributorClass="org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML"
 			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
@@ -95,15 +95,14 @@
 			objectClass="org.eclipse.core.resources.IProject"
 			adaptable="true"
 			name="%WebContentSettings.name"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.ProjectWebContentSettingsPropertyPage"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.ProjectContentSettingsPropertyPage"
 			id="org.eclipse.wst.html.ui.dynamicprojectpropertypage">
 			<filter
 				name="nature"
-				value="org.eclipse.wst.common.project.facet.core.nature">
+				value="org.eclipse.wst.webproject.WebNature">
 			</filter>
 		</page>
 		<!-- for static web project -->
-		<!--
 		<page
 			objectClass="org.eclipse.core.resources.IProject"
 			adaptable="true"
@@ -112,42 +111,72 @@
 			id="org.eclipse.wst.html.ui.staticprojectpropertypage">
 			<filter
 				name="nature"
-				value="org.eclipse.wst.common.project.facet.core.nature">
-			</filter>
-		</page>
-		-->
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage.html">
-			<filter
-				name="contentTypeId"
-				value="org.eclipse.wst.html.core.htmlsource">
+				value="org.eclipse.wst.webproject.StaticWebNature">
 			</filter>
 		</page>
 		<page
 			objectClass="org.eclipse.core.resources.IFile"
 			adaptable="true"
 			name="%WebContentSettings.name"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage.jsp">
-			<filter
-				name="contentTypeId"
-				value="org.eclipse.jst.jsp.core.jspsource">
-			</filter>
+			nameFilter="*.htm*"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.htmlpropertypage">
 		</page>
 		<page
 			objectClass="org.eclipse.core.resources.IFile"
 			adaptable="true"
 			name="%WebContentSettings.name"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage.jspf">
-			<filter
-				name="contentTypeId"
-				value="org.eclipse.jst.jsp.core.jspfragmentsource">
-			</filter>
+			nameFilter="*.shtml"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.htmlpropertypage">
+		</page>
+		<page
+			objectClass="org.eclipse.core.resources.IFile"
+			adaptable="true"
+			name="%WebContentSettings.name"
+			nameFilter="*.xhtml"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.htmlpropertypage">
+		</page>
+		<page
+			objectClass="org.eclipse.core.resources.IFile"
+			adaptable="true"
+			name="%WebContentSettings.name"
+			nameFilter="*.jhtml"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.htmlpropertypage">
+		</page>
+		<page
+			objectClass="org.eclipse.core.resources.IFile"
+			adaptable="true"
+			name="%WebContentSettings.name"
+			nameFilter="*.jsp"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.htmlpropertypage">
+		</page>
+		<page
+			objectClass="org.eclipse.core.resources.IFile"
+			adaptable="true"
+			name="%WebContentSettings.name"
+			nameFilter="*.jspf"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.htmlpropertypage">
+		</page>
+		<page
+			objectClass="org.eclipse.core.resources.IFile"
+			adaptable="true"
+			name="%WebContentSettings.name"
+			nameFilter="*.jsf"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.htmlpropertypage">
+		</page>
+		<page
+			objectClass="org.eclipse.core.resources.IFile"
+			adaptable="true"
+			name="%WebContentSettings.name"
+			nameFilter="*.wml"
+			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
+			id="org.eclipse.wst.html.ui.htmlpropertypage">
 		</page>
 	</extension>
 	<!-- Editor actionsets -->
@@ -265,7 +294,7 @@
 				class="org.eclipse.wst.html.internal.validation.HTMLValidationWorkbenchHelper">
 			</helper>
 			<run
-				enabled="true"
+				enabled="false"
 				class="org.eclipse.wst.html.internal.validation.HTMLValidator">
 			</run>
 		</validator>
@@ -303,7 +332,7 @@
 			name="%_UI_WIZARD_NAME"
 			class="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard"
 			category="org.eclipse.wst.web.ui"
-			icon="$nl$/icons/full/etool16/newhtml_wiz.gif">
+			icon="icons/full/etool16/newhtml_wiz.gif">
 			<description>%_UI_WIZARD_CREATE_NEW_FILE</description>
 			<selection class="org.eclipse.core.resources.IResource" />
 		</wizard>
@@ -312,18 +341,21 @@
 	<!-- Add new HTML wizard to J2EE Project Navigator -->
 	<extension
 		id="org.eclipse.wst.html.commonWizard.newHTML"
-		point="org.eclipse.ui.navigator.navigatorContent">
+		point="org.eclipse.wst.common.navigator.workbench.commonWizard">
 		<commonWizard
 			type="new"
 			wizardId="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard">
 			<enablement>
 				<or>
-					<instanceof
-						value="org.eclipse.core.resources.IProject" />
-					<instanceof
-						value="org.eclipse.core.resources.IFolder" />
-					<instanceof
-						value="org.eclipse.core.resources.IFile" />
+					<objectClass
+						name="org.eclipse.core.resources.IProject">
+					</objectClass>
+					<objectClass
+						name="org.eclipse.core.resources.IFolder">
+					</objectClass>
+					<objectClass
+						name="org.eclipse.core.resources.IFile">
+					</objectClass>
 				</or>
 			</enablement>
 		</commonWizard>
diff --git a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd b/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
index 742f82f..5a31888 100644
--- a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
+++ b/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
@@ -62,7 +62,7 @@
          <meta.section type="since"/>
       </appInfo>
       <documentation>
-         &lt;b&gt;This extension point is deprecated and should not be used by any other plugins.&lt;/b&gt;
+         &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
       </documentation>
    </annotation>
 
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
index b05f8d1..756566a 100644
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
@@ -21,48 +21,41 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.Logger;
 import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
 import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.util.URIResolver;
 import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
 import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
 import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
 import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Text;
 
-public class HTMLValidator implements IValidatorJob, ISourceValidator {
+public class HTMLValidator implements IValidator, ISourceValidator {
 	private static final String ORG_ECLIPSE_JST_JSP_CORE_JSPSOURCE = "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
 	private static final String ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
 
@@ -210,78 +203,76 @@
 			validateFull(helper, reporter);
 		}
 	}
-
+	
 	/**
-	 * This validate call is for the ISourceValidator partial document
-	 * validation approach
-	 * 
+	 * This validate call is for the ISourceValidator partial document validation approach
 	 * @param dirtyRegion
 	 * @param helper
 	 * @param reporter
-	 * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
+	 *  @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
 	 */
 	public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
-
+		
 		if (helper == null || fDocument == null)
 			return;
-
+		
 		if ((reporter != null) && (reporter.isCancelled() == true)) {
 			throw new OperationCanceledException();
 		}
-
+		
 		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
 		if (model == null)
 			return; // error
-
+	
 		try {
-
+		
 			IDOMDocument document = null;
-			if (model instanceof IDOMModel) {
-				document = ((IDOMModel) model).getDocument();
+			if(model instanceof IDOMModel) {
+				document = ((IDOMModel)model).getDocument();
 			}
 
 			if (document == null || !hasHTMLFeature(document))
-				return; // ignore
-
+				return ; // ignore
+	
 			ITextFileBuffer fb = FileBufferModelManager.getInstance().getBuffer(fDocument);
-			if (fb == null)
+			if(fb == null)
 				return;
-
+			
 			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(fb.getLocation());
-			if (file == null || !file.exists())
+			if(file == null || !file.exists())
 				return;
-
+			
 			// this will be the wrong region if it's Text (instead of Element)
 			// we don't know how to validate Text
-			IndexedRegion ir = getCoveringNode(dirtyRegion); //  model.getIndexedRegion(dirtyRegion.getOffset());
-			if (ir instanceof Text) {
-				while (ir != null && ir instanceof Text) {
+			IndexedRegion ir = model.getIndexedRegion(dirtyRegion.getOffset());
+			if(ir instanceof Text) {
+				while(ir != null && ir instanceof Text) {
 					// it's assumed that this gets the IndexedRegion to
 					// the right of the end offset
 					ir = model.getIndexedRegion(ir.getEndOffset());
 				}
 			}
 			
-			if (ir instanceof INodeNotifier) {
-
+			if(ir instanceof INodeNotifier) {
+				
 				INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
-				ValidationAdapter adapter = (ValidationAdapter) factory.adapt((INodeNotifier) ir);
+				ValidationAdapter adapter = (ValidationAdapter) factory.adapt((INodeNotifier)ir);
 				if (adapter == null)
 					return; // error
-
+				
 				if (reporter != null) {
 					HTMLValidationReporter rep = null;
-					rep = getReporter(reporter, file, (IDOMModel) model);
+					rep = getReporter(reporter, file, (IDOMModel)model);
 					rep.clear();
 					adapter.setReporter(rep);
-
+					
 					String fileName = ""; //$NON-NLS-1$
 					IPath filePath = file.getFullPath();
 					if (filePath != null) {
 						fileName = filePath.toString();
 					}
 					String args[] = new String[]{fileName};
-
+		
 					Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(HTMLUIMessages.MESSAGE_HTML_VALIDATION_MESSAGE_UI_, args));
 					mess.setParams(args);
 					reporter.displaySubtask(this, mess);
@@ -290,81 +281,24 @@
 			}
 		}
 		finally {
-			if (model != null)
+			if(model != null)
 				model.releaseFromRead();
 		}
 	}
 
-	private IndexedRegion getCoveringNode(IRegion dirtyRegion) {
-		
-		IndexedRegion largestRegion = null;
-		if(fDocument instanceof IStructuredDocument) {
-			IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			try {
-				if(sModel != null) {
-					IStructuredDocumentRegion[] regions = ((IStructuredDocument)fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
-				    largestRegion = getLargest(regions);
-				}
-			}
-			finally {
-				if(sModel != null)
-					sModel.releaseFromRead();
-			}
-		}
-		return largestRegion;
-	}
-	protected IndexedRegion getLargest(IStructuredDocumentRegion[] sdRegions) {
-		
-		if(sdRegions == null || sdRegions.length == 0)
-			return null;
-		 
-		IndexedRegion currentLargest = getCorrespondingNode(sdRegions[0]);
-		for (int i = 0; i < sdRegions.length; i++) {
-		    if(!sdRegions[i].isDeleted()) {
-    			IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
-    			
-    			if(currentLargest instanceof Text)
-    				currentLargest = corresponding;
-    			
-                if(corresponding != null) {
-                	if(!(corresponding instanceof Text)) {
-	        			if (corresponding.getStartOffset() <= currentLargest.getStartOffset()  
-	        						&&  corresponding.getEndOffset() >= currentLargest.getEndOffset() )
-	        				currentLargest = corresponding;
-                	}
-                }
-                
-            }
-		}
-		return currentLargest;
-	}
-	protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-        IndexedRegion indexedRegion = null;
-        try {
-            if (sModel != null) 
-                indexedRegion = sModel.getIndexedRegion(sdRegion.getStart());    
-        } finally {
-            if (sModel != null)
-                sModel.releaseFromRead();
-        }
-        return indexedRegion;
-    }
-
 	/**
 	 * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
 	 */
 	public void connect(IDocument document) {
 		fDocument = document;
 	}
-
 	/**
 	 * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
 	 */
 	public void disconnect(IDocument document) {
 		// don't need to do anything
 	}
-
+	
 	/**
 	 */
 	protected HTMLValidationResult validate(IDOMModel model, IFile file) {
@@ -503,19 +437,4 @@
 	public IResource getResource(String delta) {
 		return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(delta));
 	}
-
-	public ISchedulingRule getSchedulingRule(IValidationContext helper) {
-		return null;
-	}
-
-	public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
-		IStatus status = Status.OK_STATUS;
-		try {
-			validate(helper, reporter);
-		}
-		catch (Exception e) {
-			Logger.logException(e);
-		}
-		return status;
-	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
index 80cbe16..1a697d1 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
@@ -25,14 +25,14 @@
 import org.eclipse.jface.text.information.IInformationProvider;
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
 import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
 import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForEmbeddedCSS;
 import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
 import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
 import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
 import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
 import org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs;
 import org.eclipse.wst.html.ui.internal.autoedit.StructuredAutoEditStrategyHTML;
 import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
@@ -45,15 +45,15 @@
 import org.eclipse.wst.javascript.ui.internal.common.style.LineStyleProviderForJavaScript;
 import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptInformationProvider;
 import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptTagInfoHoverProcessor;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
 import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
 import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
 
 /**
@@ -105,7 +105,7 @@
 			allStrategies.add(superStrategies[i]);
 		}
 
-		if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION) {
+		if (contentType == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.HTML_DECLARATION) {
 			allStrategies.add(new StructuredAutoEditStrategyHTML());
 		}
 
@@ -123,8 +123,8 @@
 			String[] htmlTypes = StructuredTextPartitionerForHTML.getConfiguredContentTypes();
 			fConfiguredContentTypes = new String[2 + xmlTypes.length + htmlTypes.length];
 
-			fConfiguredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION;
-			fConfiguredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION;
+			fConfiguredContentTypes[0] = IStructuredPartitionTypes.DEFAULT_PARTITION;
+			fConfiguredContentTypes[1] = IStructuredPartitionTypes.UNKNOWN_PARTITION;
 
 			int index = 0;
 			System.arraycopy(xmlTypes, 0, fConfiguredContentTypes, index += 2, xmlTypes.length);
@@ -137,16 +137,16 @@
 	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
 		IContentAssistProcessor[] processors = null;
 
-		if ((partitionType == IHTMLPartitions.HTML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_COMMENT)) {
+		if ((partitionType == IHTMLPartitionTypes.HTML_DEFAULT) || (partitionType == IHTMLPartitionTypes.HTML_COMMENT)) {
 			processors = new IContentAssistProcessor[]{new HTMLContentAssistProcessor()};
 		}
-		else if (partitionType == IHTMLPartitions.SCRIPT) {
+		else if (partitionType == IHTMLPartitionTypes.SCRIPT) {
 			processors = new IContentAssistProcessor[]{new JavaScriptContentAssistProcessor()};
 		}
-		else if (partitionType == ICSSPartitions.STYLE) {
+		else if (partitionType == ICSSPartitionTypes.STYLE) {
 			processors = new IContentAssistProcessor[]{new CSSContentAssistProcessor()};
 		}
-		else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
+		else if (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION) {
 			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessorForHTML()};
 		}
 
@@ -154,7 +154,7 @@
 	}
 
 	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitions.HTML_DEFAULT);
+		final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitionTypes.HTML_DEFAULT);
 
 		formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
 
@@ -162,7 +162,7 @@
 	}
 
 	public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
-		if (contentType == IHTMLPartitions.HTML_DEFAULT) {
+		if (contentType == IHTMLPartitionTypes.HTML_DEFAULT) {
 			// use xml's doubleclick strategy
 			return getXMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IXMLPartitions.XML_DEFAULT);
 		}
@@ -232,11 +232,11 @@
 
 	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
 		IInformationProvider provider = null;
-		if (partitionType == IHTMLPartitions.HTML_DEFAULT) {
+		if (partitionType == IHTMLPartitionTypes.HTML_DEFAULT) {
 			// HTML
 			provider = new HTMLInformationProvider();
 		}
-		else if (partitionType == IHTMLPartitions.SCRIPT) {
+		else if (partitionType == IHTMLPartitionTypes.SCRIPT) {
 			// HTML JavaScript
 			provider = new JavaScriptInformationProvider();
 		}
@@ -246,13 +246,13 @@
 	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
 		LineStyleProvider[] providers = null;
 
-		if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION) {
+		if (partitionType == IHTMLPartitionTypes.HTML_DEFAULT || partitionType == IHTMLPartitionTypes.HTML_COMMENT || partitionType == IHTMLPartitionTypes.HTML_DECLARATION) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForHTML()};
 		}
-		else if (partitionType == IHTMLPartitions.SCRIPT) {
+		else if (partitionType == IHTMLPartitionTypes.SCRIPT) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForJavascript()};
 		}
-		else if (partitionType == ICSSPartitions.STYLE) {
+		else if (partitionType == ICSSPartitionTypes.STYLE) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForEmbeddedCSS()};
 		}
 
@@ -293,19 +293,19 @@
 				String hoverType = hoverDescs[i].getId();
 				if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
 					// check if script or html is needed
-					if (contentType == IHTMLPartitions.SCRIPT) {
+					if (contentType == IHTMLPartitionTypes.SCRIPT) {
 						textHover = manager.createBestMatchHover(new JavaScriptTagInfoHoverProcessor());
 					}
-					else if (contentType == IHTMLPartitions.HTML_DEFAULT) {
+					else if (contentType == IHTMLPartitionTypes.HTML_DEFAULT) {
 						textHover = manager.createBestMatchHover(new HTMLTagInfoHoverProcessor());
 					}
 				}
 				else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType))
 					// check if script or html is needed
-					if (contentType == IHTMLPartitions.SCRIPT) {
+					if (contentType == IHTMLPartitionTypes.SCRIPT) {
 						textHover = new JavaScriptTagInfoHoverProcessor();
 					}
-					else if (contentType == IHTMLPartitions.HTML_DEFAULT) {
+					else if (contentType == IHTMLPartitionTypes.HTML_DEFAULT) {
 						textHover = new HTMLTagInfoHoverProcessor();
 					}
 			}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
index 4d6b8ff..b4547be 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
@@ -23,33 +23,12 @@
 	private static final String BUNDLE_NAME = "org.eclipse.wst.html.ui.internal.HTMLUIPluginResources";//$NON-NLS-1$
 	private static ResourceBundle fResourceBundle;
 
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, HTMLUIMessages.class);
-	}
-	
-	private HTMLUIMessages() {
-		// cannot create new instance of this class
-	}
-	
-	public static ResourceBundle getResourceBundle() {
-		try {
-			if (fResourceBundle == null)
-				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
-		}
-		catch (MissingResourceException x) {
-			fResourceBundle = null;
-		}
-		return fResourceBundle;
-	}
-	
 	public static String Sample_HTML_doc;
 	public static String HTMLFilesPreferencePage_0;
 	public static String _UI_WIZARD_NEW_TITLE;
 	public static String _UI_WIZARD_NEW_HEADING;
 	public static String _UI_WIZARD_NEW_DESCRIPTION;
 	public static String _ERROR_FILENAME_MUST_END_HTML;
-	public static String ResourceGroup_nameExists;
 	public static String NewHTMLTemplatesWizardPage_0;
 	public static String NewHTMLTemplatesWizardPage_1;
 	public static String NewHTMLTemplatesWizardPage_2;
@@ -75,14 +54,9 @@
 	public static String Creating_files;
 	public static String Encoding_desc;
 	public static String UI_Description_of_role_of_following_DOCTYPE;
-	public static String UI_Default_HTML_DOCTYPE_ID___1;
 	public static String UI_Public_ID;
 	public static String UI_System_ID;
 	public static String UI_none;
-	public static String UI_CSS_profile___2;
-	public static String WebContentSettingsPropertyPage_0;
-	public static String ProjectWebContentSettingsPropertyPage_0;
-	
 	public static String Preferred_markup_case_UI_;
 	public static String Tag_names__UI_;
 	public static String Tag_names_Upper_case_UI_;
@@ -113,4 +87,24 @@
 	public static String HTMLFilesPreferencePage_2;
 	public static String HTMLFilesPreferencePage_3;
 	// above are possibly unused strings that may be deleted
+	
+	static {
+		// load message values from bundle file
+		NLS.initializeMessages(BUNDLE_NAME, HTMLUIMessages.class);
+	}
+	
+	private HTMLUIMessages() {
+		// cannot create new instance of this class
+	}
+	
+	public static ResourceBundle getResourceBundle() {
+		try {
+			if (fResourceBundle == null)
+				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
+		}
+		catch (MissingResourceException x) {
+			fResourceBundle = null;
+		}
+		return fResourceBundle;
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
index a8c46b8..efddd5d 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
@@ -19,7 +19,6 @@
 _UI_WIZARD_NEW_HEADING = HTML Page
 _UI_WIZARD_NEW_DESCRIPTION = Create a new HTML Page.
 _ERROR_FILENAME_MUST_END_HTML = The file name must end in one of the following extensions {0}.
-ResourceGroup_nameExists = The same name already exists.
 NewHTMLTemplatesWizardPage_0=Select HTML Template
 NewHTMLTemplatesWizardPage_1=Select a template as initial content in the HTML page.
 NewHTMLTemplatesWizardPage_2=Name
@@ -73,16 +72,12 @@
 
 # web content settings
 UI_Description_of_role_of_following_DOCTYPE=Use the following default document type when no DOCTYPE is declared in a file:
-UI_Default_HTML_DOCTYPE_ID___1=Document type:
 UI_Public_ID=Public ID:
 UI_System_ID=System ID:
 UI_none=none
-UI_CSS_profile___2=CSS profile:
-WebContentSettingsPropertyPage_0=The properties used that cannot or are not specified in web files.  The project setting is used if you specify "none."
-ProjectWebContentSettingsPropertyPage_0=The properties for J2EE Web projects act as "project" default to be looked up when no properties are specified for a particular web file.
 
 # below are possibly unused strings that may be deleted
 HTMLFilesPreferencePage_1=Add this suffix (if not specified):
 HTMLFilesPreferencePage_2=Insert DOCTYPE declaration
 HTMLFilesPreferencePage_3=Insert GENERATOR with META tag
-# above are possibly unused strings that may be deleted
\ No newline at end of file
+# above are possibly unused strings that may be deleted
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
index d17d678..6d8e2be 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
@@ -22,8 +22,8 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
index 3d08fde..650a4c3 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
@@ -16,7 +16,7 @@
 import org.eclipse.jface.text.templates.TemplateContext;
 import org.eclipse.jface.text.templates.TemplateProposal;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
 
 /**
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
index 5f31eaa..f605ba6 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
@@ -29,12 +29,12 @@
 import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
 import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
 import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -83,6 +83,14 @@
 	}
 
 	/**
+	 * @see AbstractContentAssistProcessor#addXMLProposal(ContentAssistRequest)
+	 */
+	protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
+		if (isXHTML)
+			super.addXMLProposal(contentAssistRequest);
+	}
+
+	/**
 	 * Add the proposals for a completely empty document
 	 */
 	protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
index 56ba59c..1013fab 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
@@ -71,11 +71,11 @@
 			return new ICompletionProposal[0];
 
 		context.setVariable("selection", selection.getText()); // name of the
-		// selection
-		// variables
-		// {line,
-		// word}_selection
-		// //$NON-NLS-1$
+																// selection
+																// variables
+																// {line,
+																// word}_selection
+																// //$NON-NLS-1$
 
 		Template[] templates = getTemplates(context.getContextType().getId());
 
@@ -116,8 +116,7 @@
 	 *         given location, or <code>null</code>
 	 */
 	private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
-		// pretty much same code as super.createContext except create
-		// SmartReplaceTemplateContext
+		// pretty much same code as super.createContext except create SmartReplaceTemplateContext
 		TemplateContextType contextType = getContextType(viewer, region);
 		if (contextType != null) {
 			IDocument document = viewer.getDocument();
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
index d4512f2..a63a6f2 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
@@ -11,9 +11,9 @@
 package org.eclipse.wst.html.ui.internal.contentassist;
 
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
 import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
 import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
 import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
 
@@ -26,13 +26,13 @@
 		
 		super.initPartitionToProcessorMap();
 		IContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor();
-		addPartitionProcessor(IHTMLPartitions.HTML_DEFAULT, htmlProcessor);
-		addPartitionProcessor(IHTMLPartitions.HTML_COMMENT, htmlProcessor);
+		addPartitionProcessor(IHTMLPartitionTypes.HTML_DEFAULT, htmlProcessor);
+		addPartitionProcessor(IHTMLPartitionTypes.HTML_COMMENT, htmlProcessor);
 
 		IContentAssistProcessor jsContentAssistProcessor = new JavaScriptContentAssistProcessor();
-		addPartitionProcessor(IHTMLPartitions.SCRIPT, jsContentAssistProcessor);
+		addPartitionProcessor(IHTMLPartitionTypes.SCRIPT, jsContentAssistProcessor);
 
 		IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
-		addPartitionProcessor(ICSSPartitions.STYLE, cssContentAssistProcessor);
+		addPartitionProcessor(ICSSPartitionTypes.STYLE, cssContentAssistProcessor);
 	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
index b5d028d..d72abeb 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
@@ -10,9 +10,6 @@
  *******************************************************************************/
 package org.eclipse.wst.html.ui.internal.contentproperties.ui;
 
-/**
- * @deprecated Not needed. See BUG118359
- */
 public class AbstractDeviceProfileEntry implements DeviceProfileEntry {
 
 	public AbstractDeviceProfileEntry() {
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
index 44f0bc5..173e80c 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
@@ -12,9 +12,6 @@
 
 import java.util.Iterator;
 
-/**
- * @deprecated Not needed.  See BUG118359
- */
 public class AbstractDeviceProfileEntryProvider implements
 		DeviceProfileEntryProvider {
 
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
index 375ad6b..e66d242 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
@@ -21,10 +21,6 @@
 import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
 import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboList;
 
-/**
- * @deprecated This class only contains helper methods that you should
- *             actually implement yourself.
- */
 public final class ContentSettingsRegistry {
 
 	private static final String NONE = HTMLUIMessages.UI_none;
@@ -62,16 +58,16 @@
 	}
 
 	public static void setCSSMetaModelRegistryInto(ComboList combo) {
-		combo.add(NONE, ""); //$NON-NLS-1$
-		CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
-		Iterator i = reg.getProfiles();
-		while (i.hasNext()) {
-			CSSProfile profile = (CSSProfile) i.next();
-			String id = profile.getProfileID();
-			String name = profile.getProfileName();
-			combo.add(name, id);
-		}
-		combo.sortByKey(1);
+		 combo.add(NONE, ""); //$NON-NLS-1$
+		 CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
+		 Iterator i = reg.getProfiles();
+		 while (i.hasNext()) {
+		 	CSSProfile profile = (CSSProfile) i.next();
+		 	String id = profile.getProfileID();
+		 	String name = profile.getProfileName();
+		 	combo.add(name, id);
+		 }
+		 combo.sortByKey(1);
 	}
 
 	public static void setDeviceProfileRegistryInto(ComboList combo) {
@@ -115,7 +111,7 @@
 					"text/html", //$NON-NLS-1$
 					"text/xml",}; //$NON-NLS-1$
 		String[] displayName = {NONE, "application/xhtml+xml", //$NON-NLS-1$
-					//$NON-NLS-1$
+		//$NON-NLS-1$
 					"application/xml", //$NON-NLS-1$
 					"text/html", //$NON-NLS-1$
 					"text/xml",}; //$NON-NLS-1$
@@ -131,7 +127,7 @@
 	public static void setCharacterCodeInto(ComboList combo) {
 		combo.add(NONE, ""); //$NON-NLS-1$
 		String max = ""; //$NON-NLS-1$
-		// CommonCharsetNames encoding = new CommonCharsetNames();
+		//CommonCharsetNames encoding = new CommonCharsetNames();
 		String[] charCode = CommonCharsetNames.getCommonCharsetNames();
 		for (int i = 0; i < charCode.length; i++) {
 			String displayName = CommonCharsetNames.getDisplayString(charCode[i]);
@@ -144,14 +140,17 @@
 			else
 				combo.add(charCode[i], charCode[i]);
 		}
-		/*
-		 * charCode = encoding.getSupportedJavaEncodings(); for(int i=0;i<charCode.length;i++){
-		 * String displayName = encoding.getDisplayString(charCode[i]); if
-		 * (displayName!=null && displayName.length()!=0)
-		 * combo.add(displayName,charCode[i]); else
-		 * combo.add(charCode[i],charCode[i]); }
+		/*	
+		 charCode = encoding.getSupportedJavaEncodings();
+		 for(int i=0;i<charCode.length;i++){
+		 String displayName = encoding.getDisplayString(charCode[i]);
+		 if (displayName!=null && displayName.length()!=0)
+		 combo.add(displayName,charCode[i]);
+		 else
+		 combo.add(charCode[i],charCode[i]);
+		 }
 		 */
-		// combo.sortByKey(1);
+		//	combo.sortByKey(1);
 		maxLengthStringInCharacterCodeRegistry = max;
 	}
 
@@ -160,7 +159,7 @@
 					"java", //$NON-NLS-1$
 					"javascript",}; //$NON-NLS-1$
 		String[] displayName = {NONE, "java", //$NON-NLS-1$
-					//$NON-NLS-1$
+		//$NON-NLS-1$
 					"javascript",}; //$NON-NLS-1$
 		for (int i = 0; i < lang.length; i++) {
 			if (displayName[i] != null && displayName[i].length() != 0)
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
index 0be791b..94f24e4 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
@@ -12,16 +12,12 @@
 
 /**
  * <p>
- * This interface is not intended to be implemented by clients directly.
- * Instead, please use abstract class(AbstractDeviceProfileEntry) instead.
+ * This interface is not intended to be implemented by clients
+ * directly. Instead, please use abstract class(AbstractDeviceProfileEntry) instead.
  * </p>
- * 
- * @deprecated Not needed. See BUG118359
  */
 public interface DeviceProfileEntry {
 	public String getEntryId();
-
 	public String getEntryName();
-
 	public void release();
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
index 8e7260b..552c1db 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
@@ -14,15 +14,11 @@
 
 /**
  * <p>
- * This interface is not intended to be implemented by clients directly.
- * Instead, please use abstract class(AbstractDeviceProfileEntryProvider)
- * instead.
+ * This interface is not intended to be implemented by clients
+ * directly. Instead, please use abstract class(AbstractDeviceProfileEntryProvider) instead.
  * </p>
- * 
- * @deprecated Not needed. See BUG118359
  */
 public interface DeviceProfileEntryProvider {
 	public Iterator getDeviceProfileEntries();
-
 	public void release();
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
index 6e5ad05..6367d10 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
@@ -16,9 +16,6 @@
 import org.eclipse.core.runtime.IExtensionPoint;
 import org.eclipse.core.runtime.Platform;
 
-/**
- * @deprecated Not needed.  See BUG118359
- */
 public class DeviceProfileEntryProviderBuilder {
 	private static final String EXTENSION_POINT_PLUGINID = "org.eclipse.wst.html.ui";  //$NON-NLS-1$
 	private static final String EXTENSION_POINT_NAME = "deviceProfileEntryProvider"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
index ec1fb00..b2f148f 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
@@ -26,9 +26,6 @@
 import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
 import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
 
-/**
- * @deprecated Use WebContentSettingsPropertyPage instead
- */
 public final class HTMLContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
 
 
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
index 5188e05..b5c84d6 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
@@ -26,9 +26,6 @@
 import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
 import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
 
-/**
- * @deprecated Use ProjectHTMLContentSettingsPropertyPage instead
- */
 public final class ProjectContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
 
 
@@ -52,7 +49,7 @@
 
 	protected void createDocumentTypeComboBox() {
 
-		// create description of implecit DOCTYPE
+		// create description of implecit DOCTYPE	
 		Label label = new Label(propertyPage, SWT.LEFT);
 		label.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
 		GridData data = new GridData();
@@ -65,7 +62,7 @@
 		super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
 		// set entry list into Combo
 		ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
-		// create TextField
+		//	create TextField
 		createIDTextField();
 		if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
 			return;
@@ -137,7 +134,7 @@
 		int type = ((IResource) getElement()).getType();
 		switch (type) {
 			case IResource.PROJECT :
-				// composite = createComposite(propertyPage,numCols,numRows);
+				//	composite = createComposite(propertyPage,numCols,numRows);
 				createDocumentTypeComboBox();
 				createCSSComboBox();
 				createDeviceComboBox();
@@ -225,8 +222,7 @@
 
 
 	private void computeMaxWidthHint() {
-		// maxLengthString was set when HTMLDocumentTypeEntry was set in class
-		// ContentSettingsRegistry.
+		// maxLengthString was set when HTMLDocumentTypeEntry was set in class ContentSettingsRegistry.
 		String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
 		String backup = this.systemIdText.getText();
 		this.systemIdText.setText(maxLengthString);
@@ -280,3 +276,4 @@
 	}
 
 }
+
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java
deleted file mode 100644
index 6ccbe4c..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-
-public class ProjectWebContentSettingsPropertyPage extends WebContentSettingsPropertyPage {
-	public ProjectWebContentSettingsPropertyPage() {
-		setDescription(HTMLUIMessages.ProjectWebContentSettingsPropertyPage_0);
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
deleted file mode 100644
index 4bd999c..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentProperties;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-
-public class WebContentSettingsPropertyPage extends PropertyPage {
-	private static final String SELECT_NONE = HTMLUIMessages.UI_none;
-	private String maxLengthStringInHTMLDocumentTypeRegistry = ""; //$NON-NLS-1$
-
-	private class ComboSelectionListener implements SelectionListener {
-		public void widgetDefaultSelected(SelectionEvent e) {
-			// do nothing
-		}
-
-		public void widgetSelected(SelectionEvent e) {
-			int index = fDocumentTypeCombo.getSelectionIndex();
-			String doctype = (String) fDocumentTypeIds.get(index);
-			updateDoctypeText(index, doctype);
-		}
-	}
-
-	Combo fDocumentTypeCombo;
-	List fDocumentTypeIds;
-	private Text fPublicIdText;
-	private Text fSystemIdText;
-	private Combo fProfileCombo;
-	private List fProfileIds;
-	private SelectionListener fListener;
-
-	public WebContentSettingsPropertyPage() {
-		super();
-		setDescription(HTMLUIMessages.WebContentSettingsPropertyPage_0);
-	}
-
-	private Composite createComposite(Composite parent, int numColumns) {
-		Composite composite = new Composite(parent, SWT.NULL);
-
-		// GridLayout
-		GridLayout layout = new GridLayout();
-		layout.numColumns = numColumns;
-		composite.setLayout(layout);
-
-		// GridData
-		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		composite.setLayoutData(data);
-
-		return composite;
-	}
-
-	protected Control createContents(Composite parent) {
-		Composite propertyPage = createComposite(parent, 2);
-
-		createDoctypeContents(propertyPage);
-		createCSSProfileContents(propertyPage);
-
-		populateValues();
-		initializeValues();
-		computeMaxWidthHint();
-
-		fListener = new ComboSelectionListener();
-		fDocumentTypeCombo.addSelectionListener(fListener);
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
-		return propertyPage;
-	}
-
-	private void createCSSProfileContents(Composite parent) {
-		// CSS Profile
-		Text languageLabel = new Text(parent, SWT.READ_ONLY);
-		languageLabel.setText(HTMLUIMessages.UI_CSS_profile___2);
-		fProfileCombo = new Combo(parent, SWT.READ_ONLY);
-		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		fProfileCombo.setLayoutData(data);
-	}
-
-	private void createDoctypeContents(Composite parent) {
-		// create description of implicit DOCTYPE
-		Text doctypeLabel = new Text(parent, SWT.READ_ONLY);
-		doctypeLabel.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
-		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		data.horizontalSpan = 2;
-		doctypeLabel.setLayoutData(data);
-
-		// document type
-		Text languageLabel = new Text(parent, SWT.READ_ONLY);
-		languageLabel.setText(HTMLUIMessages.UI_Default_HTML_DOCTYPE_ID___1);
-		fDocumentTypeCombo = new Combo(parent, SWT.READ_ONLY);
-		data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		fDocumentTypeCombo.setLayoutData(data);
-
-		// public ID
-		Text publicIdLabel = new Text(parent, SWT.READ_ONLY);
-		publicIdLabel.setText(HTMLUIMessages.UI_Public_ID);
-		fPublicIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
-		data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		fPublicIdText.setLayoutData(data);
-
-		// system ID
-		Text systemIdLabel = new Text(parent, SWT.READ_ONLY);
-		systemIdLabel.setText(HTMLUIMessages.UI_System_ID);
-		fSystemIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
-		data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalIndent = 0;
-		fSystemIdText.setLayoutData(data);
-
-		// create separator
-		Label label = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
-		data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		data.horizontalSpan = 2;
-		data.verticalSpan = 8;
-		label.setLayoutData(data);
-	}
-
-	/**
-	 * Get the resource this properties page is for
-	 * 
-	 * @return IResource for this properties page or null if there is no
-	 *         IResource
-	 */
-	private IResource getResource() {
-		IResource resource = null;
-		if (getElement() instanceof IResource) {
-			resource = (IResource) getElement();
-		}
-		return resource;
-	}
-
-	private String getSystemIdFrom(String publicId) {
-		if (publicId == null || publicId.length() == 0)
-			return null;
-		HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
-		Enumeration e = reg.getEntries();
-		while (e.hasMoreElements()) {
-			HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
-			if (entry.getPublicId().equals(publicId))
-				return entry.getSystemId();
-		}
-		return null;
-	}
-
-	private void initializeValues() {
-		initializeDoctypeValues();
-		initializeCSSProfileValues();
-	}
-
-	private void initializeCSSProfileValues() {
-		int index = 0;
-		String profile = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, getResource(), false);
-		if (profile != null && profile.length() > 0) {
-			/*
-			 * If item is already part of combo, select it. Otherwise, select
-			 * none.
-			 */
-			index = fProfileIds.indexOf(profile);
-		}
-		index = index >= 0 ? index : 0;
-		fProfileCombo.select(index);
-	}
-
-	private void initializeDoctypeValues() {
-		int index = 0;
-		String doctype = HTMLContentProperties.getProperty(HTMLContentProperties.DOCUMENT_TYPE, getResource(), false);
-		if (doctype != null && doctype.length() > 0) {
-			/*
-			 * If item is already part of combo, select it. Otherwise, select
-			 * none.
-			 */
-			index = fDocumentTypeIds.indexOf(doctype);
-		}
-
-		// set combobox
-		index = index >= 0 ? index : 0;
-		fDocumentTypeCombo.select(index);
-
-		updateDoctypeText(index, doctype);
-	}
-
-	void updateDoctypeText(int index, String doctype) {
-		if (index > 0) {
-			// set public/system id text
-			fPublicIdText.setText(doctype);
-			String systemId = getSystemIdFrom(doctype);
-			if (systemId != null)
-				fSystemIdText.setText(systemId);
-			else
-				fSystemIdText.setText(""); //$NON-NLS-1$
-		}
-		else {
-			// set public/system id text
-			fPublicIdText.setText(""); //$NON-NLS-1$
-			fSystemIdText.setText(""); //$NON-NLS-1$
-		}
-	}
-
-	private void populateValues() {
-		populateDoctypeValues();
-		populateCSSProfileValues();
-	}
-
-	private void populateCSSProfileValues() {
-		fProfileIds = new ArrayList();
-		// add none first
-		fProfileCombo.add(SELECT_NONE);
-		fProfileIds.add(null);
-
-		CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
-		Iterator i = reg.getProfiles();
-		while (i.hasNext()) {
-			CSSProfile profile = (CSSProfile) i.next();
-			String id = profile.getProfileID();
-			String name = profile.getProfileName();
-			fProfileCombo.add(name);
-			fProfileIds.add(id);
-		}
-	}
-
-	private void populateDoctypeValues() {
-		fDocumentTypeIds = new ArrayList();
-		// add none first
-		fDocumentTypeCombo.add(SELECT_NONE);
-		fDocumentTypeIds.add(null);
-
-		HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
-		Enumeration e = reg.getEntries();
-		while (e.hasMoreElements()) {
-			HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
-			String publicId = entry.getPublicId();
-			String displayName = entry.getDisplayName();
-			displayName = displayName != null ? displayName : publicId;
-
-			fDocumentTypeCombo.add(displayName);
-			fDocumentTypeIds.add(publicId);
-
-			if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length()) {
-				maxLengthStringInHTMLDocumentTypeRegistry = displayName;
-			}
-
-			if (entry.getSystemId() == null)
-				continue; // if HTML entry
-
-
-			if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
-				maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
-		}
-	}
-
-	private void computeMaxWidthHint() {
-		// maxLengthString was set populateDoctypeValues was called
-		String maxLengthString = maxLengthStringInHTMLDocumentTypeRegistry;
-		String backup = fSystemIdText.getText();
-		fSystemIdText.setText(maxLengthString);
-		int maxWidthHint = fSystemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
-		fSystemIdText.setText(backup);
-
-		if (fDocumentTypeCombo.getLayoutData() != null)
-			((GridData) fDocumentTypeCombo.getLayoutData()).widthHint = maxWidthHint;
-		if (fPublicIdText.getLayoutData() != null)
-			((GridData) fPublicIdText.getLayoutData()).widthHint = maxWidthHint;
-		if (fSystemIdText.getLayoutData() != null)
-			((GridData) fSystemIdText.getLayoutData()).widthHint = maxWidthHint;
-		if (fProfileCombo.getLayoutData() != null)
-			((GridData) fProfileCombo.getLayoutData()).widthHint = maxWidthHint;
-	}
-
-	private void performCSSProfileDefaults() {
-		int index = fProfileCombo.indexOf(SELECT_NONE);
-		if (index > -1)
-			fProfileCombo.select(index);
-
-		super.performDefaults();
-	}
-
-	private boolean performCSSProfileOk() {
-		int index = fProfileCombo.getSelectionIndex();
-		if (index > -1) {
-			String id = (String) fProfileIds.get(index);
-			if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
-				// if none, use null
-				id = null;
-			}
-			try {
-				CSSContentProperties.setProperty(CSSContentProperties.CSS_PROFILE, getResource(), id);
-			}
-			catch (CoreException e) {
-				// maybe in future, let user know there was a problem saving
-				// file
-				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			}
-		}
-		return true;
-	}
-
-	protected void performDefaults() {
-		super.performDefaults();
-
-		performDoctypeDefaults();
-		performCSSProfileDefaults();
-	}
-
-	private void performDoctypeDefaults() {
-		fPublicIdText.setText("");//$NON-NLS-1$
-		fSystemIdText.setText(""); //$NON-NLS-1$
-	}
-
-	private boolean performDoctypeOk() {
-		int index = fDocumentTypeCombo.getSelectionIndex();
-		if (index > -1) {
-			String id = (String) fDocumentTypeIds.get(index);
-			if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
-				// if none, use null
-				id = null;
-			}
-			try {
-				HTMLContentProperties.setProperty(HTMLContentProperties.DOCUMENT_TYPE, getResource(), id);
-			}
-			catch (CoreException e) {
-				// maybe in future, let user know there was a problem saving
-				// file
-				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			}
-		}
-		return true;
-	}
-
-	public boolean performOk() {
-		performDoctypeOk();
-		performCSSProfileOk();
-
-		return super.performOk();
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
index 6869065..56428dc 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
@@ -16,9 +16,9 @@
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
 import org.eclipse.jface.text.contentassist.IContentAssistant;
 import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
 import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML;
 
 /**
@@ -34,7 +34,7 @@
 
 			if (sourceViewer != null) {
 				IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(sourceViewer);
-				assistant.setContentAssistProcessor(correctionProcessor, IHTMLPartitions.HTML_DEFAULT);
+				assistant.setContentAssistProcessor(correctionProcessor, IHTMLPartitionTypes.HTML_DEFAULT);
 				assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA);
 				assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT);
 				assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION);
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
index 4d553f8..f6139b5 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
@@ -27,9 +27,9 @@
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
 import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
index 54f9baa..4d8b548 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
@@ -18,11 +18,11 @@
 import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
 import org.eclipse.jface.text.hyperlink.URLHyperlink;
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
@@ -304,7 +304,7 @@
 					int regLength = valueRegion.getTextLength();
 					String attValue = att.getValueRegionText();
 					if (StringUtils.isQuoted(attValue)) {
-						++regOffset;
+						regOffset = ++regOffset;
 						regLength = regLength - 2;
 					}
 					hyperRegion = new Region(regOffset, regLength);
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
index e3b4631..5039c72 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
@@ -23,8 +23,8 @@
 import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
 import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
index 165153b..097e0bf 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
@@ -10,20 +10,20 @@
  *******************************************************************************/
 package org.eclipse.wst.html.ui.internal.preferences.ui;
 
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
 import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
 import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
 import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.xml.ui.internal.preferences.EncodingSettings;
 import org.eclipse.wst.xml.ui.internal.preferences.WorkbenchDefaultEncodingSettings;
 import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
 
@@ -34,9 +34,7 @@
 		return HTMLCorePlugin.getDefault().getPluginPreferences();
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
+	/* (non-Javadoc)
 	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
 	 */
 	protected IPreferenceStore doGetPreferenceStore() {
@@ -47,9 +45,7 @@
 		HTMLCorePlugin.getDefault().savePluginPreferences(); // model
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
+	/* (non-Javadoc)
 	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
 	 */
 	protected Control createContents(Composite parent) {
@@ -57,12 +53,12 @@
 		createContentsForCreatingOrSavingGroup(scrolledComposite);
 		createContentsForCreatingGroup(scrolledComposite);
 		createContentsForLoadingGroup(scrolledComposite);
-
+		
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(scrolledComposite, IHelpContextIds.HTML_PREFWEBX_FILES_HELPID);
-
+		
 		setSize(scrolledComposite);
 		loadPreferences();
-
+		
 		return scrolledComposite;
 	}
 
@@ -72,57 +68,48 @@
 
 		fInputEncodingSettings = new WorkbenchDefaultEncodingSettings(group);
 	}
-
-	protected IContentType getContentType() {
-		return Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
-	}
-
+	
 	protected void initializeValues() {
 		super.initializeValues();
 		initializeValuesForLoadingGroup();
 	}
-
+	
 	protected void initializeValuesForLoadingGroup() {
 		String encoding = getModelPreferences().getString(CommonEncodingPreferenceNames.INPUT_CODESET);
-
+		
 		fInputEncodingSettings.setIANATag(encoding);
 	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
+	
+	/* (non-Javadoc)
 	 * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
 	 */
 	protected void performDefaults() {
 		super.performDefaults();
 		performDefaultsForLoadingGroup();
 	}
-
+	
 	protected void performDefaultsForLoadingGroup() {
 		String encoding = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.INPUT_CODESET);
 
 		fInputEncodingSettings.setIANATag(encoding);
 	}
-
+	
 	protected void storeValues() {
 		super.storeValues();
 		storeValuesForLoadingGroup();
 	}
-
+	
 	protected void storeValuesForLoadingGroup() {
-		getModelPreferences().setValue(CommonEncodingPreferenceNames.INPUT_CODESET, fInputEncodingSettings.getIANATag());
+		getModelPreferences().setValue(CommonEncodingPreferenceNames.INPUT_CODESET, fInputEncodingSettings.getIANATag());		
 	}
-
 	protected void createContentsForCreatingGroup(Composite parent) {
-		super.createContentsForCreatingGroup(parent);
-		// Group creatingGroup = createGroup(parent, 2);
-		// creatingGroup.setText(HTMLUIMessages.Creating_files);
-		//		
-		// // Encoding..
-		// Label label = createLabel(creatingGroup,
-		// HTMLUIMessages.Encoding_desc);
-		// ((GridData)label.getLayoutData()).horizontalSpan = 2;
-		// fEncodingSettings = new EncodingSettings(creatingGroup);
-		// ((GridData)fEncodingSettings.getLayoutData()).horizontalSpan = 2;
+		Group creatingGroup = createGroup(parent, 2);
+		creatingGroup.setText(HTMLUIMessages.Creating_files);
+		
+		// Encoding..
+		Label label = createLabel(creatingGroup, HTMLUIMessages.Encoding_desc);
+		((GridData)label.getLayoutData()).horizontalSpan = 2;
+		fEncodingSettings = new EncodingSettings(creatingGroup);
+		((GridData)fEncodingSettings.getLayoutData()).horizontalSpan = 2;
 	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
index 268df31..d6a0457 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
@@ -4,12 +4,12 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.source.projection.IProjectionListener;
 import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Document;
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
index 2e2a696..4a3e740 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
@@ -12,10 +12,10 @@
 
 package org.eclipse.wst.html.ui.internal.search;
 
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
 import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
 
 /**
  * Configures a FindOccurrencesProcessor with HTML partitions and regions
@@ -23,7 +23,7 @@
 public class HTMLFindOccurrencesProcessor extends FindOccurrencesProcessor {
 
 	protected String[] getPartitionTypes() {
-		return new String[]{IHTMLPartitions.HTML_DEFAULT, IXMLPartitions.XML_DEFAULT};
+		return new String[]{IHTMLPartitionTypes.HTML_DEFAULT, IXMLPartitions.XML_DEFAULT};
 	}
 
 	protected String[] getRegionTypes() {
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
index 4e9cb00..9c85f32 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
@@ -21,6 +21,8 @@
 
 /**
  * Provides context information for HTML tags (Shows tooltip description)
+ * 
+ * @author amywu
  */
 public class HTMLInformationProvider implements IInformationProvider, IInformationProviderExtension {
 
@@ -30,31 +32,22 @@
 		fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new HTMLTagInfoHoverProcessor());
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer,
-	 *      int)
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int)
 	 */
 	public IRegion getSubject(ITextViewer textViewer, int offset) {
 		return fTextHover.getHoverRegion(textViewer, offset);
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer,
-	 *      org.eclipse.jface.text.IRegion)
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
 	 */
 	public String getInformation(ITextViewer textViewer, IRegion subject) {
-		return (String) getInformation2(textViewer, subject);
+		return (String)getInformation2(textViewer, subject);
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer,
-	 *      org.eclipse.jface.text.IRegion)
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
 	 */
 	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
 		return fTextHover.getHoverInfo(textViewer, subject);
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
index e012751..081f609 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
@@ -1,13 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
 package org.eclipse.wst.html.ui.internal.wizard;
 
 import java.io.ByteArrayInputStream;
@@ -18,11 +8,8 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
 import org.eclipse.core.runtime.content.IContentType;
@@ -39,7 +26,6 @@
 import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
 import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
 import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
 import org.eclipse.wst.html.ui.internal.Logger;
@@ -51,109 +37,30 @@
 	private WizardNewFileCreationPage fNewFilePage;
 	private NewHTMLTemplatesWizardPage fNewFileTemplatesPage;
 	private IStructuredSelection fSelection;
-	private IContentType fContentType;
 	private List fValidExtensions = null;
 
 	/**
-	 * Adds default extension to the filename
-	 * 
-	 * @param filename
-	 * @return
-	 */
-	String addDefaultExtension(String filename) {
-		StringBuffer newFileName = new StringBuffer(filename);
-
-		Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
-		String ext = preference.getString(HTMLCorePreferenceNames.DEFAULT_EXTENSION);
-
-		newFileName.append("."); //$NON-NLS-1$
-		newFileName.append(ext);
-
-		return newFileName.toString();
-	}
-
-	/**
-	 * Get content type associated with this new file wizard
-	 * 
-	 * @return IContentType
-	 */
-	IContentType getContentType() {
-		if (fContentType == null)
-			fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
-		return fContentType;
-	}
-
-	/**
-	 * Get list of valid extensions for HTML Content type
+	 * Get list of valid extensions for JSP Content type
 	 * 
 	 * @return
 	 */
 	List getValidExtensions() {
 		if (fValidExtensions == null) {
-			IContentType type = getContentType();
+			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
 			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
 		}
 		return fValidExtensions;
 	}
-	
-	/**
-	 * Verifies if fileName is valid name for content type. Takes base content
-	 * type into consideration.
-	 * 
-	 * @param fileName
-	 * @return true if extension is valid for this content type
-	 */
-	boolean extensionValidForContentType(String fileName) {
-		boolean valid = false;
-
-		IContentType type = getContentType();
-		// there is currently an extension
-		if (fileName.lastIndexOf('.') != -1) {
-			// check what content types are associated with current extension
-			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
-			int i = 0;
-			while (i < types.length && !valid) {
-				valid = types[i].isKindOf(type);
-				++i;
-			}
-		}
-		else
-			valid = true; // no extension so valid
-		return valid;
-	}
 
 	public void addPages() {
 		fNewFilePage = new WizardNewFileCreationPage("HTMLWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
 			protected boolean validatePage() {
-				String fileName = getFileName();
-				IPath fullPath = getContainerFullPath();
-				if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
-					// check that filename does not contain invalid extension
-					if (!extensionValidForContentType(fileName)) {
-						setErrorMessage(NLS.bind(HTMLUIMessages._ERROR_FILENAME_MUST_END_HTML, getValidExtensions().toString()));
-						return false;
-					}
-					// no file extension specified so check adding default
-					// extension doesn't equal a file that already exists
-					if (fileName.lastIndexOf('.') == -1) {
-						String newFileName = addDefaultExtension(fileName);
-						IPath resourcePath = fullPath.append(newFileName);
-
-						IWorkspace workspace = ResourcesPlugin.getWorkspace();
-						IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
-						if (!result.isOK()) {
-							// path invalid
-							setErrorMessage(result.getMessage());
-							return false;
-						}
-
-						if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
-							setErrorMessage(HTMLUIMessages.ResourceGroup_nameExists);
-							return false;
-						}
-					}
+				IPath handlePath = new Path(getFileName());
+				String extension = handlePath.getFileExtension();
+				if (extension == null || !getValidExtensions().contains(extension)) {
+					setErrorMessage(NLS.bind(HTMLUIMessages._ERROR_FILENAME_MUST_END_HTML, getValidExtensions().toString()));
+					return false;
 				}
-
 				setErrorMessage(null);
 				return super.validatePage();
 			}
@@ -162,7 +69,7 @@
 		fNewFilePage.setDescription(HTMLUIMessages._UI_WIZARD_NEW_DESCRIPTION);
 
 		addPage(fNewFilePage);
-
+		
 		fNewFileTemplatesPage = new NewHTMLTemplatesWizardPage();
 		addPage(fNewFileTemplatesPage);
 	}
@@ -170,7 +77,7 @@
 	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
 		fSelection = aSelection;
 		setWindowTitle(HTMLUIMessages._UI_WIZARD_NEW_TITLE);
-
+		
 		ImageDescriptor descriptor = HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(HTMLEditorPluginImages.IMG_WIZBAN_NEWHTMLFILE);
 		setDefaultPageImageDescriptor(descriptor);
 	}
@@ -192,58 +99,42 @@
 	}
 
 	public boolean performFinish() {
-		boolean performedOK = false;
 		// save user options for next use
 		fNewFileTemplatesPage.saveLastSavedPreferences();
 
-		// no file extension specified so add default extension
-		String fileName = fNewFilePage.getFileName();
-		if (fileName.lastIndexOf('.') == -1) {
-			String newFileName = addDefaultExtension(fileName);
-			fNewFilePage.setFileName(newFileName);
-		}
-
 		// create a new empty file
 		IFile file = fNewFilePage.createNewFile();
 
-		// if there was problem with creating file, it will be null, so make
-		// sure to check
-		if (file != null) {
-			// put template contents into file
-			String templateString = fNewFileTemplatesPage.getTemplateString();
-			if (templateString != null) {
-				// determine the encoding for the new file
-				Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
-				String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+		// put template contents into file
+		String templateString = fNewFileTemplatesPage.getTemplateString();
+		if (templateString != null) {
+			// determine the encoding for the new file
+			Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
+			String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
 
-				try {
-					ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-					OutputStreamWriter outputStreamWriter = null;
-					if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
-						// just use default encoding
-						outputStreamWriter = new OutputStreamWriter(outputStream);
-					}
-					else {
-						outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
-					}
-					outputStreamWriter.write(templateString);
-					outputStreamWriter.flush();
-					outputStreamWriter.close();
-					ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
-					file.setContents(inputStream, true, false, null);
-					inputStream.close();
+			try {
+				ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+				OutputStreamWriter outputStreamWriter = null;
+				if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
+					// just use default encoding
+					outputStreamWriter = new OutputStreamWriter(outputStream);
+				} else {
+					outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
 				}
-				catch (Exception e) {
-					Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new HTML file", e); //$NON-NLS-1$
-				}
+				outputStreamWriter.write(templateString);
+				outputStreamWriter.flush();
+				outputStreamWriter.close();
+				ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
+				file.setContents(inputStream, true, false, null);
+				inputStream.close();
 			}
-
-			// open the file in editor
-			openEditor(file);
-
-			// everything's fine
-			performedOK = true;
+			catch (Exception e) {
+				Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new HTML file", e); //$NON-NLS-1$
+			}
 		}
-		return performedOK;
+
+		// open the file in editor
+		openEditor(file);
+		return true;
 	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/.cvsignore b/bundles/org.eclipse.wst.sse.core/.cvsignore
index 60d0b9a..fa4ec03 100644
--- a/bundles/org.eclipse.wst.sse.core/.cvsignore
+++ b/bundles/org.eclipse.wst.sse.core/.cvsignore
@@ -5,4 +5,3 @@
 org.eclipse.wst.sse.core_1.0.0.jar
 @dot
 src.zip
-.fbwarnings
diff --git a/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index e586e9e..0000000
--- a/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:38:30 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.pde.prefs
index a589719..1c37f54 100644
--- a/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:43:52 EDT 2006
-compilers.p.build=0
+#Fri May 27 23:57:51 EDT 2005
 compilers.p.deprecated=1
 compilers.p.illegal-att-value=0
 compilers.p.no-required-att=0
diff --git a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
index 992598c..5be5741 100644
--- a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
@@ -2,45 +2,42 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.sse.core; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.sse.core.internal.SSECorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.core,
- org.eclipse.wst.sse.core.internal;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.cleanup;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.encoding;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.encoding.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.exceptions;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.filebuffers;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.format;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.ltk.modelhandler;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.ltk.parser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.model;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.modelhandler;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.parser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.preferences;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.events;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.exceptions;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.model;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.tasks;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.tasks;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.text.rules;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.undo;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.validate;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.text,
- org.eclipse.wst.sse.core.utils,
- org.eclipse.wst.sse.internal.contentproperties;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui"
+Export-Package: org.eclipse.wst.sse.core.internal,
+ org.eclipse.wst.sse.core.internal.cleanup,
+ org.eclipse.wst.sse.core.internal.document,
+ org.eclipse.wst.sse.core.internal.encoding,
+ org.eclipse.wst.sse.core.internal.encoding.util,
+ org.eclipse.wst.sse.core.internal.exceptions,
+ org.eclipse.wst.sse.core.internal.filebuffers,
+ org.eclipse.wst.sse.core.internal.format,
+ org.eclipse.wst.sse.core.internal.ltk.modelhandler,
+ org.eclipse.wst.sse.core.internal.ltk.parser,
+ org.eclipse.wst.sse.core.internal.model,
+ org.eclipse.wst.sse.core.internal.modelhandler,
+ org.eclipse.wst.sse.core.internal.parser,
+ org.eclipse.wst.sse.core.internal.preferences,
+ org.eclipse.wst.sse.core.internal.provisional,
+ org.eclipse.wst.sse.core.internal.provisional.document,
+ org.eclipse.wst.sse.core.internal.provisional.events,
+ org.eclipse.wst.sse.core.internal.provisional.exceptions,
+ org.eclipse.wst.sse.core.internal.provisional.model,
+ org.eclipse.wst.sse.core.internal.provisional.tasks,
+ org.eclipse.wst.sse.core.internal.provisional.text,
+ org.eclipse.wst.sse.core.internal.tasks,
+ org.eclipse.wst.sse.core.internal.text,
+ org.eclipse.wst.sse.core.internal.text.rules,
+ org.eclipse.wst.sse.core.internal.undo,
+ org.eclipse.wst.sse.core.internal.util,
+ org.eclipse.wst.sse.core.internal.validate,
+ org.eclipse.wst.sse.internal.contentproperties
 Require-Bundle: org.eclipse.core.resources,
  org.eclipse.text;visibility:=reexport,
  org.eclipse.core.runtime,
  org.eclipse.core.filebuffers,
  org.eclipse.wst.common.uriresolver,
  org.eclipse.emf.common
-Eclipse-LazyStart: true
+Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.properties b/bundles/org.eclipse.wst.sse.core/plugin.properties
index a8ac67c..9bc14b0 100644
--- a/bundles/org.eclipse.wst.sse.core/plugin.properties
+++ b/bundles/org.eclipse.wst.sse.core/plugin.properties
@@ -12,6 +12,7 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=Structured Text Model
+nlFeatureName=Structured Text Model NL Support
 # extension names
 Adapt_On_Create_Factory_Extension.name=Adapt On Create Factory Extension
 Document_Types_Extension.name=Document Types Extension
@@ -22,4 +23,4 @@
 Model_Handler_Extension.name=Model Handler Extension
 Format_Processors_Extension_Point.name=Format Processors Extension Point
 Task_Scanner_Extension_Point.name=Task Scanner Extension Point
-Structured_Sources_Task_Extension.name=Structured Sources Task
+Structured_Sources_Task_Extension.name=Structured Sources Task
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java
index e94bfa2..2ea4a2d 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java
@@ -14,9 +14,6 @@
 
 import org.eclipse.core.resources.IResourceDelta;
 
-/**
- * @deprecated This is package protected so no one cares anyways.
- */
 abstract class AbstractContentSettingsHandler implements IContentSettingsHandler {
 
 
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java
index 176a7a4..d3d16b0 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java
@@ -17,10 +17,6 @@
 import java.util.Map;
 import java.util.Set;
 
-/**
- * @deprecated See
- *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
 public abstract class AbstractSubject implements INotify, ISubject {
 
 
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
index 3b37451..7044188 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
@@ -35,10 +35,6 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-/**
- * @deprecated See
- *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
 public class ContentSettings implements IContentSettings {
 	private static final String contentSettingsName = ".contentsettings";//$NON-NLS-1$
 
@@ -89,32 +85,27 @@
 			if (!existsContentSettings()) {
 				// create DOM tree for new XML Document
 				createNewDOMTree();
-			}
-			else {
+			} else {
 				// create DOM tree from existing contentsettings.
 				createDOMTree();
 			}
 
-		}
-		catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
+		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
 			Logger.logException(e);
 			try {
 				createNewDOMTree();
 				writeDOMDocument();
-			}
-			catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return;
-			}
-			catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return;
 			}
 
-		}
-		catch (SimpleNodeOperator.CreateContentSettingsFailureException e) {
+		} catch (SimpleNodeOperator.CreateContentSettingsFailureException e) {
 			Logger.logException(e);
 			preProject = currProject;
 			return;
@@ -127,8 +118,7 @@
 				// create project Element and add it into tree
 				e = (Element) domOperator.addElementUnderRoot(this.projectElementName);
 			}
-		}
-		else if (resource.getType() == IResource.FILE) {
+		} else if (resource.getType() == IResource.FILE) {
 			// check exists file Element
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 			if (e == null) {
@@ -161,8 +151,7 @@
 		// write dom tree into .contentsettings
 		try {
 			writeDOMDocument();
-		}
-		catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
+		} catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
 			Logger.logException(ex);
 			preProject = currProject;
 			return;
@@ -189,32 +178,27 @@
 			if (!existsContentSettings()) {
 				// create DOM tree for new XML Document
 				createNewDOMTree();
-			}
-			else {
+			} else {
 				// create DOM tree from existing contentsettings.
 				createDOMTree();
 			}
 
-		}
-		catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
+		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
 			Logger.logException(e);
 			try {
 				createNewDOMTree();
 				writeDOMDocument();
-			}
-			catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return;
-			}
-			catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return;
 			}
 
-		}
-		catch (SimpleNodeOperator.CreateContentSettingsFailureException e) {
+		} catch (SimpleNodeOperator.CreateContentSettingsFailureException e) {
 			Logger.logException(e);
 			preProject = currProject;
 			return;
@@ -227,8 +211,7 @@
 				// create project Element and add it into tree
 				e = (Element) domOperator.addElementUnderRoot(this.projectElementName);
 			}
-		}
-		else if (resource.getType() == IResource.FILE) {
+		} else if (resource.getType() == IResource.FILE) {
 			// check exists file Element
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 			if (e == null) {
@@ -252,8 +235,7 @@
 		// write dom tree into .contentsettings
 		try {
 			writeDOMDocument();
-		}
-		catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
+		} catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
 			Logger.logException(ex);
 			preProject = currProject;
 			return;
@@ -284,11 +266,9 @@
 		Document document = null;
 		try {
 			document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-		}
-		catch (ParserConfigurationException e) {
+		} catch (ParserConfigurationException e) {
 			Logger.logException("exception creating document", e); //$NON-NLS-1$
-		}
-		catch (FactoryConfigurationError e) {
+		} catch (FactoryConfigurationError e) {
 			Logger.logException("exception creating document", e); //$NON-NLS-1$
 		}
 		if (document != null) {
@@ -299,17 +279,17 @@
 
 
 	/**
-	 * 
+	 *  
 	 */
 	public synchronized void deleteAllProperties(final IResource deletedFile) {
 		if (deletedFile == null)
 			return;
-		// if (deletedFile.exists()) return;
+		//	if (deletedFile.exists()) return;
 		if ((deletedFile).getType() != IResource.FILE && (deletedFile).getType() != IResource.PROJECT)
 			return;
 
 
-		contentSettingsPath = getContentSettingsPath(deletedFile);// getProjectOf((IResource)deletedFile)
+		contentSettingsPath = getContentSettingsPath(deletedFile);//getProjectOf((IResource)deletedFile)
 		// +
 		// IPath.SEPARATOR
 		// +
@@ -321,8 +301,7 @@
 
 		try {
 			createDOMTree();
-		}
-		catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
+		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
 			Logger.logException(e);
 			return;
 		}
@@ -349,8 +328,7 @@
 		// write dom tree into .contentsettings
 		try {
 			writeDOMDocument();
-		}
-		catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
+		} catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
 			Logger.logException(ex);
 			preProject = currProject;
 			return;
@@ -375,19 +353,16 @@
 		}
 		try {
 			createDOMTree();
-		}
-		catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
+		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
 			Logger.logException(e);
 			try {
 				createNewDOMTree();
 				writeDOMDocument();
-			}
-			catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return;
-			}
-			catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return;
@@ -407,8 +382,7 @@
 			// write dom tree into .contentsettings
 			try {
 				writeDOMDocument();
-			}
-			catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
+			} catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
 				Logger.logException(ex);
 				preProject = currProject;
 				return;
@@ -450,8 +424,7 @@
 
 		try {
 			createDOMTree();
-		}
-		catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
+		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
 			return false;
 		}
 
@@ -483,8 +456,7 @@
 			strbuf.append(projectPath);
 			strbuf.append(IPath.SEPARATOR);
 			strbuf.append(contentSettingsName);
-		}
-		else
+		} else
 			return null;
 
 		String str = strbuf.toString();
@@ -498,9 +470,9 @@
 
 
 	private String getProjectOf(IResource resource) {
-		// if (resource==null) return null;
+		//if (resource==null) return null;
 		currProject = resource.getProject();
-		// String projectPath=null;
+		//String projectPath=null;
 
 		IPath path = currProject.getLocation();
 		if (path == null) {
@@ -533,20 +505,17 @@
 
 		try {
 			createDOMTree();
-		}
-		catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
+		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
 			Logger.logException(e1);
 			// create DOM tree for new XML Document
 			try {
 				createNewDOMTree();
 				writeDOMDocument();
-			}
-			catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return null;
-			}
-			catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return null;
@@ -573,8 +542,7 @@
 				return null;
 			properties.remove(getPathAttr());
 			return properties;
-		}
-		else {
+		} else {
 			preProject = currProject;
 			return null;// when project or file element is NOT exist.
 		}
@@ -598,20 +566,17 @@
 
 		try {
 			createDOMTree();
-		}
-		catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
+		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
 			Logger.logException(e1);
 			// create DOM tree for new XML Document
 			try {
 				createNewDOMTree();
 				writeDOMDocument();
-			}
-			catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return null;
-			}
-			catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
+			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
 				Logger.logException(e2);
 				preProject = currProject;
 				return null;
@@ -632,8 +597,7 @@
 			String result = e.getAttribute(propertyName);
 			preProject = currProject;
 			return result;
-		}
-		else {
+		} else {
 			preProject = currProject;
 			return null;// when project or file element is NOT exist.
 		}
@@ -691,12 +655,10 @@
 				outputFile.create(inputStream, true, null);
 
 			inputStream.close();
-		}
-		catch (CoreException e) {
+		} catch (CoreException e) {
 			Logger.logException(e);
 			throw new SimpleNodeOperator.WriteContentSettingsFailureException("invalid outputFile in writeDOMDocument()");//$NON-NLS-1$
-		}
-		catch (IOException e) {
+		} catch (IOException e) {
 			Logger.logException(e);
 			throw new SimpleNodeOperator.WriteContentSettingsFailureException("invalid outputStream or inputStream in writeDOMDocument()");//$NON-NLS-1$
 		}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java
index 858329d..0cdf8ed 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java
@@ -13,10 +13,7 @@
 package org.eclipse.wst.sse.internal.contentproperties;
 
 
-/**
- * @deprecated See
- *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
+
 public class ContentSettingsChangeSubject extends AbstractSubject {
 
 
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java
index af1e31a..d4947a7 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java
@@ -13,10 +13,7 @@
 package org.eclipse.wst.sse.internal.contentproperties;
 
 
-/**
- * @deprecated See
- *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
+
 public class ContentSettingsCreator {
 
 	public final static IContentSettings create() {
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java
index b7383d4..042b07e 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java
@@ -23,9 +23,6 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
 class ContentSettingsFileHandler extends AbstractContentSettingsHandler {
 
 
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java
index 9f1ee1b..73e42f5 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java
@@ -16,9 +16,6 @@
 
 import org.eclipse.core.resources.IResourceDelta;
 
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
 final class ContentSettingsSelfHandler extends AbstractContentSettingsHandler {
 
 	private static INotify notify;// = new ContentSettingsChangedSubject();
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
index b4f5bd2..ac8a94f 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
@@ -23,10 +23,6 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.wst.sse.core.internal.Logger;
 
-/**
- * @deprecated See
- *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
 public class ContentSettingsSynchronizer implements IResourceChangeListener {
 	class ContentSettingsVisitor implements IResourceDeltaVisitor {
 		// redefinition in ContentSettings.java
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java
index 1d0bb4a..69ea6e4 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java
@@ -18,51 +18,47 @@
 
 import org.eclipse.core.resources.IResource;
 
-/**
- * @deprecated See
- *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
 public interface IContentSettings {
 	/**
-	 * 
+	 *  
 	 */
 	public final String CSS_PROFILE = "css-profile"; //$NON-NLS-1$
 	/**
-	 * 
+	 *  
 	 */
 	public final String DEVICE_PROFILE = "target-device"; //$NON-NLS-1$
 
 	/**
-	 * 
+	 *  
 	 */
 	public final String DOCUMENT_TYPE = "document-type"; //$NON-NLS-1$
 	/**
-	 * 
+	 *  
 	 */
 	public final String HTML_DOCUMENT_TYPE = "html-document-type"; //$NON-NLS-1$
 
 	/**
-	 * 
+	 *  
 	 */
 	public void deleteAllProperties(final IResource deletedFile);
 
 	/**
-	 * 
+	 *  
 	 */
 	public void deleteProperty(final IResource resource, final String propertyName);
 
 	/**
-	 * 
+	 *  
 	 */
 	public boolean existsProperties(IResource resource);
 
 	/**
-	 * 
+	 *  
 	 */
 	public Map getProperties(final IResource resource);
 
 	/**
-	 * 
+	 *  
 	 */
 	public String getProperty(final IResource resource, final String propertyName);
 
@@ -72,12 +68,12 @@
 	public void releaseCache();
 
 	/**
-	 * 
+	 *  
 	 */
 	public void setProperties(final IResource resource, final Map properties);
 
 	/**
-	 * 
+	 *  
 	 */
 	public void setProperty(final IResource resource, final String propertyName, final String propertyValue);
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java
index 3cce408..22ed3b2 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java
@@ -16,9 +16,6 @@
 
 import org.eclipse.core.resources.IResourceDelta;
 
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
 interface IContentSettingsHandler {
 
 	public void handle(final IResourceDelta delta);
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java
index 581addd..2e02260 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java
@@ -12,10 +12,8 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.internal.contentproperties;
 
-/**
- * @deprecated See
- *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
+
+
 public interface IContentSettingsListener {
 
 	void contentSettingsChanged(org.eclipse.core.resources.IResource e);
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java
index 338de9f..e1c9af1 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java
@@ -13,9 +13,7 @@
 package org.eclipse.wst.sse.internal.contentproperties;
 
 
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
+
 interface INotify {
 
 	void notifyListeners(org.eclipse.core.resources.IResource resource);
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java
index 981a5b4..813ba01 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java
@@ -13,10 +13,7 @@
 package org.eclipse.wst.sse.internal.contentproperties;
 
 
-/**
- * @deprecated See
- *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
+
 public interface ISubject {
 
 	void addListener(IContentSettingsListener listener);
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
index eb231d4..3b22857 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
@@ -46,9 +46,6 @@
 import org.w3c.dom.traversal.NodeIterator;
 import org.xml.sax.SAXException;
 
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
 class SimpleNodeOperator {
 
 	class CreateContentSettingsFailureException extends Exception {
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java
index 2d6ca30..332a09d 100644
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java
+++ b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java
@@ -24,7 +24,7 @@
 
 public class ContentBasedPreferenceGateway {
 	private static String DEFAULT_LOCATION = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-	private static String RUNTIME_XML_ID = "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
+	private static String RUNTIME_XML_ID = "org.eclipse.runtime.xml"; //$NON-NLS-1$
 	private static String SSE_XML_ID = "org.eclipse.wst.xml.core.xmlsource"; //$NON-NLS-1$
 
 	/**
@@ -51,13 +51,13 @@
 		} else {
 			fullId = contentType.getId();
 		}
+		String pluginId = inferPluginId(fullId);
 		// only one known case, so far, of hard coded re-direction
 		// (not sure this is even needed, but just in case).
 		// We don't want to store/change runtime.xml preferences
-		if (RUNTIME_XML_ID.equals(fullId)) {
-			fullId = SSE_XML_ID;
+		if (RUNTIME_XML_ID.equals(pluginId)) {
+			pluginId = SSE_XML_ID;
 		}
-		String pluginId = inferPluginId(fullId);
 		return pluginId;
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
index 430f18c..69b13b7 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
@@ -26,7 +26,7 @@
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.SSECorePlugin;
 import org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 public class FileTaskScannerRegistryReader {
 	private class ScannerInfo {
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
index 64867ae..479be62 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
@@ -28,7 +28,7 @@
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.SSECoreMessages;
 import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.osgi.framework.Bundle;
 
 /**
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
index e15f13f..ec581ea 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
@@ -25,7 +25,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 public class TaskScanningScheduler {
 	private class ListenerVisitor implements IResourceChangeListener, IResourceDeltaVisitor {
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
index 500067e..5499867 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
@@ -39,7 +39,7 @@
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner;
 import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 /**
  * Dispatcher for scanning based on deltas and requested projects
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
deleted file mode 100644
index 0d54a3b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.core;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.model.ModelManagerImpl;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.osgi.framework.Bundle;
-
-/**
- * Class to allow access to ModelManager. Not intended to be subclassed.
- * 
- * @since  1.5  org.eclipse.wst.sse.core
- */
-final public class StructuredModelManager {
-	/**
-	 * Do not allow instances to be created.
-	 */
-	private StructuredModelManager() {
-		super();
-	}
-
-	/**
-	 * Provides access to the instance of IModelManager. Returns null if model
-	 * manager can not be created or is not valid (such as, when workbench is
-	 * shutting down).
-	 * 
-	 * @return IModelManager - returns the one model manager for structured
-	 *         model
-	 */
-	public static IModelManager getModelManager() {
-		boolean isReady = false;
-		IModelManager modelManager = null;
-		while (!isReady) {
-			Bundle localBundle = Platform.getBundle(SSECorePlugin.ID);
-			int state = localBundle.getState();
-			if (state == Bundle.ACTIVE) {
-				isReady = true;
-				// getInstance is a synchronized static method.
-				modelManager = ModelManagerImpl.getInstance();
-			}
-			else if (state == Bundle.STARTING) {
-				try {
-					Thread.sleep(100);
-				}
-				catch (InterruptedException e) {
-					// ignore, just loop again
-				}
-			}
-			else if (state == Bundle.STOPPING || state == Bundle.UNINSTALLED) {
-				isReady = true;
-				modelManager = null;
-			}
-			else {
-				// not sure about other states, 'resolved', 'installed'
-				isReady = true;
-				modelManager = null;
-			}
-		}
-		return modelManager;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
index 698469f..fd4a755 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
@@ -14,11 +14,11 @@
 
 import org.eclipse.core.runtime.Plugin;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
 import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
 import org.eclipse.wst.sse.core.internal.preferences.CommonModelPreferenceNames;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.osgi.framework.BundleContext;
 
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java
index 3343a7a..320c0fd 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java
@@ -26,11 +26,11 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
 import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Node;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
index 96f526f..a20b1a7 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
@@ -23,9 +23,9 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.util.Assert;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Node;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java
index 87dc721..11d7ca2 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java
@@ -24,8 +24,6 @@
 
 	boolean getFormatWithSiblingIndent();
 
-	boolean getInPreserveSpaceElement();
-
 	/** 
 	 * some special elements can ignore clearing blank lines
 	 * */
@@ -34,6 +32,4 @@
 	void setCurrentIndent(String currentIndent);
 
 	void setFormatWithSiblingIndent(boolean formatWithSiblingIndent);
-	
-	void setInPreserveSpaceElement(boolean inPreserveSpaceElement);
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java
index 6995c4f..e26cff2 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java
@@ -8,16 +8,15 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.format;
 
 public class StructuredFormatContraints implements IStructuredFormatContraints {
-	private boolean fClearAllBlankLines;
-	private String fCurrentIndent = ""; //$NON-NLS-1$
-	private boolean fFormatWithSiblingIndent = false;
-	private boolean fInPreserveSpaceElement = false;
+	protected int fAvailableLineWidth;
+	protected boolean fClearAllBlankLines;
+	protected String fCurrentIndent = ""; //$NON-NLS-1$
+	protected boolean fFormatWithSiblingIndent = false;
 
 	public boolean getClearAllBlankLines() {
 		return fClearAllBlankLines;
@@ -42,12 +41,4 @@
 	public void setFormatWithSiblingIndent(boolean formatWithSiblingIndent) {
 		fFormatWithSiblingIndent = formatWithSiblingIndent;
 	}
-
-	public boolean getInPreserveSpaceElement() {
-		return fInPreserveSpaceElement;
-	}
-
-	public void setInPreserveSpaceElement(boolean inPreserveSpaceElement) {
-		fInPreserveSpaceElement = inPreserveSpaceElement;		
-	}
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java
index eae0077..5fe3224 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java
@@ -24,7 +24,6 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.ILockable;
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.SSECoreMessages;
@@ -36,6 +35,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.events.AboutToBeChangedEvent;
 import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener;
 import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
index 0016fdb..be5d56f 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
@@ -20,8 +20,6 @@
  * Class to allow access to ModelManager. Not intended to be subclassed.
  * 
  * @plannedfor 1.0
- * @deprecated - use the one that is in
- *             org.eclipse.wst.sse.core.SttructuredModelManager
  */
 final public class StructuredModelManager {
 	/**
@@ -38,8 +36,6 @@
 	 * 
 	 * @return IModelManager - returns the one model manager for structured
 	 *         model
-	 * @deprecated - use the one that is in
-	 *             org.eclipse.wst.sse.core.SttructuredModelManager
 	 */
 	public static IModelManager getModelManager() {
 		boolean isReady = false;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java
index fb9c6b6..cda0f7b 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java
@@ -41,7 +41,7 @@
  * 
  * Clients can reference this interface, but should not implement.
  * 
- * @see org.eclipse.wst.sse.core.StructuredModelManager
+ * @see org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager
  * @plannedfor 1.0
  */
 public interface IModelManagerProposed {
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java
index 70c7b80..75e37f0 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java
@@ -5,7 +5,7 @@
  * It defines the partitioning for StructuredDocuments.
  * Clients should reference the partition type Strings defined here directly.
  * 
- * @deprecated use org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitions
+ * @plannedfor 1.0
  */
 public interface IStructuredPartitionTypes {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java
index ff64c86..d4c2ba4 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java
@@ -44,7 +44,7 @@
 	 * <br><code>org.eclipse.wst.html.core.text.IHTMLPartitions.HTML_DEFAULT</code>
 	 * <br><code>org.eclipse.wst.jsp.core.text.IJSPPartitions.JSP_DEFAULT</code>
 	 * </p>
-	 * @see org.eclipse.wst.sse.core.text.IStructuredPartitions
+	 * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes
 	 * @see org.eclipse.wst.xml.core.text.IXMLPartitions
 	 * @see org.eclipse.wst.html.core.text.IHTMLPartitions
 	 * @see org.eclipse.wst.jsp.core.text.IJSPPartitions
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
index 09c7b51..f6dd9db 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
@@ -33,8 +33,8 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.util.Debug;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.sse.core.utils.StringUtils;
 
 
 /**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
index ebda2ce..77fe5f0 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
@@ -27,11 +27,11 @@
 import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 
 
 /**
@@ -57,7 +57,7 @@
 
 	private CachedComputedPartitions cachedPartitions = new CachedComputedPartitions(-1, -1, null);
 	protected String[] fSupportedTypes = null;
-	protected IStructuredTypedRegion internalReusedTempInstance = new SimpleStructuredTypedRegion(0, 0, IStructuredPartitions.DEFAULT_PARTITION);
+	protected IStructuredTypedRegion internalReusedTempInstance = new SimpleStructuredTypedRegion(0, 0, IStructuredPartitionTypes.DEFAULT_PARTITION);
 	protected IStructuredDocument fStructuredDocument;
 
 	/**
@@ -266,7 +266,7 @@
 	 */
 	public String getDefaultPartitionType() {
 
-		return IStructuredPartitions.DEFAULT_PARTITION;
+		return IStructuredPartitionTypes.DEFAULT_PARTITION;
 	}
 
 	/**
@@ -474,14 +474,14 @@
 	 * about are attempt to partition
 	 */
 	protected String getUnknown() {
-		return IStructuredPartitions.UNKNOWN_PARTITION;
+		return IStructuredPartitionTypes.UNKNOWN_PARTITION;
 	}
 
 	/**
 	 * to be abstract eventually
 	 */
 	protected void initLegalContentTypes() {
-		fSupportedTypes = new String[]{IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION};
+		fSupportedTypes = new String[]{IStructuredPartitionTypes.DEFAULT_PARTITION, IStructuredPartitionTypes.UNKNOWN_PARTITION};
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
index 731b9f7..9c934eb 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
@@ -19,10 +19,10 @@
 import org.eclipse.emf.common.command.CommandStack;
 import org.eclipse.emf.common.command.CommandStackListener;
 import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.SSECoreMessages;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
 import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
 import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
index e97a4a6..e6bcf94 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
@@ -98,7 +98,7 @@
 			flatNode = (ITextRegionCollection) structuredDocumentRegions.nextElement();
 			if (!verbose) {
 				String outString = flatNode.toString();
-				outString = org.eclipse.wst.sse.core.utils.StringUtils.escape(outString);
+				outString = org.eclipse.wst.sse.core.internal.util.StringUtils.escape(outString);
 				System.out.println(outString);
 			} else {
 				dump(flatNode, verbose);
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/StringUtils.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/StringUtils.java
new file mode 100644
index 0000000..76e0afe
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/StringUtils.java
@@ -0,0 +1,743 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.sse.core.internal.util;
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.wst.sse.core.internal.Logger;
+
+
+public class StringUtils {
+	protected static final String AMPERSTAND = "&"; //$NON-NLS-1$
+	protected static final String AMPERSTAND_ENTITY = "&&;"; //$NON-NLS-1$
+	protected static final String CARRIAGE_RETURN = "\r"; //$NON-NLS-1$
+	protected static final String CARRIAGE_RETURN_ENTITY = "\\r"; //$NON-NLS-1$
+	protected static final String CR = "\r"; //$NON-NLS-1$
+	protected static final String CRLF = "\r\n"; //$NON-NLS-1$
+	protected static final String DELIMITERS = " \t\n\r\f"; //$NON-NLS-1$
+	protected static final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$
+	protected static final char DOUBLE_QUOTE_CHAR = '\"'; //$NON-NLS-1$
+	protected static final String DOUBLE_QUOTE_ENTITY = "&quot;"; //$NON-NLS-1$
+
+	protected static final String EQUAL_SIGN = "="; //$NON-NLS-1$
+	protected static final String EQUAL_SIGN_ENTITY = "&#61;"; //$NON-NLS-1$
+	private static final String FALSE = "false"; //$NON-NLS-1$
+	protected static final String GREATER_THAN = ">"; //$NON-NLS-1$
+	protected static final String GREATER_THAN_ENTITY = "&gt;"; //$NON-NLS-1$
+	protected static final String LESS_THAN = "<"; //$NON-NLS-1$
+	protected static final String LESS_THAN_ENTITY = "&lt;"; //$NON-NLS-1$
+	protected static final String LF = "\n"; //$NON-NLS-1$
+	protected static final String LINE_FEED = "\n"; //$NON-NLS-1$
+	protected static final String LINE_FEED_ENTITY = "\\n"; //$NON-NLS-1$
+	protected static final String LINE_FEED_TAG = "<dl>"; //$NON-NLS-1$
+	protected static final String LINE_TAB = "\t"; //$NON-NLS-1$
+	protected static final String LINE_TAB_ENTITY = "\\t"; //$NON-NLS-1$
+	protected static final String LINE_TAB_TAG = "<dd>"; //$NON-NLS-1$
+	protected static final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
+	protected static final char SINGLE_QUOTE_CHAR = '\''; //$NON-NLS-1$
+	protected static final String SINGLE_QUOTE_ENTITY = "&#039;"; //$NON-NLS-1$
+	protected static final String SPACE = " "; //$NON-NLS-1$
+	protected static final String SPACE_ENTITY = "&nbsp;"; //$NON-NLS-1$
+	private static final String TRUE = "true"; //$NON-NLS-1$
+
+	/**
+	 * Append appendString to the end of aString only if aString does not end
+	 * with the insertString.
+	 */
+	public static String appendIfNotEndWith(String aString, String appendString) {
+		if ((aString != null) && (appendString != null))
+			if (aString.endsWith(appendString))
+				return aString;
+			else
+				return aString + appendString;
+		else
+			return aString;
+	}
+
+	/**
+	 * Breaks out space-separated words into an array of words. For example:
+	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
+	 * <code>a[1]= "comment"</code>.
+	 * 
+	 * @param value
+	 *            the string to be converted
+	 * @return the list of words
+	 */
+	public static String[] asArray(String value) {
+		ArrayList list = new ArrayList();
+		StringTokenizer stok = new StringTokenizer(value);
+		while (stok.hasMoreTokens()) {
+			list.add(stok.nextToken());
+		}
+		String result[] = new String[list.size()];
+		list.toArray(result);
+		return result;
+	}
+
+	/**
+	 * Breaks out delim-separated words into an array of words. For example:
+	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
+	 * <code>a[1]= "comment"</code>.
+	 * 
+	 * @param value
+	 *            the string to be converted
+	 * @return the list of words
+	 */
+	public static String[] asArray(String value, String delim) {
+		return asArray(value, delim, false);
+	}
+
+	/**
+	 * Breaks out delim-separated words into an array of words. For example:
+	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
+	 * <code>a[1]= "comment"</code>.
+	 * 
+	 * @param value
+	 *            the string to be converted
+	 * @return the list of words
+	 */
+	public static String[] asArray(String value, String delim, boolean returnTokens) {
+		ArrayList list = new ArrayList();
+		StringTokenizer stok = new StringTokenizer(value, delim, returnTokens);
+		while (stok.hasMoreTokens()) {
+			list.add(stok.nextToken());
+		}
+		String result[] = new String[list.size()];
+		list.toArray(result);
+		return result;
+	}
+
+	/**
+	 * Breaks out delim-separated words into an array of words. For example:
+	 * <code>"abc,,def"</code> into an array <code>a[0]="abc"</code>,
+	 * <code>a[1]=null</code>, and <code>a[2]= "def"</code> where "," is
+	 * the delim.
+	 * 
+	 * @param value
+	 *            the string to be converted
+	 * @return the list of words
+	 */
+	public static String[] asFixedArray(String value, String delim) {
+		String array[] = asArray(value, delim, true);
+		int arrayLength = array.length;
+		boolean stringFound = false;
+		ArrayList list = new ArrayList();
+
+		for (int i = 0; i < arrayLength; i++) {
+			String token = array[i];
+			if (token.compareTo(delim) == 0) {
+				if (!stringFound)
+					list.add(null);
+				stringFound = false;
+			}
+			else {
+				list.add(token);
+				stringFound = true;
+			}
+		}
+		// add one more null if last token is the delim
+		if (!stringFound)
+			list.add(null);
+
+		String result[] = new String[list.size()];
+		list.toArray(result);
+		return result;
+	}
+
+	public static String chop(String source) {
+		return chop(source, "/"); //$NON-NLS-1$
+	}
+
+	public static String chop(String source, String delimiter) {
+		return source.substring(0, source.lastIndexOf(delimiter));
+	}
+
+	public static boolean contains(String[] arrayOfStrings, String needle, boolean caseSensitive) {
+		boolean result = false;
+		if (needle == null)
+			return false;
+		if (arrayOfStrings == null)
+			return false;
+
+		if (caseSensitive) {
+			for (int i = 0; i < arrayOfStrings.length; i++) {
+				if (needle.equals(arrayOfStrings[i])) {
+					result = true;
+					break;
+				}
+			}
+		}
+		else {
+			for (int i = 0; i < arrayOfStrings.length; i++) {
+				if (needle.equalsIgnoreCase(arrayOfStrings[i])) {
+					result = true;
+					break;
+				}
+			}
+		}
+		return result;
+	}
+
+	public static boolean containsLetters(String fullValue) {
+
+		if (fullValue == null || fullValue.length() == 0)
+			return false;
+
+		char[] chars = fullValue.toCharArray();
+		for (int i = 0; i < fullValue.length(); i++)
+			if (Character.isLetter(chars[i]))
+				return true;
+
+		return false;
+	}
+
+	public static boolean containsLineDelimiter(String aString) {
+		return indexOfLineDelimiter(aString) != -1;
+	}
+
+	public static String convertLineDelimiters(String allText, String lineDelimiterToUse) {
+		IDocument tempDoc = new Document(allText);
+
+		if (lineDelimiterToUse == null)
+			lineDelimiterToUse = System.getProperty("line.separator"); //$NON-NLS-1$
+
+		String newText = ""; //$NON-NLS-1$
+		int lineCount = tempDoc.getNumberOfLines();
+		for (int i = 0; i < lineCount; i++) {
+			try {
+				org.eclipse.jface.text.IRegion lineInfo = tempDoc.getLineInformation(i);
+				int lineStartOffset = lineInfo.getOffset();
+				int lineLength = lineInfo.getLength();
+				int lineEndOffset = lineStartOffset + lineLength;
+				newText += allText.substring(lineStartOffset, lineEndOffset);
+
+				if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null))
+					newText += lineDelimiterToUse;
+			}
+			catch (BadLocationException e) {
+				// log for now, unless we find reason not to
+				Logger.log(Logger.INFO, e.getMessage());
+			}
+		}
+
+		return newText;
+	}
+
+	/**
+	 * Replaces all instances of special HTML characters with the appropriate
+	 * HTML entity equivalent. WARNING only use this method for strings that
+	 * dont already have HTML-specific items such as tags and entities.
+	 * 
+	 * @param String
+	 *            content String to convert
+	 * 
+	 * @return String the converted string
+	 * @see HTMLPrinter#convertToHTMLContent(String content)
+	 */
+	public static String convertToHTMLContent(String content) {
+		content = replace(content, AMPERSTAND, AMPERSTAND_ENTITY);
+		content = replace(content, LESS_THAN, LESS_THAN_ENTITY);
+		content = replace(content, GREATER_THAN, GREATER_THAN_ENTITY);
+		content = replace(content, LINE_FEED, LINE_FEED_TAG);
+		content = replace(content, LINE_TAB, LINE_TAB_TAG);
+		content = replace(content, SINGLE_QUOTE, SINGLE_QUOTE_ENTITY);
+		content = replace(content, DOUBLE_QUOTE, DOUBLE_QUOTE_ENTITY);
+		content = replace(content, SPACE + SPACE, SPACE_ENTITY + SPACE_ENTITY); // replacing
+		// every
+		// space
+		// would
+		// be
+		// too
+		// much
+		return content;
+	}
+
+	/**
+	 * Converts a string into a form that will not conflict with saving it
+	 * into an INI file
+	 */
+	public static String escape(String normalString) {
+		if (normalString == null)
+			return null;
+		StringBuffer escapedBuffer = new StringBuffer();
+		StringTokenizer toker = new StringTokenizer(normalString, EQUAL_SIGN + LINE_FEED + CARRIAGE_RETURN + LINE_TAB, true);
+		String chunk = null;
+		while (toker.hasMoreTokens()) {
+			chunk = toker.nextToken();
+			if (chunk.equals(EQUAL_SIGN)) {
+				escapedBuffer.append(EQUAL_SIGN_ENTITY);
+			}
+			else if (chunk.equals(LINE_FEED)) {
+				escapedBuffer.append(LINE_FEED_ENTITY);
+			}
+			else if (chunk.equals(CARRIAGE_RETURN)) {
+				escapedBuffer.append(CARRIAGE_RETURN_ENTITY);
+			}
+			else if (chunk.equals(LINE_TAB)) {
+				escapedBuffer.append(LINE_TAB_ENTITY);
+			}
+			else {
+				escapedBuffer.append(chunk);
+			}
+		}
+		return escapedBuffer.toString();
+	}
+
+	/**
+	 * Returns the first line of the given text without a trailing delimiter
+	 * 
+	 * @param text
+	 * @return
+	 */
+	public static String firstLineOf(String text) {
+		if (text == null || text.length() < 1) {
+			return text;
+		}
+		IDocument doc = new Document(text);
+		try {
+			int lineNumber = doc.getLineOfOffset(0);
+			IRegion line = doc.getLineInformation(lineNumber);
+			return doc.get(line.getOffset(), line.getLength());
+		}
+		catch (BadLocationException e) {
+			// do nothing
+		}
+		return text;
+	}
+
+	public static int indexOfLastLineDelimiter(String aString) {
+		return indexOfLastLineDelimiter(aString, aString.length());
+	}
+
+	public static int indexOfLastLineDelimiter(String aString, int offset) {
+		int index = -1;
+
+		if (aString != null && aString.length() > 0) {
+			index = aString.lastIndexOf(CRLF, offset);
+			if (index == -1) {
+				index = aString.lastIndexOf(CR, offset);
+				if (index == -1)
+					index = aString.lastIndexOf(LF, offset);
+			}
+		}
+
+		return index;
+	}
+
+	public static int indexOfLineDelimiter(String aString) {
+		return indexOfLineDelimiter(aString, 0);
+	}
+
+	public static int indexOfLineDelimiter(String aString, int offset) {
+		int index = -1;
+
+		if (aString != null && aString.length() > 0) {
+			index = aString.indexOf(CRLF, offset);
+			if (index == -1) {
+				index = aString.indexOf(CR, offset);
+				if (index == -1)
+					index = aString.indexOf(LF, offset);
+			}
+		}
+
+		return index;
+	}
+
+	public static int indexOfNonblank(String aString) {
+		return indexOfNonblank(aString, 0);
+	}
+
+	public static int indexOfNonblank(String aString, int offset) {
+		int index = -1;
+
+		if (aString != null && aString.length() > 0) {
+			for (int i = offset; i < aString.length(); i++) {
+				if (DELIMITERS.indexOf(aString.substring(i, i + 1)) == -1) {
+					index = i;
+					break;
+				}
+			}
+		}
+
+		return index;
+	}
+
+	/**
+	 * Insert insertString to the beginning of aString only if aString does
+	 * not start with the insertString.
+	 */
+	public static String insertIfNotStartWith(String aString, String insertString) {
+		if ((aString != null) && (insertString != null))
+			if (aString.startsWith(insertString))
+				return aString;
+			else
+				return insertString + aString;
+		else
+			return aString;
+	}
+
+	public static boolean isQuoted(String string) {
+		if ((string == null) || (string.length() < 2))
+			return false;
+
+		int lastIndex = string.length() - 1;
+		char firstChar = string.charAt(0);
+		char lastChar = string.charAt(lastIndex);
+
+		return (((firstChar == SINGLE_QUOTE_CHAR) && (lastChar == SINGLE_QUOTE_CHAR)) || ((firstChar == DOUBLE_QUOTE_CHAR) && (lastChar == DOUBLE_QUOTE_CHAR)));
+	}
+
+	/**
+	 * Unit tests.
+	 * 
+	 * @param args
+	 *            java.lang.String[]
+	 */
+	public static void main(String[] args) {
+		// testPaste();
+		testStripNonLetterDigits();
+	}
+
+	/*
+	 * Returns the merged form of both strings
+	 */
+	public static String merge(String newStart, String newEnd) {
+		String[] regions = overlapRegions(newStart, newEnd);
+		return regions[0] + regions[1] + regions[2];
+	}
+
+	public static int occurrencesOf(String searchString, char targetChar) {
+		int result = 0;
+		int len = searchString.length();
+		for (int i = 0; i < len; i++) {
+			if (targetChar == searchString.charAt(i))
+				result++;
+		}
+		return result;
+	}
+
+	/**
+	 * 
+	 * @return java.lang.String[]
+	 * @param start
+	 *            java.lang.String
+	 * @param end
+	 *            java.lang.String
+	 * 
+	 * Returns a 3 String array containing unique text from the start,
+	 * duplicated text that overlaps the start and end, and the unique text
+	 * from the end.
+	 */
+	private static String[] overlapRegions(String start, String end) {
+		String[] results = null;
+		if (start != null && end == null) {
+			results = new String[]{start, "", ""}; //$NON-NLS-2$//$NON-NLS-1$
+		}
+		else if (start == null && end != null) {
+			results = new String[]{"", "", end}; //$NON-NLS-2$//$NON-NLS-1$
+		}
+		else if (start == null && end == null) {
+			results = new String[]{"", "", ""}; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+		}
+		else if (start != null && end != null) {
+
+			int startLength = start.length();
+			int endLength = end.length();
+
+			if (startLength == 0 || endLength == 0) {
+				results = new String[]{"", "", ""}; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+			}
+			else {
+				results = new String[3];
+				String testStart = ""; //$NON-NLS-1$
+				String testEnd = ""; //$NON-NLS-1$
+				int mergeLength = Math.min(startLength, endLength);
+				boolean finished = false;
+				while (mergeLength > 0 && !finished) {
+					testStart = start.substring(startLength - mergeLength);
+					testEnd = end.substring(0, mergeLength);
+					// case sensitive
+					if (testStart.equals(testEnd)) {
+						finished = true;
+						results[0] = start.substring(0, startLength - mergeLength);
+						results[1] = start.substring(startLength - mergeLength);
+						results[2] = end.substring(mergeLength);
+					}
+					mergeLength--;
+				}
+				if (!finished) {
+					results[0] = start;
+					results[1] = ""; //$NON-NLS-1$
+					results[2] = end;
+				}
+			}
+		}
+		return results;
+	}
+
+	/**
+	 * Packs an array of Strings into a single comma delimited String.
+	 * 
+	 * @param strings
+	 * @return
+	 * @todo Generated comment
+	 */
+	public static String pack(String[] strings) {
+		StringBuffer buf = new StringBuffer();
+		for (int i = 0; i < strings.length; i++) {
+			buf.append(StringUtils.replace(strings[i], ",", "&comma;")); //$NON-NLS-1$ //$NON-NLS-2$
+			if (i < strings.length - 1)
+				buf.append(","); //$NON-NLS-1$
+		}
+		return buf.toString();
+	}
+
+	/*
+	 * Pastes the new text into the old at the start position, replacing text
+	 * implied by length.
+	 */
+	public static String paste(String oldText, String newText, int start, int length) {
+		String result = null;
+		StringBuffer sb = new StringBuffer();
+		int startIndex = start;
+		int endIndex = start + length;
+		if (startIndex > oldText.length()) {
+			startIndex = oldText.length();
+		}
+		sb.append(oldText.substring(0, startIndex));
+		// null or empty new text accompliches a delete
+		if (newText != null) {
+			sb.append(newText);
+		}
+		if (endIndex < oldText.length()) {
+
+			sb.append(oldText.substring(endIndex));
+		}
+		result = sb.toString();
+		return result;
+	}
+
+	/**
+	 * Replace matching literal portions of a string with another string
+	 */
+	public static String replace(String aString, String source, String target) {
+		if (aString == null)
+			return null;
+		String normalString = ""; //$NON-NLS-1$
+		int length = aString.length();
+		int position = 0;
+		int previous = 0;
+		int spacer = source.length();
+		while (position + spacer - 1 < length && aString.indexOf(source, position) > -1) {
+			position = aString.indexOf(source, previous);
+			normalString = normalString + aString.substring(previous, position) + target;
+			position += spacer;
+			previous = position;
+		}
+		normalString = normalString + aString.substring(position, aString.length());
+
+		return normalString;
+	}
+
+	/**
+	 * Restore the entity references for markup delimiters in text where they
+	 * have been replaced by the proper Unicode values through a DOM text
+	 * parser.
+	 */
+	public static String restoreMarkers(String text) {
+		String content = text;
+		content = replace(content, AMPERSTAND, AMPERSTAND_ENTITY);
+		content = replace(content, LESS_THAN, LESS_THAN_ENTITY);
+		content = replace(content, GREATER_THAN, GREATER_THAN_ENTITY);
+		return content;
+	}
+
+	/**
+	 * Removes extra whitespace characters and quotes
+	 */
+	public static String strip(String quotedString) {
+		if (quotedString == null || quotedString.length() == 0)
+			return quotedString;
+		String trimmed = quotedString.trim();
+		if (trimmed.length() < 2)
+			return quotedString;
+
+		char first = trimmed.charAt(0);
+		char nextToLast = trimmed.charAt(trimmed.length() - 2);
+		char last = trimmed.charAt(trimmed.length() - 1);
+
+		if ((first == '\"' && last == '\"' && nextToLast != '\\') || (first == '\'' && last == '\'' && nextToLast != '\\')) {
+			return trimmed.substring(1, trimmed.length() - 1);
+		}
+		return trimmed;
+	}
+
+	/**
+	 * This method strips anything from the beginning and end of a string that
+	 * is not a letter or digit. It is used by some encoding detectors to come
+	 * up with the encoding name from illformed input (e.g in <?xml
+	 * encoding="abc?> -- where final quote is left off, the '>' is returned
+	 * with the rest of the attribute value 'abc').
+	 */
+	public static String stripNonLetterDigits(String fullValue) {
+		if (fullValue == null || fullValue.length() == 0)
+			return fullValue;
+		int fullValueLength = fullValue.length();
+		int firstPos = 0;
+		while (firstPos < fullValueLength && !Character.isLetterOrDigit(fullValue.charAt(firstPos))) {
+			firstPos++;
+		}
+		int lastPos = fullValueLength - 1;
+		while (lastPos > firstPos && !Character.isLetterOrDigit(fullValue.charAt(lastPos))) {
+			lastPos--;
+		}
+		String result = fullValue;
+		if (firstPos != 0 || lastPos != fullValueLength) {
+			result = fullValue.substring(firstPos, lastPos + 1);
+		}
+		return result;
+	}
+
+	/**
+	 * Similar to strip, except quotes don't need to match such as "UTF' is
+	 * still stripped of both quotes. (Plus, this one does not detect escaped
+	 * quotes)
+	 */
+	public static String stripQuotes(String quotedValue) {
+		if (quotedValue == null)
+			return null;
+		// normally will never have leading or trailing blanks,
+		// but if it does, we'll do lenient interpretation
+		return stripQuotesLeaveInsideSpace(quotedValue).trim();
+	}
+
+	/**
+	 * Like strip quotes, except leaves the start and end space inside the
+	 * quotes
+	 * 
+	 * @param quotedValue
+	 * @return
+	 */
+	public static String stripQuotesLeaveInsideSpace(String quotedValue) {
+		if (quotedValue == null)
+			return null;
+		// nomally will never have leading or trailing blanks ... but just in
+		// case.
+		String result = quotedValue.trim();
+		int len = result.length();
+		if (len > 0) {
+			char firstChar = result.charAt(0);
+			if ((firstChar == SINGLE_QUOTE_CHAR) || (firstChar == DOUBLE_QUOTE_CHAR)) {
+				result = result.substring(1, len);
+			}
+			len = result.length();
+			if (len > 0) {
+				char lastChar = result.charAt(len - 1);
+				if ((lastChar == SINGLE_QUOTE_CHAR) || (lastChar == DOUBLE_QUOTE_CHAR)) {
+					result = result.substring(0, len - 1);
+				}
+			}
+		}
+		return result;
+	}
+
+	public static void testPaste() {
+		String testString = "The quick brown fox ..."; //$NON-NLS-1$
+		System.out.println(paste(testString, null, 4, 5));
+		System.out.println(paste(testString, null, 4, 6));
+		System.out.println(paste(testString, "", 4, 6)); //$NON-NLS-1$
+		System.out.println(paste(testString, "fast", 4, 6)); //$NON-NLS-1$
+		System.out.println(paste(testString, "fast ", 4, 6)); //$NON-NLS-1$
+		System.out.println(paste(testString, "But ", 0, 0)); //$NON-NLS-1$
+		System.out.println(paste("", "burp", 4, 6)); //$NON-NLS-2$//$NON-NLS-1$
+	}
+
+	public static void testStripNonLetterDigits() {
+		String testString = "abc"; //$NON-NLS-1$
+		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
+		testString = ""; //$NON-NLS-1$
+		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
+		testString = "\"abc\""; //$NON-NLS-1$
+		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
+		testString = "\"ab-c1?"; //$NON-NLS-1$
+		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
+		testString = "+++"; //$NON-NLS-1$
+		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
+		testString = "abc="; //$NON-NLS-1$
+		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
+		testString = "abc "; //$NON-NLS-1$
+		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
+
+	}
+
+	public static String toString(boolean booleanValue) {
+		if (booleanValue)
+			return TRUE;
+		else
+			return FALSE;
+	}
+
+	/**
+	 * Remove "escaped" chars from a string.
+	 */
+	public static String unescape(String aString) {
+		if (aString == null)
+			return null;
+		String normalString = replace(aString, EQUAL_SIGN_ENTITY, EQUAL_SIGN);
+		normalString = replace(normalString, LINE_FEED_ENTITY, LINE_FEED);
+		normalString = replace(normalString, CARRIAGE_RETURN_ENTITY, CARRIAGE_RETURN);
+		normalString = replace(normalString, LINE_TAB_ENTITY, LINE_TAB);
+		return normalString;
+	}
+
+	public static String uniqueEndOf(String newStart, String newEnd) {
+		String[] regions = overlapRegions(newStart, newEnd);
+		return regions[2];
+	}
+
+	/**
+	 * Unpacks a comma delimited String into an array of Strings
+	 * 
+	 * @param s
+	 * @return
+	 * @todo Generated comment
+	 */
+	public static String[] unpack(String s) {
+		if (s == null)
+			return new String[0];
+		StringTokenizer toker = new StringTokenizer(s, ","); //$NON-NLS-1$
+		List list = new ArrayList();
+		while (toker.hasMoreTokens()) {
+			// since we're separating the values with ',', escape ',' in the
+			// values
+			list.add(StringUtils.replace(toker.nextToken(), "&comma;", ",").trim()); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		return (String[]) list.toArray(new String[0]);
+	}
+
+	/**
+	 * StringUtils constructor comment.
+	 */
+	private StringUtils() {
+		super();
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java
deleted file mode 100644
index cf9df7d..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.eclipse.wst.sse.core.text;
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partitioning for StructuredDocuments.
- * Clients should reference the partition type Strings defined here directly.
- * 
- * @since 1.1
- */
-public interface IStructuredPartitions {
-
-	String DEFAULT_PARTITION = "org.eclipse.wst.sse.ST_DEFAULT"; //$NON-NLS-1$
-	String UNKNOWN_PARTITION = "org.eclipse.wst.sse.UNKNOWN_PARTITION_TYPE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
deleted file mode 100644
index 0721bf2..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
+++ /dev/null
@@ -1,743 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.core.utils;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-
-public class StringUtils {
-	protected static final String AMPERSTAND = "&"; //$NON-NLS-1$
-	protected static final String AMPERSTAND_ENTITY = "&&;"; //$NON-NLS-1$
-	protected static final String CARRIAGE_RETURN = "\r"; //$NON-NLS-1$
-	protected static final String CARRIAGE_RETURN_ENTITY = "\\r"; //$NON-NLS-1$
-	protected static final String CR = "\r"; //$NON-NLS-1$
-	protected static final String CRLF = "\r\n"; //$NON-NLS-1$
-	protected static final String DELIMITERS = " \t\n\r\f"; //$NON-NLS-1$
-	protected static final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$
-	protected static final char DOUBLE_QUOTE_CHAR = '\"'; //$NON-NLS-1$
-	protected static final String DOUBLE_QUOTE_ENTITY = "&quot;"; //$NON-NLS-1$
-
-	protected static final String EQUAL_SIGN = "="; //$NON-NLS-1$
-	protected static final String EQUAL_SIGN_ENTITY = "&#61;"; //$NON-NLS-1$
-	private static final String FALSE = "false"; //$NON-NLS-1$
-	protected static final String GREATER_THAN = ">"; //$NON-NLS-1$
-	protected static final String GREATER_THAN_ENTITY = "&gt;"; //$NON-NLS-1$
-	protected static final String LESS_THAN = "<"; //$NON-NLS-1$
-	protected static final String LESS_THAN_ENTITY = "&lt;"; //$NON-NLS-1$
-	protected static final String LF = "\n"; //$NON-NLS-1$
-	protected static final String LINE_FEED = "\n"; //$NON-NLS-1$
-	protected static final String LINE_FEED_ENTITY = "\\n"; //$NON-NLS-1$
-	protected static final String LINE_FEED_TAG = "<dl>"; //$NON-NLS-1$
-	protected static final String LINE_TAB = "\t"; //$NON-NLS-1$
-	protected static final String LINE_TAB_ENTITY = "\\t"; //$NON-NLS-1$
-	protected static final String LINE_TAB_TAG = "<dd>"; //$NON-NLS-1$
-	protected static final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
-	protected static final char SINGLE_QUOTE_CHAR = '\''; //$NON-NLS-1$
-	protected static final String SINGLE_QUOTE_ENTITY = "&#039;"; //$NON-NLS-1$
-	protected static final String SPACE = " "; //$NON-NLS-1$
-	protected static final String SPACE_ENTITY = "&nbsp;"; //$NON-NLS-1$
-	private static final String TRUE = "true"; //$NON-NLS-1$
-
-	/**
-	 * Append appendString to the end of aString only if aString does not end
-	 * with the insertString.
-	 */
-	public static String appendIfNotEndWith(String aString, String appendString) {
-		if ((aString != null) && (appendString != null))
-			if (aString.endsWith(appendString))
-				return aString;
-			else
-				return aString + appendString;
-		else
-			return aString;
-	}
-
-	/**
-	 * Breaks out space-separated words into an array of words. For example:
-	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
-	 * <code>a[1]= "comment"</code>.
-	 * 
-	 * @param value
-	 *            the string to be converted
-	 * @return the list of words
-	 */
-	public static String[] asArray(String value) {
-		ArrayList list = new ArrayList();
-		StringTokenizer stok = new StringTokenizer(value);
-		while (stok.hasMoreTokens()) {
-			list.add(stok.nextToken());
-		}
-		String result[] = new String[list.size()];
-		list.toArray(result);
-		return result;
-	}
-
-	/**
-	 * Breaks out delim-separated words into an array of words. For example:
-	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
-	 * <code>a[1]= "comment"</code>.
-	 * 
-	 * @param value
-	 *            the string to be converted
-	 * @return the list of words
-	 */
-	public static String[] asArray(String value, String delim) {
-		return asArray(value, delim, false);
-	}
-
-	/**
-	 * Breaks out delim-separated words into an array of words. For example:
-	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
-	 * <code>a[1]= "comment"</code>.
-	 * 
-	 * @param value
-	 *            the string to be converted
-	 * @return the list of words
-	 */
-	public static String[] asArray(String value, String delim, boolean returnTokens) {
-		ArrayList list = new ArrayList();
-		StringTokenizer stok = new StringTokenizer(value, delim, returnTokens);
-		while (stok.hasMoreTokens()) {
-			list.add(stok.nextToken());
-		}
-		String result[] = new String[list.size()];
-		list.toArray(result);
-		return result;
-	}
-
-	/**
-	 * Breaks out delim-separated words into an array of words. For example:
-	 * <code>"abc,,def"</code> into an array <code>a[0]="abc"</code>,
-	 * <code>a[1]=null</code>, and <code>a[2]= "def"</code> where "," is
-	 * the delim.
-	 * 
-	 * @param value
-	 *            the string to be converted
-	 * @return the list of words
-	 */
-	public static String[] asFixedArray(String value, String delim) {
-		String array[] = asArray(value, delim, true);
-		int arrayLength = array.length;
-		boolean stringFound = false;
-		ArrayList list = new ArrayList();
-
-		for (int i = 0; i < arrayLength; i++) {
-			String token = array[i];
-			if (token.compareTo(delim) == 0) {
-				if (!stringFound)
-					list.add(null);
-				stringFound = false;
-			}
-			else {
-				list.add(token);
-				stringFound = true;
-			}
-		}
-		// add one more null if last token is the delim
-		if (!stringFound)
-			list.add(null);
-
-		String result[] = new String[list.size()];
-		list.toArray(result);
-		return result;
-	}
-
-	public static String chop(String source) {
-		return chop(source, "/"); //$NON-NLS-1$
-	}
-
-	public static String chop(String source, String delimiter) {
-		return source.substring(0, source.lastIndexOf(delimiter));
-	}
-
-	public static boolean contains(String[] arrayOfStrings, String needle, boolean caseSensitive) {
-		boolean result = false;
-		if (needle == null)
-			return false;
-		if (arrayOfStrings == null)
-			return false;
-
-		if (caseSensitive) {
-			for (int i = 0; i < arrayOfStrings.length; i++) {
-				if (needle.equals(arrayOfStrings[i])) {
-					result = true;
-					break;
-				}
-			}
-		}
-		else {
-			for (int i = 0; i < arrayOfStrings.length; i++) {
-				if (needle.equalsIgnoreCase(arrayOfStrings[i])) {
-					result = true;
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	public static boolean containsLetters(String fullValue) {
-
-		if (fullValue == null || fullValue.length() == 0)
-			return false;
-
-		char[] chars = fullValue.toCharArray();
-		for (int i = 0; i < fullValue.length(); i++)
-			if (Character.isLetter(chars[i]))
-				return true;
-
-		return false;
-	}
-
-	public static boolean containsLineDelimiter(String aString) {
-		return indexOfLineDelimiter(aString) != -1;
-	}
-
-	public static String convertLineDelimiters(String allText, String lineDelimiterToUse) {
-		IDocument tempDoc = new Document(allText);
-
-		if (lineDelimiterToUse == null)
-			lineDelimiterToUse = System.getProperty("line.separator"); //$NON-NLS-1$
-
-		String newText = ""; //$NON-NLS-1$
-		int lineCount = tempDoc.getNumberOfLines();
-		for (int i = 0; i < lineCount; i++) {
-			try {
-				org.eclipse.jface.text.IRegion lineInfo = tempDoc.getLineInformation(i);
-				int lineStartOffset = lineInfo.getOffset();
-				int lineLength = lineInfo.getLength();
-				int lineEndOffset = lineStartOffset + lineLength;
-				newText += allText.substring(lineStartOffset, lineEndOffset);
-
-				if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null))
-					newText += lineDelimiterToUse;
-			}
-			catch (BadLocationException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-		}
-
-		return newText;
-	}
-
-	/**
-	 * Replaces all instances of special HTML characters with the appropriate
-	 * HTML entity equivalent. WARNING only use this method for strings that
-	 * dont already have HTML-specific items such as tags and entities.
-	 * 
-	 * @param String
-	 *            content String to convert
-	 * 
-	 * @return String the converted string
-	 * @see HTMLPrinter#convertToHTMLContent(String content)
-	 */
-	public static String convertToHTMLContent(String content) {
-		content = replace(content, AMPERSTAND, AMPERSTAND_ENTITY);
-		content = replace(content, LESS_THAN, LESS_THAN_ENTITY);
-		content = replace(content, GREATER_THAN, GREATER_THAN_ENTITY);
-		content = replace(content, LINE_FEED, LINE_FEED_TAG);
-		content = replace(content, LINE_TAB, LINE_TAB_TAG);
-		content = replace(content, SINGLE_QUOTE, SINGLE_QUOTE_ENTITY);
-		content = replace(content, DOUBLE_QUOTE, DOUBLE_QUOTE_ENTITY);
-		content = replace(content, SPACE + SPACE, SPACE_ENTITY + SPACE_ENTITY); // replacing
-		// every
-		// space
-		// would
-		// be
-		// too
-		// much
-		return content;
-	}
-
-	/**
-	 * Converts a string into a form that will not conflict with saving it
-	 * into an INI file
-	 */
-	public static String escape(String normalString) {
-		if (normalString == null)
-			return null;
-		StringBuffer escapedBuffer = new StringBuffer();
-		StringTokenizer toker = new StringTokenizer(normalString, EQUAL_SIGN + LINE_FEED + CARRIAGE_RETURN + LINE_TAB, true);
-		String chunk = null;
-		while (toker.hasMoreTokens()) {
-			chunk = toker.nextToken();
-			if (chunk.equals(EQUAL_SIGN)) {
-				escapedBuffer.append(EQUAL_SIGN_ENTITY);
-			}
-			else if (chunk.equals(LINE_FEED)) {
-				escapedBuffer.append(LINE_FEED_ENTITY);
-			}
-			else if (chunk.equals(CARRIAGE_RETURN)) {
-				escapedBuffer.append(CARRIAGE_RETURN_ENTITY);
-			}
-			else if (chunk.equals(LINE_TAB)) {
-				escapedBuffer.append(LINE_TAB_ENTITY);
-			}
-			else {
-				escapedBuffer.append(chunk);
-			}
-		}
-		return escapedBuffer.toString();
-	}
-
-	/**
-	 * Returns the first line of the given text without a trailing delimiter
-	 * 
-	 * @param text
-	 * @return
-	 */
-	public static String firstLineOf(String text) {
-		if (text == null || text.length() < 1) {
-			return text;
-		}
-		IDocument doc = new Document(text);
-		try {
-			int lineNumber = doc.getLineOfOffset(0);
-			IRegion line = doc.getLineInformation(lineNumber);
-			return doc.get(line.getOffset(), line.getLength());
-		}
-		catch (BadLocationException e) {
-			// do nothing
-		}
-		return text;
-	}
-
-	public static int indexOfLastLineDelimiter(String aString) {
-		return indexOfLastLineDelimiter(aString, aString.length());
-	}
-
-	public static int indexOfLastLineDelimiter(String aString, int offset) {
-		int index = -1;
-
-		if (aString != null && aString.length() > 0) {
-			index = aString.lastIndexOf(CRLF, offset);
-			if (index == -1) {
-				index = aString.lastIndexOf(CR, offset);
-				if (index == -1)
-					index = aString.lastIndexOf(LF, offset);
-			}
-		}
-
-		return index;
-	}
-
-	public static int indexOfLineDelimiter(String aString) {
-		return indexOfLineDelimiter(aString, 0);
-	}
-
-	public static int indexOfLineDelimiter(String aString, int offset) {
-		int index = -1;
-
-		if (aString != null && aString.length() > 0) {
-			index = aString.indexOf(CRLF, offset);
-			if (index == -1) {
-				index = aString.indexOf(CR, offset);
-				if (index == -1)
-					index = aString.indexOf(LF, offset);
-			}
-		}
-
-		return index;
-	}
-
-	public static int indexOfNonblank(String aString) {
-		return indexOfNonblank(aString, 0);
-	}
-
-	public static int indexOfNonblank(String aString, int offset) {
-		int index = -1;
-
-		if (aString != null && aString.length() > 0) {
-			for (int i = offset; i < aString.length(); i++) {
-				if (DELIMITERS.indexOf(aString.substring(i, i + 1)) == -1) {
-					index = i;
-					break;
-				}
-			}
-		}
-
-		return index;
-	}
-
-	/**
-	 * Insert insertString to the beginning of aString only if aString does
-	 * not start with the insertString.
-	 */
-	public static String insertIfNotStartWith(String aString, String insertString) {
-		if ((aString != null) && (insertString != null))
-			if (aString.startsWith(insertString))
-				return aString;
-			else
-				return insertString + aString;
-		else
-			return aString;
-	}
-
-	public static boolean isQuoted(String string) {
-		if ((string == null) || (string.length() < 2))
-			return false;
-
-		int lastIndex = string.length() - 1;
-		char firstChar = string.charAt(0);
-		char lastChar = string.charAt(lastIndex);
-
-		return (((firstChar == SINGLE_QUOTE_CHAR) && (lastChar == SINGLE_QUOTE_CHAR)) || ((firstChar == DOUBLE_QUOTE_CHAR) && (lastChar == DOUBLE_QUOTE_CHAR)));
-	}
-
-	/**
-	 * Unit tests.
-	 * 
-	 * @param args
-	 *            java.lang.String[]
-	 */
-	public static void main(String[] args) {
-		// testPaste();
-		testStripNonLetterDigits();
-	}
-
-	/*
-	 * Returns the merged form of both strings
-	 */
-	public static String merge(String newStart, String newEnd) {
-		String[] regions = overlapRegions(newStart, newEnd);
-		return regions[0] + regions[1] + regions[2];
-	}
-
-	public static int occurrencesOf(String searchString, char targetChar) {
-		int result = 0;
-		int len = searchString.length();
-		for (int i = 0; i < len; i++) {
-			if (targetChar == searchString.charAt(i))
-				result++;
-		}
-		return result;
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String[]
-	 * @param start
-	 *            java.lang.String
-	 * @param end
-	 *            java.lang.String
-	 * 
-	 * Returns a 3 String array containing unique text from the start,
-	 * duplicated text that overlaps the start and end, and the unique text
-	 * from the end.
-	 */
-	private static String[] overlapRegions(String start, String end) {
-		String[] results = null;
-		if (start != null && end == null) {
-			results = new String[]{start, "", ""}; //$NON-NLS-2$//$NON-NLS-1$
-		}
-		else if (start == null && end != null) {
-			results = new String[]{"", "", end}; //$NON-NLS-2$//$NON-NLS-1$
-		}
-		else if (start == null && end == null) {
-			results = new String[]{"", "", ""}; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		}
-		else if (start != null && end != null) {
-
-			int startLength = start.length();
-			int endLength = end.length();
-
-			if (startLength == 0 || endLength == 0) {
-				results = new String[]{"", "", ""}; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-			}
-			else {
-				results = new String[3];
-				String testStart = ""; //$NON-NLS-1$
-				String testEnd = ""; //$NON-NLS-1$
-				int mergeLength = Math.min(startLength, endLength);
-				boolean finished = false;
-				while (mergeLength > 0 && !finished) {
-					testStart = start.substring(startLength - mergeLength);
-					testEnd = end.substring(0, mergeLength);
-					// case sensitive
-					if (testStart.equals(testEnd)) {
-						finished = true;
-						results[0] = start.substring(0, startLength - mergeLength);
-						results[1] = start.substring(startLength - mergeLength);
-						results[2] = end.substring(mergeLength);
-					}
-					mergeLength--;
-				}
-				if (!finished) {
-					results[0] = start;
-					results[1] = ""; //$NON-NLS-1$
-					results[2] = end;
-				}
-			}
-		}
-		return results;
-	}
-
-	/**
-	 * Packs an array of Strings into a single comma delimited String.
-	 * 
-	 * @param strings
-	 * @return
-	 * @todo Generated comment
-	 */
-	public static String pack(String[] strings) {
-		StringBuffer buf = new StringBuffer();
-		for (int i = 0; i < strings.length; i++) {
-			buf.append(StringUtils.replace(strings[i], ",", "&comma;")); //$NON-NLS-1$ //$NON-NLS-2$
-			if (i < strings.length - 1)
-				buf.append(","); //$NON-NLS-1$
-		}
-		return buf.toString();
-	}
-
-	/*
-	 * Pastes the new text into the old at the start position, replacing text
-	 * implied by length.
-	 */
-	public static String paste(String oldText, String newText, int start, int length) {
-		String result = null;
-		StringBuffer sb = new StringBuffer();
-		int startIndex = start;
-		int endIndex = start + length;
-		if (startIndex > oldText.length()) {
-			startIndex = oldText.length();
-		}
-		sb.append(oldText.substring(0, startIndex));
-		// null or empty new text accompliches a delete
-		if (newText != null) {
-			sb.append(newText);
-		}
-		if (endIndex < oldText.length()) {
-
-			sb.append(oldText.substring(endIndex));
-		}
-		result = sb.toString();
-		return result;
-	}
-
-	/**
-	 * Replace matching literal portions of a string with another string
-	 */
-	public static String replace(String aString, String source, String target) {
-		if (aString == null)
-			return null;
-		String normalString = ""; //$NON-NLS-1$
-		int length = aString.length();
-		int position = 0;
-		int previous = 0;
-		int spacer = source.length();
-		while (position + spacer - 1 < length && aString.indexOf(source, position) > -1) {
-			position = aString.indexOf(source, previous);
-			normalString = normalString + aString.substring(previous, position) + target;
-			position += spacer;
-			previous = position;
-		}
-		normalString = normalString + aString.substring(position, aString.length());
-
-		return normalString;
-	}
-
-	/**
-	 * Restore the entity references for markup delimiters in text where they
-	 * have been replaced by the proper Unicode values through a DOM text
-	 * parser.
-	 */
-	public static String restoreMarkers(String text) {
-		String content = text;
-		content = replace(content, AMPERSTAND, AMPERSTAND_ENTITY);
-		content = replace(content, LESS_THAN, LESS_THAN_ENTITY);
-		content = replace(content, GREATER_THAN, GREATER_THAN_ENTITY);
-		return content;
-	}
-
-	/**
-	 * Removes extra whitespace characters and quotes
-	 */
-	public static String strip(String quotedString) {
-		if (quotedString == null || quotedString.length() == 0)
-			return quotedString;
-		String trimmed = quotedString.trim();
-		if (trimmed.length() < 2)
-			return quotedString;
-
-		char first = trimmed.charAt(0);
-		char nextToLast = trimmed.charAt(trimmed.length() - 2);
-		char last = trimmed.charAt(trimmed.length() - 1);
-
-		if ((first == '\"' && last == '\"' && nextToLast != '\\') || (first == '\'' && last == '\'' && nextToLast != '\\')) {
-			return trimmed.substring(1, trimmed.length() - 1);
-		}
-		return trimmed;
-	}
-
-	/**
-	 * This method strips anything from the beginning and end of a string that
-	 * is not a letter or digit. It is used by some encoding detectors to come
-	 * up with the encoding name from illformed input (e.g in <?xml
-	 * encoding="abc?> -- where final quote is left off, the '>' is returned
-	 * with the rest of the attribute value 'abc').
-	 */
-	public static String stripNonLetterDigits(String fullValue) {
-		if (fullValue == null || fullValue.length() == 0)
-			return fullValue;
-		int fullValueLength = fullValue.length();
-		int firstPos = 0;
-		while (firstPos < fullValueLength && !Character.isLetterOrDigit(fullValue.charAt(firstPos))) {
-			firstPos++;
-		}
-		int lastPos = fullValueLength - 1;
-		while (lastPos > firstPos && !Character.isLetterOrDigit(fullValue.charAt(lastPos))) {
-			lastPos--;
-		}
-		String result = fullValue;
-		if (firstPos != 0 || lastPos != fullValueLength) {
-			result = fullValue.substring(firstPos, lastPos + 1);
-		}
-		return result;
-	}
-
-	/**
-	 * Similar to strip, except quotes don't need to match such as "UTF' is
-	 * still stripped of both quotes. (Plus, this one does not detect escaped
-	 * quotes)
-	 */
-	public static String stripQuotes(String quotedValue) {
-		if (quotedValue == null)
-			return null;
-		// normally will never have leading or trailing blanks,
-		// but if it does, we'll do lenient interpretation
-		return stripQuotesLeaveInsideSpace(quotedValue).trim();
-	}
-
-	/**
-	 * Like strip quotes, except leaves the start and end space inside the
-	 * quotes
-	 * 
-	 * @param quotedValue
-	 * @return
-	 */
-	public static String stripQuotesLeaveInsideSpace(String quotedValue) {
-		if (quotedValue == null)
-			return null;
-		// nomally will never have leading or trailing blanks ... but just in
-		// case.
-		String result = quotedValue.trim();
-		int len = result.length();
-		if (len > 0) {
-			char firstChar = result.charAt(0);
-			if ((firstChar == SINGLE_QUOTE_CHAR) || (firstChar == DOUBLE_QUOTE_CHAR)) {
-				result = result.substring(1, len);
-			}
-			len = result.length();
-			if (len > 0) {
-				char lastChar = result.charAt(len - 1);
-				if ((lastChar == SINGLE_QUOTE_CHAR) || (lastChar == DOUBLE_QUOTE_CHAR)) {
-					result = result.substring(0, len - 1);
-				}
-			}
-		}
-		return result;
-	}
-
-	public static void testPaste() {
-		String testString = "The quick brown fox ..."; //$NON-NLS-1$
-		System.out.println(paste(testString, null, 4, 5));
-		System.out.println(paste(testString, null, 4, 6));
-		System.out.println(paste(testString, "", 4, 6)); //$NON-NLS-1$
-		System.out.println(paste(testString, "fast", 4, 6)); //$NON-NLS-1$
-		System.out.println(paste(testString, "fast ", 4, 6)); //$NON-NLS-1$
-		System.out.println(paste(testString, "But ", 0, 0)); //$NON-NLS-1$
-		System.out.println(paste("", "burp", 4, 6)); //$NON-NLS-2$//$NON-NLS-1$
-	}
-
-	public static void testStripNonLetterDigits() {
-		String testString = "abc"; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = ""; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "\"abc\""; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "\"ab-c1?"; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "+++"; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "abc="; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "abc "; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-
-	}
-
-	public static String toString(boolean booleanValue) {
-		if (booleanValue)
-			return TRUE;
-		else
-			return FALSE;
-	}
-
-	/**
-	 * Remove "escaped" chars from a string.
-	 */
-	public static String unescape(String aString) {
-		if (aString == null)
-			return null;
-		String normalString = replace(aString, EQUAL_SIGN_ENTITY, EQUAL_SIGN);
-		normalString = replace(normalString, LINE_FEED_ENTITY, LINE_FEED);
-		normalString = replace(normalString, CARRIAGE_RETURN_ENTITY, CARRIAGE_RETURN);
-		normalString = replace(normalString, LINE_TAB_ENTITY, LINE_TAB);
-		return normalString;
-	}
-
-	public static String uniqueEndOf(String newStart, String newEnd) {
-		String[] regions = overlapRegions(newStart, newEnd);
-		return regions[2];
-	}
-
-	/**
-	 * Unpacks a comma delimited String into an array of Strings
-	 * 
-	 * @param s
-	 * @return
-	 * @todo Generated comment
-	 */
-	public static String[] unpack(String s) {
-		if (s == null)
-			return new String[0];
-		StringTokenizer toker = new StringTokenizer(s, ","); //$NON-NLS-1$
-		List list = new ArrayList();
-		while (toker.hasMoreTokens()) {
-			// since we're separating the values with ',', escape ',' in the
-			// values
-			list.add(StringUtils.replace(toker.nextToken(), "&comma;", ",").trim()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return (String[]) list.toArray(new String[0]);
-	}
-
-	/**
-	 * StringUtils constructor comment.
-	 */
-	private StringUtils() {
-		super();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/.options b/bundles/org.eclipse.wst.sse.ui/.options
index 34c8ec1..aaba6a7 100644
--- a/bundles/org.eclipse.wst.sse.ui/.options
+++ b/bundles/org.eclipse.wst.sse.ui/.options
@@ -59,6 +59,4 @@
 #org.eclipse.wst.sse.ui.internal.GotoAnnotationAction._debug
 org.eclipse.wst.sse.ui/gotoNextAnnotation=false
 
-org.eclipse.wst.sse.ui/preferences-properties=false
-
-org.eclipse.wst.sse.ui/debug/reconcilerSpelling=false
\ No newline at end of file
+org.eclipse.wst.sse.ui/preferences-properties=false
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8aa465b..0000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:38:39 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
index 48d3430..c9a18d3 100644
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:43:56 EDT 2006

-compilers.p.build=0

+#Fri May 27 23:56:32 EDT 2005

 compilers.p.deprecated=1

 compilers.p.illegal-att-value=0

 compilers.p.no-required-att=0

diff --git a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
index 235f4af..7c0be57 100644
--- a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
@@ -2,52 +2,50 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.sse.ui; singleton:=true
-Bundle-Version: 1.0.101.qualifier
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.wst.sse.ui.internal.SSEUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.wst.sse.ui,
- org.eclipse.wst.sse.ui.internal;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.actions;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentassist;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentoutline;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentproperties.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.correction;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.debug;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.derived;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.edit.util;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.editor;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.encoding.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.extension;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.format;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.hyperlink;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.openon;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.preferences;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.preferences.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.projection;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.properties;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.extensions;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.preferences;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.registry;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.style;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.reconcile;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.reconcile.validator;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.search;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.selection;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.spelling;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.taginfo;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.text;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.util;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.view.events;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
+ org.eclipse.wst.sse.ui.internal,
+ org.eclipse.wst.sse.ui.internal.actions,
+ org.eclipse.wst.sse.ui.internal.contentassist,
+ org.eclipse.wst.sse.ui.internal.contentoutline,
+ org.eclipse.wst.sse.ui.internal.contentproperties.ui,
+ org.eclipse.wst.sse.ui.internal.correction,
+ org.eclipse.wst.sse.ui.internal.debug,
+ org.eclipse.wst.sse.ui.internal.derived,
+ org.eclipse.wst.sse.ui.internal.edit.util,
+ org.eclipse.wst.sse.ui.internal.editor,
+ org.eclipse.wst.sse.ui.internal.extension,
+ org.eclipse.wst.sse.ui.internal.format,
+ org.eclipse.wst.sse.ui.internal.hyperlink,
+ org.eclipse.wst.sse.ui.internal.openon,
+ org.eclipse.wst.sse.ui.internal.preferences,
+ org.eclipse.wst.sse.ui.internal.preferences.ui,
+ org.eclipse.wst.sse.ui.internal.projection,
+ org.eclipse.wst.sse.ui.internal.properties,
+ org.eclipse.wst.sse.ui.internal.provisional.extensions,
+ org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint,
+ org.eclipse.wst.sse.ui.internal.provisional.preferences,
+ org.eclipse.wst.sse.ui.internal.provisional.registry,
+ org.eclipse.wst.sse.ui.internal.provisional.style,
+ org.eclipse.wst.sse.ui.internal.reconcile,
+ org.eclipse.wst.sse.ui.internal.reconcile.validator,
+ org.eclipse.wst.sse.ui.internal.search,
+ org.eclipse.wst.sse.ui.internal.selection,
+ org.eclipse.wst.sse.ui.internal.taginfo,
+ org.eclipse.wst.sse.ui.internal.text,
+ org.eclipse.wst.sse.ui.internal.ui,
+ org.eclipse.wst.sse.ui.internal.util,
+ org.eclipse.wst.sse.ui.internal.view.events,
  org.eclipse.wst.sse.ui.views.contentoutline,
  org.eclipse.wst.sse.ui.views.properties
 Require-Bundle: org.eclipse.ui.ide,
  org.eclipse.jface.text,
  org.eclipse.debug.core,
  org.eclipse.debug.ui,
- org.eclipse.ui.editors;visibility:=reexport,
+ org.eclipse.ui.editors,
  org.eclipse.search,
  org.eclipse.swt,
  org.eclipse.jface,
@@ -59,7 +57,6 @@
  org.eclipse.core.filebuffers,
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
- org.eclipse.wst.validation,
- org.eclipse.emf.common,
- com.ibm.icu
-Eclipse-LazyStart: true
+ org.eclipse.wst.validation, 
+ org.eclipse.emf.common
+Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.sse.ui/build.properties b/bundles/org.eclipse.wst.sse.ui/build.properties
index a5b77be..c5ca9ad 100644
--- a/bundles/org.eclipse.wst.sse.ui/build.properties
+++ b/bundles/org.eclipse.wst.sse.ui/build.properties
@@ -13,7 +13,9 @@
 bin.includes = plugin.xml,\
                .options,\
                .,\
+               data/,\
                icons/,\
+               jspdebug.properties,\
                plugin.properties,\
                META-INF/,\
                about.html
@@ -22,8 +24,14 @@
                temp.folder/**
 src.includes = toc.xml,\
                testToc.xml,\
+               smoke/,\
                schema/,\
-               html/
+               jspdebug.properties,\
+               javadoc.xml,\
+               html/,\
+               data/,\
+               DevTimeSupport/,\
+               doc/
 source.. = src/,\
            src-extensions/,\
            src-encoding,\
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.properties b/bundles/org.eclipse.wst.sse.ui/plugin.properties
index dbbb50c..ff436b9 100644
--- a/bundles/org.eclipse.wst.sse.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.sse.ui/plugin.properties
@@ -12,6 +12,7 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=Structured Source Editor
+nlFeatureName=Structured Source Editor NL Support
 Standalone_Structured_Source_Editor.name=Standalone Structured Source Editor
 # Name on preferences page
 WEB_AND_XML_Files.name=Web and XML
@@ -23,6 +24,7 @@
 sourceEditorFontDefintion.description=The Structured text editor text font is used by Structured text editors.
 
 Adapter_Factory_Description_Extension.name=Adapter Factory Description Extension
+Embedded_Content_Type_Adapter_Factory_Provider_Extension.name=Embedded Content Type Adapter Factory Provider Extension
 Extended_Editor_Actions_Extension.name=Extended Editor Actions Extension
 Drop_Target_Transfers_Extension.name=Drop Target Transfers Extension
 Extended_Editor_Configuration_Extension.name=Extended Editor Configuration Extension
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.xml b/bundles/org.eclipse.wst.sse.ui/plugin.xml
index 2dc2474..d600ef5 100644
--- a/bundles/org.eclipse.wst.sse.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.sse.ui/plugin.xml
@@ -383,7 +383,7 @@
 	<extension point="org.eclipse.ui.editors">
 		<editor
 			name="%Standalone_Structured_Source_Editor.name"
-			icon="$nl$/icons/sourceEditor.gif"
+			icon="icons/sourceEditor.gif"
 			contributorClass="org.eclipse.wst.sse.ui.internal.actions.ActionContributor"
 			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
 			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
diff --git a/bundles/org.eclipse.wst.sse.ui/reexport-info.txt b/bundles/org.eclipse.wst.sse.ui/reexport-info.txt
deleted file mode 100644
index 9c8c7c7..0000000
--- a/bundles/org.eclipse.wst.sse.ui/reexport-info.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-we reexport eclipse.ui.editors 
-since one of our APIs, StructuredSourceViewerConfiguration 
-requires it. 
-
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
index 03fcdfc..4102329 100644
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
+++ b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
@@ -11,7 +11,7 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.preferences.ui;
 
-import com.ibm.icu.text.Collator;
+import java.text.Collator;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -44,7 +44,7 @@
 import org.eclipse.wst.sse.core.internal.SSECorePlugin;
 import org.eclipse.wst.sse.core.internal.tasks.FileTaskScannerRegistryReader;
 import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.util.Sorter;
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
index d69fee6..27383ed 100644
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
+++ b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
@@ -54,7 +54,7 @@
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
 import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 
 class MainTab implements IPreferenceTab {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/InformationProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/InformationProvider.java
deleted file mode 100644
index 8f84759..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/InformationProvider.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.ui;
-
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.jface.text.information.IInformationProviderExtension2;
-
-/**
- * Information provider used to present the information.
- * 
- * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor#InformationDispatchAction
- * @see org.eclipse.wst.sse.ui.StructuredTextEditor#InformationDispatchAction
- */
-class InformationProvider implements IInformationProvider, IInformationProviderExtension, IInformationProviderExtension2 {
-
-	private IRegion fHoverRegion;
-	private String fHoverInfo;
-	private IInformationControlCreator fControlCreator;
-
-	InformationProvider(IRegion hoverRegion, String hoverInfo, IInformationControlCreator controlCreator) {
-		fHoverRegion = hoverRegion;
-		fHoverInfo = hoverInfo;
-		fControlCreator = controlCreator;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public IRegion getSubject(ITextViewer textViewer, int invocationOffset) {
-		return fHoverRegion;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	public String getInformation(ITextViewer textViewer, IRegion subject) {
-		return (String) getInformation2(textViewer, subject);
-	}
-
-	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
-		return fHoverInfo;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.information.IInformationProviderExtension2#getInformationPresenterControlCreator()
-	 * @since 3.0
-	 */
-	public IInformationControlCreator getInformationPresenterControlCreator() {
-		return fControlCreator;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
index a43422a..d57c8eb 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
@@ -26,8 +26,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
@@ -39,7 +38,6 @@
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DefaultInformationControl;
 import org.eclipse.jface.text.DocumentEvent;
 import org.eclipse.jface.text.IDocument;
@@ -54,14 +52,8 @@
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.ITextViewerExtension;
 import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.ITextViewerExtension4;
-import org.eclipse.jface.text.ITextViewerExtension5;
 import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.TextUtilities;
 import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension2;
-import org.eclipse.jface.text.information.InformationPresenter;
 import org.eclipse.jface.text.source.ICharacterPairMatcher;
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.jface.text.source.IVerticalRuler;
@@ -69,6 +61,7 @@
 import org.eclipse.jface.text.source.SourceViewerConfiguration;
 import org.eclipse.jface.text.source.projection.ProjectionSupport;
 import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.jface.util.ListenerList;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jface.util.SafeRunnable;
 import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -123,22 +116,20 @@
 import org.eclipse.ui.texteditor.IUpdate;
 import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
 import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
-import org.eclipse.ui.texteditor.TextEditorAction;
 import org.eclipse.ui.texteditor.TextOperationAction;
 import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
 import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
 import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.text.IExecutionDelegatable;
 import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
 import org.eclipse.wst.sse.ui.internal.ExtendedEditorDropTargetAdapter;
@@ -162,7 +153,6 @@
 import org.eclipse.wst.sse.ui.internal.debug.ManageBreakpointAction;
 import org.eclipse.wst.sse.ui.internal.debug.ToggleBreakpointAction;
 import org.eclipse.wst.sse.ui.internal.debug.ToggleBreakpointsTarget;
-import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
 import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
 import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
 import org.eclipse.wst.sse.ui.internal.editor.StructuredModelDocumentProvider;
@@ -663,7 +653,7 @@
 			isFiringSelection = true;
 			for (int i = 0; i < listeners.length; ++i) {
 				final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
-				SafeRunner.run(new SafeRunnable() {
+				Platform.run(new SafeRunnable() {
 					public void run() {
 						l.selectionChanged(event);
 					}
@@ -843,127 +833,6 @@
 	}
 
 	/**
-	 * This action behaves in two different ways: If there is no current text
-	 * hover, the javadoc is displayed using information presenter. If there
-	 * is a current text hover, it is converted into a information presenter
-	 * in order to make it sticky.
-	 * 
-	 * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor#InformationDispatchAction
-	 */
-	class InformationDispatchAction extends TextEditorAction {
-
-		/** The wrapped text operation action. */
-		private final TextOperationAction fTextOperationAction;
-
-		/**
-		 * Creates a dispatch action.
-		 * 
-		 * @param resourceBundle
-		 *            the resource bundle
-		 * @param prefix
-		 *            the prefix
-		 * @param textOperationAction
-		 *            the text operation action
-		 */
-		public InformationDispatchAction(ResourceBundle resourceBundle, String prefix, final TextOperationAction textOperationAction) {
-			super(resourceBundle, prefix, StructuredTextEditor.this);
-			if (textOperationAction == null)
-				throw new IllegalArgumentException();
-			fTextOperationAction = textOperationAction;
-		}
-
-		/*
-		 * @see org.eclipse.jface.action.IAction#run()
-		 */
-		public void run() {
-			ISourceViewer sourceViewer = getSourceViewer();
-			if (sourceViewer == null) {
-				fTextOperationAction.run();
-				return;
-			}
-
-			if (sourceViewer instanceof ITextViewerExtension4) {
-				ITextViewerExtension4 extension4 = (ITextViewerExtension4) sourceViewer;
-				if (extension4.moveFocusToWidgetToken())
-					return;
-			}
-
-			if (!(sourceViewer instanceof ITextViewerExtension2)) {
-				fTextOperationAction.run();
-				return;
-			}
-
-			ITextViewerExtension2 textViewerExtension2 = (ITextViewerExtension2) sourceViewer;
-
-			// does a text hover exist?
-			ITextHover textHover = textViewerExtension2.getCurrentTextHover();
-			if (textHover == null) {
-				fTextOperationAction.run();
-				return;
-			}
-
-			Point hoverEventLocation = textViewerExtension2.getHoverEventLocation();
-			int offset = computeOffsetAtLocation(sourceViewer, hoverEventLocation.x, hoverEventLocation.y);
-			if (offset == -1) {
-				fTextOperationAction.run();
-				return;
-			}
-
-			try {
-				// get the text hover content
-				String contentType = TextUtilities.getContentType(sourceViewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, true);
-
-				IRegion hoverRegion = textHover.getHoverRegion(sourceViewer, offset);
-				if (hoverRegion == null)
-					return;
-
-				String hoverInfo = textHover.getHoverInfo(sourceViewer, hoverRegion);
-
-				IInformationControlCreator controlCreator = null;
-				if (textHover instanceof IInformationProviderExtension2)
-					controlCreator = ((IInformationProviderExtension2) textHover).getInformationPresenterControlCreator();
-
-				IInformationProvider informationProvider = new InformationProvider(hoverRegion, hoverInfo, controlCreator);
-
-				fInformationPresenter.setOffset(offset);
-				fInformationPresenter.setDocumentPartitioning(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
-				fInformationPresenter.setInformationProvider(informationProvider, contentType);
-				fInformationPresenter.showInformation();
-
-			}
-			catch (BadLocationException e) {
-				// No good information to display
-			}
-		}
-
-		// modified version from TextViewer
-		private int computeOffsetAtLocation(ITextViewer textViewer, int x, int y) {
-
-			StyledText styledText = textViewer.getTextWidget();
-			IDocument document = textViewer.getDocument();
-
-			if (document == null)
-				return -1;
-
-			try {
-				int widgetLocation = styledText.getOffsetAtLocation(new Point(x, y));
-				if (textViewer instanceof ITextViewerExtension5) {
-					ITextViewerExtension5 extension = (ITextViewerExtension5) textViewer;
-					return extension.widgetOffset2ModelOffset(widgetLocation);
-				}
-				else {
-					IRegion visibleRegion = textViewer.getVisibleRegion();
-					return widgetLocation + visibleRegion.getOffset();
-				}
-			}
-			catch (IllegalArgumentException e) {
-				return -1;
-			}
-
-		}
-	}
-
-	/**
 	 * Not API. May be removed in the future.
 	 */
 	protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']'};
@@ -1046,8 +915,6 @@
 	private String fViewerConfigurationTargetId;
 	/** The selection history of the editor */
 	private SelectionHistory fSelectionHistory;
-	/** The information presenter. */
-	private InformationPresenter fInformationPresenter;
 	private boolean fUpdateMenuTextPending;
 	int hoverX = -1;
 	int hoverY = -1;
@@ -1320,7 +1187,6 @@
 		// the current insertion
 		// position
 		action = new TextOperationAction(SSEUIMessages.getResourceBundle(), StructuredTextEditorActionConstants.ACTION_NAME_INFORMATION + UNDERSCORE, this, ISourceViewer.INFORMATION, true);
-		action = new InformationDispatchAction(SSEUIMessages.getResourceBundle(), StructuredTextEditorActionConstants.ACTION_NAME_INFORMATION + UNDERSCORE, (TextOperationAction) action);
 		action.setActionDefinitionId(ActionDefinitionIds.INFORMATION);
 		setAction(StructuredTextEditorActionConstants.ACTION_NAME_INFORMATION, action);
 		markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_INFORMATION, true);
@@ -1489,19 +1355,6 @@
 		else {
 			updateEditorControlsForContentType(null);
 		}
-
-		// used for Show Tooltip Description
-		IInformationControlCreator informationControlCreator = new IInformationControlCreator() {
-			public IInformationControl createInformationControl(Shell shell) {
-				boolean cutDown = false;
-				int style = cutDown ? SWT.NONE : (SWT.V_SCROLL | SWT.H_SCROLL);
-				return new DefaultInformationControl(shell, SWT.RESIZE | SWT.TOOL, style, new HTMLTextPresenter(cutDown));
-			}
-		};
-
-		fInformationPresenter = new InformationPresenter(informationControlCreator);
-		fInformationPresenter.setSizeConstraints(60, 10, true, true);
-		fInformationPresenter.install(getSourceViewer());
 	}
 
 	protected PropertySheetConfiguration createPropertySheetConfiguration() {
@@ -1562,7 +1415,6 @@
 		}
 		if (tools == null) {
 			tools = NullSourceEditingTextTools.getInstance();
-			((NullSourceEditingTextTools)tools).setTextEditor(this);
 		}
 		Method method = null; //$NON-NLS-1$
 		try {
@@ -1659,12 +1511,6 @@
 			System.out.println("Average time per call: " + (adapterTime / adapterRequests)); //$NON-NLS-1$
 		}
 
-		// dispose of information presenter
-		if (fInformationPresenter != null) {
-			fInformationPresenter.dispose();
-			fInformationPresenter = null;
-		}
-
 		// dispose of selection history
 		if (fSelectionHistory != null) {
 			fSelectionHistory.dispose();
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
index 5ca2617..00c932c 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
@@ -282,7 +282,7 @@
 		// used by hover help
 		return new IInformationControlCreator() {
 			public IInformationControl createInformationControl(Shell parent) {
-				return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true));
+				return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(false));
 			}
 		};
 	}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
index e28996b..fc2dc98 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
@@ -20,7 +20,7 @@
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
 import org.osgi.framework.Bundle;
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
index e3eded8..823f9ea 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
@@ -50,13 +50,10 @@
  * the org.eclipse.jdt.internal.ui.JavaEditor's gotoError() method. Rewritten
  * based on 3.0M7 version to operate generically.
  * 
- * @deprecated - use org.eclipse.ui.texteditor.GotoAnnotationAction
- * 
  */
 public class GotoAnnotationAction extends TextEditorAction {
 
 	private static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/gotoNextAnnotation")); //$NON-NLS-1$  //$NON-NLS-2$
-
 	/**
 	 * Clears the status line on selection changed.
 	 */
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
index f7ffb66..be08070 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others. All rights reserved.   This
+ * Copyright (c) 2005 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 http://www.eclipse.org/legal/epl-v10.html
@@ -27,8 +27,7 @@
 		try {
 			if (fResourceBundle == null)
 				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
-		}
-		catch (MissingResourceException x) {
+		} catch (MissingResourceException x) {
 			fResourceBundle = null;
 		}
 		return fResourceBundle;
@@ -167,8 +166,6 @@
 	public static String EditorModelUtil_0;
 	public static String EditorModelUtil_1;
 
-	// TODO: These should be removed when ContentSettingsPropertyPage is
-	// deleted
 	// web content settings
 	public static String UI_Default_HTML_DOCTYPE_ID___1;
 	public static String UI_CSS_profile___2;
@@ -278,9 +275,6 @@
 	public static String OccurrencesSearchQuery_2;
 	public static String ShowView_errorTitle;
 	public static String proc_dirty_regions_0;
-
-	public static String textHoverMakeStickyHint;
-
 	// Encoding
 	public static String EncodingPreferencePage_0;
 	public static String EncodingPreferencePage_1;
@@ -302,12 +296,10 @@
 	public static String OffsetStatusLineContributionItem_11;
 	public static String OffsetStatusLineContributionItem_12;
 	public static String OffsetStatusLineContributionItem_13;
-	public static String OffsetStatusLineContributionItem_14;
 	public static String OffsetStatusLineContributionItem_15;
 	public static String OffsetStatusLineContributionItem_16;
 	public static String OffsetStatusLineContributionItem_17;
 	public static String OffsetStatusLineContributionItem_18;
-	public static String OffsetStatusLineContributionItem_19;
 
 	/*
 	 * *****Below are possibly unused strings that may be removed *****
@@ -372,7 +364,7 @@
 	public static String EnableProjectSettings;
 
 	public static String LoadingReferencedGrammars;
-
+	
 	public static String Folding;
 	public static String StructuredTextEditorPreferencePage_3;
 	public static String Projection_Toggle_label;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
index a50fcb7..af1d4f1 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
@@ -251,9 +251,6 @@
 OccurrencesSearchQuery_2=file
 ShowView_errorTitle=Problems Showing View
 proc_dirty_regions_0 = Processing Dirty Regions
-
-textHoverMakeStickyHint=Press ''{0}'' for focus.
-
 ## Encoding
 EncodingPreferencePage_0=Encoding settings for Web and XML files:
 EncodingPreferencePage_1=Use 3 byte BOM (Byte Order Mark) when saving UTF-8 encoded files
@@ -273,12 +270,10 @@
 OffsetStatusLineContributionItem_11=Type
 OffsetStatusLineContributionItem_12=Input Type: 
 OffsetStatusLineContributionItem_13=Partitioner: 
-OffsetStatusLineContributionItem_14=Selection
 OffsetStatusLineContributionItem_15=Start
 OffsetStatusLineContributionItem_16=Length
 OffsetStatusLineContributionItem_17=Text Length
 OffsetStatusLineContributionItem_18=Context
-OffsetStatusLineContributionItem_19=Workbench Selection
 
 StructuredTextEditor_0=Unsupported content type warning
 UnknownContentTypeDialog_0=Unsupported Content Type
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
index 576cc07..fa76b6b 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
@@ -33,9 +33,9 @@
 import org.eclipse.ui.editors.text.FileDocumentProvider;
 import org.eclipse.ui.editors.text.StorageDocumentProvider;
 import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.encoding.CodedReaderCreator;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.util.Utilities;
 import org.eclipse.wst.sse.ui.internal.debug.BreakpointRulerAction;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
index d2d3e33..ad15ec8 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
@@ -37,7 +37,7 @@
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 
 public class StructuredTextAnnotationHover implements IAnnotationHover {
 
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java
similarity index 100%
rename from bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties
rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
index efa9b45..e0801ed 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
@@ -16,7 +16,6 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IDocumentAdapter;
 import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITextViewerExtension2;
 import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.TextSelection;
@@ -737,11 +736,8 @@
 	 * @see org.eclipse.wst.sse.core.undo.IDocumentSelectionMediator#undoOperationSelectionChanged(org.eclipse.wst.sse.core.undo.UndoDocumentEvent)
 	 */
 	public void undoOperationSelectionChanged(UndoDocumentEvent event) {
-		if (event.getRequester() != null && event.getRequester().equals(this) && event.getDocument().equals(getDocument())) {
-			//BUG107687: Undo/redo do not scroll editor
-			ITextSelection selection = new TextSelection(event.getOffset(), event.getLength());
-			setSelection(selection, true);
-		}
+		if (event.getRequester() != null && event.getRequester().equals(this) && event.getDocument().equals(getDocument()))
+			setSelectedRange(event.getOffset(), event.getLength());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
index 04080be..3b62c6b 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
@@ -12,10 +12,10 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.contentassist;
 
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java
index 013799b..9872fb2 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java
@@ -188,7 +188,7 @@
     public int getContextInformationPosition() {
         return getCursorPosition();
     }
-    
+
     public int getCursorPosition() {
         return fCursorPosition;
     }
@@ -197,10 +197,6 @@
         fCursorPosition = pos;
     }
 
-    public void setDisplayString(String newDisplayString) {
-    	fDisplayString = newDisplayString;
-    }
-    
     public String getDisplayString() {
         // return fProposal.getDisplayString();
         return fDisplayString;
@@ -215,9 +211,6 @@
         return fRelevance;
     }
 
-    public void setReplacementLength(int newReplacementLength) {
-        fReplacementLength = newReplacementLength;
-    }  
     public int getReplacementLength() {
         return fReplacementLength;
     }
@@ -268,15 +261,13 @@
 
     // code is borrowed from JavaCompletionProposal
     protected boolean startsWith(IDocument document, int offset, String word) {
-	
-    	int wordLength = word == null ? 0 : word.length();
+        int wordLength = word == null ? 0 : word.length();
         if (offset > fReplacementOffset + wordLength)
             return false;
 
         try {
             int length = offset - fReplacementOffset;
             String start = document.get(fReplacementOffset, length);
-
             return word.substring(0, length).equalsIgnoreCase(start);
         } catch (BadLocationException x) {
         }
@@ -300,20 +291,11 @@
         if (offset < fReplacementOffset)
             return false;
         boolean validated = startsWith(document, offset, fDisplayString);
-
+        // CMVC 269884
         if (fUpdateLengthOnValidate) {
-
-            // it would be better to use "originalCursorPosition" instead of
-            // getReplacementOffset(), but we don't have that info.
             int newLength = offset - getReplacementOffset();
             int delta = newLength - fOriginalReplacementLength;
             fReplacementLength = delta + fOriginalReplacementLength;
-            
-        	// if it's an attribute value, replacement offset is
-            // going to be one off from the actual cursor offset...
-        	char firstChar = document.get().charAt(getReplacementOffset());
-        	if(firstChar == '"' || firstChar == '\'')
-        		fReplacementLength ++;
         }
         return validated;
     }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
index 4586fb7..62bb1dc 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
@@ -49,7 +49,7 @@
 		if (fProcessors == null)
 			fProcessors = new HashMap();
 
-		CompoundContentAssistProcessor compoundProcessor = getExistingContentAssistProcessor(partitionType);
+		CompoundContentAssistProcessor compoundProcessor = (CompoundContentAssistProcessor) getContentAssistProcessor(partitionType);
 
 		// if processor is null, you want to remove all processors of
 		// contentType
@@ -72,21 +72,6 @@
 		super.setContentAssistProcessor(compoundProcessor, partitionType);
 	}
 
-	private CompoundContentAssistProcessor getExistingContentAssistProcessor(String partitionType) {
-		CompoundContentAssistProcessor compoundContentAssistProcessor = null;
-		IContentAssistProcessor processor = super.getContentAssistProcessor(partitionType);
-		if (processor != null) {
-			if (processor instanceof CompoundContentAssistProcessor) {
-				compoundContentAssistProcessor = (CompoundContentAssistProcessor) processor;
-			}
-			else {
-				throw new IllegalStateException("StructuredContentAssistant use CompoundContentAssistProcessor"); //$NON-NLS-1$
-			}
-		}
-		return compoundContentAssistProcessor;
-
-	}
-
 	/**
 	 * Returns the content assist processor to be used for the given content
 	 * type. Also installs any content assist processors that were added by
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
index fbb1466..2f1874c 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
@@ -153,7 +153,7 @@
 				 * have focus.
 				 */
 				ISelection validContentSelection = getConfiguration().getSelection(getTreeViewer(), selection);
-//				getTreeViewer().refresh(true);
+				getTreeViewer().refresh(true);
 				boolean isLinked = getConfiguration().isLinkedWithEditor(getTreeViewer());
 				if (isLinked) {
 					getTreeViewer().setSelection(validContentSelection, true);
@@ -383,6 +383,7 @@
 	}
 
 	public void dispose() {
+		super.dispose();
 		getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(getSelectionServiceListener());
 		if (fDoubleClickProvider != null) {
 			getTreeViewer().removeDoubleClickListener(fDoubleClickProvider);
@@ -398,7 +399,6 @@
 			fContextMenuManager.dispose();
 		}
 		setConfiguration(NULL_CONFIGURATION);
-		super.dispose();
 	}
 
 	/*
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java
index 8b8eb59..7222ce6 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2004 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
@@ -26,9 +26,7 @@
 import org.eclipse.wst.sse.ui.internal.Logger;
 
 
-/**
- * @deprecated People should manage their own combo/list
- */
+
 public class ComboList {
 	private Combo combo;
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java
index f46c517..297c860 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2004 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
@@ -16,9 +16,7 @@
 
 import org.eclipse.swt.widgets.Composite;
 
-/**
- * @deprecated People should manage their own combo/list
- */
+
 public final class ComboListOnPropertyPage extends ComboList {
 
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java
index c21501f..6273596 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java
@@ -31,22 +31,15 @@
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.internal.contentproperties.ContentSettings;
 import org.eclipse.wst.sse.internal.contentproperties.ContentSettingsCreator;
 import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 
-/**
- * @deprecated Please use
- *             org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage
- *             or
- *             eclipse.wst.css.ui.internal.contentproperties.ui.CSSWebContentSettingsPropertyPage
- *             instead
- */
 public abstract class ContentSettingsPropertyPage extends PropertyPage {
 	private static final IStatus STATUS_ERROR = new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.INFO, "ERROR", null); //$NON-NLS-1$
 
@@ -87,15 +80,12 @@
 				if (!model.isDirty()) {
 					try {
 						file.refreshLocal(IResource.DEPTH_ONE, null);
-					}
-					catch (CoreException e) {
+					} catch (CoreException e) {
 						return STATUS_ERROR;
-					}
-					finally {
+					} finally {
 						model.releaseFromRead();
 					}
-				}
-				else {
+				} else {
 					model.releaseFromRead();
 				}
 			}
@@ -146,7 +136,7 @@
 		ComboListOnPropertyPage combo = new ComboListOnPropertyPage(propertyPage, SWT.READ_ONLY);
 		GridData data = new GridData();
 		data.verticalAlignment = GridData.FILL;
-		// data.horizontalAlignment= GridData.FILL;
+		//data.horizontalAlignment= GridData.FILL;
 		data.grabExcessHorizontalSpace = true;
 		combo.setLayoutData(data);
 		return combo;
@@ -157,18 +147,18 @@
 	protected Composite createComposite(Composite parent, int numColumns, int numRows) {
 		Composite composite = new Composite(parent, SWT.NONE);
 
-		// GridLayout
+		//GridLayout
 		GridLayout layout = new GridLayout();
 		layout.numColumns = numColumns;
 		composite.setLayout(layout);
 
-		// GridData
+		//GridData
 		GridData data = new GridData();
 		data.verticalAlignment = GridData.FILL;
 		data.horizontalAlignment = GridData.FILL;
 		data.grabExcessHorizontalSpace = true;
-		// data.horizontalSpan=numColumns;
-		// data.verticalSpan=numRows;
+		//		data.horizontalSpan=numColumns;
+		//		data.verticalSpan=numRows;
 
 		composite.setLayoutData(data);
 		return composite;
@@ -190,7 +180,7 @@
 
 	protected abstract void createSettingsPageGUI();
 
-	// protected abstract void applySelectedPropertyValue(String str,int
+	//protected abstract void applySelectedPropertyValue(String str,int
 	// index);
 	protected abstract void deleteNoneProperty(int index);
 
@@ -210,8 +200,8 @@
 		super.performDefaults();
 		// selected(applied) item is restored.
 		for (int i = 0; i < numberOfCombo; i++) {
-			// String appliedValue = combo[i].getApplyValue();
-			// setSelectionItem(combo[i],appliedValue);
+			//String appliedValue = combo[i].getApplyValue();
+			//setSelectionItem(combo[i],appliedValue);
 			combo[i].select(0); // select none.
 
 		}
@@ -238,7 +228,7 @@
 				deleteNoneProperty(i);
 			else
 				putSelectedPropertyInto(properties, str, i);
-			// applySelectedPropertyValue(str,i);
+			//applySelectedPropertyValue(str,i);
 
 			// set apply value in ComboListOnPropertyPage.
 			combo[i].setApplyValue(str);
@@ -283,11 +273,11 @@
 		IFile file = project.getFile(name);
 
 		if (file != null && !file.exists())
-			return true; // Is this really OK?
-		// If false should be returned,
-		// This statemant can be removed,
-		// since ModelManagerUtil.validateEdit()
-		// returns error to this case.
+			return true; //Is this really OK?
+		//If false should be returned,
+		//This statemant can be removed,
+		//since ModelManagerUtil.validateEdit()
+		//returns error to this case.
 
 		Shell shell = getControl().getShell();
 		IStatus status = validateEdit(file, shell);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
index 947d649..d37c77a 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
@@ -42,8 +42,8 @@
 import org.eclipse.ui.texteditor.IDocumentProvider;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.Logger;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java
index 21c9b84..056330a 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java
@@ -53,7 +53,7 @@
 import org.eclipse.ui.texteditor.IElementStateListener;
 import org.eclipse.ui.texteditor.ITextEditorActionConstants;
 import org.eclipse.ui.texteditor.MarkerRulerAction;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
 import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
index 84937bf..fb20197 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
@@ -32,9 +32,9 @@
 import org.eclipse.ui.texteditor.IDocumentProvider;
 import org.eclipse.ui.texteditor.IDocumentProviderExtension4;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.util.Debug;
 import org.eclipse.wst.sse.ui.internal.Logger;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java
index 57aec74..0b30af6 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java
@@ -15,7 +15,7 @@
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.Reader;
-import com.ibm.icu.text.BreakIterator;
+import java.text.BreakIterator;
 
 import org.eclipse.swt.graphics.GC;
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java
index 04dca68..ab721c8 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java
@@ -14,7 +14,7 @@
 
 import java.util.Iterator;
 
-import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.util.SafeRunnable;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
@@ -61,7 +61,7 @@
 				 * don't specify a content type
 				 */
 				if (provider.isFor(structuredModel.getModelHandler())) {
-					SafeRunner.run(new SafeRunnable(SSEUIMessages.EditorModelUtil_1) { //$NON-NLS-1$
+					Platform.run(new SafeRunnable(SSEUIMessages.EditorModelUtil_1) { //$NON-NLS-1$
 									public void run() {
 										provider.addAdapterFactories(structuredModel);
 									}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
index 0eebf4e..77132ea 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
@@ -22,8 +22,8 @@
 
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
 import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
 import org.eclipse.wst.sse.ui.internal.Logger;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
index 72c7bba..410e6d5 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
@@ -22,8 +22,8 @@
 
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
 import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
 import org.eclipse.wst.sse.ui.internal.Logger;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java
index 8bcf216..c8facd3 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java
@@ -30,8 +30,8 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.editors.text.EditorsUI;
 import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.Logger;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java
index 46d90b9..cc42bc2 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java
@@ -20,9 +20,9 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java
index 160100a..427998d 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java
@@ -13,7 +13,7 @@
 package org.eclipse.wst.sse.ui.internal.preferences.ui;
 
 import java.io.CharArrayReader;
-import com.ibm.icu.text.Collator;
+import java.text.Collator;
 import java.util.Dictionary;
 import java.util.List;
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
index b9d3093..fae0606 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
@@ -16,11 +16,9 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.runtime.CoreException;
@@ -30,11 +28,9 @@
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.reconciler.DirtyRegion;
 import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
 import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
 import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension;
 import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
@@ -43,21 +39,21 @@
 
 
 /**
- * A base ReconcilingStrategy. Subclasses must implement
- * createReconcileSteps(). This class should not know about
- * IStructuredDocument, only IDocument.
+ * A base ReconcilingStrategy. 
+ * Subclasses must implement createReconcileSteps().
+ * This class should not know about IStructuredDocument, only IDocument.
  * 
  * @author pavery
  */
 public abstract class AbstractStructuredTextReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension, IReleasable {
 
-	/** debug flag */
-	protected static final boolean DEBUG;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
-
+    /** debug flag */
+    protected static final boolean DEBUG;
+    static {
+        String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
+        DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+    }
+    
 	// these limits are safetys for "runaway" validation cases
 	// should be used to safeguard potentially dangerous loops or potentially
 	// long annotations
@@ -65,17 +61,17 @@
 	// annotations)
 	public static final int ANNOTATION_LENGTH_LIMIT = 25;
 	public static final int ELEMENT_ERROR_LIMIT = 25;
-
+    
 	private IDocument fDocument = null;
-	// private IReconcileStep fFirstStep = null;
+//	private IReconcileStep fFirstStep = null;
 	private IProgressMonitor fProgressMonitor = null;
 	private ISourceViewer fSourceViewer = null;
-	private Comparator fComparator;
+    private Comparator fComparator;
 
 	// list of "validator" annotations
 	// for gray/un-gray capability
 	private HashSet fMarkerAnnotations = null;
-
+	
 	/**
 	 * Creates a new strategy. The editor parameter is for access to the
 	 * annotation model.
@@ -97,13 +93,13 @@
 		// can be null when closing the editor
 		if (getAnnotationModel() != null) {
 			TemporaryAnnotation tempAnnotation = (TemporaryAnnotation) result;
-
+			
 			StructuredMarkerAnnotation sma = getCorrespondingMarkerAnnotation(tempAnnotation);
-			if (sma != null) {
+			if(sma != null) {
 				// un-gray out the marker annotation
 				sma.setGrayed(false);
 			}
-
+			
 			getAnnotationModel().addAnnotation(tempAnnotation, tempAnnotation.getPosition());
 		}
 	}
@@ -113,24 +109,24 @@
 	 * @return if this strategy is responisble for adding this type of key
 	 */
 	protected boolean canHandlePartition(String partition) {
-		// String[] haystack = getPartitionTypes();
-		// for (int i = 0; i < haystack.length; i++) {
-		// if (haystack[i].equals(partition))
-		// return true;
-		// }
-		// return false;
+//		String[] haystack = getPartitionTypes();
+//		for (int i = 0; i < haystack.length; i++) {
+//			if (haystack[i].equals(partition))
+//				return true;
+//		}
+//		return false;
 		return false;
 	}
 
-	// /**
-	// * @param step
-	// * @return
-	// */
-	// protected boolean containsStep(IReconcileStep step) {
-	// if (fFirstStep instanceof StructuredReconcileStep)
-	// return ((StructuredReconcileStep) fFirstStep).isSiblingStep(step);
-	// return false;
-	// }
+//	/**
+//	 * @param step
+//	 * @return
+//	 */
+//	protected boolean containsStep(IReconcileStep step) {
+//		if (fFirstStep instanceof StructuredReconcileStep)
+//			return ((StructuredReconcileStep) fFirstStep).isSiblingStep(step);
+//		return false;
+//	}
 
 	/**
 	 * This is where you should create the steps for this strategy
@@ -154,10 +150,7 @@
 				ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
 				// then if this strategy knows how to add/remove this
 				// partition type
-				if (canHandlePartition(key.getPartitionType()) /*
-																 * &&
-																 * containsStep(key.getStep())
-																 */)
+				if (canHandlePartition(key.getPartitionType()) /*&& containsStep(key.getStep())*/)
 					removals.add(annotation);
 			}
 		}
@@ -173,38 +166,38 @@
 	}
 
 	protected TemporaryAnnotation[] getAnnotationsToRemove(DirtyRegion dr) {
-
+		
 		List remove = new ArrayList();
 		IAnnotationModel annotationModel = getAnnotationModel();
 		// can be null when closing the editor
 		if (getAnnotationModel() != null) {
-
+			
 			// clear validator annotations
 			getMarkerAnnotations().clear();
-
+			
 			Iterator i = annotationModel.getAnnotationIterator();
 			while (i.hasNext()) {
-
+				
 				Object obj = i.next();
-
+				
 				// check if it's a validator marker annotation
 				// if it is save it for comparision later (to "gray" icons)
-				if (obj instanceof StructuredMarkerAnnotation) {
-					StructuredMarkerAnnotation sma = (StructuredMarkerAnnotation) obj;
-
-					if (sma.getAnnotationType() == TemporaryAnnotation.ANNOT_ERROR || sma.getAnnotationType() == TemporaryAnnotation.ANNOT_WARNING)
+				if(obj instanceof StructuredMarkerAnnotation) {
+					StructuredMarkerAnnotation sma = (StructuredMarkerAnnotation)obj;
+					
+					if(sma.getAnnotationType() == TemporaryAnnotation.ANNOT_ERROR || sma.getAnnotationType() == TemporaryAnnotation.ANNOT_WARNING)
 						fMarkerAnnotations.add(sma);
 				}
-
+				
 				if (!(obj instanceof TemporaryAnnotation))
 					continue;
 
 				TemporaryAnnotation annotation = (TemporaryAnnotation) obj;
 				ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
-
+				
 				// then if this strategy knows how to add/remove this
 				// partition type
-				if (canHandlePartition(key.getPartitionType()) && containsStep(key.getStep())) {
+				if (canHandlePartition(key.getPartitionType()) /*&& containsStep(key.getStep())*/) {
 					if (key.getScope() == ReconcileAnnotationKey.PARTIAL && annotation.getPosition().overlapsWith(dr.getOffset(), dr.getLength())) {
 						remove.add(annotation);
 					}
@@ -218,18 +211,17 @@
 	}
 
 
-	protected abstract boolean containsStep(IReconcileStep step);
-
 	/**
 	 * Gets partition types from all steps in this strategy.
 	 * 
 	 * @return parition types from all steps
 	 */
-	// public String[] getPartitionTypes() {
-	// if (fFirstStep instanceof StructuredReconcileStep)
-	// return ((StructuredReconcileStep) fFirstStep).getPartitionTypes();
-	// return new String[0];
-	// }
+//	public String[] getPartitionTypes() {
+//		if (fFirstStep instanceof StructuredReconcileStep)
+//			return ((StructuredReconcileStep) fFirstStep).getPartitionTypes();
+//		return new String[0];
+//	}
+
 	public void init() {
 		createReconcileSteps();
 	}
@@ -262,16 +254,16 @@
 		if (results == null)
 			return;
 
-		for (int i = 0; i < results.length && i < ELEMENT_ERROR_LIMIT && !isCanceled(); i++) {
+		for (int i = 0; i<results.length && i<ELEMENT_ERROR_LIMIT && !isCanceled(); i++) {
 
 			if (isCanceled()) {
-				if (DEBUG)
-					System.out.println("[trace reconciler] >** PROCESS (adding) WAS CANCELLED **"); //$NON-NLS-1$
+                if(DEBUG)
+				    System.out.println("[trace reconciler] >** PROCESS (adding) WAS CANCELLED **"); //$NON-NLS-1$
 				return;
 			}
 			addResultToAnnotationModel(results[i]);
 		}
-
+        
 		if (DEBUG) {
 			StringBuffer traceString = new StringBuffer();
 			for (int j = 0; j < results.length; j++)
@@ -287,31 +279,28 @@
 	public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
 		// not used
 		// we only have validator strategy now
-
-		// // external files may be null
-		// if (isCanceled() || fFirstStep == null)
-		// return;
-		//
-		// TemporaryAnnotation[] annotationsToRemove = new
-		// TemporaryAnnotation[0];
-		// IReconcileResult[] annotationsToAdd = new IReconcileResult[0];
-		// StructuredReconcileStep structuredStep = (StructuredReconcileStep)
-		// fFirstStep;
-		//        
-		// annotationsToRemove = getAnnotationsToRemove(dirtyRegion);
-		// annotationsToAdd = structuredStep.reconcile(dirtyRegion,
-		// subRegion);
-		//        
-		// smartProcess(annotationsToRemove, annotationsToAdd);
+		
+//		// external files may be null
+//		if (isCanceled() || fFirstStep == null)
+//			return;
+//
+//        TemporaryAnnotation[] annotationsToRemove = new TemporaryAnnotation[0];
+//        IReconcileResult[] annotationsToAdd = new IReconcileResult[0];
+//        StructuredReconcileStep structuredStep = (StructuredReconcileStep) fFirstStep;
+//        
+//        annotationsToRemove = getAnnotationsToRemove(dirtyRegion);
+//        annotationsToAdd = structuredStep.reconcile(dirtyRegion, subRegion);
+//        
+//        smartProcess(annotationsToRemove, annotationsToAdd);
 	}
-
+    
 	/**
 	 * @param partition
 	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.IRegion)
 	 */
 	public void reconcile(IRegion partition) {
 		// not used, we use:
-		// reconcile(DirtyRegion dirtyRegion, IRegion subRegion)
+        // reconcile(DirtyRegion dirtyRegion, IRegion subRegion)
 	}
 
 	/**
@@ -320,34 +309,34 @@
 	 */
 	public void release() {
 		// release steps (each step calls release on the next)
-		// if (fFirstStep != null && fFirstStep instanceof IReleasable)
-		// ((IReleasable) fFirstStep).release();
+		//if (fFirstStep != null && fFirstStep instanceof IReleasable)
+		//	((IReleasable) fFirstStep).release();
 		// we don't to null out the steps, in case
 		// it's reconfigured later
 	}
 
 	private void removeAnnotations(TemporaryAnnotation[] annotationsToRemove) {
-
+		
 		IAnnotationModel annotationModel = getAnnotationModel();
 		// can be null when closing the editor
 		if (annotationModel != null) {
 			for (int i = 0; i < annotationsToRemove.length; i++) {
 				if (isCanceled()) {
-					if (DEBUG)
-						System.out.println("[trace reconciler] >** REMOVAL WAS CANCELLED **"); //$NON-NLS-1$
+                    if(DEBUG)
+					    System.out.println("[trace reconciler] >** REMOVAL WAS CANCELLED **"); //$NON-NLS-1$
 					return;
 				}
 				StructuredMarkerAnnotation sma = getCorrespondingMarkerAnnotation(annotationsToRemove[i]);
-				if (sma != null) {
+				if(sma != null) {
 					// gray out the marker annotation
 					sma.setGrayed(true);
 				}
 				// remove the temp one
 				annotationModel.removeAnnotation(annotationsToRemove[i]);
-
+				
 			}
 		}
-
+        
 		if (DEBUG) {
 			StringBuffer traceString = new StringBuffer();
 			for (int i = 0; i < annotationsToRemove.length; i++)
@@ -356,29 +345,29 @@
 		}
 	}
 
-	private StructuredMarkerAnnotation getCorrespondingMarkerAnnotation(TemporaryAnnotation tempAnnotation) {
-
+    private StructuredMarkerAnnotation getCorrespondingMarkerAnnotation(TemporaryAnnotation tempAnnotation) {
+		
 		Iterator it = getMarkerAnnotations().iterator();
 		while (it.hasNext()) {
 			StructuredMarkerAnnotation markerAnnotation = (StructuredMarkerAnnotation) it.next();
 			String message = ""; //$NON-NLS-1$
 			try {
 				message = (String) markerAnnotation.getMarker().getAttribute(IMarker.MESSAGE);
-			}
+			} 
 			catch (CoreException e) {
-				if (DEBUG)
+				if(DEBUG)
 					Logger.logException(e);
 			}
 			// it would be nice to check line number here...
-			if (message != null && message.equals(tempAnnotation.getText()))
+			if(message != null && message.equals(tempAnnotation.getText()))
 				return markerAnnotation;
 		}
 		return null;
 	}
 
 	private void removeAllAnnotations() {
-		removeAnnotations(getAllAnnotationsToRemove());
-	}
+        removeAnnotations(getAllAnnotationsToRemove());
+    }
 
 	/**
 	 * Set the document for this strategy.
@@ -389,129 +378,109 @@
 	public void setDocument(IDocument document) {
 
 		// remove all old annotations since it's a new document
-		removeAllAnnotations();
+	    removeAllAnnotations();
 
 		if (document == null)
 			release();
-
-		// if (getFirstStep() != null)
-		// getFirstStep().setInputModel(new DocumentAdapter(document));
-
+		
+//		if (getFirstStep() != null)
+//			getFirstStep().setInputModel(new DocumentAdapter(document));
+		
 		fDocument = document;
 	}
 
 	public IDocument getDocument() {
 		return fDocument;
 	}
-
+	
 	/**
 	 * @param monitor
 	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	public void setProgressMonitor(IProgressMonitor monitor) {
-		// fProgressMonitor = monitor;
-		// if (fFirstStep != null)
-		// fFirstStep.setProgressMonitor(fProgressMonitor);
+//		fProgressMonitor = monitor;
+//		if (fFirstStep != null)
+//			fFirstStep.setProgressMonitor(fProgressMonitor);
 	}
 
 	/**
-	 * Check if the annotation is already there, if it is, no need to remove
-	 * or add again. This will avoid a lot of "flickering" behavior.
+	 * Check if the annotation is already there, if it is, no need to 
+     * remove or add again. This will avoid a lot of "flickering" behavior.
 	 * 
 	 * @param annotationsToRemove
 	 * @param annotationsToAdd
 	 */
 	protected void smartProcess(TemporaryAnnotation[] annotationsToRemove, IReconcileResult[] annotationsToAdd) {
-
-		// pa_TODO: investigate a better algorithm,
-		// also see if this is a bad performance hit.
-
-		Comparator comp = getTemporaryAnnotationComparator();
-		List sortedRemovals = Arrays.asList(annotationsToRemove);
-		Collections.sort(sortedRemovals, comp);
-
-		List sortedAdditions = Arrays.asList(annotationsToAdd);
-		Collections.sort(sortedAdditions, comp);
-
-		List filteredRemovals = new ArrayList(sortedRemovals);
-		List filteredAdditions = new ArrayList(sortedAdditions);
-
-		boolean ignore = false;
-		int lastFoundAdded = 0;
-		for (int i = 0; i < sortedRemovals.size(); i++) {
-			TemporaryAnnotation removal = (TemporaryAnnotation) sortedRemovals.get(i);
-			for (int j = lastFoundAdded; j < sortedAdditions.size(); j++) {
-				TemporaryAnnotation addition = (TemporaryAnnotation) sortedAdditions.get(j);
-				// quick position check here
-				if (removal.getPosition().equals(addition.getPosition())) {
-					lastFoundAdded = j;
-					// remove performs TemporaryAnnotation.equals()
-					// which checks text as well
-					filteredAdditions.remove(addition);
-					ignore = true;
-					if (DEBUG)
-						System.out.println(" ~ smart process ignoring: " + removal.getPosition().getOffset()); //$NON-NLS-1$
-					break;
-				}
-			}
-			if (ignore) {
-				filteredRemovals.remove(removal);
-			}
-			ignore = false;
-		}
-		if (getAnnotationModel() instanceof IAnnotationModelExtension) {
-			TemporaryAnnotation[] filteredRemovalArray = (TemporaryAnnotation[]) filteredRemovals.toArray(new TemporaryAnnotation[filteredRemovals.size()]);
-			// apply "grey"-ness
-			for (int i = 0; i < filteredRemovalArray.length; i++) {
-				if (isCanceled()) {
-					if (DEBUG)
-						System.out.println("[trace reconciler] >** replacing WAS CANCELLED **"); //$NON-NLS-1$
-					return;
-				}
-				StructuredMarkerAnnotation sma = getCorrespondingMarkerAnnotation(filteredRemovalArray[i]);
-				if (sma != null) {
-					// gray out the marker annotation
-					sma.setGrayed(true);
-				}
-			}
-			Map annotationsToAddMap = new HashMap();
-			for (int i = 0; i < filteredAdditions.size(); i++) {
-				TemporaryAnnotation temporaryAnnotation = (TemporaryAnnotation) filteredAdditions.get(i);
-				annotationsToAddMap.put(temporaryAnnotation, temporaryAnnotation.getPosition());
-			}
-			if (isCanceled()) {
-				if (DEBUG)
-					System.out.println("[trace reconciler] >** PROCESS (replacing) WAS CANCELLED **"); //$NON-NLS-1$
-				return;
-			}
-			/*
-			 * Using the extension means we can't enforce the
-			 * ELEMENT_ERROR_LIMIT limit.
-			 */
-			((IAnnotationModelExtension) getAnnotationModel()).replaceAnnotations(filteredRemovalArray, annotationsToAddMap);
-		}
-		else {
-			removeAnnotations((TemporaryAnnotation[]) filteredRemovals.toArray(new TemporaryAnnotation[filteredRemovals.size()]));
-			process((IReconcileResult[]) filteredAdditions.toArray(new IReconcileResult[filteredAdditions.size()]));
-		}
+        
+        // pa_TODO: investigate a better algorithm, 
+        // also see if this is a bad performance hit.
+        
+        Comparator comp = getAnnotationComparator();
+        List sortedRemovals = Arrays.asList(annotationsToRemove);
+	    Collections.sort(sortedRemovals, comp);
+        
+        List sortedAdditions = Arrays.asList(annotationsToAdd);
+        Collections.sort(sortedAdditions, comp);
+        
+        List filteredRemovals = new ArrayList(sortedRemovals);
+        List filteredAdditions = new ArrayList(sortedAdditions);
+        
+        boolean ignore = false;
+        int lastFoundAdded = 0;
+        for(int i=0; i<sortedRemovals.size(); i++) {
+            TemporaryAnnotation removal = (TemporaryAnnotation)sortedRemovals.get(i);       
+            for(int j=lastFoundAdded; j<sortedAdditions.size(); j++) {             
+                TemporaryAnnotation addition = (TemporaryAnnotation)sortedAdditions.get(j);
+                // quick position check here
+                if(removal.getPosition().equals(addition.getPosition())) {
+                    lastFoundAdded = j;
+                    // remove performs TemporaryAnnotation.equals()
+                    // which checks text as well
+                    filteredAdditions.remove(addition);
+                    ignore = true;
+                    if(DEBUG)
+                        System.out.println(" ~ smart process ignoring: " + removal.getPosition().getOffset()); //$NON-NLS-1$
+                    break;
+                }
+            }
+            if(ignore) {
+                filteredRemovals.remove(removal);
+            }
+            ignore = false;
+        }
+        
+        removeAnnotations((TemporaryAnnotation[])filteredRemovals.toArray(new TemporaryAnnotation[filteredRemovals.size()]));
+        process((IReconcileResult[])filteredAdditions.toArray(new IReconcileResult[filteredAdditions.size()]));
 	}
-
-	private Comparator getTemporaryAnnotationComparator() {
-		if (fComparator == null) {
-			fComparator = new Comparator() {
-				public int compare(Object arg0, Object arg1) {
-					TemporaryAnnotation ta1 = (TemporaryAnnotation) arg0;
-					TemporaryAnnotation ta2 = (TemporaryAnnotation) arg1;
-					return ta1.getPosition().getOffset() - ta2.getPosition().getOffset();
-				}
-			};
-		}
-		return fComparator;
+    
+    private Comparator getAnnotationComparator() {
+        if(fComparator == null) {
+            fComparator = new Comparator( ) {
+                public int compare(Object arg0, Object arg1) {
+                    TemporaryAnnotation ta1 = (TemporaryAnnotation)arg0;
+                    TemporaryAnnotation ta2 = (TemporaryAnnotation)arg1;
+                    return ta1.getPosition().getOffset() - ta2.getPosition().getOffset();
+                }
+            };
+        }
+        return fComparator;
+    }
+	
+	public boolean isTotalScope() {
+		return false;
 	}
 
 	public HashSet getMarkerAnnotations() {
-		if (fMarkerAnnotations == null)
-			fMarkerAnnotations = new HashSet();
+		if(fMarkerAnnotations == null)
+			 fMarkerAnnotations = new HashSet();
 		return fMarkerAnnotations;
 	}
+
+//	public IReconcileStep getFirstStep() {
+//		return fFirstStep;
+//	}
+//
+//	public void setFirstStep(IReconcileStep firstStep) {
+//		fFirstStep = firstStep;
+//	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
index f9166fd..aca9770 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
@@ -14,10 +14,8 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -26,130 +24,29 @@
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.ITextInputListener;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.TextUtilities;
 import org.eclipse.jface.text.reconciler.DirtyRegion;
 import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.reconciler.IReconcilerExtension;
 import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
 import org.eclipse.wst.sse.ui.internal.Logger;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 
 /**
- * This Job holds a queue of updates from the editor (DirtyRegions) to
+ * This job holds a queue of updates from the editor (DirtyRegions) to
  * process. When a new request comes in, the current run is canceled, the new
  * request is added to the queue, then the job is re-scheduled.
  * 
  * @author pavery
  */
-public class DirtyRegionProcessor extends Job implements IReconciler, IReconcilerExtension, IConfigurableReconciler {
-	class DocumentListener implements IDocumentListener {
-		public void documentAboutToBeChanged(DocumentEvent event) {
-			// save partition type (to see if it changes in documentChanged())
-			fLastPartitions = getPartitions(event.getOffset(), event.getLength());
-		}
-
-		public void documentChanged(DocumentEvent event) {
-			if (partitionsChanged(event)) {
-				// pa_TODO
-				// this is a simple way to ensure old
-				// annotations are removed when partition changes
-
-				// it might be a performance hit though
-				setEntireDocumentDirty(getDocument());
-			}
-			else {
-				/*
-				 * Note that creating DirtyRegions *now* means that the wrong
-				 * text may be included
-				 */
-				DirtyRegion dr = null;
-				if (event.getLength() == 0) {
-					/*
-					 * It's an insert-- we use text length though so that the
-					 * new region gets validated...
-					 */
-					dr = createDirtyRegion(event.getOffset(), 0, DirtyRegion.INSERT);
-				}
-				else {
-					if ("".equals(event.getText())) { //$NON-NLS-1$
-						// it's a delete
-						dr = createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.REMOVE);
-					}
-					else {
-						// it's a replace
-						dr = createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.INSERT);
-					}
-				}
-				processDirtyRegion(dr);
-			}
-		}
-
-		/**
-		 * Checks previous partitions from the span of the event w/ the new
-		 * partitions from the span of the event. If partitions changed,
-		 * return true, else return false
-		 * 
-		 * @param event
-		 * @return
-		 */
-		private boolean partitionsChanged(DocumentEvent event) {
-			boolean changed = false;
-			int length = event.getLength();
-
-			if (event.getLength() == 0 && event.getText().length() > 0) {
-				// it's an insert, we want partitions of the new text
-				length = event.getText().length();
-			}
-
-			String[] newPartitions = getPartitions(event.getOffset(), length);
-			if (fLastPartitions != null) {
-				if (fLastPartitions.length != newPartitions.length) {
-					changed = true;
-				}
-				else {
-					for (int i = 0; i < fLastPartitions.length; i++) {
-						if (!fLastPartitions[i].equals(newPartitions[i])) {
-							changed = true;
-							break;
-						}
-					}
-				}
-			}
-			return changed;
-		}
-
-
-	}
-
-	/**
-	 * Reconciles the entire document when the document in the viewer is
-	 * changed. This happens when the document is initially opened, as well as
-	 * after a save-as.
-	 * 
-	 * Also see processPostModelEvent(...) for similar behavior when document
-	 * for the model is changed.
-	 */
-	class TextInputListener implements ITextInputListener {
-		public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-			// do nothing
-		}
-
-		public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-			handleInputDocumentChanged(oldInput, newInput);
-		}
-	}
-
+public class DirtyRegionProcessor extends Job implements IReconciler {
 	/** debug flag */
 	protected static final boolean DEBUG;
-	private static final long UPDATE_DELAY = 750;
 
+	private static final long UPDATE_DELAY = 750;
 	static {
 		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
@@ -157,14 +54,12 @@
 
 	private long fDelay;
 
-
 	/** local queue of dirty regions (created here) to be reconciled */
 	private List fDirtyRegionQueue = Collections.synchronizedList(new ArrayList());
 
 	/** document that this reconciler works on */
 	private IDocument fDocument = null;
 
-	private IDocumentListener fDocumentListener = new DocumentListener();
 	/**
 	 * set true after first install to prevent duplicate work done in the
 	 * install method (since install gets called multiple times)
@@ -172,21 +67,10 @@
 	private boolean fIsInstalled = false;
 
 	/**
-	 * so we can tell if a partition changed after the last edit
-	 */
-	String[] fLastPartitions;
-
-	List fNonIncrementalStrategiesAlreadyProcessed = new ArrayList(1);
-
-	/**
 	 * The partitioning this reconciler uses.
 	 */
 	private String fPartitioning;
 
-	Map fReconcilingStrategies = null;
-
-	/** for initial reconcile when document is opened */
-	private TextInputListener fTextInputListener = null;
 	/** the text viewer */
 	private ITextViewer fViewer;
 
@@ -194,6 +78,7 @@
 	 * Creates a new StructuredRegionProcessor
 	 */
 	public DirtyRegionProcessor() {
+		
 		// init job stuff
 		super(SSEUIMessages.proc_dirty_regions_0); //$NON-NLS-1$
 		setPriority(Job.LONG);
@@ -201,7 +86,6 @@
 
 		// init reconciler stuff
 		setDelay(UPDATE_DELAY);
-		fReconcilingStrategies = new HashMap();
 	}
 
 	/**
@@ -210,62 +94,56 @@
 	 * 
 	 * @param resource
 	 */
-	private synchronized void addRequest(DirtyRegion newDirtyRegion) {
-		List dirtyRegionQueue = getDirtyRegionQueue();
+	private synchronized void addRequest(DirtyRegion dr) {
+        
+		List drq = getDirtyRegionQueue();
 		// if we already have a request which contains the new request,
 		// discare the new request
-		int size = dirtyRegionQueue.size();
+		int size = drq.size();
 		for (int i = 0; i < size; i++) {
-			if (contains((DirtyRegion) dirtyRegionQueue.get(i), newDirtyRegion))
+			if (contains((DirtyRegion) drq.get(i), dr))
 				return;
 		}
 		// if new request is contains any existing requests,
 		// remove those
-		for (Iterator it = dirtyRegionQueue.iterator(); it.hasNext();) {
-			if (contains(newDirtyRegion, (DirtyRegion) it.next()))
+		for (Iterator it = drq.iterator(); it.hasNext();) {
+			if (contains(dr, (DirtyRegion) it.next()))
 				it.remove();
 		}
-		dirtyRegionQueue.add(newDirtyRegion);
-	}
-
-	/**
-	 * Notifies subclasses that processing of multiple dirty regions has begun
-	 */
-	protected void beginProcessing() {
-		// do nothing by default
+		drq.add(dr);
 	}
 
 	/**
 	 * @param dirtyRegion
 	 * @return
 	 */
-	protected ITypedRegion[] computePartitioning(DirtyRegion dirtyRegion) {
-		int drOffset = dirtyRegion.getOffset();
-		int drLength = dirtyRegion.getLength();
-
-		return computePartitioning(drOffset, drLength);
+	protected ITypedRegion[] computePartitioning(DirtyRegion dirtyRegion) {       
+        int drOffset = dirtyRegion.getOffset();
+        int drLength = dirtyRegion.getLength();
+        
+        return computePartitioning(drOffset, drLength);
 	}
 
 	protected ITypedRegion[] computePartitioning(int drOffset, int drLength) {
 		IDocument doc = getDocument();
 		int docLength = doc.getLength();
-
+		
 		ITypedRegion[] tr = new ITypedRegion[0];
-
-		if (drOffset > docLength) {
-			drOffset = docLength;
-			drLength = 0;
-		}
-		else if (drOffset + drLength > docLength) {
-			drLength = docLength - drOffset;
-		}
-
+		
+		if(drOffset > docLength) {
+            drOffset = docLength;
+            drLength = 0;
+        }
+        else if(drOffset + drLength > docLength) {
+            drLength = docLength - drOffset;
+        }
+            
 		try {
 			// dirty region may span multiple partitions
-			tr = TextUtilities.computePartitioning(doc, getDocumentPartitioning(), drOffset, drLength, true);
+            tr = TextUtilities.computePartitioning(doc, getDocumentPartitioning(), drOffset, drLength, true);
 		}
 		catch (BadLocationException e) {
-			String info = "dr: [" + drOffset + ":" + drLength + "] doc: [" + docLength + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+            String info = "dr: ["+ drOffset+":"+ drLength + "] doc: [" + docLength + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 			Logger.logException(info, e);
 			tr = new ITypedRegion[0];
 		}
@@ -273,11 +151,8 @@
 	}
 
 	/**
-	 * Used to determine of a "possible" dirty region can be discarded in
-	 * favor of using just the "root" dirty region.
-	 * 
-	 * @return if the root dirty region contains possible, return true,
-	 *         otherwise return false
+	 * @return if the root is parent of possible, return true, otherwise
+	 *         return false
 	 */
 	protected boolean contains(DirtyRegion root, DirtyRegion possible) {
 
@@ -297,18 +172,18 @@
 		if (doc != null) {
 			// safety for BLE
 			int docLen = doc.getLength();
-			if (offset > docLen) {
-				offset = docLen;
-				length = 0;
-			}
-			else if (offset + length >= docLen)
+            if(offset > docLen) {
+                offset = docLen;
+                length = 0;
+            }
+            else if (offset + length >= docLen)
 				length = docLen - offset;
 			try {
 				durty = new DirtyRegion(offset, length, type, doc.get(offset, length));
 			}
 			catch (BadLocationException e) {
-				String info = "dr: [" + offset + ":" + length + "] doc: [" + docLen + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-				Logger.logException(info, e);
+                String info = "dr: ["+ offset+":"+ length + "] doc: [" + docLen + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+                Logger.logException(info, e);
 			}
 		}
 		return durty;
@@ -318,28 +193,16 @@
 		return createDirtyRegion(tr.getOffset(), tr.getLength(), type);
 	}
 
-	protected void flushDirtyRegionQueue() {
-		fDirtyRegionQueue.clear();
-	}
-
-	/**
-	 * Notifies subclasses that processing of multiple dirty regions has
-	 * ended, for now
-	 */
-	protected void endProcessing() {
-		// do nothing by default
-	}
-
 	/**
 	 * Delay between processing of DirtyRegions.
 	 * 
 	 * @return
 	 */
-	long getDelay() {
+	protected long getDelay() {
 		return fDelay;
 	}
 
-	List getDirtyRegionQueue() {
+	protected List getDirtyRegionQueue() {
 		return fDirtyRegionQueue;
 	}
 
@@ -352,25 +215,38 @@
 		return fDocument;
 	}
 
+
 	public String getDocumentPartitioning() {
 		if (fPartitioning == null)
 			return IDocumentExtension3.DEFAULT_PARTITIONING;
 		return fPartitioning;
 	}
 
-	protected String[] getPartitions(int drOffset, int drLength) {
+	/**
+	 * Utility method to get partitions of a dirty region
+	 * 
+	 * @param dirtyRegion
+	 * @return
+	 */
+	protected String[] getPartitions(DirtyRegion dirtyRegion) {
+        int drOffset = dirtyRegion.getOffset();
+        int drLength = dirtyRegion.getLength();
+        return getPartitions(drOffset, drLength);
+	}
 
+	protected String[] getPartitions(int drOffset, int drLength) {
+		
 		ITypedRegion[] regions = new ITypedRegion[0];
 		int docLength = getDocument().getLength();
-
-		if (drOffset > docLength) {
-			drOffset = docLength;
-			drLength = 0;
-		}
-		else if (drOffset + drLength > docLength) {
-			drLength = docLength - drOffset;
-		}
-
+        
+        if(drOffset > docLength) {
+            drOffset = docLength;
+            drLength = 0;
+        }
+        else if(drOffset + drLength > docLength) {
+            drLength = docLength - drOffset;
+        }
+            
 		try {
 			regions = TextUtilities.computePartitioning(getDocument(), getDocumentPartitioning(), drOffset, drLength, true);
 		}
@@ -383,24 +259,14 @@
 			partitions[i] = regions[i].getType();
 		return partitions;
 	}
-
+	
 	/**
-	 * Returns the reconciling strategy registered with the reconciler for the
-	 * specified partition type.
-	 * 
-	 * @param partitionType
-	 *            the partition type for which to determine the reconciling
-	 *            strategy
-	 * 
-	 * @return the reconciling strategy registered for the given partition
-	 *         type, or <code>null</code> if there is no such strategy
-	 * 
-	 * @see org.eclipse.jface.text.reconciler.IReconciler#getReconcilingStrategy(java.lang.String)
+	 * contentType is actually partitionType
+	 * @see IReconciler#getReconcilingStrategy(String)
 	 */
-	public IReconcilingStrategy getReconcilingStrategy(String partitionType) {
-		if (partitionType == null)
-			return null;
-		return (IReconcilingStrategy) fReconcilingStrategies.get(partitionType);
+	public IReconcilingStrategy getReconcilingStrategy(String contentType) {
+		// we don't use this, we only have a validator strategy
+		return null;
 	}
 
 	/**
@@ -415,6 +281,22 @@
 	}
 
 	/**
+	 * Gets a strategy that is made to handle the given dirtyRegion.
+	 * 
+	 * @param dirtyRegion
+	 * @return a strategy that is made to handle the given dirtyRegion, or the
+	 *         default strategy for this reconciler if there isn't one
+	 */
+	protected IReconcilingStrategy getStrategy(DirtyRegion dirtyRegion) {
+		String[] partitions = getPartitions(dirtyRegion);
+		// for now just grab first partition type in dirty region
+		IReconcilingStrategy rs = null;
+		if (partitions.length > 0)
+			rs = getReconcilingStrategy(partitions[0]);
+		return rs;
+	}
+
+	/**
 	 * Returns the text viewer this reconciler is installed on.
 	 * 
 	 * @return the text viewer this reconciler is installed on
@@ -424,21 +306,6 @@
 	}
 
 	/**
-	 * 
-	 * @param oldInput
-	 * @param newInput
-	 */
-	void handleInputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		// don't bother if reconciler not installed
-		if (isInstalled()) {
-
-			reconcilerDocumentChanged(newInput);
-			setDocument(newInput);
-			setEntireDocumentDirty(newInput);
-		}
-	}
-
-	/**
 	 * @see org.eclipse.jface.text.reconciler.IReconciler#install(ITextViewer)
 	 */
 	public void install(ITextViewer textViewer) {
@@ -446,8 +313,6 @@
 		// maybe after being uninstalled as well, so track separately
 		if (!isInstalled()) {
 			fViewer = textViewer;
-			fTextInputListener = new TextInputListener();
-			textViewer.addTextInputListener(fTextInputListener);
 			setInstalled(true);
 		}
 	}
@@ -463,25 +328,12 @@
 	}
 
 	/**
-	 * Subclasses should implement for specific handling of dirty regions. The
-	 * method is invoked for each dirty region in the Job's queue.
+	 * Subclasses should implement for specific handling of dirty regions.
 	 * 
-	 * @param dirtyRegion
+	 * @param dr
 	 */
-	protected void process(DirtyRegion dirtyRegion) {
-		/*
-		 * Break the dirty region into a sequence of partitions and find the
-		 * corresponding strategy to reconcile those partitions. If a strategy
-		 * implements INonIncrementalReconcilingStrategy, only call it once
-		 * regardless of the number and types of partitions.
-		 */
-		ITypedRegion[] partitions = computePartitioning(dirtyRegion);
-		for (int i = 0; i < partitions.length; i++) {
-			IReconcilingStrategy strategy = getReconcilingStrategy(partitions[i].getType());
-			if (strategy != null) {
-				strategy.reconcile(partitions[i]);
-			}
-		}
+	protected void process(DirtyRegion dr) {
+		// subclasses should implement
 	}
 
 	/**
@@ -492,7 +344,7 @@
 	public final void processDirtyRegion(DirtyRegion dr) {
 		if (dr == null)
 			return;
-
+        
 		cancel();
 		addRequest(dr);
 		schedule(getDelay());
@@ -504,29 +356,18 @@
 	}
 
 	/**
-	 * Reinitializes listeners and sets new document onall strategies.
+	 * Reinitializes listeners and sets new document on all strategies.
 	 * 
 	 * @see org.eclipse.jface.text.reconciler.AbstractReconciler#reconcilerDocumentChanged(IDocument)
 	 */
-	void reconcilerDocumentChanged(IDocument newDocument) {
-		IDocument currentDoc = getDocument();
-
-		// unhook old document listener
-		if (currentDoc != null)
-			currentDoc.removeDocumentListener(fDocumentListener);
-		// hook up new document listener
-		if (newDocument != null)
-			newDocument.addDocumentListener(fDocumentListener);
-
-		// sets document on all strategies
-		setDocument(newDocument);
+	protected void reconcilerDocumentChanged(IDocument document) {
+		setDocument(document);
+//		setDocumentOnAllStrategies(document);
 	}
 
 	protected IStatus run(IProgressMonitor monitor) {
 		IStatus status = Status.OK_STATUS;
 		try {
-			beginProcessing();
-
 			DirtyRegion[] toRefresh = getRequests();
 			for (int i = 0; i < toRefresh.length; i++) {
 				if (monitor.isCanceled())
@@ -534,25 +375,23 @@
 				process(toRefresh[i]);
 			}
 		}
-		catch (Exception e) {
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=103676
+		catch(Exception e) {
+		    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=103676
 			// stop errors from popping up a dialog
 			// from the job manager
-
+			
 			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=106052
 			// don't log OperationCanceledException
-			if (!(e instanceof OperationCanceledException))
-				Logger.logException("problem with reconciling", e); //$NON-NLS-1$
+			if(!(e instanceof OperationCanceledException))
+				Logger.logException("problem with as-you-type validation", e); //$NON-NLS-1$
 		}
 		finally {
-			endProcessing();
-
 			monitor.done();
 		}
 		return status;
 	}
 
-	public void setDelay(long delay) {
+	protected void setDelay(long delay) {
 		fDelay = delay;
 	}
 
@@ -571,54 +410,19 @@
 	}
 
 	/**
-	 * Basically means process the entire document.
-	 * 
-	 * @param document
-	 */
-	protected void setEntireDocumentDirty(IDocument document) {
-
-		// make the entire document dirty
-		// this also happens on a "save as"
-		if (document != null && isInstalled()) {
-
-			// since we're marking the entire doc dirty
-			getDirtyRegionQueue().clear();
-			DirtyRegion entireDocument = createDirtyRegion(0, document.getLength(), DirtyRegion.INSERT);
-			processDirtyRegion(entireDocument);
-		}
-	}
-
-	/**
 	 * @param isInstalled
 	 *            The isInstalled to set.
 	 */
-	void setInstalled(boolean isInstalled) {
+	public void setInstalled(boolean isInstalled) {
 		fIsInstalled = isInstalled;
 	}
 
-	public void setReconcilingStrategy(String partitionType, IReconcilingStrategy strategy) {
-		if (partitionType == null) {
-			throw new IllegalArgumentException();
-		}
-
-		if (strategy == null) {
-			fReconcilingStrategies.remove(partitionType);
-		}
-		else {
-			fReconcilingStrategies.put(partitionType, strategy);
-		}
-	}
-
 	/**
 	 * @see org.eclipse.jface.text.reconciler.IReconciler#uninstall()
 	 */
 	public void uninstall() {
 		if (isInstalled()) {
-			// removes widget listener
-			getTextViewer().removeTextInputListener(fTextInputListener);
 			setInstalled(false);
-			// removes document listeners
-			reconcilerDocumentChanged(null);
 		}
 		setDocument(null);
 	}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java
index 6eaaf3b..9e80850 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java
@@ -2,11 +2,18 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
 
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.text.DocumentEvent;
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.ITextInputListener;
+import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.reconciler.DirtyRegion;
 import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
@@ -15,19 +22,39 @@
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorBuilder;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorMetaData;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy;
-import org.eclipse.wst.sse.ui.internal.spelling.SpellcheckStrategy;
 
 /**
- * Adds to DirtyRegionProcessor Job: - IDocumentListener - ValidatorStrategy -
- * Text viewer(dispose, input changed) listeners. - default, spelling, and
- * validator strategies - DirtyRegion processing logic.
+ * Adds to DirtyRegionProcessor Job:
+ * 
+ * - IDocumentListener
+ * - ValidatorStrategy
+ * - Text viewer(dispose, input changed) listeners.
+ * - default and validator strategies
+ * - DirtyRegion processing logic.
  */
-public class DocumentRegionProcessor extends DirtyRegionProcessor {
+public class DocumentRegionProcessor extends DirtyRegionProcessor implements IDocumentListener{
 
 	/**
-	 * A strategy to use the defined default Spelling service.
+	 * Reconclies the entire document when the document in the viewer is
+	 * changed. This happens when the document is initially opened, as well as
+	 * after a save-as.
+	 * 
+	 * Also see processPostModelEvent(...) for similar behavior when document
+	 * for the model is changed.
 	 */
-	private SpellcheckStrategy fSpellcheckStrategy;
+	private class SourceTextInputListener implements ITextInputListener {
+
+		public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
+			// do nothing
+		}
+
+		public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
+			handleInputDocumentChanged(oldInput, newInput);
+		}
+	}
+
+	/** for initital reconcile when document is opened */
+	private SourceTextInputListener fTextInputListener = null;
 
 	/**
 	 * The strategy that runs validators contributed via
@@ -35,86 +62,188 @@
 	 * extension point
 	 */
 	private ValidatorStrategy fValidatorStrategy;
-
-	private final String SSE_UI_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
-	protected void beginProcessing() {
-		super.beginProcessing();
-		ValidatorStrategy validatorStrategy = getValidatorStrategy();
-		if (validatorStrategy != null) {
-			validatorStrategy.beginProcessing();
-		}
-	}
-
-	protected void endProcessing() {
-		super.endProcessing();
-		ValidatorStrategy validatorStrategy = getValidatorStrategy();
-		if (validatorStrategy != null) {
-			validatorStrategy.endProcessing();
-		}
-	}
-
-	protected String getContentType(IDocument doc) {
-		if (doc == null)
-			return null;
-
-		String contentTypeId = null;
-
-		// pa_TODO it would be nice to be able to get filename from
-		// IDocument...
-		// because it seems that getting content type from input stream
-		// isn't all that accurate (eg. w/ a javascript file)
-
-		// IContentType ct =
-		// Platform.getContentTypeManager().findContentTypeFor("test.js");
-		IContentType ct = null;
-		try {
-			IContentDescription desc = Platform.getContentTypeManager().getDescriptionFor(new ByteArrayInputStream(doc.get().getBytes()), null, IContentDescription.ALL);
-			if (desc != null) {
-				ct = desc.getContentType();
-				if (ct != null)
-					contentTypeId = ct.getId();
-			}
-		}
-		catch (IOException e) {
-			// just bail
-		}
-		return contentTypeId;
-	}
-
-	protected final StructuredTextReconcilingStrategy getSpellcheckStrategy() {
-		if (fSpellcheckStrategy == null) {
-			String contentTypeId = getContentType(getDocument());
-			if (contentTypeId != null) {
-				if (getTextViewer() instanceof ISourceViewer) {
-					ISourceViewer viewer = (ISourceViewer) getTextViewer();
-					fSpellcheckStrategy = new SpellcheckStrategy(viewer, contentTypeId);
-					fSpellcheckStrategy.setDocument(getDocument());
-					fSpellcheckStrategy.setDocumentPartitioning(getDocumentPartitioning());
-				}
-			}
-		}
-		return fSpellcheckStrategy;
-	}
+	
+	private final String SSE_EDITOR_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
 
 	/**
-	 * @return Returns the ValidatorStrategy.
+	 * so we can tell if a partition changed after the last edit
 	 */
-	protected ValidatorStrategy getValidatorStrategy() {
+	private String[] fLastPartitions;
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#install(org.eclipse.jface.text.ITextViewer)
+	 */
+	public void install(ITextViewer textViewer) {
+
+		super.install(textViewer);
+		fTextInputListener = new SourceTextInputListener();
+		textViewer.addTextInputListener(fTextInputListener);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#uninstall()
+	 */
+	public void uninstall() {
+		if (isInstalled()) {
+
+			cancel();
+
+			// removes document listeners
+			reconcilerDocumentChanged(null);
+
+			// removes widget listener
+			getTextViewer().removeTextInputListener(fTextInputListener);
+
+			IReconcilingStrategy validatorStrategy = getValidatorStrategy();
+			
+			if(validatorStrategy != null) {
+				if(validatorStrategy instanceof IReleasable)
+					((IReleasable)validatorStrategy).release();
+			}
+		}
+		super.uninstall();
+	}
+	
+	/**
+	 * 
+	 * @param oldInput
+	 * @param newInput
+	 */
+	public void handleInputDocumentChanged(IDocument oldInput, IDocument newInput) {
+		// don't bother if reconciler not installed
+		if (isInstalled()) {
+
+			reconcilerDocumentChanged(newInput);
+			setDocument(newInput);
+			setEntireDocumentDirty(newInput);
+		}
+	}
+	
+	public void setDocument(IDocument doc) {
+		super.setDocument(doc);
+		IReconcilingStrategy validatorStrategy = getValidatorStrategy();
+		if(validatorStrategy != null) {
+			validatorStrategy.setDocument(doc);
+		}
+	}
+	
+	/**
+	 * Reinitializes listeners and sets new document onall strategies.
+	 * 
+	 * @see org.eclipse.jface.text.reconciler.AbstractReconciler#reconcilerDocumentChanged(IDocument)
+	 */
+	protected void reconcilerDocumentChanged(IDocument newDocument) {
+
+		IDocument currentDoc = getDocument();
+
+		// unhook old document listener
+		if (currentDoc != null)
+			currentDoc.removeDocumentListener(this);
+		// hook up new document listener
+		if (newDocument != null)
+			newDocument.addDocumentListener(this);
+
+		// sets document on all strategies
+		super.reconcilerDocumentChanged(newDocument);
+	}
+	
+	/**
+	 * @param dirtyRegion
+	 */
+	protected void process(DirtyRegion dirtyRegion) {
+		if (!isInstalled())
+			return;
+
+		ITypedRegion[] unfiltered = computePartitioning(dirtyRegion);
+
+		// remove duplicate typed regions
+		// that are handled by the same "total scope" strategy
+		ITypedRegion[] filtered = filterTotalScopeRegions(unfiltered);
+
+		DirtyRegion dirty = null;
+		for (int i = 0; i < filtered.length; i++) {
+
+			dirty = createDirtyRegion(filtered[i], DirtyRegion.INSERT);
+
+			// validator (extension) for this partition
+			if (getValidatorStrategy() != null)
+				getValidatorStrategy().reconcile(filtered[i], dirty);
+		}
+	}
+	/**
+	 * Removes multiple "total-scope" regions (and leaves one) for a each
+	 * partitionType. This improves performance by preventing unnecessary full
+	 * document validations.
+	 * 
+	 * @param unfiltered
+	 * @return
+	 */
+	protected ITypedRegion[] filterTotalScopeRegions(ITypedRegion[] unfiltered) {
+		IReconcilingStrategy s = null;
+		// ensure there is only one typed region in the list
+		// for regions handled by "total scope" strategies
+		HashMap totalScopeRegions = new HashMap();
+		HashMap partialScopeRegions = new HashMap();
+		List allRegions = new ArrayList();
+		for (int i = 0; i < unfiltered.length; i++) {
+
+			String partitionType = unfiltered[i].getType();
+
+			// short circuit loop
+			if (totalScopeRegions.containsKey(partitionType) || partialScopeRegions.containsKey(partitionType))
+				continue;
+
+			s = getReconcilingStrategy(partitionType);
+
+			// might be the validator strategy
+			if (s == null) {
+				ValidatorStrategy validatorStrategy = getValidatorStrategy();
+				if (validatorStrategy != null) {
+					if (validatorStrategy.canValidatePartition(partitionType))
+						s = validatorStrategy;
+				}
+			}
+
+			if (s instanceof AbstractStructuredTextReconcilingStrategy) {
+				// only allow one dirty region for a strategy
+				// that has "total scope"
+				if (((AbstractStructuredTextReconcilingStrategy) s).isTotalScope())
+					totalScopeRegions.put(partitionType, unfiltered[i]);
+				else
+					partialScopeRegions.put(partitionType, unfiltered[i]);
+			}
+			else
+				partialScopeRegions.put(partitionType, unfiltered[i]);
+		}
+		allRegions.addAll(totalScopeRegions.values());
+		allRegions.addAll(partialScopeRegions.values());
+		ITypedRegion[] filtered = (ITypedRegion[]) allRegions.toArray(new ITypedRegion[allRegions.size()]);
+
+		if (DEBUG)
+			System.out.println("filtered out this many 'total-scope' regions: " + (unfiltered.length - filtered.length)); //$NON-NLS-1$
+
+		return filtered;
+	}
+	
+	/**
+	 * @return Returns the fValidatorStrategy.
+	 */
+	public ValidatorStrategy getValidatorStrategy() {
 		if (fValidatorStrategy == null) {
 			ValidatorStrategy validatorStrategy = null;
-
+			
 			if (getTextViewer() instanceof ISourceViewer) {
-				ISourceViewer viewer = (ISourceViewer) getTextViewer();
+				ISourceViewer viewer = (ISourceViewer)getTextViewer();
 				String contentTypeId = null;
-
+				
 				IDocument doc = viewer.getDocument();
 				contentTypeId = getContentType(doc);
-
+			
 				if (contentTypeId != null) {
+					
 					validatorStrategy = new ValidatorStrategy(viewer, contentTypeId);
 					ValidatorBuilder vBuilder = new ValidatorBuilder();
-					ValidatorMetaData[] vmds = vBuilder.getValidatorMetaData(SSE_UI_ID);
+					ValidatorMetaData[] vmds = vBuilder.getValidatorMetaData(SSE_EDITOR_ID);
 					for (int i = 0; i < vmds.length; i++) {
 						if (vmds[i].canHandleContentType(contentTypeId))
 							validatorStrategy.addValidatorMetaData(vmds[i]);
@@ -126,54 +255,110 @@
 		return fValidatorStrategy;
 	}
 
-	/**
-	 * @param dirtyRegion
-	 */
-	protected void process(DirtyRegion dirtyRegion) {
-		if (!isInstalled())
-			return;
-
-		super.process(dirtyRegion);
-
-		// Also call the validation and spell-check strategies
-		ITypedRegion[] partitions = computePartitioning(dirtyRegion);
-
-		DirtyRegion dirty = null;
-		for (int i = 0; i < partitions.length; i++) {
-			dirty = createDirtyRegion(partitions[i], DirtyRegion.INSERT);
-			// [source]validator (extension) for this partition
-			if (getValidatorStrategy() != null)
-				getValidatorStrategy().reconcile(partitions[i], dirty);
-		}
-		// single spell-check for everything
-		if (getSpellcheckStrategy() != null)
-			getSpellcheckStrategy().reconcile(dirtyRegion, dirtyRegion);
-	}
-
-	public void setDocument(IDocument doc) {
-		super.setDocument(doc);
-		IReconcilingStrategy validatorStrategy = getValidatorStrategy();
-		if (validatorStrategy != null) {
-			validatorStrategy.setDocument(doc);
-		}
-	}
-
-	/**
-	 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#uninstall()
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-
-			cancel();
-
-
-			IReconcilingStrategy validatorStrategy = getValidatorStrategy();
-
-			if (validatorStrategy != null) {
-				if (validatorStrategy instanceof IReleasable)
-					((IReleasable) validatorStrategy).release();
+	protected String getContentType(IDocument doc) {
+		
+		if(doc == null)
+			return null;
+		
+		String contentTypeId = null;
+		
+		// pa_TODO it would be nice to be able to get filename from IDocument...
+		// because it seems that getting content type from input stream
+		// isn't all that accurate (eg. w/ a javascript file)
+		
+		//IContentType ct = Platform.getContentTypeManager().findContentTypeFor("test.js");
+		IContentType ct = null;
+		try {
+			IContentDescription desc = Platform.getContentTypeManager().getDescriptionFor(new ByteArrayInputStream(doc.get().getBytes()), null, IContentDescription.ALL);
+			if(desc != null) {
+				ct  = desc.getContentType();
+				if(ct != null) 
+					contentTypeId = ct.getId();
 			}
 		}
-		super.uninstall();
+		catch (IOException e) {
+			// just bail
+		}
+		return contentTypeId;
+	}
+
+	public void documentAboutToBeChanged(DocumentEvent event) {
+		// save partition type (to see if it changes in documentChanged())
+		fLastPartitions = getPartitions(event.getOffset(), event.getLength());			
+	}
+
+	public void documentChanged(DocumentEvent event) {
+		if(partitionsChanged(event)) {
+			// pa_TODO
+			// this is a simple way to ensure old
+			// annotations are removed when partition changes
+			
+			// it might be a performance hit though
+			setEntireDocumentDirty(getDocument());
+		}
+		else {
+			DirtyRegion dr = null;
+			if(event.getLength() == 0) {
+				// it's an insert
+				// we use text length though
+				// so that the new region gets validated...
+				dr = createDirtyRegion(event.getOffset(), 0, DirtyRegion.INSERT);
+			}
+			else {
+				if("".equals(event.getText())) { //$NON-NLS-1$
+					// it's a delete
+					dr =createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.REMOVE);
+				}
+				else {
+					// it's a replace
+					dr = createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.INSERT);	
+				}
+			}
+			processDirtyRegion(dr);
+		}
+	}
+	
+	/**
+	 * Checks previous partitions from the span of the event
+	 * w/ the new partitions from the span of the event.
+	 * If partitions changed, return true, else return false
+	 * 
+	 * @param event
+	 * @return
+	 */
+	private boolean partitionsChanged(DocumentEvent event) {
+		boolean changed = false;
+		String[] newPartitions = getPartitions(event.getOffset(), event.getLength());
+		if(fLastPartitions != null) {
+			if(fLastPartitions.length != newPartitions.length) {
+				changed = true;
+			}
+			else {
+				for(int i=0; i<fLastPartitions.length; i++) {
+					if(!fLastPartitions[i].equals(newPartitions[i])) {
+						changed = true;
+						break;
+					}
+				}	
+			}
+		}
+		return changed;
+	}
+	
+	/**
+	 * Basically means process the entire document.
+	 * @param document
+	 */
+	protected void setEntireDocumentDirty(IDocument document) {
+
+		// make the entire document dirty
+		// this also happens on a "save as"
+		if (document != null && isInstalled()) {
+
+			// since we're marking the entire doc dirty
+			getDirtyRegionQueue().clear();
+			DirtyRegion entireDocument = createDirtyRegion(0, document.getLength(), DirtyRegion.INSERT);
+			processDirtyRegion(entireDocument);
+		}
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IConfigurableReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IConfigurableReconciler.java
deleted file mode 100644
index 6f8b28f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IConfigurableReconciler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-
-/**
- * A reconciler that allows IReconcilingStrategies to be assigned to partition
- * types. The reconciler will call the registered IReconcilingStrategy when
- * dirty regions which contain partitions of a specific type need to be
- * reconciled.
- * 
- * @since 1.1
- */
-public interface IConfigurableReconciler {
-	/**
-	 * Sets the reconciling strategy for the reconciler to use for the
-	 * specified content type.
-	 * 
-	 * @param partitionType
-	 *            the partition type
-	 * @param strategy
-	 *            the reconciling strategy
-	 */
-	void setReconcilingStrategy(String partitionType, IReconcilingStrategy strategy);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
index e6a8875..430313c 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
@@ -29,8 +29,8 @@
 import org.eclipse.jface.text.reconciler.IReconcileResult;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.Logger;
 
@@ -73,7 +73,7 @@
 	public ReconcileAnnotationKey createKey(IStructuredDocumentRegion sdRegion, int scope) {
 
 		ITypedRegion tr = getPartition(sdRegion);
-		String partitionType = (tr != null) ? tr.getType() : IStructuredPartitions.UNKNOWN_PARTITION;
+		String partitionType = (tr != null) ? tr.getType() : IStructuredPartitionTypes.UNKNOWN_PARTITION;
 		return createKey(partitionType, scope);
 	}
 
@@ -132,7 +132,7 @@
 
 	public String getPartitionType(IDocument doc, int offset) {
 		ITypedRegion tr = getPartition(doc, offset);
-		return (tr != null) ? tr.getType() : IStructuredPartitions.UNKNOWN_PARTITION;
+		return (tr != null) ? tr.getType() : IStructuredPartitionTypes.UNKNOWN_PARTITION;
 	}
 
 	public String[] getPartitionTypes() {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
index b93bf19..92420c2 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2004 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
@@ -13,105 +13,138 @@
 package org.eclipse.wst.sse.ui.internal.reconcile;
 
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Position;
 import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
 import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 
 /**
- * An IStructuredModel aware Region Processor. Adds ModelLifecycle listener.
- * ModelLifecycle listener notifies us that some reinitialization needs to
- * take place.
+ * An IStructuredModel aware Region Processor.
+ * Adds ModelLifecycle listener.  ModelLifecycle listener notifies
+ * us that some reinitialization needs to take place.
  * 
- * Model aware "process()" Implements a IndexedRegion-based "contains()"
- * method using IStructuredModel.
+ * Model aware "process()"
+ * Implements a DOM based "contains()" method using IStructuredModel.
  * 
  */
-public class StructuredRegionProcessor extends DocumentRegionProcessor {
+public class StructuredRegionProcessor extends DocumentRegionProcessor implements IModelLifecycleListener {
 
-	class ModelLifecycleListener implements IModelLifecycleListener {
-		/**
-		 * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPostModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
-		 */
-		public void processPostModelEvent(ModelLifecycleEvent event) {
-
-			// if underlying StructuredDocument changed, need to reconnect it
-			// here...
-			// ex. file is modified outside the workbench
-			if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
-
-				// check that it's this model that changed
-				IStructuredModel thisModel = getStructuredModelForRead(getDocument());
-				try {
-					if (thisModel != null && event.getModel().equals(thisModel)) {
-
-						IStructuredDocument sDoc = event.getModel().getStructuredDocument();
-
-						if (DEBUG) {
-							System.out.println("======================================================"); //$NON-NLS-1$
-							System.out.println("StructuredRegionProcessor: DOCUMENT MODEL CHANGED TO: "); //$NON-NLS-1$
-							System.out.println(sDoc.get());
-							System.out.println("======================================================"); //$NON-NLS-1$
-						}
-						setDocument(sDoc);
-						// propagate document change
-						// setDocumentOnAllStrategies(sDoc);
-						// ensure that the document is re-reconciled
-						setEntireDocumentDirty(sDoc);
+	protected void process(DirtyRegion dirtyRegion) {
+		
+		if(getDocument() == null)
+			return;
+		
+		// use structured model to determine area to process
+		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
+		try {
+			if(sModel != null) {
+				
+				int start = dirtyRegion.getOffset();
+				IndexedRegion ir = sModel.getIndexedRegion(start);
+				
+				if(ir != null) {
+					
+					int end = ir.getEndOffset();
+					
+					ITypedRegion[] unfiltered = computePartitioning(start, end);
+					// remove duplicate typed regions (partitions)
+					// that are handled by the same "total scope" strategy
+					ITypedRegion[] filtered = filterTotalScopeRegions(unfiltered);
+					
+					// iterate dirty partitions
+					for (int i = 0; i < filtered.length; i++) {
+						process(filtered[i]);
 					}
 				}
-				finally {
-					if (thisModel != null)
-						thisModel.releaseFromRead();
-				}
 			}
 		}
-
-		/**
-		 * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPreModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
-		 */
-		public void processPreModelEvent(ModelLifecycleEvent event) {
-
-			if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
-
-				flushDirtyRegionQueue();
-				// note: old annotations are removed via the strategies on
-				// AbstractStructuredTextReconcilingStrategy#setDocument(...)
-			}
+		finally {
+			if(sModel != null) 
+				sModel.releaseFromRead();
 		}
 	}
+	
+	private void process(ITypedRegion partition) {
+		
+		IStructuredDocumentRegion[] sdRegions = ((IStructuredDocument)getDocument()).getStructuredDocumentRegions(partition.getOffset(), partition.getLength());
+		Position coverage = getNodeCoverage(sdRegions);
+		DirtyRegion nodeDirtyRegion = createDirtyRegion(coverage.offset, coverage.length, DirtyRegion.INSERT);
+		// we only run extension point strategy now
+		if (getValidatorStrategy() != null)
+			getValidatorStrategy().reconcile(partition, nodeDirtyRegion);
+	}
 
-	private IModelLifecycleListener fLifeCycleListener = new ModelLifecycleListener();
+	/**
+	 * Expands coverage based on DOM.
+	 * 
+	 * @return node coverage as a position
+	 */
+	protected Position getNodeCoverage(IStructuredDocumentRegion[] sdRegions) {
+		int start = -1;
+		int end = -1;
+		for (int i = 0; i < sdRegions.length; i++) {
+		    if(!sdRegions[i].isDeleted()) {
+    			IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
+                if(corresponding != null) {
+        			if (start == -1 || start > corresponding.getStartOffset())
+        				start = corresponding.getStartOffset();
+        			if (end == -1 || end < corresponding.getEndOffset())
+        				end = corresponding.getEndOffset();
+                }
+            }
+		}
+		return new Position(start, end-start);
+	}
 
 	/**
+	 * Returns the corresponding node for the StructuredDocumentRegion.
+	 * 
+	 * @param sdRegion
+	 * @return the corresponding node for sdRegion
+	 */
+	protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
+		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
+        IndexedRegion indexedRegion = null;
+        try {
+            if (sModel != null) 
+                indexedRegion = sModel.getIndexedRegion(sdRegion.getStart());    
+        } finally {
+            if (sModel != null)
+                sModel.releaseFromRead();
+        }
+        return indexedRegion;
+    }
+	
+	/**
 	 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#contains(org.eclipse.jface.text.reconciler.DirtyRegion,
 	 *      org.eclipse.jface.text.reconciler.DirtyRegion)
 	 */
 	protected boolean contains(DirtyRegion root, DirtyRegion possible) {
+
 		// this method is a performance hit
 		// look for alternatives
 
 		boolean contains = false;
 		IStructuredModel sModel = getStructuredModelForRead(getDocument());
 		try {
-			if (sModel != null) {
+			if(sModel != null) {
 				IndexedRegion rootRegion = sModel.getIndexedRegion(root.getOffset());
-				IndexedRegion rootRegion2 = sModel.getIndexedRegion(root.getOffset() + root.getLength());
 				IndexedRegion possRegion = sModel.getIndexedRegion(possible.getOffset());
-				IndexedRegion possRegion2 = sModel.getIndexedRegion(possible.getOffset() + possible.getLength());
 				if (rootRegion != null && possRegion != null) {
 					int rootStart = rootRegion.getStartOffset();
-					int rootEnd = rootRegion2 != null ? rootRegion2.getEndOffset() : getDocument().getLength();
+					int rootEnd = rootRegion.getEndOffset();
 					int possStart = possRegion.getStartOffset();
-					int possEnd = possRegion2 != null ? possRegion2.getEndOffset() : getDocument().getLength();
-
-					if (rootStart <= possStart && rootEnd >= possEnd) {
+					int possEnd = possRegion.getEndOffset();
+	
+					if (rootStart <= possStart && rootEnd >= possEnd)
 						contains = true;
-					}
-
+	
 					if (DEBUG)
 						System.out.println("checking if [" + rootStart + ":" + rootEnd + "] contains [" + possStart + ":" + possEnd + "] ... " + contains); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
 				}
@@ -125,39 +158,19 @@
 	}
 
 	/**
-	 * We already know content type from when we created the model, so just
-	 * use that.
-	 */
-	protected String getContentType(IDocument doc) {
-
-		String contentTypeId = null;
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
-			if (sModel != null) {
-				contentTypeId = sModel.getContentTypeIdentifier();
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-		return contentTypeId;
-	}
-
-
-	/**
 	 * Remember to release model after use!!
 	 * 
 	 * @return
 	 */
-	private IStructuredModel getStructuredModelForRead(IDocument doc) {
+	public IStructuredModel getStructuredModelForRead(IDocument doc) {
+
 		IStructuredModel sModel = null;
 		if (doc != null)
 			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
 		return sModel;
 	}
 
+
 	/**
 	 * @param document
 	 */
@@ -165,7 +178,7 @@
 		IStructuredModel sModel = getStructuredModelForRead(document);
 		try {
 			if (sModel != null) {
-				sModel.addModelLifecycleListener(fLifeCycleListener);
+				sModel.addModelLifecycleListener(this);
 			}
 		}
 		finally {
@@ -174,31 +187,53 @@
 		}
 	}
 
-	protected void process(DirtyRegion dirtyRegion) {
-		if (getDocument() == null)
-			return;
+	/**
+	 * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPostModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
+	 */
+	public void processPostModelEvent(ModelLifecycleEvent event) {
 
-		// use structured model to determine area to process
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-		try {
-			if (sModel != null) {
-				int start = dirtyRegion.getOffset();
-				int end = start + dirtyRegion.getLength();
-				IndexedRegion irStart = sModel.getIndexedRegion(start);
-				IndexedRegion irEnd = sModel.getIndexedRegion(end);
+		// if underlying StructuredDocument changed, need to reconnect it
+		// here...
+		// ex. file is modified outside the workbench
+		if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
 
-				if (irStart != null) {
-					start = Math.min(start, irStart.getStartOffset());
+			// check that it's this model that changed
+			IStructuredModel thisModel = getStructuredModelForRead(getDocument());
+			try {
+				if (thisModel != null && event.getModel().equals(thisModel)) {
+
+					IStructuredDocument sDoc = event.getModel().getStructuredDocument();
+
+					if (DEBUG) {
+						System.out.println("======================================================"); //$NON-NLS-1$
+						System.out.println("StructuredRegionProcessor: DOCUMENT MODEL CHANGED TO: "); //$NON-NLS-1$
+						System.out.println(sDoc.get());
+						System.out.println("======================================================"); //$NON-NLS-1$
+					}
+					setDocument(sDoc);
+					// propagate document change
+					// setDocumentOnAllStrategies(sDoc);
+					// ensure that the document is re-reconciled
+					setEntireDocumentDirty(sDoc);
 				}
-				if (irEnd != null) {
-					end = Math.max(end, irEnd.getEndOffset());
-				}
-				super.process(createDirtyRegion(start, end - start, DirtyRegion.INSERT));
+			}
+			finally {
+				if (thisModel != null)
+					thisModel.releaseFromRead();
 			}
 		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPreModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
+	 */
+	public void processPreModelEvent(ModelLifecycleEvent event) {
+
+		if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
+
+			getDirtyRegionQueue().clear();
+			// note: old annotations are removed via the strategies on
+			// AbstractStructuredTextReconcilingStrategy#setDocument(...)
 		}
 	}
 
@@ -217,6 +252,8 @@
 		if (newDocument != null)
 			hookUpModelLifecycleListener(newDocument);
 
+		// hooks up new document listener
+		// sets document on all strategies
 		super.reconcilerDocumentChanged(newDocument);
 	}
 
@@ -227,7 +264,7 @@
 		IStructuredModel sModel = getStructuredModelForRead(document);
 		try {
 			if (sModel != null)
-				sModel.removeModelLifecycleListener(fLifeCycleListener);
+				sModel.removeModelLifecycleListener(this);
 
 		}
 		finally {
@@ -237,9 +274,28 @@
 	}
 
 	public void uninstall() {
-
+		
 		// removes model listeners
 		unhookModelLifecycleListener(getDocument());
 		super.uninstall();
 	}
+	
+	/**
+	 * We already know content type from when we created the model, so just use that.
+	 */
+	protected String getContentType(IDocument doc) {
+
+		String contentTypeId = null;
+		IStructuredModel sModel = null;
+		try {
+			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+			if (sModel != null) {
+				contentTypeId = sModel.getContentTypeIdentifier();
+			}
+		} finally {
+			if (sModel != null)
+				sModel.releaseFromRead();
+		}
+		return contentTypeId;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java
index e573fb2..ca4b90b 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java
@@ -9,9 +9,9 @@
 import org.eclipse.jface.text.reconciler.DirtyRegion;
 import org.eclipse.jface.text.source.IAnnotationModel;
 import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.ui.internal.StructuredMarkerAnnotation;
@@ -68,7 +68,7 @@
 				
 				// then if this strategy knows how to add/remove this
 				// partition type
-				if (canHandlePartition(key.getPartitionType()) && containsStep(key.getStep())) {
+				if (canHandlePartition(key.getPartitionType()) /*&& containsStep(key.getStep())*/) {
 					if (key.getScope() == ReconcileAnnotationKey.PARTIAL && overlaps(annotation.getPosition(), sdRegions)) {
 						remove.add(annotation);
 					}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
index 15c16a8..afee08d 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
@@ -27,8 +27,9 @@
 import org.eclipse.jface.text.reconciler.DirtyRegion;
 import org.eclipse.jface.text.reconciler.IReconcilableModel;
 import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.jface.text.reconciler.IReconcileStep;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.Logger;
 import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
 import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
@@ -70,6 +71,12 @@
 		fScope = scope;
 	}
 
+	public ReconcileStepForValidator(IValidator v, IReconcileStep step, int scope) {
+//		super(step);
+		fValidator = v;
+		fScope = scope;
+	}
+
 	/**
 	 * Converts a map of IValidatorForReconcile to List to annotations based
 	 * on those messages
@@ -266,7 +273,7 @@
 
 		IFile file = getFile();
 
-		if (file != null && file.exists()) {
+		if (file != null) {
 			try {
 				IProject project = file.getProject();
 				IncrementalHelper helper = getHelper(project);
@@ -316,25 +323,30 @@
  		IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
  
  		IFile file = getFile();
- 		
- 		if(file != null && file.exists()) {
-			try {
-				IProject project = file.getProject();
-				IncrementalHelper helper = getHelper(project);
+		try {
+			IProject project = null;
+			if (file != null)
+				project = file.getProject();
+ 
+			IncrementalHelper helper = getHelper(project);
+
+			if (file != null)
 				helper.setURI(file.getFullPath().toString());
-				
-				if(fValidator instanceof ISourceValidator) {
-					IncrementalReporter reporter = getReporter();
-					((ISourceValidator)fValidator).validate(dirtyRegion, helper, reporter);
-					//results = createAnnotations(reporter.getMessages());
-					results = createAnnotations(reporter.getAnnotationInfo());
-					reporter.removeAllMessages(fValidator);
-				}
-	
-			} catch (Exception e) {
-				Logger.logException(e);
-	 		}
+ 
+			if(fValidator instanceof ISourceValidator) {
+				IncrementalReporter reporter = getReporter();
+				((ISourceValidator)fValidator).validate(dirtyRegion, helper, reporter);
+				//results = createAnnotations(reporter.getMessages());
+				results = createAnnotations(reporter.getAnnotationInfo());
+				reporter.removeAllMessages(fValidator);
+			}
+
+		} catch (Exception e) {
+			Logger.logException(e);
  		}
  		return results;
  	}
+	
+	
+	
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
index b5bc89b..370be75 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
@@ -106,7 +106,7 @@
         return false;
 	}
 
-	public boolean canHandlePartitionType(String contentTypeIds[], String paritionType) {
+	public boolean canHandleParitionType(String contentTypeIds[], String paritionType) {
         for(int i=0; i<contentTypeIds.length; i++) {
     		if (fMatrix.containsKey(contentTypeIds[i])) {
     			List partitions = (List) fMatrix.get(contentTypeIds[i]);
@@ -200,10 +200,7 @@
 		e.printStackTrace();
 		result[0] = null;
 	}
-	/**
-	 * ReconcileAnnotationKey.TOTAL or  ReconcileAnnotationKey.PARTIAL
-	 * @return
-	 */
+
     public int getValidatorScope() {
         return fScope.equalsIgnoreCase("total") ? ReconcileAnnotationKey.TOTAL : ReconcileAnnotationKey.PARTIAL; //$NON-NLS-1$
     }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
index fb6f816..e36b5f3 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
@@ -31,7 +31,7 @@
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
+import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
 import org.eclipse.wst.sse.ui.internal.reconcile.StructuredTextReconcilingStrategy;
 import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
 import org.eclipse.wst.validation.internal.provisional.core.IValidator;
@@ -39,23 +39,16 @@
 
 /**
  * Special validator strategy. Runs validator steps contributed via the
- * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code> extension
- * point
+ * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code> extension point
  * 
  * @author pavery
  */
 public class ValidatorStrategy extends StructuredTextReconcilingStrategy {
-
-	private String[] fContentTypeIds = null;
-	private List fMetaData = null;
-	/** validator id (as declared in ext point) -> ReconcileStepForValidator * */
+	
+    private String[] fContentTypeIds = null;
+    /** validator id (as declared in ext point) -> ReconcileStepForValidator **/
 	private HashMap fVidToVStepMap = null;
-
-	/*
-	 * List of ValidatorMetaDatas of total scope validators that have been run
-	 * since beginProcessing() was called.
-	 */
-	private List fTotalScopeValidatorsAlreadyRun;
+	private List fMetaData = null;
 
 	public ValidatorStrategy(ISourceViewer sourceViewer, String contentType) {
 		super(sourceViewer);
@@ -64,54 +57,64 @@
 		fVidToVStepMap = new HashMap();
 	}
 
-	public void addValidatorMetaData(ValidatorMetaData vmd) {
+	/**
+     * The content type passed in should be the most specific one.   
+     * TODO: This exact method is also in ValidatorMetaData. Should be in a common place.
+     * 
+     * @param contentType
+     * @return
+     */
+    private String[] calculateParentContentTypeIds(String contentTypeId) {
+
+        Set parentTypes = new HashSet();
+        
+        IContentTypeManager ctManager = Platform.getContentTypeManager();    
+        IContentType ct = ctManager.getContentType(contentTypeId);
+        String id = contentTypeId;
+
+        while(ct != null && id != null) {
+            
+            parentTypes.add(id);
+            ct = ctManager.getContentType(id);
+            if(ct != null) {
+                IContentType baseType = ct.getBaseType();
+                id = (baseType != null) ? baseType.getId() : null;
+            }
+        }
+        return (String[])parentTypes.toArray(new String[parentTypes.size()]);
+    }
+
+    public void addValidatorMetaData(ValidatorMetaData vmd) {
 		fMetaData.add(vmd);
 	}
 
-	public void beginProcessing() {
-		if (fTotalScopeValidatorsAlreadyRun == null)
-			fTotalScopeValidatorsAlreadyRun = new ArrayList();
-	}
-
-	/**
-	 * The content type passed in should be the most specific one. TODO: This
-	 * exact method is also in ValidatorMetaData. Should be in a common place.
-	 * 
-	 * @param contentType
-	 * @return
-	 */
-	private String[] calculateParentContentTypeIds(String contentTypeId) {
-
-		Set parentTypes = new HashSet();
-
-		IContentTypeManager ctManager = Platform.getContentTypeManager();
-		IContentType ct = ctManager.getContentType(contentTypeId);
-		String id = contentTypeId;
-
-		while (ct != null && id != null) {
-
-			parentTypes.add(id);
-			ct = ctManager.getContentType(id);
-			if (ct != null) {
-				IContentType baseType = ct.getBaseType();
-				id = (baseType != null) ? baseType.getId() : null;
-			}
-		}
-		return (String[]) parentTypes.toArray(new String[parentTypes.size()]);
-	}
-
-	protected boolean canHandlePartition(String partitionType) {
+    /**
+     * 
+     * @param partitionType
+     * @return true if the strategy contains at least one ValidatorMetaData
+     *          that says it can handle the partition type (for a given content type) 
+     */
+	public boolean canValidatePartition(String partitionType) {
 		ValidatorMetaData vmd = null;
 		for (int i = 0; i < fMetaData.size(); i++) {
 			vmd = (ValidatorMetaData) fMetaData.get(i);
-			if (vmd.canHandlePartitionType(getContentTypeIds(), partitionType))
+			if (vmd.canHandleParitionType(getContentTypeIds(), partitionType))
 				return true;
 		}
 		return false;
 	}
+	
+	protected boolean canHandlePartition(String partition) {
+		return canValidatePartition(partition);
+	}
 
+	/*
+	 * so that removal will work properly
+	 * 
+	 * @see org.eclipse.wst.sse.ui.reconcile.AbstractStructuredTextReconcilingStrategy#containsStep(org.eclipse.jface.text.reconciler.IReconcileStep)
+	 */
 	protected boolean containsStep(IReconcileStep step) {
-		return fVidToVStepMap.containsValue(step);
+		return step != null ? fVidToVStepMap.values().contains(step) : false;
 	}
 
 	/**
@@ -121,100 +124,82 @@
 		// do nothing, steps are created
 	}
 
-	public void endProcessing() {
-		fTotalScopeValidatorsAlreadyRun.clear();
-	}
-
-	/**
-	 * All content types on which this ValidatorStrategy can run
-	 * 
-	 * @return
-	 */
 	public String[] getContentTypeIds() {
 		return fContentTypeIds;
 	}
 
+	/*
+	 * so that removal will work properly
+	 * 
+	 * @see org.eclipse.wst.sse.ui.reconcile.AbstractStructuredTextReconcilingStrategy#getPartitionTypes()
+	 */
+	public String[] getPartitionTypes() {
+		List partitionTypes = new ArrayList();
+		Iterator keys = fVidToVStepMap.keySet().iterator();
+		String key = null;
+		while (keys.hasNext()) {
+			key = (String) keys.next();
+			StructuredReconcileStep step = (StructuredReconcileStep) fVidToVStepMap.get(key);
+			partitionTypes.addAll(Arrays.asList(step.getPartitionTypes()));
+		}
+		return (String[]) partitionTypes.toArray(new String[partitionTypes.size()]);
+	}
 	/**
-	 * @param tr
-	 *            Partition of the region to reconcile.
-	 * @param dr
-	 *            Dirty region representation of the typed region
+	 * @param tr Partition of the region to reconcile.
+	 * @param dr Dirty region representation of the typed region
 	 */
 	public void reconcile(ITypedRegion tr, DirtyRegion dr) {
-
-		if (isCanceled())
+		
+		if(isCanceled())
 			return;
-
+		
 		IDocument doc = getDocument();
 		// for external files, this can be null
-		if (doc == null)
+		if (doc == null) 
 			return;
-
+			
 		String partitionType = tr.getType();
+		if (canValidatePartition(partitionType)) {
+			ValidatorMetaData vmd = null;
 
-		ValidatorMetaData vmd = null;
-		List annotationsToAdd = new ArrayList();
-		/*
-		 * Loop through all of the relevant validator meta data to find
-		 * supporting validators for this partition type. Don't check
-		 * this.canHandlePartition() before-hand since it just loops through
-		 * and calls vmd.canHandlePartitionType()...which we're already doing
-		 * here anyway to find the right vmd.
-		 */
-		for (int i = 0; i < fMetaData.size() && !isCanceled(); i++) {
-			vmd = (ValidatorMetaData) fMetaData.get(i);
-			if (vmd.canHandlePartitionType(getContentTypeIds(), partitionType)) {
-				int validatorScope = vmd.getValidatorScope();
-				ReconcileStepForValidator validatorStep = null;
-				// get step for partition type
-				Object o = fVidToVStepMap.get(vmd.getValidatorId());
-				if (o != null) {
-					validatorStep = (ReconcileStepForValidator) o;
-				}
-				else {
-					// if doesn't exist, create one
-					IValidator validator = vmd.createValidator();
+			// IReconcileResult[]
+			ArrayList annotationsToAdd = new ArrayList();
+            // loop all of the relevant validator meta data
+            // to find new annotations
+			for (int i = 0; i < fMetaData.size() && !isCanceled(); i++) {
+				vmd = (ValidatorMetaData) fMetaData.get(i);
+				if (vmd.canHandleParitionType(getContentTypeIds(), partitionType)) {
+					// get step for partition type
+					Object o = fVidToVStepMap.get(vmd.getValidatorId());
+					ReconcileStepForValidator validatorStep = null;
+					if (o != null) {
+						validatorStep = (ReconcileStepForValidator) o;
+					} else {
+						// if doesn't exist, create one
+						IValidator validator = vmd.createValidator();
+						validatorStep = new ReconcileStepForValidator(validator, vmd.getValidatorScope());
+						validatorStep.setInputModel(new DocumentAdapter(doc));
 
-					validatorStep = new ReconcileStepForValidator(validator, validatorScope);
-					validatorStep.setInputModel(new DocumentAdapter(doc));
-
-					fVidToVStepMap.put(vmd.getValidatorId(), validatorStep);
-				}
-
-				if (!fTotalScopeValidatorsAlreadyRun.contains(vmd)) {
-					annotationsToAdd.addAll(Arrays.asList(validatorStep.reconcile(dr, dr)));
-
-					if (validatorScope == ReconcileAnnotationKey.TOTAL) {
-						// mark this validator as "run"
-						fTotalScopeValidatorsAlreadyRun.add(vmd);
+						fVidToVStepMap.put(vmd.getValidatorId(), validatorStep);
 					}
+					annotationsToAdd.addAll(Arrays.asList(validatorStep.reconcile(dr, dr)));
 				}
 			}
-		}
-
-		TemporaryAnnotation[] annotationsToRemove = getAnnotationsToRemove(dr);
-		if (annotationsToRemove.length + annotationsToAdd.size() > 0)
-			smartProcess(annotationsToRemove, (IReconcileResult[]) annotationsToAdd.toArray(new IReconcileResult[annotationsToAdd.size()]));
-	}
-
-	public void release() {
-		super.release();
-		Iterator it = fVidToVStepMap.values().iterator();
-		IReconcileStep step = null;
-		while (it.hasNext()) {
-			step = (IReconcileStep) it.next();
-			if (step instanceof IReleasable)
-				((IReleasable) step).release();
+            
+            TemporaryAnnotation[] annotationsToRemove= getAnnotationsToRemove(dr);   
+            if (annotationsToRemove.length + annotationsToAdd.size() > 0)
+                smartProcess(annotationsToRemove, (IReconcileResult[]) annotationsToAdd.toArray(new IReconcileResult[annotationsToAdd.size()]));
+  
 		}
 	}
 
-	/**
+    /**
 	 * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
 	 */
 	public void setDocument(IDocument document) {
-
+		
 		super.setDocument(document);
-
+		
 		// validator steps are in "fVIdToVStepMap" (as opposed to fFirstStep >
 		// next step etc...)
 		Iterator it = fVidToVStepMap.values().iterator();
@@ -224,4 +209,19 @@
 			step.setInputModel(new DocumentAdapter(document));
 		}
 	}
+	
+	public void release() {
+		super.release();
+		Iterator it = fVidToVStepMap.values().iterator();
+		IReconcileStep step = null;
+		while (it.hasNext()) {
+			step = (IReconcileStep) it.next();
+			if(step instanceof IReleasable)
+				((IReleasable)step).release();
+		}
+	}
+	
+	public boolean isTotalScope() {
+		return true;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
index 7c8f2f2..1c39cbb 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
@@ -16,9 +16,9 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.Region;
 import org.eclipse.jface.util.Assert;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.StructuredTextEditor;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.w3c.dom.Node;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java
index 850c24b..22eba08 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java
@@ -24,9 +24,9 @@
 import org.eclipse.ui.IViewActionDelegate;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 
 abstract public class StructuredSelectActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
 	private IEditorPart fEditor;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java
deleted file mode 100644
index 40b9aee..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.spelling;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
-import org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector;
-import org.eclipse.ui.texteditor.spelling.SpellingContext;
-import org.eclipse.ui.texteditor.spelling.SpellingEngineDescriptor;
-import org.eclipse.ui.texteditor.spelling.SpellingProblem;
-import org.eclipse.ui.texteditor.spelling.SpellingService;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredTextReconcilingStrategy;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-
-/**
- * A reconciling strategy that queries the SpellingService using its default
- * engine. Results are show as temporary annotations.
- * 
- * @since 1.5
- */
-public class SpellcheckStrategy extends StructuredTextReconcilingStrategy {
-	private class SpellingProblemCollector implements ISpellingProblemCollector {
-		List annotations = new ArrayList();
-
-		public void accept(SpellingProblem problem) {
-			TemporaryAnnotation annotation = new TemporaryAnnotation(new Position(problem.getOffset(), problem.getLength()), TemporaryAnnotation.ANNOT_WARNING, problem.getMessage(), fReconcileAnnotationKey);
-			/*
-			 * TODO: create and use an IQuickFixProcessor that uses
-			 * problem.getProposals() for fixes [note, the default engine
-			 * doesn't propose fixes, at least without a dictionary].
-			 */
-			annotation.setAdditionalFixInfo(problem);
-			annotations.add(annotation);
-			if (_DEBUG_SPELLING) {
-				Logger.log(Logger.INFO_DEBUG, problem.getMessage());
-			}
-		}
-
-		public void beginCollecting() {
-		}
-
-		void clear() {
-			annotations.clear();
-		}
-
-		public void endCollecting() {
-		}
-
-		IReconcileResult[] getResults() {
-			return (IReconcileResult[]) annotations.toArray(new IReconcileResult[annotations.size()]);
-		}
-	}
-
-	private class SpellingStep extends StructuredReconcileStep {
-		protected IReconcileResult[] reconcileModel(final DirtyRegion dirtyRegion, IRegion subRegion) {
-			SpellingService service = getSpellingService(fContentTypeId + "." + SpellingService.PREFERENCE_SPELLING_ENGINE);
-			if (_DEBUG_SPELLING) {
-				Logger.log(Logger.INFO_DEBUG, "Spell checking [" + subRegion.getOffset() + "-" + (subRegion.getOffset() + subRegion.getLength()) + "]"); //$NON-NLS-1$
-			}
-			service.check(getDocument(), new IRegion[]{subRegion}, fSpellingContext, fProblemCollector, getProgressMonitor());
-			IReconcileResult[] results = fProblemCollector.getResults();
-			fProblemCollector.clear();
-			return results;
-		}
-	}
-
-	static final boolean _DEBUG_SPELLING = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerSpelling")).booleanValue(); //$NON-NLS-1$
-
-	static final String ANNOTATION_TYPE = "org.eclipse.wst.sse.ui.temp.spelling"; //$NON-NLS-1$
-
-	private static final String EXTENDED_BUILDER_TYPE = "spellingsupport"; //$NON-NLS-1$
-
-	static final String KEY_CONTENT_TYPE = "org.eclipse.wst.sse.ui.temp.spelling"; //$NON-NLS-1$
-	private String fContentTypeId = null;
-
-	private String fDocumentPartitioning;
-
-	private SpellingProblemCollector fProblemCollector = new SpellingProblemCollector();
-
-	/*
-	 * Keying our Temporary Annotations based on the partition doesn't help
-	 * this strategy to only remove its own TemporaryAnnotations since it's
-	 * possibly run on all partitions. Instead, set the key to use an
-	 * arbitrary partition type that we can check for using our own
-	 * implementation of getAnnotationsToRemove(DirtyRegion).
-	 * 
-	 * Value initialized through
-	 * 
-	 * super(ISourceViewer)->super.init()->createReconcileSteps()
-	 */
-	ReconcileAnnotationKey fReconcileAnnotationKey;
-
-	SpellingContext fSpellingContext;
-	/*
-	 * Value initialized through
-	 * 
-	 * super(ISourceViewer)->super.init()->createReconcileSteps()
-	 */
-	IReconcileStep fSpellingStep;
-
-	String[] fSupportedPartitionTypes;
-
-	public SpellcheckStrategy(ISourceViewer viewer, String contentTypeId) {
-		super(viewer);
-		fContentTypeId = contentTypeId;
-
-		fSpellingContext = new SpellingContext();
-		fSpellingContext.setContentType(Platform.getContentTypeManager().getContentType(fContentTypeId));
-		fReconcileAnnotationKey = new ReconcileAnnotationKey(fSpellingStep, KEY_CONTENT_TYPE, ReconcileAnnotationKey.PARTIAL);
-
-		String[] definitions = ExtendedConfigurationBuilder.getInstance().getDefinitions(EXTENDED_BUILDER_TYPE, fContentTypeId);
-		List defs = new ArrayList();
-		for (int i = 0; i < definitions.length; i++) {
-			defs.addAll(Arrays.asList(StringUtils.unpack(definitions[i])));
-		}
-		fSupportedPartitionTypes = (String[]) defs.toArray(new String[defs.size()]);
-	}
-
-	protected boolean containsStep(IReconcileStep step) {
-		return fSpellingStep.equals(step);
-	}
-
-	public void createReconcileSteps() {
-		fSpellingStep = new SpellingStep();
-	}
-
-	String getDocumentPartitioning() {
-		return fDocumentPartitioning == null ? IDocumentExtension3.DEFAULT_PARTITIONING : fDocumentPartitioning;
-	}
-
-	private TemporaryAnnotation[] getSpellingAnnotationsToRemove(IRegion region) {
-		List toRemove = new ArrayList();
-		IAnnotationModel annotationModel = getAnnotationModel();
-		// can be null when closing the editor
-		if (getAnnotationModel() != null) {
-			Iterator i = annotationModel.getAnnotationIterator();
-			while (i.hasNext()) {
-				Object obj = i.next();
-				if (!(obj instanceof TemporaryAnnotation))
-					continue;
-
-				TemporaryAnnotation annotation = (TemporaryAnnotation) obj;
-				ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
-
-				// then if this strategy knows how to add/remove this
-				// partition type
-				if (key != null && key.equals(fReconcileAnnotationKey)) {
-					Position position = annotation.getPosition();
-					if (key.getScope() == ReconcileAnnotationKey.PARTIAL && position.overlapsWith(region.getOffset(), region.getLength())) {
-						toRemove.add(annotation);
-					}
-					else if (key.getScope() == ReconcileAnnotationKey.TOTAL) {
-						toRemove.add(annotation);
-					}
-				}
-			}
-		}
-
-		return (TemporaryAnnotation[]) toRemove.toArray(new TemporaryAnnotation[toRemove.size()]);
-	}
-
-	/**
-	 * @param engineID
-	 * @return the SpellingService with the preferred engine
-	 */
-	SpellingService getSpellingService(String engineID) {
-		SpellingService defaultService = EditorsUI.getSpellingService();
-
-		SpellingService preferredService = defaultService;
-
-		if (engineID != null) {
-			/*
-			 * Set up a preference store indicating that the given engine
-			 * should be used instead of the default preference store's
-			 * default
-			 */
-			SpellingEngineDescriptor[] descriptors = defaultService.getSpellingEngineDescriptors();
-			for (int i = 0; i < descriptors.length; i++) {
-				if (engineID.equals(descriptors[i].getId())) {
-					IPreferenceStore store = new ScopedPreferenceStore(new InstanceScope(), SSEUIPlugin.getDefault().getBundle().getSymbolicName());
-					store.setValue(SpellingService.PREFERENCE_SPELLING_ENGINE, engineID);
-					preferredService = new SpellingService(store);
-					break;
-				}
-			}
-		}
-		return preferredService;
-	}
-
-	private boolean isSupportedPartitionType(String type) {
-		boolean supported = false;
-		if (fSupportedPartitionTypes == null || fSupportedPartitionTypes.length == 0) {
-			supported = true;
-		}
-		else {
-			for (int i = 0; i < fSupportedPartitionTypes.length; i++) {
-				if (type.equals(fSupportedPartitionTypes[i])) {
-					supported = true;
-					break;
-				}
-			}
-		}
-		return supported;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.reconciler.DirtyRegion,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
-		if (isCanceled())
-			return;
-
-		TemporaryAnnotation[] annotationsToRemove = null;
-		IReconcileResult[] annotationsToAdd = null;
-		StructuredReconcileStep structuredStep = (StructuredReconcileStep) fSpellingStep;
-		IAnnotationModel annotationModel = getAnnotationModel();
-
-		try {
-			ITypedRegion[] partitions = TextUtilities.computePartitioning(getDocument(), getDocumentPartitioning(), dirtyRegion.getOffset(), dirtyRegion.getLength(), true);
-			for (int i = 0; i < partitions.length; i++) {
-				if (isSupportedPartitionType(partitions[i].getType())) {
-					annotationsToRemove = getSpellingAnnotationsToRemove(partitions[i]);
-					annotationsToAdd = structuredStep.reconcile(dirtyRegion, partitions[i]);
-
-					if (annotationModel instanceof IAnnotationModelExtension) {
-						IAnnotationModelExtension modelExtension = (IAnnotationModelExtension) annotationModel;
-						Map annotationsToAddMap = new HashMap();
-						for (int j = 0; j < annotationsToAdd.length; j++) {
-							annotationsToAddMap.put(annotationsToAdd[j], ((TemporaryAnnotation) annotationsToAdd[j]).getPosition());
-						}
-						modelExtension.replaceAnnotations(annotationsToRemove, annotationsToAddMap);
-					}
-
-					else {
-						for (int j = 0; j < annotationsToAdd.length; j++) {
-							annotationModel.addAnnotation((TemporaryAnnotation) annotationsToAdd[j], ((TemporaryAnnotation) annotationsToAdd[j]).getPosition());
-						}
-						for (int j = 0; j < annotationsToRemove.length; j++) {
-							annotationModel.removeAnnotation(annotationsToRemove[j]);
-						}
-					}
-				}
-			}
-		}
-		catch (BadLocationException e) {
-		}
-
-	}
-
-	/**
-	 * @param partition
-	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.IRegion)
-	 */
-
-	public void reconcile(IRegion partition) {
-		DirtyRegion region = null;
-		try {
-			region = new DirtyRegion(partition.getOffset(), partition.getLength(), DirtyRegion.INSERT, getDocument().get(partition.getOffset(), partition.getLength()));
-			reconcile(region, region);
-		}
-		catch (BadLocationException e) {
-			Logger.logException(e);
-		}
-	}
-
-	public void setDocument(IDocument document) {
-		super.setDocument(document);
-		if (fSpellingStep == null) {
-			createReconcileSteps();
-		}
-		fSpellingStep.setInputModel(new DocumentAdapter(document));
-	}
-
-	public void setDocumentPartitioning(String partitioning) {
-		fDocumentPartitioning = partitioning;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AbstractHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AbstractHoverProcessor.java
deleted file mode 100644
index 0ea279f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AbstractHoverProcessor.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.taginfo;
-
-import org.eclipse.jface.bindings.TriggerSequence;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextHoverExtension;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.keys.IBindingService;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
-
-/**
- * Abstract class for providing hover information for Source editor. Includes
- * a hover control creator which has the "Press F2 for focus" message built
- * in.
- * 
- * @since WTP 1.5
- */
-abstract public class AbstractHoverProcessor implements ITextHover, ITextHoverExtension {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextHoverExtension#getHoverControlCreator()
-	 */
-	public IInformationControlCreator getHoverControlCreator() {
-		return new IInformationControlCreator() {
-			public IInformationControl createInformationControl(Shell parent) {
-				return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true), getTooltipAffordanceString());
-			}
-		};
-	}
-
-	/**
-	 * Returns the short cut assigned to the sub menu or <code>null</code>
-	 * if no short cut is assigned.
-	 * 
-	 * @return the short cut as a human readable string or <code>null</code>
-	 */
-	private String getShortCutString() {
-		final IWorkbench workbench = PlatformUI.getWorkbench();
-		final IBindingService bindingService = (IBindingService) workbench.getAdapter(IBindingService.class);
-		final TriggerSequence[] activeBindings = bindingService.getActiveBindingsFor(ActionDefinitionIds.INFORMATION);
-		if (activeBindings.length > 0) {
-			return activeBindings[0].format();
-		}
-
-		return null;
-	}
-
-	/**
-	 * Returns the tool tip affordance string.
-	 * 
-	 * @return the affordance string or <code>null</code> if disabled or no
-	 *         key binding is defined
-	 * @since 3.0
-	 */
-	private String getTooltipAffordanceString() {
-		String sticky = null;
-		String keySequence = getShortCutString();
-		if (keySequence != null) {
-			sticky = NLS.bind(SSEUIMessages.textHoverMakeStickyHint, keySequence);
-		}
-		return sticky;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
index 5e8475a..b3ffc99 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2004 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
@@ -18,6 +18,7 @@
 
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.Position;
 import org.eclipse.jface.text.Region;
@@ -27,7 +28,7 @@
 import org.eclipse.ui.editors.text.EditorsUI;
 import org.eclipse.ui.texteditor.AnnotationPreference;
 import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
@@ -38,13 +39,13 @@
  * 
  * @author amywu
  */
-public class AnnotationHoverProcessor extends AbstractHoverProcessor {
+public class AnnotationHoverProcessor implements ITextHover {
 	private final static String LIST_BEGIN = "<ul>"; //$NON-NLS-1$
 	private final static String LIST_ELEMENT = "<li>"; //$NON-NLS-1$
 	private final static String PARAGRAPH_END = "</p>"; //$NON-NLS-1$
-	private final static String PARAGRAPH_START = "<p>"; //$NON-NLS-1$
 
-	private IPreferenceStore fPreferenceStore = null;
+	private final static String PARAGRAPH_START = "<p>"; //$NON-NLS-1$
+	protected IPreferenceStore fPreferenceStore = null;
 
 	/**
 	 * 
@@ -60,7 +61,7 @@
 	 *            assumes msg is neither null nor empty string
 	 * @return
 	 */
-	private String formatMessage(String msg) {
+	protected String formatMessage(String msg) {
 		StringBuffer buf = new StringBuffer();
 		buf.append(PARAGRAPH_START);
 		buf.append(StringUtils.convertToHTMLContent(msg));
@@ -74,7 +75,7 @@
 	 * @param messages
 	 * @return
 	 */
-	private String formatMessages(List messages) {
+	protected String formatMessages(List messages) {
 		StringBuffer buffer = new StringBuffer();
 		buffer.append(PARAGRAPH_START);
 		buffer.append(SSEUIMessages.Multiple_errors); //$NON-NLS-1$
@@ -104,6 +105,7 @@
 		return EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation);
 	}
 
+
 	public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
 		IAnnotationModel model = ((SourceViewer) viewer).getAnnotationModel();
 		if (model != null) {
@@ -182,7 +184,7 @@
 	 * Retreives the preference store If no preference store is currently
 	 * stored, retreive the appropriate preference store
 	 */
-	private IPreferenceStore getPreferenceStore() {
+	protected IPreferenceStore getPreferenceStore() {
 		if (fPreferenceStore == null) {
 			IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
 			IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
@@ -191,7 +193,7 @@
 		return fPreferenceStore;
 	}
 
-	boolean isAnnotationValid(Annotation a) {
+	protected boolean isAnnotationValid(Annotation a) {
 		AnnotationPreference preference = getAnnotationPreference(a);
 		if (preference == null)
 			return false;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
index 5e4eb60..227d229 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
@@ -16,10 +16,8 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.eclipse.jface.text.IInformationControlCreator;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextHoverExtension;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.wst.sse.ui.internal.Logger;
 
@@ -28,11 +26,11 @@
  * processors) Priority of hover help processors is: ProblemHoverProcessor,
  * TagInfoProcessor, AnnotationHoverProcessor
  */
-public class BestMatchHover implements ITextHover, ITextHoverExtension {
+public class BestMatchHover implements ITextHover {
 	private ITextHover fBestMatchHover; // current best match text hover
 	private ITextHover fTagInfoHover; // documentation/information hover
 	private List fTextHovers; // list of text hovers to consider in best
-	// match
+								// match
 
 	public BestMatchHover(ITextHover infotaghover) {
 		fTagInfoHover = infotaghover;
@@ -60,15 +58,6 @@
 		return hoverList;
 	}
 
-	public IInformationControlCreator getHoverControlCreator() {
-		IInformationControlCreator creator = null;
-
-		if (fBestMatchHover instanceof ITextHoverExtension) {
-			creator = ((ITextHoverExtension) fBestMatchHover).getHoverControlCreator();
-		}
-		return creator;
-	}
-
 	/*
 	 * (non-Javadoc)
 	 * 
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java
index 2e292a5..e96ee19 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2004 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
@@ -24,9 +24,10 @@
 /**
  * Provides debug hover help
  * 
+ * @author amywu
  * @see org.eclipse.jface.text.ITextHover
  */
-public class DebugInfoHoverProcessor extends AbstractHoverProcessor {
+public class DebugInfoHoverProcessor implements ITextHover {
 	public static final String TRACEFILTER = "debuginfohover"; //$NON-NLS-1$
 	protected IPreferenceStore fPreferenceStore = null;
 
@@ -43,8 +44,7 @@
 		String displayText = null;
 		if ((hoverRegion == null) || (viewer == null) || (viewer.getDocument() == null)) {
 			displayText = null;
-		}
-		else {
+		} else {
 			int offset = hoverRegion.getOffset();
 
 			ITypedRegion region;
@@ -52,12 +52,10 @@
 				region = viewer.getDocument().getPartition(offset);
 				if (region != null) {
 					displayText = region.getType();
-				}
-				else {
+				} else {
 					displayText = "Null Region was returned?!"; //$NON-NLS-1$
 				}
-			}
-			catch (BadLocationException e) {
+			} catch (BadLocationException e) {
 				displayText = "BadLocationException Occurred!?"; //$NON-NLS-1$
 			}
 
@@ -80,13 +78,11 @@
 		ITypedRegion region = null;
 		if ((textViewer == null) || (textViewer.getDocument() == null)) {
 			region = null;
-		}
-		else {
+		} else {
 
 			try {
 				region = textViewer.getDocument().getPartition(offset);
-			}
-			catch (BadLocationException e) {
+			} catch (BadLocationException e) {
 				region = null;
 			}
 		}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
index a6ca4fe..9b19440 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
@@ -25,15 +25,10 @@
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
 import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.ColumnWeightData;
@@ -49,46 +44,34 @@
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Sash;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.TabFolder;
 import org.eclipse.swt.widgets.TabItem;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.MarkerAnnotation;
 import org.eclipse.ui.texteditor.MarkerUtilities;
-import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
 import org.eclipse.ui.texteditor.StatusLineContributionItem;
 import org.eclipse.ui.views.properties.IPropertyDescriptor;
 import org.eclipse.ui.views.properties.IPropertySource;
 import org.eclipse.ui.views.properties.IPropertySourceProvider;
 import org.eclipse.ui.views.properties.PropertySheetPage;
 import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
@@ -98,158 +81,14 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.util.Utilities;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
 
 /**
  * @author nsd A Status Line contribution intended to display the selected
  *         offsets in an editor. Double-clicking shows information about
- *         partitions, document regions, annotations, and selection.
+ *         partitions and the Structured Document regions.
  */
 public class OffsetStatusLineContributionItem extends StatusLineContributionItem {
 
-	class AnnotationPropertySource implements IPropertySource {
-		Annotation fAnnotation = null;
-		IPropertyDescriptor[] fDescriptors = null;
-		String[] TEMPORARY_ANNOTATION_KEYS = new String[]{"Partition Type", "Step", "Scope", "Offset", "Length", "Description"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-
-		public AnnotationPropertySource(Annotation annotation) {
-			super();
-			fAnnotation = annotation;
-		}
-
-		public Object getEditableValue() {
-			return null;
-		}
-
-		public IPropertyDescriptor[] getPropertyDescriptors() {
-			if (fDescriptors == null) {
-				try {
-					if (fAnnotation instanceof SimpleMarkerAnnotation) {
-						Map attrs = ((SimpleMarkerAnnotation) fAnnotation).getMarker().getAttributes();
-						Object[] keys = attrs.keySet().toArray();
-
-						fDescriptors = new IPropertyDescriptor[keys.length];
-						for (int i = 0; i < keys.length; i++) {
-							TextPropertyDescriptor descriptor = new TextPropertyDescriptor(keys[i].toString(), keys[i].toString());
-							fDescriptors[i] = descriptor;
-						}
-					}
-					else if (fAnnotation instanceof TemporaryAnnotation) {
-						Object key = ((TemporaryAnnotation) fAnnotation).getKey();
-						if (key != null && key instanceof ReconcileAnnotationKey) {
-							String[] keys = TEMPORARY_ANNOTATION_KEYS;
-							fDescriptors = new IPropertyDescriptor[keys.length];
-							for (int i = 0; i < keys.length; i++) {
-								TextPropertyDescriptor descriptor = new TextPropertyDescriptor(keys[i].toString(), keys[i].toString());
-								fDescriptors[i] = descriptor;
-							}
-						}
-					}
-				}
-				catch (CoreException e) {
-					e.printStackTrace();
-				}
-			}
-			if (fDescriptors == null)
-				fDescriptors = new IPropertyDescriptor[0];
-			return fDescriptors;
-		}
-
-		public Object getPropertyValue(Object id) {
-			String value = null;
-			if (fAnnotation instanceof SimpleMarkerAnnotation) {
-				Object o;
-				try {
-					o = ((SimpleMarkerAnnotation) fAnnotation).getMarker().getAttributes().get(id);
-					if (o != null) {
-						value = o.toString();
-					}
-				}
-				catch (CoreException e) {
-				}
-			}
-			else if (fAnnotation instanceof TemporaryAnnotation) {
-				if (TEMPORARY_ANNOTATION_KEYS[0].equals(id)) {
-					Object key = ((TemporaryAnnotation) fAnnotation).getKey();
-					if (key != null && key instanceof ReconcileAnnotationKey) {
-						value = ((ReconcileAnnotationKey) key).getPartitionType();
-					}
-				}
-				else if (TEMPORARY_ANNOTATION_KEYS[1].equals(id)) {
-					Object key = ((TemporaryAnnotation) fAnnotation).getKey();
-					if (key != null && key instanceof ReconcileAnnotationKey) {
-						IReconcileStep step = ((ReconcileAnnotationKey) key).getStep();
-						if (step != null) {
-							value = step.getClass().getName();
-						}
-					}
-				}
-				else if (TEMPORARY_ANNOTATION_KEYS[2].equals(id)) {
-					Object key = ((TemporaryAnnotation) fAnnotation).getKey();
-					if (key != null && key instanceof ReconcileAnnotationKey) {
-						int scope = ((ReconcileAnnotationKey) key).getScope();
-						if (scope == ReconcileAnnotationKey.PARTIAL) {
-							value = "PARTIAL"; //$NON-NLS-1$
-						}
-						if (scope == ReconcileAnnotationKey.TOTAL) {
-							value = "TOTAL"; //$NON-NLS-1$
-						}
-					}
-				}
-				else if (TEMPORARY_ANNOTATION_KEYS[3].equals(id)) {
-					IAnnotationModel annotationModel = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput());
-					Position p = annotationModel.getPosition(fAnnotation);
-					if (p != null) {
-						value = String.valueOf(p.getOffset());
-					}
-				}
-				else if (TEMPORARY_ANNOTATION_KEYS[4].equals(id)) {
-					IAnnotationModel annotationModel = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput());
-					Position p = annotationModel.getPosition(fAnnotation);
-					if (p != null) {
-						value = String.valueOf(p.getLength());
-					}
-				}
-				else if (TEMPORARY_ANNOTATION_KEYS[5].equals(id)) {
-					value = ((TemporaryAnnotation) fAnnotation).getDescription();
-				}
-			}
-			return value;
-		}
-
-		public boolean isPropertySet(Object id) {
-			return false;
-		}
-
-		public void resetPropertyValue(Object id) {
-			try {
-				if (fAnnotation instanceof SimpleMarkerAnnotation) {
-					((SimpleMarkerAnnotation) fAnnotation).getMarker().getAttributes().remove(id);
-				}
-				else if (fAnnotation instanceof TemporaryAnnotation) {
-				}
-			}
-			catch (CoreException e) {
-				e.printStackTrace();
-			}
-		}
-
-		public void setPropertyValue(Object id, Object value) {
-			try {
-				if (fAnnotation instanceof SimpleMarkerAnnotation) {
-					((MarkerAnnotation) fAnnotation).getMarker().setAttribute(id.toString(), value);
-				}
-				else if (fAnnotation instanceof TemporaryAnnotation) {
-				}
-			}
-			catch (CoreException e) {
-				e.printStackTrace();
-			}
-		}
-	}
-
 	class InformationDialog extends Dialog {
 
 		IDocument fDocument = fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
@@ -259,18 +98,22 @@
 			setShellStyle(getShellStyle() | SWT.RESIZE);
 		}
 
-		private void createAnnotationTabContents(Composite annotationsTabComposite) {
+		private void createAnnotationContents(Composite annotationsTabComposite) {
 			annotationsTabComposite.setLayout(new GridLayout());
 			annotationsTabComposite.setLayoutData(new GridData());
 
-			final Composite annotationsComposite = new Composite(annotationsTabComposite, SWT.NONE);
+			Composite annotationsComposite = new Composite(annotationsTabComposite, SWT.NONE);
+			annotationsComposite.setLayout(new GridLayout(2, false));
 			annotationsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 
-			final TableViewer annotationsTable = new TableViewer(annotationsComposite, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+			final TableViewer annotationsTable = new TableViewer(annotationsComposite, SWT.FULL_SELECTION);
+			GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+			gd.horizontalSpan = 2;
+			annotationsTable.getControl().setLayoutData(gd);
 			annotationsTable.setContentProvider(new ArrayContentProvider());
 			annotationsTable.getTable().setHeaderVisible(true);
 			annotationsTable.getTable().setLinesVisible(true);
-			String[] columns = new String[]{"Line", "Owner", "Type", "Class", "Message"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+			String[] columns = new String[]{"Line", "Owner", "Type", "Message"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 			annotationsTable.setLabelProvider(new ITableLabelProvider() {
 				public void addListener(ILabelProviderListener listener) {
 				}
@@ -287,18 +130,15 @@
 					String text = null;
 					switch (columnIndex) {
 						case 0 :
-							text = getLineNumber(annotation);
+							text = (annotation instanceof MarkerAnnotation) ? Integer.toString(MarkerUtilities.getLineNumber(((MarkerAnnotation) annotation).getMarker())) : "-1"; //$NON-NLS-1$
 							break;
 						case 1 :
-							text = getOwner(annotation);
+							text = (annotation instanceof MarkerAnnotation) ? ((MarkerAnnotation) annotation).getMarker().getAttribute("owner", "n/a") : "?"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 							break;
 						case 2 :
-							text = getType(annotation); //$NON-NLS-1$
+							text = (annotation instanceof MarkerAnnotation) ? MarkerUtilities.getMarkerType(((MarkerAnnotation) annotation).getMarker()) : "?"; //$NON-NLS-1$
 							break;
 						case 3 :
-							text = annotation.getClass().getName();
-							break;
-						case 4 :
 							text = annotation.getText();
 							break;
 					}
@@ -307,40 +147,8 @@
 					return text;
 				}
 
-
-				private String getOwner(Annotation annotation) {
-					String owner = null;
-					if (annotation instanceof MarkerAnnotation) {
-						owner = ((MarkerAnnotation) annotation).getMarker().getAttribute("owner", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$				
-					}
-					else if (annotation instanceof TemporaryAnnotation) {
-						Object key = ((TemporaryAnnotation) annotation).getKey();
-						if (key != null) {
-							if (key instanceof ReconcileAnnotationKey) {
-								key = key.getClass().getName();
-							}
-							if (key != null)
-								owner = key.toString();
-						}
-					}
-					return owner;
-				}
-
-				private String getType(Annotation annotation) {
-					String type = null;
-					if (annotation instanceof MarkerAnnotation) {
-						type = MarkerUtilities.getMarkerType(((MarkerAnnotation) annotation).getMarker());
-					}
-					else {
-						type = annotation.getType();
-					}
-					if (type == null)
-						type = "";
-					return type;
-				}
-
 				public boolean isLabelProperty(Object element, String property) {
-					return true;
+					return false;
 				}
 
 				public void removeListener(ILabelProviderListener listener) {
@@ -349,7 +157,7 @@
 
 			TableLayout tlayout = new TableLayout();
 			CellEditor[] cellEditors = new CellEditor[columns.length];
-			int columnWidths[] = new int[]{Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 7, Display.getCurrent().getBounds().width / 7, Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 7};
+			int columnWidths[] = new int[]{Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 7, Display.getCurrent().getBounds().width / 7, Display.getCurrent().getBounds().width / 7};
 			for (int i = 0; i < columns.length; i++) {
 				tlayout.addColumnData(new ColumnWeightData(1));
 				TableColumn tc = new TableColumn(annotationsTable.getTable(), SWT.NONE);
@@ -359,31 +167,27 @@
 			}
 			annotationsTable.setCellEditors(cellEditors);
 			annotationsTable.setColumnProperties(columns);
+			// textSelection.getOffset(), textSelection.getLength()
 			List matchingAnnotations = new ArrayList(0);
-			if (fTextEditor != null) {
-				IAnnotationModel annotationModel = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput());
-				if (annotationModel != null) {
-					Iterator iterator = annotationModel.getAnnotationIterator();
-					while (iterator.hasNext()) {
-						Annotation element = (Annotation) iterator.next();
-						if (true) {
-							matchingAnnotations.add(element);
-						}
-					}
+			Iterator iterator = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput()).getAnnotationIterator();
+			while (iterator.hasNext()) {
+				Annotation element = (Annotation) iterator.next();
+				if (true) {
+					matchingAnnotations.add(element);
 				}
 			}
-			annotationsTable.setSorter(new ViewerSorter());
 			annotationsTable.setInput(matchingAnnotations);
 
-			final Sash sash = new Sash(annotationsComposite, SWT.HORIZONTAL);
-
 			final PropertySheetPage propertySheet = new PropertySheetPage();
 			propertySheet.createControl(annotationsComposite);
+			gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+			gd.horizontalSpan = 2;
+			propertySheet.getControl().setLayoutData(gd);
 			propertySheet.setPropertySourceProvider(new IPropertySourceProvider() {
 				public IPropertySource getPropertySource(Object object) {
-					if (object instanceof Annotation) {
-						IPropertySource annotationPropertySource = new AnnotationPropertySource(((Annotation) object));
-						return annotationPropertySource;
+					if (object instanceof MarkerAnnotation) {
+						IPropertySource markerAnnotationPropertySource = new MarkerAnnotationPropertySource(((MarkerAnnotation) object));
+						return markerAnnotationPropertySource;
 					}
 					return null;
 				}
@@ -394,36 +198,6 @@
 					propertySheet.selectionChanged(null, event.getSelection());
 				}
 			});
-
-			final FormLayout form = new FormLayout();
-			annotationsComposite.setLayout(form);
-
-			FormData tableData = new FormData();
-			tableData.top = new FormAttachment(0, 0);
-			tableData.bottom = new FormAttachment(sash, 2);
-			tableData.left = new FormAttachment(0, 0);
-			tableData.right = new FormAttachment(100, 0);
-			annotationsTable.getControl().setLayoutData(tableData);
-
-			FormData propertiesData = new FormData();
-			propertiesData.top = new FormAttachment(sash, 2);
-			propertiesData.left = new FormAttachment(0, 0);
-			propertiesData.right = new FormAttachment(100, 0);
-			propertiesData.bottom = new FormAttachment(100, 0);
-			propertySheet.getControl().setLayoutData(propertiesData);
-
-			final FormData sashData = new FormData();
-			sashData.top = new FormAttachment(60, 0);
-			sashData.left = new FormAttachment(0, 0);
-			sashData.right = new FormAttachment(100, 0);
-			sash.setLayoutData(sashData);
-			sash.addListener(SWT.Selection, new org.eclipse.swt.widgets.Listener() {
-				public void handleEvent(Event e) {
-					sashData.top = new FormAttachment(0, e.y);
-					annotationsComposite.layout();
-				}
-			});
-			annotationsComposite.pack(true);
 		}
 
 		/*
@@ -437,47 +211,6 @@
 			parent.getShell().setText(SSEUIMessages.OffsetStatusLineContributionItem_0 + textSelection.getOffset() + "-" + (textSelection.getOffset() + textSelection.getLength())); //$NON-NLS-1$ //$NON-NLS-2$
 			Composite composite = (Composite) super.createDialogArea(parent);
 
-			Text documentTypeLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
-			GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-			gd.horizontalSpan = 2;
-			documentTypeLabel.setLayoutData(gd);
-			documentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_6 + fDocument.getClass().getName()); //$NON-NLS-1$
-
-			Text documentProviderLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
-			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-			gd.horizontalSpan = 2;
-			documentProviderLabel.setLayoutData(gd);
-			documentProviderLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_7 + fTextEditor.getDocumentProvider().getClass().getName()); //$NON-NLS-1$
-
-			Text editorInputLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
-			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-			gd.horizontalSpan = 2;
-			editorInputLabel.setLayoutData(gd);
-			editorInputLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_12 + fTextEditor.getEditorInput().getClass().getName()); //$NON-NLS-1$
-
-			IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (model != null) {
-				Text modelContentTypeLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
-				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-				gd.horizontalSpan = 2;
-				modelContentTypeLabel.setLayoutData(gd);
-				modelContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_4 + model.getContentTypeIdentifier()); //$NON-NLS-1$
-
-				Text modelHandlerContentTypeLabel = new Text(composite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
-				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-				gd.horizontalSpan = 2;
-				modelHandlerContentTypeLabel.setLayoutData(gd);
-				modelHandlerContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_5 + model.getModelHandler() + " (" + model.getModelHandler().getAssociatedContentTypeId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-				Label blankRow = new Label(composite, SWT.NONE);
-				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-				gd.horizontalSpan = 2;
-				blankRow.setLayoutData(gd);
-			}
-			if (model != null) {
-				model.releaseFromRead();
-			}
-
 			TabFolder tabfolder = new TabFolder(composite, SWT.NONE);
 			tabfolder.setLayoutData(new GridData(GridData.FILL_BOTH));
 
@@ -485,13 +218,7 @@
 			partitionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_2); //$NON-NLS-1$
 			Composite partitions = new Composite(tabfolder, SWT.NONE);
 			partitionTab.setControl(partitions);
-			createPartitionTabContents(partitions);
-
-			TabItem annotationsTab = new TabItem(tabfolder, SWT.BORDER);
-			annotationsTab.setText("Annotations"); //$NON-NLS-1$
-			Composite annotations = new Composite(tabfolder, SWT.NONE);
-			annotationsTab.setControl(annotations);
-			createAnnotationTabContents(annotations);
+			createPartitionContents(partitions);
 
 			// only create the ITextRegions tab for IStructuredDocuments
 			if (fDocument instanceof IStructuredDocument) {
@@ -500,29 +227,14 @@
 				SashForm regions = new SashForm(tabfolder, SWT.NONE);
 				regions.setOrientation(SWT.HORIZONTAL);
 				regionTab.setControl(regions);
-				createRegionTabContents(regions);
+				createRegionsContents(regions);
 			}
 
-			TabItem editorSelectionTab = new TabItem(tabfolder, SWT.BORDER);
-			editorSelectionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_14);
-			Composite editorSelectionComposite = new Composite(tabfolder, SWT.NONE);
-			editorSelectionTab.setControl(editorSelectionComposite);
-			fillSelectionTabContents(editorSelectionComposite, fTextEditor.getSelectionProvider().getSelection());
-
-			IEditorSite site = fTextEditor.getEditorSite();
-			if (site != null) {
-				IWorkbenchWindow window = site.getWorkbenchWindow();
-				if (window != null) {
-					ISelectionService service = window.getSelectionService();
-					if (service != null && !service.getSelection().equals(fTextEditor.getSelectionProvider().getSelection())) {
-						TabItem selectionServiceTab = new TabItem(tabfolder, SWT.BORDER);
-						selectionServiceTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_19);
-						Composite selectionServiceComposite = new Composite(tabfolder, SWT.NONE);
-						selectionServiceTab.setControl(selectionServiceComposite);
-						fillSelectionTabContents(selectionServiceComposite, service.getSelection());
-					}
-				}
-			}
+			TabItem annotationsTab = new TabItem(tabfolder, SWT.BORDER);
+			annotationsTab.setText("Annotations"); //$NON-NLS-1$
+			Composite annotations = new Composite(tabfolder, SWT.NONE);
+			annotationsTab.setControl(annotations);
+			createAnnotationContents(annotations);
 
 			return composite;
 		}
@@ -530,7 +242,7 @@
 		/**
 		 * @param area
 		 */
-		private void createPartitionTabContents(Composite area) {
+		private void createPartitionContents(Composite area) {
 			area.setLayout(new GridLayout());
 			area.setLayoutData(new GridData());
 
@@ -538,14 +250,55 @@
 			partioningComposite.setLayout(new GridLayout(2, false));
 			partioningComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 
-			Label label = new Label(partioningComposite, SWT.SINGLE);
+			Text documentTypeLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
+			GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+			gd.horizontalSpan = 2;
+			documentTypeLabel.setLayoutData(gd);
+			documentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_6 + fDocument.getClass().getName()); //$NON-NLS-1$
+
+			Text documentProviderLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
+			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+			gd.horizontalSpan = 2;
+			documentProviderLabel.setLayoutData(gd);
+			documentProviderLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_7 + fTextEditor.getDocumentProvider().getClass().getName()); //$NON-NLS-1$
+
+			Text editorInputLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
+			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+			gd.horizontalSpan = 2;
+			editorInputLabel.setLayoutData(gd);
+			editorInputLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_12 + fTextEditor.getEditorInput().getClass().getName()); //$NON-NLS-1$
+
+			IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
+			if (model != null) {
+				Text modelContentTypeLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
+				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+				gd.horizontalSpan = 2;
+				modelContentTypeLabel.setLayoutData(gd);
+				modelContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_4 + model.getContentTypeIdentifier()); //$NON-NLS-1$
+
+				Text modelHandlerContentTypeLabel = new Text(partioningComposite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
+				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+				gd.horizontalSpan = 2;
+				modelHandlerContentTypeLabel.setLayoutData(gd);
+				modelHandlerContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_5 + model.getModelHandler() + " (" + model.getModelHandler().getAssociatedContentTypeId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+				Label blankRow = new Label(partioningComposite, SWT.NONE);
+				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+				gd.horizontalSpan = 2;
+				blankRow.setLayoutData(gd);
+			}
+			if (model != null) {
+				model.releaseFromRead();
+			}
+
+			Text label = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
 			label.setText(SSEUIMessages.OffsetStatusLineContributionItem_8); //$NON-NLS-1$
 			label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
 			final Combo partitioningCombo = new Combo(partioningComposite, SWT.READ_ONLY);
 			partitioningCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
 
-			final Label partitionerInstanceLabel = new Label(partioningComposite, SWT.SINGLE);
-			GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+			final Text partitionerInstanceLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
+			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
 			gd.horizontalSpan = 2;
 			partitionerInstanceLabel.setLayoutData(gd);
 
@@ -558,6 +311,7 @@
 			fPartitionTable.getTable().setLinesVisible(true);
 			String[] columns = new String[]{SSEUIMessages.OffsetStatusLineContributionItem_9, SSEUIMessages.OffsetStatusLineContributionItem_10, SSEUIMessages.OffsetStatusLineContributionItem_11}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			fPartitionTable.setLabelProvider(new ITableLabelProvider() {
+
 				public void addListener(ILabelProviderListener listener) {
 				}
 
@@ -623,31 +377,23 @@
 				}
 			});
 			try {
-				if (partitionings.length > 0) {
-					String selectedPartitioning = partitioningCombo.getItem(0);
-					if (Utilities.contains(partitionings, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING)) {
-						selectedPartitioning = IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING;
-						for (int i = 0; i < partitionings.length; i++) {
-							if (partitionings[i].equals(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING)) {
-								partitioningCombo.select(i);
-							}
+				String selectedPartitioning = partitioningCombo.getItem(0);
+				if (Utilities.contains(partitionings, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING)) {
+					selectedPartitioning = IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING;
+					for (int i = 0; i < partitionings.length; i++) {
+						if (partitionings[i].equals(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING)) {
+							partitioningCombo.select(i);
 						}
 					}
-					else {
-						partitioningCombo.select(0);
-					}
-					ISelection sel = fTextEditor.getSelectionProvider().getSelection();
-					ITextSelection textSelection = (ITextSelection) sel;
-					ITypedRegion[] partitions = TextUtilities.computePartitioning(fDocument, selectedPartitioning, textSelection.getOffset(), textSelection.getLength(), true);
-					fPartitionTable.setInput(partitions);
-					String partitionerText = fDocument instanceof IDocumentExtension3 ? ((IDocumentExtension3) fDocument).getDocumentPartitioner(partitioningCombo.getItem(partitioningCombo.getSelectionIndex())).toString() : ("" + fDocument.getDocumentPartitioner()); //$NON-NLS-1$
-					partitionerInstanceLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_13 + partitionerText); //$NON-NLS-1$
 				}
 				else {
-					ISelection sel = fTextEditor.getSelectionProvider().getSelection();
-					ITextSelection textSelection = (ITextSelection) sel;
-					fPartitionTable.setInput(fDocument.computePartitioning(textSelection.getOffset(), textSelection.getLength()));
+					partitioningCombo.select(0);
 				}
+				ISelection sel = fTextEditor.getSelectionProvider().getSelection();
+				ITextSelection textSelection = (ITextSelection) sel;
+				fPartitionTable.setInput(TextUtilities.computePartitioning(fDocument, selectedPartitioning, textSelection.getOffset(), textSelection.getLength(), true));
+				String partitionerText = fDocument instanceof IDocumentExtension3 ? ((IDocumentExtension3) fDocument).getDocumentPartitioner(partitioningCombo.getItem(partitioningCombo.getSelectionIndex())).toString() : ("" + fDocument.getDocumentPartitioner()); //$NON-NLS-1$
+				partitionerInstanceLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_13 + partitionerText); //$NON-NLS-1$
 			}
 			catch (BadLocationException e1) {
 				fPartitionTable.setInput(new ITypedRegion[0]);
@@ -659,7 +405,7 @@
 		 * @param composite
 		 * @return
 		 */
-		private Composite createRegionTabContents(SashForm sashForm) {
+		private Composite createRegionsContents(SashForm sashForm) {
 			ISelection sel = fTextEditor.getSelectionProvider().getSelection();
 			final ITextSelection textSelection = (ITextSelection) sel;
 			final List documentRegions = new ArrayList();
@@ -696,10 +442,10 @@
 						children.add(((ITextRegionCollection) parentElement).getRegions().toArray());
 					}
 					if (parentElement instanceof ITextRegion) {
-						children.add(new KeyValuePair(CONTEXT, ((ITextRegion) parentElement).getType()));
-						children.add(new KeyValuePair(START, Integer.toString(((ITextRegion) parentElement).getStart())));
-						children.add(new KeyValuePair(TEXTLENGTH, Integer.toString(((ITextRegion) parentElement).getTextLength())));
-						children.add(new KeyValuePair(LENGTH, Integer.toString(((ITextRegion) parentElement).getLength())));
+						children.add(new Pair(CONTEXT, ((ITextRegion) parentElement).getType()));
+						children.add(new Pair(START, Integer.toString(((ITextRegion) parentElement).getStart())));
+						children.add(new Pair(TEXTLENGTH, Integer.toString(((ITextRegion) parentElement).getTextLength())));
+						children.add(new Pair(LENGTH, Integer.toString(((ITextRegion) parentElement).getLength())));
 					}
 					if (parentElement instanceof ITextRegionList) {
 						children.add(Arrays.asList(((ITextRegionList) parentElement).toArray()));
@@ -727,7 +473,7 @@
 				}
 
 				public boolean hasChildren(Object element) {
-					return !(element instanceof KeyValuePair);
+					return !(element instanceof Pair);
 				}
 
 				public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
@@ -735,8 +481,8 @@
 			});
 			tree.setLabelProvider(new LabelProvider() {
 				public String getText(Object element) {
-					if (element instanceof KeyValuePair)
-						return ((KeyValuePair) element).fKey.toString().toLowerCase() + ": " + ((KeyValuePair) element).fValue; //$NON-NLS-1$
+					if (element instanceof Pair)
+						return ((Pair) element).fKey.toString().toLowerCase() + ": " + ((Pair) element).fValue; //$NON-NLS-1$
 					if (element instanceof IStructuredDocumentRegion) {
 						IStructuredDocumentRegion documentRegion = (IStructuredDocumentRegion) element;
 						int packageNameLength = documentRegion.getClass().getPackage().getName().length();
@@ -759,16 +505,14 @@
 				}
 			});
 			tree.setInput(fDocument);
-
-
 			final Text displayText = new Text(sashForm, SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY | SWT.BORDER);
 			displayText.setBackground(sashForm.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
 			tree.addSelectionChangedListener(new ISelectionChangedListener() {
 				public void selectionChanged(SelectionChangedEvent event) {
 					if (event.getSelection() instanceof IStructuredSelection) {
 						Object o = ((IStructuredSelection) event.getSelection()).getFirstElement();
-						if (o instanceof KeyValuePair)
-							displayText.setText(((KeyValuePair) o).fValue.toString());
+						if (o instanceof Pair)
+							displayText.setText(((Pair) o).fValue.toString());
 						else if (o instanceof ITextSelection) {
 							ITextSelection text = (ITextSelection) o;
 							try {
@@ -778,10 +522,6 @@
 								displayText.setText(""); //$NON-NLS-1$
 							}
 						}
-						else if (o instanceof ITextRegionCollection) {
-							ITextRegionCollection region = (ITextRegionCollection) o;
-							displayText.setText(region.getFullText());
-						}
 						else
 							displayText.setText("" + o); //$NON-NLS-1$
 					}
@@ -790,212 +530,78 @@
 			sashForm.setWeights(new int[]{3, 2});
 			return sashForm;
 		}
+	}
 
-		private void fillSelectionTabContents(Composite area, ISelection sel) {
-			area.setLayout(new GridLayout());
-			area.setLayoutData(new GridData());
+	class MarkerAnnotationPropertySource implements IPropertySource {
+		MarkerAnnotation fMarkerAnnotation = null;
+		IPropertyDescriptor[] fDescriptors = null;
 
-			Label typeName = new Label(area, SWT.WRAP);
-			typeName.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-			typeName.setText("Class: " + sel.getClass().getName());
+		public MarkerAnnotationPropertySource(MarkerAnnotation markerAnnotation) {
+			super();
+			fMarkerAnnotation = markerAnnotation;
+		}
 
-			if (sel instanceof IStructuredSelection) {
-				(new Label(area, SWT.NONE)).setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
-				SashForm structuredSashForm = new SashForm(area, SWT.NONE);
-				structuredSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-				structuredSashForm.setOrientation(SWT.VERTICAL);
+		public Object getEditableValue() {
+			return null;
+		}
 
-				final TableViewer structuredSelectionTable = new TableViewer(structuredSashForm, SWT.FULL_SELECTION | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-
-				structuredSelectionTable.getTable().setHeaderVisible(true);
-				structuredSelectionTable.getTable().setLinesVisible(true);
-
-				structuredSelectionTable.setLabelProvider(new ITableLabelProvider() {
-					public void addListener(ILabelProviderListener listener) {
+		public IPropertyDescriptor[] getPropertyDescriptors() {
+			if (fDescriptors == null) {
+				try {
+					Map attrs = fMarkerAnnotation.getMarker().getAttributes();
+					Object[] keys = attrs.keySet().toArray();
+					fDescriptors = new IPropertyDescriptor[keys.length];
+					for (int i = 0; i < keys.length; i++) {
+						TextPropertyDescriptor descriptor = new TextPropertyDescriptor(keys[i].toString(), keys[i].toString());
+						fDescriptors[i] = descriptor;
 					}
+				}
+				catch (CoreException e) {
+					e.printStackTrace();
+				}
+			}
+			return fDescriptors;
+		}
 
-					public void dispose() {
-					}
+		public Object getPropertyValue(Object id) {
+			return fMarkerAnnotation.getMarker().getAttribute(id.toString(), ""); //$NON-NLS-1$
+		}
 
-					public Image getColumnImage(Object element, int columnIndex) {
-						return null;
-					}
+		public boolean isPropertySet(Object id) {
+			return fMarkerAnnotation.getMarker().getAttribute(id.toString(), null) != null;
+		}
 
-					public String getColumnText(Object element, int columnIndex) {
-						String text = null;
-						if (element != null) {
-							switch (columnIndex) {
-								case 0 : {
-									text = String.valueOf(((List) structuredSelectionTable.getInput()).indexOf(element));
-								}
-									break;
-								case 1 : {
-									text = element.getClass().getName();
-								}
-									break;
-								case 2 : {
-									text = element.toString();
-								}
-									break;
-								default :
-									text = ""; //$NON-NLS-1$
-							}
-						}
-						return text;
-					}
-
-					public boolean isLabelProperty(Object element, String property) {
-						return false;
-					}
-
-					public void removeListener(ILabelProviderListener listener) {
-					}
-				});
-
-				TableLayout tlayout = new TableLayout();
-				tlayout.addColumnData(new ColumnWeightData(7, true));
-				tlayout.addColumnData(new ColumnWeightData(28, true));
-				tlayout.addColumnData(new ColumnWeightData(50, true));
-				structuredSelectionTable.getTable().setLayout(tlayout);
-
-				TableColumn tc = new TableColumn(structuredSelectionTable.getTable(), SWT.NONE);
-				tc.setText("Item"); //$NON-NLS-1$
-				tc.setResizable(true);
-				tc.setWidth(40);
-
-				tc = new TableColumn(structuredSelectionTable.getTable(), SWT.NONE);
-				tc.setText("Class"); //$NON-NLS-1$
-				tc.setResizable(true);
-				tc.setWidth(40);
-
-				tc = new TableColumn(structuredSelectionTable.getTable(), SWT.NONE);
-				tc.setText("Text"); //$NON-NLS-1$
-				tc.setResizable(true);
-				tc.setWidth(40);
-
-				structuredSelectionTable.setContentProvider(new ArrayContentProvider());
-				final List input = ((IStructuredSelection) sel).toList();
-				structuredSelectionTable.setInput(input);
-
-				final TreeViewer infoTree = new TreeViewer(structuredSashForm, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-				infoTree.setLabelProvider(new LabelProvider() {
-					public Image getImage(Object element) {
-						if (element instanceof TreeViewer && infoTree.getInput() instanceof INodeNotifier) {
-							IJFaceNodeAdapter adapter = (IJFaceNodeAdapter) ((INodeNotifier) infoTree.getInput()).getAdapterFor(IJFaceNodeAdapter.class);
-							if (adapter != null) {
-								return adapter.getLabelImage((infoTree.getInput()));
-							}
-						}
-						return super.getImage(element);
-					}
-
-					public String getText(Object element) {
-						if (element instanceof Class) {
-							return "Class: " + ((Class) element).getName();
-						}
-						if (element instanceof Collection) {
-							return "Registered Adapters:";
-						}
-						if (element instanceof IRegion) {
-							return "Indexed Region offset span: [" + ((IRegion) element).getOffset() + "-" + ((IRegion) element).getLength() + "]";
-						}
-						if (element instanceof TreeViewer && infoTree.getInput() instanceof INodeNotifier) {
-							IJFaceNodeAdapter adapter = (IJFaceNodeAdapter) ((INodeNotifier) infoTree.getInput()).getAdapterFor(IJFaceNodeAdapter.class);
-							if (adapter != null) {
-								return adapter.getLabelText((infoTree.getInput()));
-							}
-						}
-						return super.getText(element);
-					}
-				});
-				infoTree.setContentProvider(new ITreeContentProvider() {
-					public void dispose() {
-					}
-
-					public Object[] getChildren(Object parentElement) {
-						if (parentElement instanceof Collection)
-							return ((Collection) parentElement).toArray();
-						return new Object[0];
-					}
-
-					public Object[] getElements(Object inputElement) {
-						List elements = new ArrayList(4);
-						if (inputElement != null) {
-							if (inputElement instanceof INodeNotifier && ((INodeNotifier) inputElement).getAdapterFor(IJFaceNodeAdapter.class) != null) {
-								elements.add(infoTree);
-							}
-							elements.add(inputElement.getClass());
-							if (inputElement instanceof IndexedRegion) {
-								elements.add(new Region(((IndexedRegion) inputElement).getStartOffset(), ((IndexedRegion) inputElement).getEndOffset()));
-							}
-							if (inputElement instanceof INodeNotifier) {
-								elements.add(((INodeNotifier) inputElement).getAdapters());
-							}
-						}
-						return elements.toArray();
-					}
-
-					public Object getParent(Object element) {
-						return null;
-					}
-
-					public boolean hasChildren(Object element) {
-						return element instanceof Collection;
-					}
-
-					public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-					}
-				});
-
-				structuredSelectionTable.addSelectionChangedListener(new ISelectionChangedListener() {
-					public void selectionChanged(SelectionChangedEvent event) {
-						int selectionIndex = structuredSelectionTable.getTable().getSelectionIndex();
-						if (selectionIndex != -1) {
-							infoTree.setInput(input.get(selectionIndex));
-						}
-						else {
-							infoTree.setInput(event.getSelectionProvider().getSelection());
-						}
-						infoTree.expandToLevel(2);
-					}
-				});
-
-				structuredSashForm.setWeights(new int[]{3, 2});
+		public void resetPropertyValue(Object id) {
+			try {
+				fMarkerAnnotation.getMarker().getAttributes().remove(id);
+			}
+			catch (CoreException e) {
+				e.printStackTrace();
 			}
 		}
 
-		private String getLineNumber(Annotation annotation) {
-			int line = -1;
-			if (annotation instanceof MarkerAnnotation) {
-				line = MarkerUtilities.getLineNumber(((MarkerAnnotation) annotation).getMarker());//$NON-NLS-1$
+		public void setPropertyValue(Object id, Object value) {
+			try {
+				fMarkerAnnotation.getMarker().setAttribute(id.toString(), value);
 			}
-			else {
-				IAnnotationModel annotationModel = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput());
-				Position p = annotationModel.getPosition(annotation);
-				if (p != null && !p.isDeleted()) {
-					try {
-						line = fDocument.getLineOfOffset(p.getOffset());
-					}
-					catch (BadLocationException e) {
-					}
-				}
+			catch (CoreException e) {
+				e.printStackTrace();
 			}
-			return Integer.toString(line);
 		}
 	}
 
-	static class KeyValuePair {
+	static class Pair {
 		Object fKey;
 		String fValue;
 
-		public KeyValuePair(Object key, String value) {
+		public Pair(Object key, String value) {
 			fKey = key;
 			fValue = value;
 		}
 	}
 
-	class ShowEditorInformationAction extends Action {
-		public ShowEditorInformationAction() {
+	class ShowPartitionAction extends Action {
+		public ShowPartitionAction() {
 			super();
 		}
 
@@ -1010,7 +616,7 @@
 		}
 	}
 
-	IAction fShowEditorInformationAction = new ShowEditorInformationAction();
+	IAction fShowPartitionAction = new ShowPartitionAction();
 
 	ITextEditor fTextEditor = null;
 
@@ -1032,6 +638,6 @@
 
 	public void setActiveEditor(ITextEditor textEditor) {
 		fTextEditor = textEditor;
-		setActionHandler(fShowEditorInformationAction);
+		setActionHandler(fShowPartitionAction);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/.classpath b/bundles/org.eclipse.wst.xml.core/.classpath
index 16b5963..9ca79ee 100644
--- a/bundles/org.eclipse.wst.xml.core/.classpath
+++ b/bundles/org.eclipse.wst.xml.core/.classpath
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src-contentmodel"/>
-	<classpathentry kind="src" path="src-search"/>
 	<classpathentry kind="src" path="src-validation"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="src-catalog"/>
diff --git a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 9ac37bc..0000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:38:57 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
index 69bdebb..e4488b8 100644
--- a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
@@ -2,59 +2,55 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xml.core; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.0.2.qualifier
 Bundle-Activator: org.eclipse.wst.xml.core.internal.XMLCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xml.core.internal;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.catalog;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.catalog.provisional;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.cleanup;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement.impl;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement.util;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.annotation;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.basic;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.factory;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.util;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelquery;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.util;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contenttype;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.document;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.emf2xml;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.encoding;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.modelhandler;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.modelquery;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.parser;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.parser.regions;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.preferences;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.propagate;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.contentmodel;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.contenttype;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.document;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.format;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.text;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.regions;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.impl;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.matching;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.quickscan;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.ssemodelquery;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.tasks;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.text;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.text.rules;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validate;x-friends:="com.ibm.etools.emf.event,org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
+Export-Package: org.eclipse.wst.xml.core.internal,
+ org.eclipse.wst.xml.core.internal.catalog,
+ org.eclipse.wst.xml.core.internal.catalog.provisional,
+ org.eclipse.wst.xml.core.internal.cleanup,
+ org.eclipse.wst.xml.core.internal.commentelement,
+ org.eclipse.wst.xml.core.internal.commentelement.impl,
+ org.eclipse.wst.xml.core.internal.commentelement.util,
+ org.eclipse.wst.xml.core.internal.contentmodel,
+ org.eclipse.wst.xml.core.internal.contentmodel.annotation,
+ org.eclipse.wst.xml.core.internal.contentmodel.basic,
+ org.eclipse.wst.xml.core.internal.contentmodel.factory,
+ org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation,
+ org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl,
+ org.eclipse.wst.xml.core.internal.contentmodel.internal.util,
+ org.eclipse.wst.xml.core.internal.contentmodel.modelquery,
+ org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension,
+ org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl,
+ org.eclipse.wst.xml.core.internal.contentmodel.util,
+ org.eclipse.wst.xml.core.internal.contenttype,
+ org.eclipse.wst.xml.core.internal.document,
+ org.eclipse.wst.xml.core.internal.emf2xml,
+ org.eclipse.wst.xml.core.internal.encoding,
+ org.eclipse.wst.xml.core.internal.modelhandler,
+ org.eclipse.wst.xml.core.internal.modelquery,
+ org.eclipse.wst.xml.core.internal.parser,
+ org.eclipse.wst.xml.core.internal.parser.regions,
+ org.eclipse.wst.xml.core.internal.preferences,
+ org.eclipse.wst.xml.core.internal.propagate,
+ org.eclipse.wst.xml.core.internal.provisional,
+ org.eclipse.wst.xml.core.internal.provisional.contentmodel,
+ org.eclipse.wst.xml.core.internal.provisional.contenttype,
+ org.eclipse.wst.xml.core.internal.provisional.document,
+ org.eclipse.wst.xml.core.internal.provisional.format,
+ org.eclipse.wst.xml.core.internal.provisional.text,
+ org.eclipse.wst.xml.core.internal.regions,
+ org.eclipse.wst.xml.core.internal.ssemodelquery,
+ org.eclipse.wst.xml.core.internal.tasks,
+ org.eclipse.wst.xml.core.internal.text,
+ org.eclipse.wst.xml.core.internal.text.rules,
+ org.eclipse.wst.xml.core.internal.validate,
  org.eclipse.wst.xml.core.internal.validation,
  org.eclipse.wst.xml.core.internal.validation.core,
  org.eclipse.wst.xml.core.internal.validation.core.logging,
  org.eclipse.wst.xml.core.internal.validation.eclipse,
- org.eclipse.wst.xml.core.text,
+ org.eclipse.wst.xml.core.internal.validation.errorcustomization,
  org.w3c.dom,
  org.w3c.dom.ranges,
  org.w3c.dom.traversal
@@ -62,6 +58,7 @@
  org.eclipse.wst.sse.core,
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
+ org.eclipse.core.filebuffers,
  org.eclipse.text,
  org.eclipse.wst.common.uriresolver,
  org.eclipse.wst.validation,
@@ -69,6 +66,6 @@
  org.eclipse.emf.ecore.edit;resolution:=optional,
  org.eclipse.wst.common.emf;resolution:=optional,
  org.eclipse.emf.ecore.xmi;resolution:=optional,
- org.eclipse.wst.common.emfworkbench.integration;resolution:=optional,
- org.eclipse.wst.common.core
-Eclipse-LazyStart: true; exceptions="org.eclipse.wst.xml.core.internal.contenttype"
+ org.eclipse.wst.common.emfworkbench.integration;resolution:=optional
+ 
+Eclipse-AutoStart: true; exceptions="org.eclipse.wst.xml.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.xml.core/build.properties b/bundles/org.eclipse.wst.xml.core/build.properties
index 0f668a7..8b7f886 100644
--- a/bundles/org.eclipse.wst.xml.core/build.properties
+++ b/bundles/org.eclipse.wst.xml.core/build.properties
@@ -12,6 +12,7 @@
 ###############################################################################
 bin.includes = plugin.xml,\
                .options,\
+               extensions.xml,\
                plugin.properties,\
                META-INF/,\
                .,\
@@ -20,7 +21,8 @@
 bin.excludes = bin/**,\
                @dot/**,\
                temp.folder/**
-src.includes = component.xml,\
+src.includes = extensions.xml,\
+               component.xml,\
                build.properties,\
                schema/,\
                DevTimeSupport/
@@ -28,7 +30,6 @@
            src-contentmodel/,\
            src-validation/,\
            src/,\
-           src-emfModelSynch/,\
-           src-search/
+           src-emfModelSynch/
 
 output.. = bin/
diff --git a/bundles/org.eclipse.wst.xml.core/plugin.properties b/bundles/org.eclipse.wst.xml.core/plugin.properties
index 1532f88..837cda4 100644
--- a/bundles/org.eclipse.wst.xml.core/plugin.properties
+++ b/bundles/org.eclipse.wst.xml.core/plugin.properties
@@ -12,6 +12,7 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=Structured Source XML Model
+nlFeatureName=Structured Source XML Model NL Support
 Structured_XML_Document_Factory_Extension.name=Structured XML Document Factory Extension
 XML_Content_Type_Extension_Element.name=XML (Illformed)
 # contentmodel strings
@@ -19,6 +20,7 @@
 Content_Model_Annotation_Files_Extension.name=Content Model Annotation Files
 Model_Query_Extension.name=Model Query Extension
 XML_Catalog_Contributions_Extension_Point.name=XML Catalog Contributions Extension Point
+XML_Catalog_Contributor_Extension_Point.name=XML Catalog Contributor Extension Point
 XSL_Content_Type_Extension_Element.name=XSL
 XMI_Content_Type=XMI
-XML_Validator.name=XML Validator
+XML_Validation_Error_Customizer.name=XML Validator Error Customizer Extension Point
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/plugin.xml b/bundles/org.eclipse.wst.xml.core/plugin.xml
index 441734e..4a8f4c4 100644
--- a/bundles/org.eclipse.wst.xml.core/plugin.xml
+++ b/bundles/org.eclipse.wst.xml.core/plugin.xml
@@ -2,6 +2,10 @@
 <?eclipse version="3.0"?>
 <plugin>
 
+   <!-- An extension for contributing a XML validation error customizer. -->
+   <extension-point id="errorCustomizer" name="%XML_Validation_Error_Customizer.name" schema="schema/errorCustomizer.exsd"/>
+
+
 	<extension point="org.eclipse.wst.sse.core.modelHandler">
 		<modelHandler
 			default="true"
@@ -161,56 +165,5 @@
           context="Headless">
       </uiContextSensitiveClass>
   </extension>
-  <!-- ====================================================== -->
-	<!-- Register the XML validator with the validation 		-->
-	<!-- framework. 										    -->
-	<!-- ====================================================== -->
- <extension
- id="xmlValidator"
-		name="%XML_Validator.name"
-       point="org.eclipse.wst.validation.validator">
-    <validator>
-    <!-- There is a custom XML validator for EJBs -->
-			<projectNature
-				include="false"
-				id="org.eclipse.jst.j2ee.ejb.EJBNature">
-			</projectNature>
-			<!-- There is a custom XML validator for EARs -->
-			<projectNature
-				include="false"
-				id="org.eclipse.jst.j2ee.EARNature">
-			</projectNature>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.xml">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.gph">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.wdo-connections">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.tld" />
-				
-    <helper
-				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
-			</helper>
-			
-       <run
-             async="true"
-             class="org.eclipse.wst.xml.core.internal.validation.eclipse.Validator"
-             enabled="true"
-             fullBuild="true"
-             incremental="true"/>
-    </validator>
- </extension>
 
 </plugin>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd b/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd
new file mode 100644
index 0000000..608f190
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd
@@ -0,0 +1,123 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.xml.core">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.xml.core" id="errorCustomizer" name="XML Validation Error Customizer"/>
+      </appInfo>
+      <documentation>
+         The error customizer extension point allows a client to contribute an error customizer for a specific namespace. The error customizer can provide error messages that are more domain specific than the generic error messages provided by the underlying generic XML validator.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="errorCustomizer" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  a fully qualified identifier of the target extension point
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  an optional identifier of the extension instance
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  an optional name of the extension instance
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="errorCustomizer">
+      <complexType>
+         <attribute name="namespace" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The namespace for which this error customizer will consider error customizations.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The class that implements &lt;code&gt;org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer&lt;/code&gt;.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         The following is an example of an Error Customizer contribution:
+&lt;pre&gt;
+   &lt;extension
+         id=&quot;sampleErrorCustomizer&quot;
+         name=&quot;Sample Error Customizer&quot;
+         point=&quot;org.eclipse.wst.xml.core.errorCustomizer&quot;&gt;
+      &lt;errorCustomizer
+            namespace=&quot;http://sample.namespace&quot;
+            class=&quot;org.eclipse.wst.xml.core.SampleErrorCustomizer&quot;/&gt;
+   &lt;/extension&gt;
+&lt;/pre&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         The supplied class must implement &lt;code&gt;org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer&lt;/code&gt;.
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
+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 &lt;a
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
index d8f356d..13c6d25 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
@@ -76,45 +76,33 @@
   }
   
   public static String resolvePath(URL platformURL, String path) 
-  {      
-	String fileLocation = path;
-	int jarPathStart = path.indexOf("jar:");
-	jarPathStart = jarPathStart < 0 ? 0 : jarPathStart + "jar:".length();
-	int jarPathEnd = path.indexOf("!");
-	jarPathEnd = jarPathEnd < 0 ? path.length() : jarPathEnd;
-	fileLocation = path.substring(jarPathStart, jarPathEnd);
-	
-	String result = path;
-	String resolvedLocation = fileLocation;
-	URL resolvedURL = null;
-    if (fileLocation.startsWith("platform:/plugin")) //$NON-NLS-1$
+  {         
+    if (path.startsWith("platform:/plugin")) //$NON-NLS-1$
     {
       // this is the speclial case, where the resource is located relative 
       // to another plugin (not the one that declares the extension point)
       //
+		URL resolvedURL;
 		try
 		{
-			resolvedURL = Platform.resolve(new URL(fileLocation));
+			resolvedURL = Platform.resolve(new URL(path));
+			return resolvedURL.toString();
 		} catch (IOException e)
 		{
-			// do nothing
-		} 
+			return path;
+		}
+      
     }
-    else{
-    	 // this is the typical case, where the resource is located relative
-        // to the plugin that declares the extension point
-    	 try {
-    	     	resolvedURL = new URL(Platform.resolve(platformURL), fileLocation);
-    	 } catch (IOException e) {
-    	    	// do nothing
-    	 }
+    // this is the typical case, where the resource is located relative
+    // to the plugin that declares the extension point
+    try {
+    	URL resolvedURL = Platform.resolve(platformURL);
+    	URL absoluteURL = new URL(resolvedURL, path);
+    	return absoluteURL.toString();
+    } catch (IOException e) {
+    	return path;
     }
-   
-   if(resolvedURL != null){
-    	resolvedLocation = resolvedURL.toExternalForm().replace('\\', '/');
-    	result = result.replaceFirst(fileLocation, resolvedLocation);
-    }
-    return result;
+     
   }
   
   public static URL getPlatformURL(String pluginId){
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
index a740250..e17cd65 100644
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
+++ b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
@@ -36,12 +36,12 @@
 import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities;
 import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
 import org.eclipse.wst.common.internal.emfworkbench.integration.ResourceSetWorkbenchEditSynchronizer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
 import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.document.DocumentTypeImpl;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java
deleted file mode 100644
index 6c1dcde..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public abstract class ComponentSearchContributor  {
-
-	protected HashMap declarations;
-
-	protected HashMap references;
-
-	protected String[] namespaces;
-
-	public ComponentSearchContributor() {
-		super();
-	}
-
-	public XMLSearchPattern getDeclarationPattern(QualifiedName componentName) {
-		return (XMLSearchPattern) getDeclarations().get(componentName);
-	}
-
-	protected Map getDeclarations() {
-		if (declarations == null) {
-			initializeDeclarations();
-		}
-		return declarations;
-	}
-
-	protected Map getReferences() {
-		if (references == null) {
-			initializeReferences();
-		}
-		return references;
-	}
-
-	public XMLSearchPattern[] getReferencesPatterns(QualifiedName componentName) {
-		List references = (List) getReferences().get(componentName);
-		if (references != null) {
-			return (XMLSearchPattern[]) references
-					.toArray(new XMLSearchPattern[references.size()]);
-		}
-		return new XMLSearchPattern[0];
-	}
-	
-	
-	public boolean supports(QualifiedName componentName){
-		return getReferencesPatterns(componentName).length > 0 ||
-			getDeclarationPattern(componentName) != null;
-	}
-
-	public String[] getSupportedNamespaces() {
-		return namespaces;
-	}
-
-	protected abstract void initializeDeclarations();
-
-	protected abstract void initializeReferences();
-
-	protected abstract void initializeSupportedNamespaces();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java
deleted file mode 100644
index 6321b7c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-
-public class TargetNamespaceReferencePattern extends SearchPattern {
-	
-	String namespaceURI;
-	
-	public TargetNamespaceReferencePattern(int matchRule, String namespaceuri) {
-		super(matchRule);
-		namespaceURI = namespaceuri;
-	}
-	
-	public TargetNamespaceReferencePattern(String namespaceuri) {
-		super();
-		namespaceURI = namespaceuri;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java
deleted file mode 100644
index 19f475b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public class XMLComponentDeclarationPattern extends XMLComponentSearchPattern {
-
-	public XMLComponentDeclarationPattern(QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(null, elementQName, typeQName, matchRule);
-		
-	}
-
-	public XMLComponentDeclarationPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-	}
-	
-	public XMLComponentDeclarationPattern(QualifiedName elementQName, QualifiedName typeQName) {
-		super(null, elementQName, typeQName);
-	}
-
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java
deleted file mode 100644
index e68a8a4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public class XMLComponentReferencePattern extends XMLComponentSearchPattern{
-
-	public XMLComponentReferencePattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(file, elementQName, typeQName, matchRule);
-		
-	}
-
-	public XMLComponentReferencePattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-		
-	}
-	
-	public XMLComponentReferencePattern(QualifiedName elementQName, QualifiedName typeQName) {
-		super(null, elementQName, typeQName);
-		
-	}
-	
-	
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java
deleted file mode 100644
index 7abd04b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-/**
- * XML component search pattern is a composite pattern that combines XML element pattern.
- *
- */
-public class XMLComponentSearchPattern extends ComponentSearchPattern {
-	
-	/**
-	 * Containing element patterns
-	 */
-	XMLSearchPattern[] children = new XMLSearchPattern[0];
-	
-
-	public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(file, elementQName, typeQName, matchRule);
-		
-	}
-
-
-	public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-		
-	}
-
-	public XMLSearchPattern[] getChildren(){
-		return children;
-	}
-	
-	public void setChildren(XMLSearchPattern[] patterns){
-		children = patterns;
-		
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
deleted file mode 100644
index 6d18c9b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.document.ComponentDeclarationEntry;
-import org.eclipse.wst.common.core.search.document.Entry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.document.SearchDocumentSet;
-import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
-import org.eclipse.wst.common.core.search.pattern.FileReferencePattern;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.ContentTypeSearchScope;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.search.impl.IXMLSearchConstants;
-import org.eclipse.wst.xml.core.internal.search.impl.XMLSearchDocument;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.matching.XMLSearchPatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.quickscan.XMLQuickScan;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- */
-public abstract class XMLSearchParticipant extends SearchParticipant {
-	
-	protected static final boolean debugPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.xml.core.internal.search/perf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	public XMLSearchParticipant() {
-		super();
-	}
-
-	
-	/*
- public  boolean initialize(SearchPattern pattern, String[] contentTypes){
-		
-	    super.initialize(pattern, contentTypes);
-		this.supportedContentTypes = contentTypes;
-		
-		if(pattern instanceof XMLComponentSearchPattern){
-			return true;
-		}
-		return false;
-	}*/
-
-	
-
-	public SearchDocument createSearchDocument(String documentPath) {
-
-		return new XMLSearchDocument(documentPath, this);
-
-	}
-
-	public String getDescription() {
-		return "XML search participant"; //$NON-NLS-1$
-	}
-
-
-
-	private void locateMatches(SearchPattern pattern, SearchDocument document,
-			SearchRequestor requestor, Map searchOptions, IProgressMonitor monitor) {
-
-        // TODO... utilize search options (that should get passed down via the SearchEngine)
-        // to specify if accurate source coordinates are req'd if not, simply use the SAX results
-        //
-        if (pattern.getMatchRule() == SearchPattern.R_PATTERN_MATCH)
-        {          
-          IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(document.getPath()));
-          // TODO.. don't assume the category is COMPONENT_DECL... handle any arbitarty category
-          Entry[] entries = document.getEntries(IXMLSearchConstants.COMPONENT_DECL, null, 0);
-          for (int i = 0; i < entries.length; i++)
-          {
-            // TODO.. don't assume this is just a component declaration entry            
-            ComponentDeclarationEntry entry = (ComponentDeclarationEntry)entries[i];
-            SearchMatch searchMatch = new SearchMatch(null, 0, 0, file);
-            searchMatch.map.put("name", entry.getName());
-            searchMatch.map.put("metaName", entry.getMetaName());
-            try
-            {
-              requestor.acceptSearchMatch(searchMatch);
-            }
-            catch (Exception e)
-            {              
-            }
-          }  
-        }
-        else 
-        {  if (document.getModel() instanceof IDOMModel) {
-			IDOMModel domModel = (IDOMModel) document.getModel();
-			IDOMElement contextNode = (IDOMElement) domModel.getDocument()
-					.getDocumentElement();
-			DOMVisitor visitor = new DOMVisitor(document.getPath(), pattern,
-					requestor);
-			visitor.visit(contextNode);
-		}
-        }
-	}
-	
-	private PatternMatcher getAdapter(Object adaptableObject, Class adapterType) {
-		if (PatternMatcher.class.equals(adapterType) &&
-				(adaptableObject instanceof XMLSearchPattern ||
-				adaptableObject instanceof XMLComponentSearchPattern) ) {
-			return new XMLSearchPatternMatcher();
-		} 
-		return null; 
-	}
-
-	private class DOMVisitor {
-
-		String path;
-		SearchPattern pattern;
-		SearchRequestor requestor;
-		PatternMatcher matcher;
-
-		
-		protected DOMVisitor(String path, SearchPattern pattern,
-				SearchRequestor requestor) {
-			super();
-			this.path = path;
-			this.pattern = pattern;
-			
-			matcher = (PatternMatcher)pattern.getAdapter(PatternMatcher.class);
-			if(matcher == null){
-				matcher = getAdapter(pattern, PatternMatcher.class);
-			}
-			this.requestor = requestor;
-		}
-
-		private void visit(Node node) {
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				match((Element)node);
-				NodeList nodeList = node.getChildNodes();
-				for (int i = 0; i < nodeList.getLength(); i++) {
-					Node aNode = nodeList.item(i);
-					visit(aNode);
-				}
-			}
-		}
-
-		private void match(Element node) {
-			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(
-					new Path(path));
-			if(matcher != null){
-				matcher.locateMatches(pattern, file, node, requestor);
-			}
-
-			
-		}
-
-	}
-
-	public SearchScope selectDocumentLocations(SearchPattern pattern, SearchScope scope, Map searchOptions, IProgressMonitor monitor) {
-		/*
-		 * gate #1: reduce the scope to the files with the content type that
-		 * could be searched using this participant
-		 */ 
-		String[] contentTypes = getSupportedContentTypes();	
-		if(contentTypes != null && contentTypes.length > 0){
-			scope = new ContentTypeSearchScope(scope, contentTypes);
-		}
-		return super.selectDocumentLocations(pattern, scope, searchOptions, monitor);
-	}
-	
-	public abstract ComponentSearchContributor getSearchContributor();
-
-
-	public void beginSearching(SearchPattern pattern, Map searchOptions) {
-		
-		super.beginSearching(pattern, searchOptions);
-		if(pattern instanceof XMLComponentDeclarationPattern){
-			XMLComponentDeclarationPattern componentPattern = (XMLComponentDeclarationPattern)pattern;
-			XMLSearchPattern childPattern = getSearchContributor().getDeclarationPattern(componentPattern.getMetaName());
-			if(childPattern != null){
-					childPattern.setSearchName(componentPattern.getName().getLocalName());
-					childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
-	     			componentPattern.setChildren(new XMLSearchPattern[]{childPattern});
-			}
-			
-		}
-		else if(pattern instanceof XMLComponentReferencePattern){
-			XMLComponentReferencePattern componentPattern = (XMLComponentReferencePattern)pattern;
-			XMLSearchPattern[] childPatterns = getSearchContributor().getReferencesPatterns(componentPattern.getMetaName());
-			for (int i = 0; i < childPatterns.length; i++) {
-				XMLSearchPattern childPattern = childPatterns[i];
-				childPattern.setSearchName(componentPattern.getName().getLocalName());
-				childPattern.setSearchNamespace(componentPattern.getName().getNamespace());				
-			}
-			componentPattern.setChildren(childPatterns);
-			
-		}
-	}
-	
-	
-	/**
-	 * The intend of this method is to limit the search to the files that have content 
-	 * which can be searched for the given pattern. It is called from 
-	 * {@link #selectDocumentLocations(SearchPattern, SearchScope, IProgressMonitor)}
-	 * 
-	 * @param pattern the search pattern that is searched for
-	 * @return content type's unique identifiers that could be searched for the given pattern.
-	 */
-	public abstract String[] getSupportedContentTypes();
-
-	public void populateSearchDocument(SearchDocument document, SearchPattern pattern)
-	{
-		PatternMatcher matcher = (PatternMatcher)pattern.getAdapter(PatternMatcher.class);
-		if(matcher == null){
-			matcher = getAdapter(pattern, PatternMatcher.class);
-		}
-		XMLQuickScan.populateSearchDocument(document, matcher, pattern);		
-	}
-
-	public void locateMatches(SearchDocumentSet documentSet, SearchPattern pattern, SearchScope scope, SearchRequestor requestor, Map searchOptions, IProgressMonitor monitor) throws CoreException
-	{
-		long time = System.currentTimeMillis();
-		
-		// TODO: use the file reference entries in the documents to reduce the scope to the referenced files only
-		// SearchDocument[] documents = documentSet.getSearchDocuments(id);
-                
-        // check to see if the search pattern is qualified by a file location
-        // if this is the case then we can use file scoping rules to prune the matches
-        IFile targetFile = null;
-        if (pattern instanceof ComponentSearchPattern)
-        {
-          ComponentSearchPattern componentSearchPattern = (ComponentSearchPattern)pattern;
-          targetFile = componentSearchPattern.getFile();                                       
-        }		
-        
-		// here we should have in scope only referenced files
-		IFile[] files = scope.enclosingFiles();  
-		for (int i = 0; i < files.length; i++)
-		{
-			IFile file = files[i];
-			String path = file.getLocation().toString();
-			SearchDocument document = documentSet.getSearchDocument(path, id); 
-			if (document != null)
-			{	
-			Entry[] entries = document.getEntries(getSearchEntryCategory(pattern), null, 0);           
-			if(entries != null && entries.length > 0)
-            {
-              //for (int j = 0; j < entries.length; j++)
-              //{
-              //  Entry entry = entries[j];
-                //System.out.println("entry " + entry.getCategory() + " " + entry.getKey() + " " + entry.getClass().getName());                 
-              //}  
-              
-              boolean isInScope = true;
-              if (targetFile != null)
-              {
-                try
-                {
-                  isInScope = isLinked(documentSet, "file:///" + path, "file:///" + targetFile.getLocation().toString());
-                  //if (path.endsWith("CancelSelection.wsdl")  && path.indexOf("clone1") != -1)
-                  //{
-                  //  fileReferenceTable.debug(qualifiedPath, 0, 5);
-                  //}                   
-                }
-                catch (Exception e)
-                {
-                  e.printStackTrace();
-                }
-              }              
-              if (isInScope)
-              { 
-			    this.locateMatches(pattern, document, requestor, searchOptions, monitor);
-              }  
-            }
-			}
-		}
-		
-		
-		if (debugPerf)
-		{
-			System.out
-					.println(""
-							+ getDescription()
-							+ ": " + (System.currentTimeMillis() - time) + "ms for locateMatches"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		
-	}
-    
-    private boolean isLinked(SearchDocumentSet set, String source, String target)
-    {
-      return isLinked(set, source, target, new HashMap());
-    }
-    
-    private boolean isLinked(SearchDocumentSet set, String source, String target, HashMap visited)
-    {
-      if (source.equals(target))
-        return true;
-      
-      String fileProtocol = "file:///";            
-      if (source.startsWith(fileProtocol))
-      {    
-        
-      SearchDocument document = set._tempGetSearchDocumetn(source.substring(fileProtocol.length()));      
-      if (document != null)
-      {        
-        URIResolver uriResolver = URIResolverPlugin.createResolver();        
-        Entry[] entries = document.getEntries(IXMLSearchConstants.REF, null, 0);
-        String[] resolveEntry = new String[entries.length];        
-        for (int j = 0; j < entries.length; j++)
-        {
-          Entry entry = entries[j];
-          if (entry instanceof FileReferenceEntry)
-          {
-            FileReferenceEntry fileReferenceEntry = (FileReferenceEntry)entry;
-            // TODO.. record an utilize the public id from the fileReferenceEntry
-            //
-            if (fileReferenceEntry.getRelativeFilePath() != null)
-            {  
-              String resolvedURI = uriResolver.resolve(source, null, fileReferenceEntry.getRelativeFilePath());
-              resolveEntry[j] = resolvedURI;
-              if (resolvedURI.equals(target))
-              {
-                return true;
-              }             
-            }  
-          }
-        }
-        // now see if there's an indirect link from the source to the target
-        // we keep track of the nodes we've already visited to avoid cycles
-        if (visited.get(source) == null)
-        {
-          visited.put(source, Boolean.TRUE);
-          for (int j = 0; j < entries.length; j++)
-          {                     
-            String resolvedURI = resolveEntry[j];
-            if (resolvedURI != null && isLinked(set, resolveEntry[j], target, visited))                
-              return true;            
-          }    
-        }                      
-      }            
-      } 
-      return false;
-    }
-    
-   
-    
-	public static String getSearchEntryCategory(SearchPattern pattern){
-		if(pattern instanceof XMLComponentDeclarationPattern){
-			return IXMLSearchConstants.COMPONENT_DECL;
-		}
-		else if(pattern instanceof XMLComponentReferencePattern){
-			return IXMLSearchConstants.COMPONENT_REF;
-		}
-		else if(pattern instanceof FileReferencePattern){
-		   return IXMLSearchConstants.COMPONENT_REF;
-		}
-		return null;
-	}   
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java
deleted file mode 100644
index 1fb55d7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-
-public class XMLSearchPattern extends SearchPattern{
-	
-	private String elementNamespace = null;
-	private String elementName = null;
-	private String attributeName = null;
-	private String searchName = null;
-	private String searchNamespace = null;
-	
-	public XMLSearchPattern(String elementNamespace, String elementName, String attributeName) {
-		super();
-		this.attributeName = attributeName;
-		this.elementName = elementName;
-		this.elementNamespace = elementNamespace;
-	}
-	
-	public XMLSearchPattern(){
-		
-	}
-	
-	public String getAttributeName() {
-		return attributeName;
-	}
-
-	public String getElementName() {
-		return elementName;
-	}
-
-	public String getElementNamespace() {
-		return elementNamespace;
-	}
-
-	public String getSearchName() {
-		return searchName;
-	}
-
-	public String getSearchNamespace() {
-		return searchNamespace;
-	}
-
-	public void setSearchName(String searchName) {
-		this.searchName = searchName;
-	}
-
-	public void setSearchNamespace(String searchNamespace) {
-		this.searchNamespace = searchNamespace;
-	}
-
-	public void setAttributeName(String attributeName) {
-		this.attributeName = attributeName;
-	}
-
-	public void setElementName(String elementName) {
-		this.elementName = elementName;
-	}
-
-	public void setElementNamespace(String elementNamespace) {
-		this.elementNamespace = elementNamespace;
-	}
-	
-
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java
deleted file mode 100644
index d160d81..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-public interface IXMLSearchConstants
-{
-		String REF= "outLink"; //$NON-NLS-1$
-		String COMPONENT_DECL = "componentDecl"; //$NON-NLS-1$
-		String COMPONENT_REF = "componentDecl"; //$NON-NLS-1$
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java
deleted file mode 100644
index d7ae22f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-import java.text.MessageFormat;
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-	
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.search.messages";//$NON-NLS-1$
-
-	
-	static {
-		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
-	}
-	private Messages() {
-		// Do not instantiate
-	}
-	
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @return the manipulated String
-	 */
-	public static String bind(String message) {
-		return bind(message, null);
-	}
-	
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param binding the object to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object binding) {
-		return bind(message, new Object[] {binding});
-	}
-
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param binding1 An object to be inserted into the message
-	 * @param binding2 A second object to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object binding1, Object binding2) {
-		return bind(message, new Object[] {binding1, binding2});
-	}
-
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param bindings An array of objects to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object[] bindings) {
-		return MessageFormat.format(message, bindings);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java
deleted file mode 100644
index 013daaf..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.core.search.document.Entry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
-
-public class XMLSearchDocument extends SearchDocument {
-	
-	IDOMModel model;
-	Map entries = new HashMap(); // category -> set (entry)	
-
-	public XMLSearchDocument(String documentPath, XMLSearchParticipant participant) {
-		super(documentPath, participant);
-	}
-
-	public Object getModel() {
-		if(model == null){
-            //System.out.println("creating DOM for " + getPath());
-			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(getPath()));
-			if(file != null){
-				try {
-					model = (IDOMModel)StructuredModelManager.getModelManager().getModelForRead(file);
-				} catch (IOException e) {
-					e.printStackTrace();
-				} catch (CoreException e) {
-					e.printStackTrace();
-				}
-			
-			}
-		}
-		return model;
-	}
-
-	public Entry[] getEntries(String category, String key, int matchRule)
-	{
-		// TODO use matchRule
-		Set results = new HashSet();
-		if(category != null){
-			Set values = (Set)entries.get(category);
-			if(values == null){
-				return new Entry[0];
-			}
-			if(key == null || "".equals(key) || "*".equals(key)){
-				// entries with any key in the given category
-				results.addAll(values);
-			}
-			else{
-				// entries with the specified key in the given category
-				for (Iterator iter = values.iterator(); iter.hasNext();)
-				{
-					Entry entry = (Entry) iter.next();
-					if(key.equals(entry.getKey())){
-						results.add(entry);
-					}
-				}
-			}
-			
-		}
-		return (Entry[]) results.toArray(new Entry[results.size()]);
-	}
-
-	public void putEntry(Entry entry)
-	{
-		if(entry.getCategory() != null){
-			Set values = (Set)entries.get(entry.getCategory());
-			if(values == null){
-				entries.put(entry.getCategory(), values=new HashSet());
-			}
-			values.add(entry);
-		}
-		
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java
deleted file mode 100644
index 7590f57..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * This class contains matching implementation.  
- * <p>
- * Subclasses of the PatternMatches should provide an implementation of the specific pattern matching.
- * </p>
- * <p>
- * Subclasses of the PatternMatches should be set as adapters for the patterns that they match.
- * </p>
- * An implementation of {@link SearchParticipant#selectDocumentLocations()} will call 
- * { @link PatternMatcher#matches() } on the adapter on pattern matcher.
- * 
- * An implementation of {@link SearchParticipant#locateMatches()} will call 
- * { @link PatternMatcher#locateMatches() } on the adapter on pattern matcher.
- *
- */
-public abstract class PatternMatcher {
-	
-	
-	/**
-	 * This method does dive actual match location to the requestor if there are matches
-	 */
-	public abstract void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor);
-
-	/**
-	 * This method only answers if the pattern matches element, it does not give actual match location
-	 */
-	public abstract boolean matches(SearchPattern pattern, Object element);
-    
-    protected SearchMatch createSearchMatch(IFile file, Attr attributeNode)
-    {
-        int start = 0;
-        int length = 0;
-        if(attributeNode instanceof IDOMAttr){
-            IDOMAttr domAttr = (IDOMAttr)attributeNode;
-            start = domAttr.getValueRegionStartOffset();
-            length = domAttr.getValueRegionText().length();
-        }
-        SearchMatch match = new SearchMatch(attributeNode, start, length, file);
-        return match;
-    }
-	
-	protected void addMatch(SearchPattern pattern, IFile file, Attr attributeNode, SearchRequestor requestor) {
-        //System.out.println("addMatch " + pattern + " " + attributeNode.getName() + "=" + attributeNode.getValue());
-		if (attributeNode != null) {
-				SearchMatch match = createSearchMatch(file, attributeNode);                
-				if(requestor != null){
-					try {
-						requestor.acceptSearchMatch(match);
-					} catch (CoreException e) {
-						//do nothing
-					}
-				}
-		}
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java
deleted file mode 100644
index 330d144..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.xml.sax.Attributes;
-
-public class SAXSearchElement{
-	Attributes attributes;
-	String elementName;
-	String elementNamespace;
-	Map namespaceMap = new HashMap(); // Map of string prefix keys and namespace
-	String targetNamespace = "";
-	
-	public SAXSearchElement() {
-		super();
-	}
-	public Attributes getAttributes() {
-		return attributes;
-	}
-	public String getElementName() {
-		return elementName;
-	}
-	public String getElementNamespace() {
-		return elementNamespace;
-	}
-	public Map getNamespaceMap() {
-		return namespaceMap;
-	}
-	public String getTargetNamespace() {
-		return targetNamespace;
-	}
-	public void setAttributes(Attributes attributes) {
-		this.attributes = attributes;
-	}
-	public void setElementName(String elementName) {
-		this.elementName = elementName;
-	}
-	public void setElementNamespace(String elementNamespace) {
-		this.elementNamespace = elementNamespace;
-	}
-	public void setNamespaceMap(Map namespaceMap) {
-		this.namespaceMap = namespaceMap;
-	}
-	public void setTargetNamespace(String targetNamespace) {
-		this.targetNamespace = targetNamespace;
-	}
-	
-	
-	
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java
deleted file mode 100644
index 5723060..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XMLSearchPatternMatcher extends PatternMatcher{
-	
-
-	protected String computeNamespaceForPrefix(Element element, String prefix)
-	{
-	  String result = null;
-	  for (Node node = element; node != null; node = node.getParentNode())
-	  {
-		if (node.getNodeType() == Node.ELEMENT_NODE)
-		{
-		  Element e = (Element)node;
-		  String attributeName = (prefix != null && prefix.length() > 0) ? ("xmlns:" + prefix) : "xmlns"; 
-		  result = e.getAttribute(attributeName);
-		  if (result != null)
-		  {
-			 break;  
-		  }	  
-		}	
-	  }	  
-	  return result;
-	}
-	
-
-	protected void initialize(XMLSearchPattern pattern, Element domElement) {
-	
-			pattern.setElementName(domElement.getLocalName());
-			pattern.setElementNamespace(domElement.getNamespaceURI());
-			String actualValue = domElement.getAttribute(pattern.getAttributeName());
-			 if(actualValue != null){
-					int n = actualValue.indexOf(":");
-					if(n > 0){
-						String prefix = actualValue.substring(0, n);
-						pattern.setSearchName(actualValue.substring(n+1));      
-						
-						String namespace = computeNamespaceForPrefix(domElement, prefix);
-						pattern.setSearchNamespace(namespace);
-					
-					}
-					else {
-						pattern.setSearchName(actualValue);
-						pattern.setSearchNamespace(domElement.getOwnerDocument().getDocumentElement().getAttribute("targetNamespace"));
-					}
-			    }
-		
-	}
-	
-	protected void initialize(XMLSearchPattern pattern, SAXSearchElement saxElement) {
-		
-		pattern.setElementName(saxElement.getElementName());
-		pattern.setElementNamespace(saxElement.getElementNamespace());
-		String actualValue = saxElement.getAttributes().getValue(pattern.getAttributeName());
-		 if(actualValue != null){
-				int n = actualValue.indexOf(":");
-				if(n > 0){
-					String prefix = actualValue.substring(0, n);
-					pattern.setSearchName(actualValue.substring(n+1));
-					pattern.setSearchNamespace((String)saxElement.getNamespaceMap().get(prefix));
-				
-				}
-				else {
-					pattern.setSearchName(actualValue);
-					pattern.setSearchNamespace(saxElement.getTargetNamespace());
-				}
-		    }
-	
-	}
-	
-	XMLSearchPattern searchPattern;
-	
-	public XMLSearchPatternMatcher() {
-		super();
-		
-	}
-
-	
-
-	
-	/**
-	 * This method does dive actual match location to the requestor if there are matches
-	 */
-	
-	public void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor) {
-		if(pattern instanceof XMLComponentSearchPattern){
-			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren();
-			for (int i = 0; i < childPatterns.length; i++) {
-				PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
-				if(matcher == null){
-					matcher = this;
-				}
-				if(matcher != null){
-					matcher.locateMatches(childPatterns[i], file, element, requestor);
-				}
-			}
-		}
-		else if(pattern instanceof XMLSearchPattern){
-			if(matches(pattern, element)){
-				Attr attribute = element.getAttributeNode(((XMLSearchPattern)pattern).getAttributeName());
-				addMatch(pattern, file, attribute, requestor);
-			}
-		
-		}
-	}
-	
-	/**
-	 * This method only answers if the pattern matches element, it does not give actual match location
-	 */
-	public boolean matches(SearchPattern pattern, Object element){
-		if(pattern instanceof XMLComponentSearchPattern){
-			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren();
-			for (int i = 0; i < childPatterns.length; i++) {
-				PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
-				if(matcher == null){
-					matcher = this;
-				}
-				if(matcher != null){
-					if(matcher.matches(childPatterns[i], element)){
-						return true;
-					}
-				}
-				
-			}
-		}
-		else if(pattern instanceof XMLSearchPattern){
-			
-			XMLSearchPattern possibleMatch = new XMLSearchPattern();
-			possibleMatch.setAttributeName(((XMLSearchPattern)pattern).getAttributeName());
-			if(element instanceof Element){
-				initialize(possibleMatch, (Element)element);
-			}
-			else if(element instanceof SAXSearchElement){
-				initialize(possibleMatch, (SAXSearchElement)element);
-			}
-			searchPattern = (XMLSearchPattern)pattern;
-			return matchesPattern(possibleMatch);
-		}
-		return false;
-	}
-	
-	protected boolean matchesPattern(SearchPattern pattern) {
-		if(searchPattern != null && pattern instanceof XMLSearchPattern){
-			XMLSearchPattern decodedPattern = (XMLSearchPattern)pattern;
-            if(searchPattern.getElementName().equals(decodedPattern.getElementName()) &&
-					searchPattern.getElementNamespace().equals(decodedPattern.getElementNamespace())){
-				if(searchPattern.getSearchName() == null)
-                {  
-                  return false;
-                }
-                else if ("*".equals(searchPattern.getSearchName()))
-                {
-                  return true;
-                }  
-                else if(searchPattern.getSearchNamespace() == null){
-					return searchPattern.getSearchName().equals(decodedPattern.getSearchName());
-				}
-				else{
-					return searchPattern.getSearchName().equals(decodedPattern.getSearchName()) &&
-					searchPattern.getSearchNamespace().equals(decodedPattern.getSearchNamespace());
-				}
-			}
-		}
-		
-		return false;
-	}
-	
-    
-    protected SearchMatch createSearchMatch(IFile file, Attr attributeNode)
-    {
-      SearchMatch match = super.createSearchMatch(file, attributeNode);
-      // todo... remove this ugly hack!!
-      if ("name".equals(attributeNode.getName()))
-      {
-        QualifiedName qualifiedName = new QualifiedName("todo-compute-targetNamespace", attributeNode.getValue());
-        match.map.put("name", qualifiedName);
-      }
-      //Element element = attributeNode.getOwnerDocument().getDocumentElement();
-      //if (element.getAttribute("targetNamespace"))
-      //{        
-      //}  
-      return match;
-    }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java
deleted file mode 100644
index 5b942be..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.search.quickscan;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * 
- */
-public class XMLQuickScan
-{
-    /*
-	public static String getTargetNamespace(String fullFilePath)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler();
-		parseFile(fullFilePath, handler);
-		return handler.getTargetNamespace();
-	}*/
-	
-	/*
-	 * Returns information about matches encountered based on the criteria
-	 * provided.
-	 *
-	public static boolean hasMatch(String fullFilePath, PatternMatcher matcher, SearchPattern pattern)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler(matcher, pattern);
-		parseFile(fullFilePath, handler);
-		return handler.hasMatch();
-	}*/
-	
-	public static boolean populateSearchDocument(SearchDocument document, PatternMatcher matcher, SearchPattern pattern)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler(document, matcher, pattern);
-		parseFile(document.getPath(), handler);
-		return handler.hasMatch();
-	}
-
-    private static XMLReader reader;
-    private static XMLReader getOrCreateReader()
-    {
-       if (reader == null)
-       {
-         try
-         {
-          SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
-          reader = parser.getXMLReader();  
-          reader.setFeature("http://xml.org/sax/features/namespaces", true);
-         }
-         catch (Exception e)
-         {           
-         }
-       } 
-       return reader;
-    }
-    
-    
-	private synchronized static void parseFile(String fullFilePath,
-			XMLQuickScanContentHandler handler)
-	{
-		FileInputStream inputStream = null;
-		try
-		{            
-			inputStream = new FileInputStream(new File(fullFilePath));
-			XMLReader reader = getOrCreateReader();
-            reader.setContentHandler(handler);
-			//System.out.println("parseFile" + reader + " (" +  fullFilePath + ")");			
-			reader.parse(new InputSource(inputStream));
-		} catch (Exception e)
-		{
-			// skip the file
-		} 
-		finally{
-			if(inputStream != null){
-				try {
-					inputStream.close();
-				} catch (IOException e) {
-					// can not do much 
-				}
-			}
-			
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java
deleted file mode 100644
index c653eee..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.quickscan;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.wst.common.core.search.document.ComponentDeclarationEntry;
-import org.eclipse.wst.common.core.search.document.ComponentReferenceEntry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
-import org.eclipse.wst.xml.core.internal.search.impl.IXMLSearchConstants;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.matching.SAXSearchElement;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * This class is a SAX content handler, it should be recycled before scanning a file for the new SearchPattern.
- *
- */
-public class XMLQuickScanContentHandler extends DefaultHandler
-{
-	private Map namespaceMap = new HashMap(); // Map of string prefix keys and namespace
-	private String targetNamespace = "";
-	
-	private SearchPattern pattern;
-	private SearchDocument document;  // we'll add useful entries in the search document as we parsing
-	private SAXSearchElement searchElement = new SAXSearchElement();
-
-	private boolean hasMatch = false;
-	private  StringBuffer currentPath = new StringBuffer();
-	private PatternMatcher matcher;
-	
-	public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
-
-	
-	public XMLQuickScanContentHandler(PatternMatcher matcher, SearchPattern pattern) {
-		super();
-		this.pattern = pattern;
-		this.matcher = matcher;
-	}
-	
-	public XMLQuickScanContentHandler(SearchDocument document, PatternMatcher matcher, SearchPattern pattern) {
-		super();
-		this.pattern = pattern;
-		this.matcher = matcher;
-		this.document = document;
-	}
-	
-	public XMLQuickScanContentHandler() {
-		super();
-	}
-
-	public void startElement(String uri, String localName, String qName,
-			Attributes attributes) throws SAXException
-	{
-	
-		currentPath.append("/" + localName);
-
-		// Search for targetNamespace if we haven't encountered it yet.
-		if (targetNamespace.equals(""))
-		{
-			int nAttributes = attributes.getLength();
-			for (int i = 0; i < nAttributes; i++)
-			{
-				if ("targetNamespace".equals(attributes.getQName(i)))
-				{
-					targetNamespace = attributes.getValue(i);
-					break;
-				}
-			}
-		}
-		
-		// collect link info
-		if("import".equals(localName) && XMLSCHEMA_NAMESPACE.equals(uri)){
-			FileReferenceEntry documentEntry = new FileReferenceEntry();
-			documentEntry.setCategory(IXMLSearchConstants.REF);
-			documentEntry.setKey("import");
-			String namespace = attributes.getValue("namespace");
-			String location = attributes.getValue("schemaLocation");
-			documentEntry.setPublicIdentifier(namespace);
-			documentEntry.setRelativeFilePath(location);            
-			document.putEntry(documentEntry);
-		}
-		if(("redefine".equals(localName)|| "include".equals(localName)) &&
-				XMLSCHEMA_NAMESPACE.equals(uri)){
-			FileReferenceEntry documentEntry = new FileReferenceEntry();
-			documentEntry.setCategory(IXMLSearchConstants.REF);
-			documentEntry.setKey("include");
-			String location = attributes.getValue("schemaLocation");
-			documentEntry.setPublicIdentifier(uri);
-			documentEntry.setRelativeFilePath(location);
-			document.putEntry(documentEntry);
-		}
-		
-		
-        // issue (cs) you may want to try perf measurements to compate reusing the same
-        // instance of a SAXSearchElement instead of newing one each time 
-		//XMLSearchPattern.SAXSearchElement searchElement = new XMLSearchPattern.SAXSearchElement();
-		searchElement.setElementName(localName);
-		searchElement.setElementNamespace(uri);
-		searchElement.setAttributes(attributes);
-		searchElement.setNamespaceMap(namespaceMap);
-		searchElement.setTargetNamespace(targetNamespace);
-	
-
-		if(matcher != null){
-			if(matcher.matches(pattern, searchElement)){
-				hasMatch = true;
-				if(pattern instanceof XMLComponentReferencePattern){
-					ComponentReferenceEntry documentEntry = new ComponentReferenceEntry();
-					documentEntry.setCategory(IXMLSearchConstants.COMPONENT_REF);
-					QualifiedName name = new QualifiedName(uri, localName);
-					documentEntry.setKey(name.toString());
-					documentEntry.setName(name);
-					document.putEntry(documentEntry);
-				}
-				else if(pattern instanceof XMLComponentDeclarationPattern){
-					ComponentDeclarationEntry documentEntry = new ComponentDeclarationEntry();
-					documentEntry.setCategory(IXMLSearchConstants.COMPONENT_DECL);
-                    QualifiedName name = new QualifiedName(targetNamespace, attributes.getValue("name"));
-					QualifiedName metaName = new QualifiedName(uri, localName);                    
-					documentEntry.setKey(name.toString());
-                    documentEntry.setName(name);
-					documentEntry.setMetaName(metaName);
-					document.putEntry(documentEntry);
-				}
-			}
-		}
-		
-	}
-	
-	public void endElement(String uri, String localName, String qName)
-			throws SAXException
-	{
-		int slashIndex = currentPath.lastIndexOf("/");
-		currentPath.delete(slashIndex, currentPath.length());
-	}
-
-	/**
-	 * Callback for SAX parser
-	 * 
-	 * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String,
-	 *      java.lang.String)
-	 */
-	public void startPrefixMapping(String arg0, String arg1)
-			throws SAXException
-	{
-		if (arg0 != null && arg0.length() > 0)
-		{
-			this.namespaceMap.put(arg0, arg1);
-		}
-	}
-
-	public String getTargetNamespace() {
-		return targetNamespace;
-	}
-
-	public void setTargetNamespace(String targetNamespace) {
-		this.targetNamespace = targetNamespace;
-	}
-
-	public boolean hasMatch() {
-		return hasMatch;
-	}
-
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
deleted file mode 100644
index 4ca52e8..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation;
-
-/**
- * An XML validation configuration allows setting specific configuration
- * information for a WTP XML validation run. Any features and properties
- * set on this configuration should not be confused with those from
- * parsers such as Xerces. (This object does not by default wrap features
- * and properties from specific parsers.)
- */
-public class XMLValidationConfiguration 
-{
-  public static String WARN_NO_GRAMMAR = "WARN_NO_GRAMMAR"; //$NON-NLS-1$
-  private boolean warn_no_grammar_value = false;
-  
-  /**
-   * Set a feature of this configuration.
-   * 
-   * @param feature
-   * 		The feature to set.
-   * @param value
-   * 		The value to set for the feature.
-   * @throws 
-   * 		An exception is thrown if the feature is not recognized.
-   */
-  public void setFeature(String feature, boolean value) throws Exception
-  {
-	if(WARN_NO_GRAMMAR.equals(feature))
-	  warn_no_grammar_value = value;
-	else
-	  throw new Exception("Feature not recognized.");
-	
-  }
-  
-  
-  /**
-   * Get the value for a given feature. If the feature is not defined
-   * this method will throw an exception.
-   * 
-   * @param feature
-   * 		The feature for which to retrieve the value.
-   * @return
-   * 		The feature's value, true or false.
-   * @throws 
-   * 		An exception is thrown if the feature is not recognized.
-   */
-  public boolean getFeature(String feature) throws Exception
-  {
-	if(WARN_NO_GRAMMAR.equals(feature))
-	  return warn_no_grammar_value;
-	
-	throw new Exception("Feature not recognized.");
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
index 59b5c96..77c6683 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
@@ -23,8 +23,6 @@
 	public static String _UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND;
 	public static String _UI_PROBLEMS_CONNECTION_REFUSED;
 	public static String _UI_REF_FILE_ERROR_MESSAGE;
-	public static String _WARN_NO_GRAMMAR;
-	public static String Message_XML_validation_message_ui;
 
 	static {
 		// load message values from bundle file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
index 1bf9391..103f874 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
@@ -24,7 +24,6 @@
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.List;
-
 import org.apache.xerces.impl.XMLErrorReporter;
 import org.apache.xerces.parsers.StandardParserConfiguration;
 import org.apache.xerces.xni.NamespaceContext;
@@ -37,11 +36,14 @@
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
 import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
 import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
+import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorCustomizationManager;
+import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.helpers.DefaultHandler;
 
 /**
  * This class performs validation using a xerces sax parser.  
@@ -53,6 +55,7 @@
 {
   protected URIResolver uriResolver = null;
   //protected MyEntityResolver entityResolver = null;
+  protected ErrorCustomizationManager errorCustomizationManager;
   protected Hashtable ingoredErrorKeyTable = new Hashtable();
 
   protected static final String IGNORE_ALWAYS = "IGNORE_ALWAYS"; //$NON-NLS-1$
@@ -61,9 +64,6 @@
   protected static final String ROOT_ELEMENT_TYPE_MUST_MATCH_DOCTYPEDECL = "RootElementTypeMustMatchDoctypedecl"; //$NON-NLS-1$
   protected static final String MSG_ELEMENT_NOT_DECLARED = "MSG_ELEMENT_NOT_DECLARED"; //$NON-NLS-1$
   
-  // WTP XML validator specific key.
-  protected static final String NO_GRAMMAR_FOUND = "NO_GRAMMAR_FOUND"; //$NON-NLS-1$
-  
   private static final String FILE_NOT_FOUND_KEY = "FILE_NOT_FOUND"; //$NON-NLS-1$
 
   /**
@@ -119,6 +119,25 @@
       reader.setFeature("http://xml.org/sax/features/namespaces", valinfo.isNamespaceEncountered());               //$NON-NLS-1$
       reader.setFeature("http://xml.org/sax/features/validation", valinfo.isGrammarEncountered());  //$NON-NLS-1$
       reader.setFeature("http://apache.org/xml/features/validation/schema", valinfo.isGrammarEncountered()); //$NON-NLS-1$
+      reader.setContentHandler(new DefaultHandler()
+      {
+        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+          
+          if (errorCustomizationManager == null)
+          {
+            errorCustomizationManager = new ErrorCustomizationManager();
+//            if (errorCustomizationManager.isDocumentNamespaceApplicable(uri))
+//            {
+//              errorCustomizationManager.setActive(true);
+//            }  
+          }
+          errorCustomizationManager.startElement(uri, localName);                    
+        }
+        
+        public void endElement(String uri, String localName, String qName) throws SAXException {
+          errorCustomizationManager.endElement(uri, localName);
+        }
+      });      
       
       // MH make sure validation works even when a customer entityResolver is note set (i.e. via setURIResolver())
       if (entityResolver != null)
@@ -147,7 +166,7 @@
    */
   public XMLValidationReport validate(String uri)
   {
-    return validate(uri, null, new XMLValidationConfiguration());  
+    return validate(uri, null);  
   }
 
   final String createStringForInputStream(InputStream inputStream)
@@ -182,22 +201,6 @@
    */
   public XMLValidationReport validate(String uri, InputStream inputStream)
   {
-	return validate(uri, inputStream, new XMLValidationConfiguration());
-  }
-  /**
-   * Validate the inputStream
-   * 
-   * @param uri 
-   * 		The URI of the file to validate.
-   * @param inputstream
-   * 		The inputStream of the file to validate
-   * @param configuration
-   * 		A configuration for this validation session.
-   * @return 
-   * 		Returns an XML validation report.
-   */
-  public XMLValidationReport validate(String uri, InputStream inputStream, XMLValidationConfiguration configuration)
-  {
     Reader reader1 = null; // Used for the preparse.
     Reader reader2 = null; // Used for validation parse.
     
@@ -216,21 +219,15 @@
         helper.computeValidationInformation(uri, reader1, uriResolver);
         valinfo.setDTDEncountered(helper.isDTDEncountered);
         valinfo.setElementDeclarationCount(helper.numDTDElements);
-        //valinfo.setNamespaceEncountered(helper.isNamespaceEncountered);
+        valinfo.setNamespaceEncountered(helper.isNamespaceEncountered);
         valinfo.setGrammarEncountered(helper.isGrammarEncountered);
-        
         XMLReader reader = createXMLReader(valinfo, entityResolver);
         XMLErrorHandler errorhandler = new XMLErrorHandler(valinfo);
         reader.setErrorHandler(errorhandler);
         
         InputSource inputSource = new InputSource(uri);
         inputSource.setCharacterStream(reader2);
-        reader.parse(inputSource);   
-        if(configuration.getFeature(XMLValidationConfiguration.WARN_NO_GRAMMAR) && 
-        		valinfo.isValid() && !helper.isGrammarEncountered)
-        {
-          valinfo.addWarning(XMLValidationMessages._WARN_NO_GRAMMAR, 1, 0, uri, NO_GRAMMAR_FOUND, null);
-        }
+        reader.parse(inputSource);      
     }
     catch (SAXParseException saxParseException)
     {
@@ -569,6 +566,7 @@
 		      if (reportError)
 		      {
 		        super.reportError(domain, key, arguments, severity);
+		        errorCustomizationManager.considerReportedError(valinfo, key, arguments);
 		      }
 		    }
 		};
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
deleted file mode 100644
index bef6d16..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-
-/**
- * An abstract validator that assists validators in running and contributing
- * nested messages in the validation results. 
- * *note: Subclasses do not need to contribute nested messages in order to
- * benefit from the use of this class. This class takes care of iterating
- * through results for validators that use the standard context.
- */
-public abstract class AbstractNestedValidator implements IValidatorJob 
-{
-  // Locally used, non-UI strings.
-  private static final String REFERENCED_FILE_ERROR_OPEN = "referencedFileError("; //$NON-NLS-1$
-  private static final String REFERENCED_FILE_ERROR_CLOSE = ")"; //$NON-NLS-1$
-  private static final String REFERENCED_FILE_ERROR = "referencedFileError"; //$NON-NLS-1$
-  private static final String FILE_PROTOCOL_NO_SLASH = "file:"; //$NON-NLS-1$
-  private static final String FILE_PROTOCOL = "file:///"; //$NON-NLS-1$
-  private static final String GROUP_NAME = "groupName"; //$NON-NLS-1$
-  private final String GET_FILE = "getFile"; //$NON-NLS-1$
-  private final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
-  private final String GET_INPUTSTREAM = "inputstream"; //$NON-NLS-1$
-  
-  // Internal strings. These strings are common addition information types.
-  protected static final String COLUMN_NUMBER_ATTRIBUTE = "columnNumber"; //$NON-NLS-1$
-  protected static final String SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE = "squiggleSelectionStrategy"; //$NON-NLS-1$
-  protected static final String SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE = "squiggleNameOrValue"; //$NON-NLS-1$
-
-  
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#validateInJob(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
-   */
-  public IStatus validateInJob(IValidationContext context, IReporter reporter) throws ValidationException 
-  {
-	NestedValidatorContext nestedcontext = new NestedValidatorContext();
-	setupValidation(nestedcontext);
-	String[] fileURIs = context.getURIs();
-	if (fileURIs != null && fileURIs.length > 0) 
-	{
-	  int numFiles = fileURIs.length;
-	  for (int i = 0; i < numFiles && !reporter.isCancelled(); i++) 
-	  {
-	    String fileName = fileURIs[i];
-	    if (fileName != null)
-	    {          
-	      Object []parms = {fileName};
-
-	      IFile file = (IFile) context.loadModel(GET_FILE, parms);
-	      if (file != null && shouldValidate(file)) 
-	      { 
-	    	// The helper may not have a file stored in it but may have an InputStream if being
-	    	// called from a source other than the validation framework such as an editor.
-	        if (context.loadModel(GET_INPUTSTREAM) instanceof InputStream) //$NON-NLS-1$
-	        {
-	          validate(file, (InputStream)context.loadModel(GET_INPUTSTREAM), reporter, nestedcontext); //do we need the fileName?  what is int ruleGroup? //$NON-NLS-1$
-	        }
-	        else
-	        {
-	    	  validate(file, null, reporter, nestedcontext);
-	        }
-	      }
-	    }
-	  }
-	}
-	// TODO: Is this needed? Shouldn't the framework pass the complete list? 
-	// Should I know that I'm validating a project as opposed to files?
-	else 
-    {
-      Object []parms = {getValidatorID()};
-      Collection files = (Collection) context.loadModel(GET_PROJECT_FILES, parms);
-      Iterator iter = files.iterator();
-      while (iter.hasNext() && !reporter.isCancelled()) 
-      {
-        IFile file = (IFile) iter.next();
-        if(shouldValidate(file))
-        {
-	      validate(file, null, reporter, nestedcontext);
-        }
-      }
-    }
-	
-	teardownValidation(nestedcontext);
-	if(reporter.isCancelled())
-	  return Status.CANCEL_STATUS;
-    return Status.OK_STATUS;
-  }
-  
-  /**
-   * Provides the id of this validator. The ID is used by the validation
-   * framework. It usually is the fully qualified class name of the class
-   * implementing the IValidator interface.
-   * 
-   * @return a String with the ID of this validator.
-   */
-  protected String getValidatorID()
-  {
-    return this.getClass().getName();
-  }
-  
-  /**
-   * Get the name of this validator. The name will be reported to the
-   * validation framework.
-   * Subclasses must implement this method.
-   * 
-   * @return
-   * 		The name of this validator.
-   */
-  protected abstract String getValidatorName();
-
-  /**
-   * Perform set up before validation runs. Subclasses may implement this
-   * method to perform validation specific set up.
-   * 
-   * @param context
-   * 		The context of the current validation.
-   */
-  protected void setupValidation(NestedValidatorContext context)
-  {
-	// Default implementation does nothing.
-  }
-  
-  /**
-   * Perform tear down after validation runs. Subclasses may implement this
-   * method to perform validation specific tear down.
-   * 
-   * @param context
-   * 		The context of the current validation.
-   */
-  protected void teardownValidation(NestedValidatorContext context)
-  {
-	// Default implementation does nothing.
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#getSchedulingRule(org.eclipse.wst.validation.internal.provisional.core.IValidationContext)
-   */
-  public ISchedulingRule getSchedulingRule(IValidationContext arg0) 
-  {
-	// TODO review whether returning a null rule is correct. Gary had a suggestion in the bug report.
-	return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#cleanup(org.eclipse.wst.validation.internal.provisional.core.IReporter)
-   */
-  public void cleanup(IReporter arg0) 
-  {
-    // No cleanup to perform. Subclasses are free to implement this method.
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#validate(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
-   */
-  public void validate(IValidationContext arg0, IReporter arg1) throws ValidationException 
-  {  
-	// This method should not be implemented by validtors implementing the validateInJob
-	// method.
-  }
-	
-	
-  /**
-   * Determine if a given file should be validated. 
-   * 
-   * @param file The file that may be validated.
-   * @return True if the file should be validated, false otherwise.
-   */
-  private static boolean shouldValidate(IFile file) 
-  {
-	IResource resource = file;
-	do 
-	{
-	  if (resource.isDerived() || resource.isTeamPrivateMember() || 
-		  !resource.isAccessible() || resource.getName().charAt(0) == '.') 
-	  {
-		return false;
-	  }
-	  resource = resource.getParent();
-	}while ((resource.getType() & IResource.PROJECT) == 0);
-	
-	return true;
-  }
-  
-  /**
-   * Validate the given file and use the reporter for the validation messages.
-   * This method does not perform the validation logic but rather delegates
-   * to the validate method in subclasses to validate. This method is responsible
-   * for reporting the messages that result from validation.
-   * 
-   * @param file 
-   * 		An IFile to validate.
-   * @param inputstream 
-   * 		An InputStream that represents the file. The InputStream may be null
-   * 		in which case the files should be validated from the IFile.
-   * @param reporter 
-   * 		The reporter with which to report validation messages.
-   * @param context
-   * 		The context of the current validation.
-   */
-  private void validate(IFile file, InputStream inputstream, IReporter reporter, NestedValidatorContext context)
-  {  
-	Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(getValidatorName(), new String[]{file.getFullPath().toString()}));
-    reporter.displaySubtask(this, message);
-    
-	IPath path = file.getLocation();
-	String uri = createURIForFilePath(path.toString());
-
-	clearMarkers(file, this, reporter);
-	ValidationReport valreport = validate(uri, inputstream, context);
-	
-	createMarkers(file, valreport.getValidationMessages(), reporter);
-	        
-	try
-	{
-	  file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
-	}
-	catch(CoreException e)
-	{
-	  System.out.println("Unable to set nested messages property.");
-	}
-  }
-	
-  /**
-   * Validate the given file and use the reporter for the validation messages.
-   * Clients must implement this method with their specific validation logic.
-   * 
-   * @param uri
-   * 		The URI of the file to validate.
-   * @param inputstream 
-   * 		An InputStream that represents the file. The InputStream may be null
-   * 		in which case the files should be validated from the IFile.
-   * @param context
-   * 		The context of the current validation.
-   * @return
-   * 		A validation report summarizing the validation.
-   */
-  public abstract ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context);
-	  
-  /**
-   * This method clears all the markers on the given IFile for a specified
-   * validator.
-   * This is a convenience method for subclasses.
-   * 
-   * @param iFile
-   * 		The IFile from which to clear the markers.
-   * @param validator
-   * 		The validator for which to remove the markers.
-   * @param reporter
-   * 		The reporter that can remove the markers.
-   */
-  private void clearMarkers(IFile iFile, IValidator validator, IReporter reporter)
-  {
-	if (fileIsAccessible(iFile))
-	{
-	  reporter.removeAllMessages(validator, iFile);
-	}
-  }
-	  
-  /**
-   * Test whether the given file is accessible and may be used for validation. A file is 
-   * available if 
-   * 1. It is not null.
-   * 2. It exists. 
-   * 3. The project containing the file is accessible.
-   * 
-   * @param file 
-   * 		The file to check to ensure it is accessible.
-   * @return 
-   * 		True if the file is accessible, false otherwise.
-   */
-  private boolean fileIsAccessible(IFile file)
-  {
-    if (file != null && file.exists() && file.getProject().isAccessible())
-	{
-	  return true;
-	}
-	return false;
-  }
-	  
-  /**
-   * Format a file name into a correct URI. 
-   * This is a convenience method for subclasses.
-   * 
-   * @param filename 
-   * 		The file name to format.
-   * @return 
-   * 		
-   * The formatted URI.
-   */
-  private String createURIForFilePath(String filename)
-  {
-	if(!filename.startsWith(FILE_PROTOCOL_NO_SLASH))
-	{
-	  while(filename.startsWith("/")) //$NON-NLS-1$
-	  {
-	    filename = filename.substring(1);
-	  }
-	  filename = FILE_PROTOCOL + filename;
-	}
-	return filename;
-  }
-	  
-  /**
-   * Create markers for the valiation messages generated from the validation.
-   * 
-   * @param iFile
-   *          The resource to create the markers on.
-   * @param valmessages
-   *          The array of validation messages.
-   */
-  public void createMarkers(IFile iFile, ValidationMessage[] valmessages, IReporter reporter)
-  {
-    if (!fileIsAccessible(iFile))
-    {
-      return;
-    }
-    int nummessages = valmessages.length;
-    for (int i = 0; i < nummessages; i++)
-    {
-      ValidationMessage validationMessage = valmessages[i];
-      String uri = validationMessage.getUri();
-
-      LocalizedMessage message;
-      if (validationMessage.getSeverity() == ValidationMessage.SEV_LOW)
-      {
-        message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, 
-        		validationMessage.getMessage(), iFile);
-      }
-      else
-      { 
-        message = new LocalizedMessage(IMessage.HIGH_SEVERITY, validationMessage.getMessage(), iFile);
-      }
-      
-      message.setLineNo(validationMessage.getLineNumber());
-      addInfoToMessage(validationMessage, message);
-      
-      List nestederrors = validationMessage.getNestedMessages();
-      if (nestederrors != null && !nestederrors.isEmpty())
-      {
-        message.setGroupName(REFERENCED_FILE_ERROR_OPEN + uri + REFERENCED_FILE_ERROR_CLOSE);
-      }
-
-      reporter.addMessage(this, message);
-	      
-    }
-    try
-    {
-      IMarker[] markers = iFile.findMarkers(null, true, IResource.DEPTH_INFINITE);
-      for (int i = 0; i < markers.length; i++)
-      {
-        IMarker marker = markers[i];
-        String groupName = null;
-        try
-        {
-          groupName = (String) marker.getAttribute(GROUP_NAME);
-        }
-        catch (Exception e)
-        {
-        }
-        if (groupName != null && groupName.startsWith(REFERENCED_FILE_ERROR))
-        {
-          marker.setAttribute(IMarker.DONE, true);
-        }
-      }
-    }
-    catch (CoreException e)
-    {
-      e.printStackTrace();
-    }
-  }
-	  
-  /**
-   * This method allows the addition of information to the validation message
-   * @param validationmessage
-   * 		The ValidationMessage to retrieve the information from.
-   * @param message
-   * 		The IMessage to add the information to.
-   */
-  protected void addInfoToMessage (ValidationMessage validationmessage, IMessage message)
-  { 
-	// This method may be overidden by subclasses
-  }
-	  
-  /**
-   * A localized message is a specialized type of IMessage that allows setting
-   * and using a localized message string for a message.
-   */
-  class LocalizedMessage extends Message 
-  {
-    private String _message = null;
-
-	public LocalizedMessage(int severity, String messageText) 
-	{
-	  this(severity, messageText, null);
-	}
-
-	public LocalizedMessage(int severity, String messageText, IResource targetObject) 
-	{
-	  this(severity, messageText, (Object) targetObject);
-	}
-
-	public LocalizedMessage(int severity, String messageText, Object targetObject) 
-	{
-	  super(null, severity, null);
-	  setLocalizedMessage(messageText);
-	  setTargetObject(targetObject);
-	}
-
-	public void setLocalizedMessage(String message) 
-	{
-	  _message = message;
-	}
-
-	public String getLocalizedMessage() 
-	{
-	  return _message;
-	}
-
-	public String getText() 
-	{
-	  return getLocalizedMessage();
-	}
-
-	public String getText(ClassLoader cl) 
-	{
-	  return getLocalizedMessage();
-	}
-
-	public String getText(Locale l) 
-	{
-	  return getLocalizedMessage();
-	}
-
-	public String getText(Locale l, ClassLoader cl) 
-	{
-	  return getLocalizedMessage();
-	}
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java
deleted file mode 100644
index 3c2710a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-
-/**
- * A context class for validators to be able to determine the context of
- * given validation session. Currently this class is only used to identify
- * the unique context.
- */
-public class NestedValidatorContext 
-{
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
index 807ea9a..d364d24 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
@@ -191,5 +191,11 @@
   {
 	  return this.messageArguments;
   }
+  
+
+  public void setMessage(String message)
+  {
+    this.message = message;
+  }  
                                      
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java
new file mode 100644
index 0000000..ab6c170
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.eclipse;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorCustomizationRegistry;
+import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorMessageCustomizerDelegate;
+import org.osgi.framework.Bundle;
+/**
+ * This class reads the plug-in manifests and registers each extension
+ * error customizer with the ErrorCustomizationRegistry.
+ */
+public class ErrorCustomizationPluginRegistryReader {
+	
+	  protected static final String PLUGIN_ID = "org.eclipse.wst.xml.core";
+	  protected static final String ATT_CLASS = "class";
+	  protected static final String ATT_NAMESPACE = "namespace";
+	  protected static final String EXTENSION_POINT_ID = "errorCustomizer";
+	  protected static final String tagName = EXTENSION_POINT_ID;
+
+	  /**
+	   * Read from plugin registry for the errorcustomizer extension.
+	   */
+	  public void readRegistry()
+	  {
+	    IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
+	    IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
+	    if (point != null)
+	    {
+	      IConfigurationElement[] elements = point.getConfigurationElements();
+	      for (int i = 0; i < elements.length; i++)
+	      {
+	        readElement(elements[i]);
+	      }
+	    }
+	  }
+
+	  /**
+	   * readElement() - parse and deal with an extension like:
+	   *
+	   * <extension point="org.eclipse.wst.xml.core.errorCustomizer"
+	   *            id="specificErrorCustomizer"
+	   *            name="Specific Error Customizer">
+	   *   <errorCustomizer
+	   *   			namespace="http://specificnamespace"
+	   *   			class="org.eclipse.wst.xml.core.MySpecificErrorCustomizer/>
+	   * </extension>
+	   */
+	  protected void readElement(IConfigurationElement element)
+	  {
+	    if (element.getName().equals(tagName))
+	    {
+	      String errorCustomizerClass = element.getAttribute(ATT_CLASS);
+	      String namespace = element.getAttribute(ATT_NAMESPACE);
+
+	      if (errorCustomizerClass != null)
+	      {
+	        try
+	        {
+	          Bundle pluginBundle = Platform.getBundle(element.getDeclaringExtension().getNamespace());
+	          ErrorMessageCustomizerDelegate delegate = new ErrorMessageCustomizerDelegate(pluginBundle, errorCustomizerClass);
+	          ErrorCustomizationRegistry.getInstance().addErrorMessageCustomizer(namespace, delegate);
+	        }
+	        catch (Exception e)
+	        {
+	        }
+	      }
+	    }
+	  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
deleted file mode 100644
index 6f21d01..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-import java.io.InputStream;
-
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationConfiguration;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationMessages;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
-import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-public class Validator extends AbstractNestedValidator
-{
-  protected boolean warnNoGrammar = false;
-  
-  /**
-   * Set any preferences for XML validation.
-   * 
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#setupValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
-   */
-  protected void setupValidation(NestedValidatorContext context) 
-  {
-	super.setupValidation(context);
-	warnNoGrammar = XMLCorePlugin.getDefault().getPluginPreferences().getBoolean(XMLCorePreferenceNames.WARN_NO_GRAMMAR);
-  }
-
-/* (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#getValidatorName()
-   */
-  protected String getValidatorName() 
-  {
-	return XMLValidationMessages.Message_XML_validation_message_ui;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
-   */
-  public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context)
-  {  
-	XMLValidator validator = XMLValidator.getInstance();
-
-	XMLValidationConfiguration configuration = new XMLValidationConfiguration();
-	try
-	{
-	  configuration.setFeature(XMLValidationConfiguration.WARN_NO_GRAMMAR, warnNoGrammar);
-	}
-	catch(Exception e)
-	{
-	  // TODO: Unable to set the preference. Log this problem.
-	}
-	
-	XMLValidationReport valreport = null;
-	if (inputstream != null)
-	{
-	  valreport = validator.validate(uri, inputstream, configuration);
-	}
-	else
-	{
-	  valreport = validator.validate(uri, null, configuration);
-	}
-		        
-	return valreport;
-  }
-	  
-  /**
-   * Store additional information in the message parameters. For XML validation there
-   * are three additional pieces of information to store:
-   * param[0] = the column number of the error
-   * param[1] = the 'squiggle selection strategy' for which DOM part to squiggle
-   * param[2] = the name or value of what is to be squiggled
-   * 
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#addInfoToMessage(org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage, org.eclipse.wst.validation.internal.provisional.core.IMessage)
-   */
-  protected void addInfoToMessage(ValidationMessage validationMessage, IMessage message)
-  { 
-	String key = validationMessage.getKey();
-	if(key != null)
-	{
-      XMLMessageInfoHelper messageInfoHelper = new XMLMessageInfoHelper();
-      String[] messageInfo = messageInfoHelper.createMessageInfo(key, validationMessage.getMessageArguments());
-      
-      message.setAttribute(COLUMN_NUMBER_ATTRIBUTE, new Integer(validationMessage.getColumnNumber()));
-      message.setAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE, messageInfo[0]);
-      message.setAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE, messageInfo[1]);
-	}
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java
deleted file mode 100644
index 6e2fcf4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-/**
- * The message info helper determines the selection strategy for elements
- * in a SSE editor.
- *
- */
-public class XMLMessageInfoHelper
-{
-  public XMLMessageInfoHelper()
-  {
-    super();
-  }
-
-  /**
-   *  Returns an array containing information about what should be underlined with the red "squiggles"
-   *  using the errorKey, and the messageArguments.
-   *  <br>Position 0 of the array returned contains the selection Strategy, or what DOM Element to underline.  
-   *  For example "ATTRIBUTE_NAME"  
-   *  <br>Position 1 contains the name or value to squiggle.
-   *  <p>For example, if we wanted to squiggle the attribute name of an attribute name
-   *  foo this method would return {"ATTRIBUTE_NAME", "foo"}
-   *  </p>
-   *  @param errorKey 
-   *  		The error key given by the Xerces parser.
-   *  @param messageArguments 
-   *  		The arguments used by Xerces to "fill in the blanks" of their messages.
-   *  @return 
-   *  		An array containing the squiggle information.
-   *  @see org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator
-   *  
-   */
-  public String[] createMessageInfo(String errorKey, Object[] messageArguments)
-  { 
-    String selectionStrategy = null;
-    String nameOrValue = null;
-    
-    if(errorKey != null)
-    {
-      if (errorKey.equals("cvc-complex-type.2.4.a") || errorKey.equals("cvc-complex-type.2.4.d") || errorKey.equals("cvc-complex-type.2.4.b") || errorKey.equals("MSG_CONTENT_INVALID") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-        | errorKey.equals("MSG_CONTENT_INCOMPLETE") || errorKey.equals("MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED") || errorKey.equals("cvc-complex-type.4")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-      {
-        selectionStrategy = "START_TAG"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("cvc-type.3.1.3")) //$NON-NLS-1$
-      {
-        selectionStrategy = "TEXT"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("cvc-complex-type.2.3")) //$NON-NLS-1$
-      {
-    	selectionStrategy = "FIRST_NON_WHITESPACE_TEXT"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("cvc-type.3.1.1")) //$NON-NLS-1$
-      {
-        selectionStrategy = "ALL_ATTRIBUTES"; //$NON-NLS-1$
-      }
-      else if (errorKey.equals("cvc-complex-type.3.2.2") || errorKey.equals("MSG_ATTRIBUTE_NOT_DECLARED")) //$NON-NLS-1$ //$NON-NLS-2$
-      {
-        selectionStrategy = "ATTRIBUTE_NAME"; //$NON-NLS-1$
-	    //in this case we need nameOrValue to be the name of the attribute to underline
-	    nameOrValue = (String)messageArguments[1];
-      }
-      else if (errorKey.equals("cvc-attribute.3") || errorKey.equals("MSG_ATTRIBUTE_VALUE_NOT_IN_LIST") || errorKey.equals("cvc-complex-type.3.1")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-      {	
-    	selectionStrategy = "ATTRIBUTE_VALUE";   //$NON-NLS-1$
-		//in this case we need nameOrValue to be the name of the Attribute
-    	if (errorKey.equals("cvc-attribute.3") || errorKey.equals("cvc-complex-type.3.1")) //$NON-NLS-1$ //$NON-NLS-2$
-    	{ 
-    	  nameOrValue = (String)messageArguments[1];
-    	}
-    	else if (errorKey.equals("MSG_ATTRIBUTE_VALUE_NOT_IN_LIST")) //$NON-NLS-1$
-    	{	
-    	  nameOrValue = (String)messageArguments[0];
-    	}
-      }
-      else if (errorKey.equals("cvc-elt.4.2")) //$NON-NLS-1$
-      {	
-    	selectionStrategy="VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE"; //$NON-NLS-1$
-		//in this case we need nameOrValue to be the value of the attribute we want to unerline
-    	nameOrValue = (String)messageArguments[1];	
-      }
-      else if (errorKey.equals("EntityNotDeclared")) //$NON-NLS-1$
-      {  	
-    	selectionStrategy="TEXT_ENTITY_REFERENCE"; //$NON-NLS-1$
-        nameOrValue = (String)messageArguments[0];
-      }
-      else if (errorKey.equals("ElementUnterminated")) //$NON-NLS-1$
-	  {
-		selectionStrategy = "ENTIRE_ELEMENT"; //$NON-NLS-1$
-	  }
-    }
-    String messageInfo[] = new String[2];
-    messageInfo[0] = selectionStrategy != null? selectionStrategy: ""; //$NON-NLS-1$
-    messageInfo[1] = nameOrValue;
-    return messageInfo;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java
deleted file mode 100644
index 2d8186d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-
-/**
- * An XML validator specific to Eclipse. This validator will wrap the internal
- * XML validator an provide automatic URI resolution support.
- * Using this class is equivalent to using the internal XML validator and registering
- * the URI resolver.
- */
-public class XMLValidator extends org.eclipse.wst.xml.core.internal.validation.XMLValidator
-{
-  private static XMLValidator instance = null;
-  
-  /**
-   * Return the one and only instance of the XML validator. The validator
-   * can be reused and cannot be customized so there should only be one instance of it.
-   * 
-   * @return The one and only instance of the XML validator.
-   */
-  public static XMLValidator getInstance()
-  {
-    if(instance == null)
-    {
-      instance = new XMLValidator();
-    }
-    return instance;
-  }
-  /**
-   * Constructor. Create the XML validator and set the URI resolver.
-   */
-  protected XMLValidator()
-  {
-    setURIResolver(URIResolverPlugin.createResolver());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java
new file mode 100644
index 0000000..eb1cca2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A simple class to store information about an XML element.
+ */
+public class ElementInformation
+{
+  protected String localName;
+  protected String namespace;
+  protected List children = new ArrayList();
+
+  /**
+   * Constructor.
+   * 
+   * @param uri
+   * 		The namespace URI of the element.
+   * @param localName
+   * 		The local name of the element.
+   */
+  public ElementInformation(String uri, String localName)
+  {
+    this.localName = localName;
+    this.namespace = uri;
+  }
+  
+  /**
+   * Get the namespace of this element.
+   * 
+   * @return
+   * 		The namespace of this element.
+   */
+  public String getNamespace()
+  {
+	return namespace;
+  }
+  
+  /**
+   * Get the local name of this element.
+   * 
+   * @return
+   * 		The local name of this element.
+   */
+  public String getLocalname()
+  {
+	return localName;
+  }
+  
+  /**
+   * Get the list of children of this element. The list contains
+   * ElementInformation objects representing the children of this element.
+   * 
+   * @return
+   * 		The list of children of this element.
+   */
+  public List getChildren()
+  {
+	return children;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java
new file mode 100644
index 0000000..745acc0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+import java.util.Stack;
+
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
+
+/**
+ * This class tracks the context of the parsed document to help identify error
+ * conditions
+ */
+public class ErrorCustomizationManager
+{
+  protected Stack elementInformationStack = new Stack();
+  protected ErrorMessageInformation messageForConsideration;
+
+  /**
+   * This method should be called in the start element method of the XML validator's
+   * content handler.
+   * 
+   * @param uri
+   * 		The namespace of the element.
+   * @param localName
+   * 		The local name of the element.
+   */
+  public void startElement(String uri, String localName)
+  { 
+    ElementInformation elementInformation = new ElementInformation(uri, localName);
+    if (elementInformationStack.size() > 0)
+    {
+      ElementInformation parent = (ElementInformation) elementInformationStack.peek();
+      parent.children.add(elementInformation);
+    }
+    elementInformationStack.push(elementInformation);
+  }
+
+  /**
+   * This method should be called in the end element method of the XML validator's
+   * content handler.
+   * 
+   * @param uri
+   * 		The namespace of the element.
+   * @param localName
+   * 		The local name of the element.
+   */
+  public void endElement(String uri, String localName)
+  {   
+    if (elementInformationStack.size() > 0)
+    {
+      ElementInformation elementInformation = (ElementInformation)elementInformationStack.pop();
+      if (messageForConsideration != null)
+      {  
+        IErrorMessageCustomizer[] customizers = ErrorCustomizationRegistry.getInstance().getCustomizers(elementInformation.getNamespace());
+        int numCustomizers = customizers.length;
+        for(int i = 0; i < numCustomizers; i++)
+        {
+          String message = customizers[i].customizeMessage(elementInformation, messageForConsideration.key, messageForConsideration.arguments);
+          if(message != null)
+          {
+        	messageForConsideration.message.setMessage(message);
+        	break;
+          }
+        }
+      }  
+    }
+  }
+
+  /**
+   * Consider the reported error for customization.
+   * 
+   * @param valInfo
+   * 		The current ValidationInfo object containing validation specific information.
+   * @param key
+   * 		The key related to the message.
+   * @param arguments
+   * 		Any message arguments.
+   */
+  public void considerReportedError(ValidationInfo valInfo, String key, Object[] arguments)
+  {
+    messageForConsideration = null;
+    ValidationMessage[] messages = valInfo.getValidationMessages();
+    if (messages.length > 0)
+    {  
+      messageForConsideration = new ErrorMessageInformation();
+      messageForConsideration.key = key;
+      messageForConsideration.arguments = arguments;
+      messageForConsideration.message = messages[messages.length - 1]; 
+    }
+  }
+  
+  /**
+   * A simple class to hold error message information.
+   */
+  public class ErrorMessageInformation
+  {
+	public String key = null;
+	public Object[] arguments = null;
+	public ValidationMessage message = null;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java
new file mode 100644
index 0000000..db0d0ce
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The error customization regsitry manages all registered
+ * IErrorMessageCustomizers by namespace.
+ */
+public class ErrorCustomizationRegistry 
+{
+  protected static ErrorCustomizationRegistry registry = null;
+  protected Map customizers = new HashMap();
+  
+  /**
+   * Restricted constructor in keeping with the singleton pattern.
+   */
+  protected ErrorCustomizationRegistry()
+  {
+  }
+  
+  /**
+   * Get the one and only instance of the registry.
+   * 
+   * @return
+   * 		The one and only instance of the registry.
+   */
+  public static ErrorCustomizationRegistry getInstance()
+  {
+	if(registry == null)
+	{
+	  registry = new ErrorCustomizationRegistry();
+	}
+	return registry;
+  }
+  
+  /**
+   * Add a customizer to the registry. 
+   * 
+   * @param namespace
+   * 		The namespace the customizer will act on.
+   * @param customizer
+   * 		The error customizer to register.
+   */
+  public void addErrorMessageCustomizer(String namespace, IErrorMessageCustomizer customizer)
+  {
+	// To register a customizer for the no namespace use an empty string.
+	if(namespace == null)
+	{
+	  namespace = "";
+	}
+	List customizersForNS = (List)customizers.get(namespace);
+	if(customizersForNS == null)
+	{
+	  customizersForNS = new ArrayList();
+	  customizers.put(namespace, customizersForNS);
+	}
+	if(customizer != null)
+	{
+	  customizersForNS.add(customizer);
+	}
+  }
+  
+  /**
+   * Get the error customizers for a given namespace.
+   * 
+   * @param namespace
+   * 		The namespace for which to retrieve the customizers.
+   * @return
+   * 		An array of customizers registered for this namespace.
+   */
+  public IErrorMessageCustomizer[] getCustomizers(String namespace)
+  {
+	if(namespace == null)
+	{
+	  namespace = "";
+	}
+	List customizersForNS = (List)customizers.get(namespace);
+	if(customizersForNS == null)
+	{
+	  customizersForNS = new ArrayList();
+	}
+	return (IErrorMessageCustomizer[])customizersForNS.toArray(new IErrorMessageCustomizer[customizersForNS.size()]);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java
new file mode 100644
index 0000000..444d86d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.osgi.framework.Bundle;
+
+/**
+ * An error message customizer delegate is used to allow for
+ * lazy loading of error customizers.
+ *
+ */
+public class ErrorMessageCustomizerDelegate implements IErrorMessageCustomizer
+{
+  protected Bundle bundle = null;
+  protected String classname = null;
+  protected IErrorMessageCustomizer customizer = null;
+  
+  public ErrorMessageCustomizerDelegate(Bundle bundle, String classname)
+  {
+	this.bundle = bundle;
+	this.classname = classname;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer#customizeMessage(org.eclipse.wst.xml.core.internal.validation.errorcustomization.ElementInformation, java.lang.String, java.lang.Object[])
+   */
+  public String customizeMessage(ElementInformation elementInfo, String errorKey, Object[] arguments) 
+  {
+	if(customizer == null)
+	{
+	  loadCustomizer();
+	}
+	if(customizer == null)
+	{
+	  return null;
+	}
+	return customizer.customizeMessage(elementInfo, errorKey, arguments);
+  }
+  
+  /**
+   * Load the customizer class.
+   */
+  protected void loadCustomizer()
+  {
+	try
+	{
+	  Class customizerClass = bundle.loadClass(classname);
+	  customizer = (IErrorMessageCustomizer)customizerClass.newInstance();
+	}
+	catch(Exception e)
+	{
+	  XMLCorePlugin.getDefault().getLog().log(
+			  new Status(IStatus.WARNING, 
+					     XMLCorePlugin.getDefault().getBundle().getSymbolicName(), 
+					     IStatus.OK, 
+					     "The XML validator error customizer was unable to load class " + classname, e));
+	}
+  }
+  
+  
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java
new file mode 100644
index 0000000..ac6d1e0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+/**
+ * An error message customizer will be called by the XML validator to customize
+ * XML validation errors for a given namespace. The customizer can be used to 
+ * create clearer errors for specific application domains.
+ */
+public interface IErrorMessageCustomizer 
+{
+  /**
+   * Return a customized error message for the given element. Null should be returned
+   * if the message should not be customized.
+   * 
+   * @param elementInformation
+   * 		The information about the element for which to customize the error.
+   * @param errorKey
+   * 		The key for the error for which to replace the message.
+   * @param arguments
+   * 		Arguments related the the error message.
+   * @return
+   * 		A customized error message or null if this customizer will not customize the message.
+   */
+  public String customizeMessage(ElementInformation elementInfo, String errorKey, Object[] arguments);
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
index c0f2111..35e7142 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
@@ -10,9 +10,6 @@
 ###############################################################################
 !-- Constants for strings  
 
-# validation strings
-Message_XML_validation_message_ui=XML Validator validating {0}
-
 ! Usage:
 !   {0} replaced with the host name
 !
@@ -28,8 +25,4 @@
 !
 ! Referenced File Dialog Related Message
 !
-_UI_REF_FILE_ERROR_MESSAGE                       = Referenced file contains errors ({0}).  For more information, right click on the message and select "Show Details..."
-
-# Warning when no grammar is located.
-_WARN_NO_GRAMMAR                                 = No grammar constraints (DTD or XML schema) detected for the document.
- 
\ No newline at end of file
+_UI_REF_FILE_ERROR_MESSAGE          = Referenced file contains errors ({0}).  For more information, right click on the message and select "Show Details..."
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
index 4deec8c..f2b8a31 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
@@ -18,6 +18,7 @@
 import org.eclipse.wst.xml.core.internal.catalog.Catalog;
 import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
+import org.osgi.framework.BundleContext;
 
 
 /**
@@ -29,7 +30,7 @@
     public static final String USER_CATALOG_ID = "user_catalog"; //$NON-NLS-1$
 	public static final String DEFAULT_CATALOG_ID = "default_catalog"; //$NON-NLS-1$
 	public static final String SYSTEM_CATALOG_ID = "system_catalog"; //$NON-NLS-1$
-    private CatalogSet catalogSet = null;
+    private CatalogSet catalogSet = new CatalogSet();
 	   
 
 	/**
@@ -40,7 +41,7 @@
 	}
 
 	/**
-	 * @deprecated use ResourcesPlugin.getWorkspace() directly
+	 * @deprecated use ResourcesPlugin.getWorkspace();
 	 */
 	public static IWorkspace getWorkspace() {
 		return ResourcesPlugin.getWorkspace();
@@ -65,15 +66,16 @@
       return location;
     }
     
+	public void start(BundleContext context) throws Exception 
+	{
+		super.start(context);
+	    catalogSet.putCatalogPersistenceLocation(DEFAULT_CATALOG_ID, getPluginStateLocation(Catalog.DEFAULT_CATALOG_FILE));
+	    catalogSet.putCatalogPersistenceLocation(SYSTEM_CATALOG_ID, getPluginStateLocation(Catalog.SYSTEM_CATALOG_FILE));
+	    catalogSet.putCatalogPersistenceLocation(USER_CATALOG_ID, getPluginStateLocation(Catalog.USER_CATALOG_FILE));
+	}
+	
 	public ICatalog getDefaultXMLCatalog()
 	{
-		if (catalogSet == null) {
-			catalogSet = new CatalogSet();
-
-			catalogSet.putCatalogPersistenceLocation(DEFAULT_CATALOG_ID, getPluginStateLocation(Catalog.DEFAULT_CATALOG_FILE));
-			catalogSet.putCatalogPersistenceLocation(SYSTEM_CATALOG_ID, getPluginStateLocation(Catalog.SYSTEM_CATALOG_FILE));
-			catalogSet.putCatalogPersistenceLocation(USER_CATALOG_ID, getPluginStateLocation(Catalog.USER_CATALOG_FILE));
-		}
 	    return catalogSet.lookupOrCreateCatalog(DEFAULT_CATALOG_ID, getPluginStateLocation(Catalog.DEFAULT_CATALOG_FILE));
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
index fc2b772..aaac354 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
@@ -24,7 +24,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java
index 81c4396..3d8d4bf 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java
@@ -14,6 +14,7 @@
 
 
 
+import org.eclipse.core.runtime.IPluginDescriptor;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementConfiguration;
 import org.eclipse.wst.xml.core.internal.document.TagAdapter;
@@ -63,6 +64,12 @@
 		return getConfiguration().getHandlerID();
 	}
 
+	/**
+	 * @deprecated this should not be needed by anyone
+	 */
+	public IPluginDescriptor getHandlerPluginDescriptor() {
+		return fConfiguration.getHandlerPluginDescriptor();
+	}
 
 	public String getProperty(String name) {
 		return getConfiguration().getProperty(name);
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
index 2e56edf..1fe62da 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
@@ -18,6 +18,7 @@
 import java.util.Map;
 
 import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPluginDescriptor;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
 import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
@@ -168,6 +169,12 @@
 		return fID;
 	}
 
+	/**
+	 * @deprecated this should not be needed by anyone
+	 */
+	public IPluginDescriptor getHandlerPluginDescriptor() {
+		return fElement.getDeclaringExtension().getDeclaringPluginDescriptor();
+	}
 
 	public String[] getPrefix() {
 		if (fPrefix == null) {
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
index 6cd86fa..ab29bca 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
@@ -14,6 +14,7 @@
 
 
 
+
 import java.util.Iterator;
 
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
@@ -114,7 +115,7 @@
 		return 0;
 	}
 
-
+	
 	public ITextRegion getEqualRegion() {
 		return this.equalRegion;
 	}
@@ -356,16 +357,17 @@
 	}
 
 	/**
-	 * ISSUE: what should behavior be if this.value == null? It's an "error"
-	 * to be in that state, but seems to occur relatively easily ... probably
-	 * due to threading bugs ... but this just shows its needs to be spec'd.
+	 * ISSUE: what should behavior be if this.value == null?
+	 * It's an "error" to be in that state, but seems to 
+	 * occur relatively easily ... probably due to threading 
+	 * bugs ... but this just shows its needs to be spec'd. 
 	 * 
 	 */
 	public int getValueRegionStartOffset() {
 		if (this.ownerElement == null)
 			return 0;
 		// assuming the firstStructuredDocumentRegion is the one that contains
-		// the valueRegion -- should make smarter?
+		// the valueRegion -- should make smarter? 
 		IStructuredDocumentRegion structuredDocumentRegion = this.ownerElement.getFirstStructuredDocumentRegion();
 		if (structuredDocumentRegion == null)
 			return 0;
@@ -460,7 +462,7 @@
 	/**
 	 * Check if Attr has JSP in value
 	 */
-	public boolean hasNestedValue() {
+public boolean hasNestedValue() {
 		if (this.valueRegion == null)
 			return false;
 		if (!(this.valueRegion instanceof ITextRegionContainer))
@@ -559,14 +561,11 @@
 			return (this.name == null);
 		if (this.name == null)
 			return false;
-		if (this.name.length() != name.length())
-			return false;
-		if (this.name.equals(name))
-			return true;
-		return this.name.equalsIgnoreCase(name) && ignoreCase();
+		if (!ignoreCase())
+			return this.name.equals(name);
+		return this.name.equalsIgnoreCase(name);
 	}
 
-
 	/**
 	 * notifyValueChanged method
 	 */
@@ -737,7 +736,6 @@
 
 	/**
 	 * Subclasses must override
-	 * 
 	 * @param regionType
 	 * @return
 	 */
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
index aecc54b..af96f24 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
@@ -20,7 +20,6 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.xerces.dom.TreeWalkerImpl;
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
 import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementRegistry;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
@@ -115,7 +114,7 @@
 	// is not needed.
 	private static final boolean usetagnamecache = true;
 
-	// private DocumentTypeAdapter documentTypeAdapter = null;
+	//private DocumentTypeAdapter documentTypeAdapter = null;
 
 	private DOMModelImpl model = null;
 	private TagNameCache tagNameCache;
@@ -304,7 +303,6 @@
 	}
 
 	public Element createCommentElement(String tagName, boolean isJSPTag) throws DOMException {
-		Element result = null;
 		if (!isJSPType() && isJSPTag) {
 			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, new String());
 		}
@@ -312,12 +310,11 @@
 		element.setJSPTag(isJSPTag);
 		CommentElementRegistry registry = CommentElementRegistry.getInstance();
 		if (registry.setupCommentElement(element)) {
-			result = element;
+			return element;
 		}
 		else {
 			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, new String());
 		}
-		return result;
 	}
 
 	/**
@@ -466,20 +463,10 @@
 	}
 
 	/**
-	 * Return an instance of tree walk
-	 */
-	/* (non-Javadoc)
-	 * @see org.w3c.dom.traversal.DocumentTraversal#createTreeWalker(org.w3c.dom.Node, int, org.w3c.dom.traversal.NodeFilter, boolean)
 	 */
 	public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) {
-		if (root == null) {
-			String msg = "Program Error: root node can not be null for TreeWalker";
-			throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
-		}
-		//ISSUE: we just use Xerces implementation for now, but longer term, we should make a 
-		// thread/job safe version (as well as not rely on Xerces "impl" class. 
-		return new TreeWalkerImpl(root, whatToShow, filter, entityReferenceExpansion);
-
+		// not suppoerted
+		return null;
 	}
 
 	private DocumentType findDoctype(Node node) {
@@ -680,20 +667,20 @@
 
 	/**
 	 */
-	// protected DocumentTypeAdapter getDocumentTypeAdapter() {
-	// // be sure to release since possibly changing
-	// if (this.documentTypeAdapter != null) {
-	// this.documentTypeAdapter.release();
-	// }
-	// this.documentTypeAdapter = (DocumentTypeAdapter)
-	// getAdapterFor(DocumentTypeAdapter.class);
-	// if (this.documentTypeAdapter == null) {
-	// // add default adapter
-	// this.documentTypeAdapter = new DocumentTypeAdapterImpl(this);
-	// addAdapter(this.documentTypeAdapter);
-	// }
-	// return this.documentTypeAdapter;
-	// }
+//	protected DocumentTypeAdapter getDocumentTypeAdapter() {
+//		// be sure to release since possibly changing
+//		if (this.documentTypeAdapter != null) {
+//			this.documentTypeAdapter.release();
+//		}
+//		this.documentTypeAdapter = (DocumentTypeAdapter) getAdapterFor(DocumentTypeAdapter.class);
+//		if (this.documentTypeAdapter == null) {
+//			// add default adapter
+//			this.documentTypeAdapter = new DocumentTypeAdapterImpl(this);
+//			addAdapter(this.documentTypeAdapter);
+//		}
+//		return this.documentTypeAdapter;
+//	}
+
 	/**
 	 */
 	public String getDocumentTypeId() {
@@ -1005,12 +992,13 @@
 
 	/**
 	 */
-	// protected void releaseDocumentType() {
-	// if (this.documentTypeAdapter == null)
-	// return;
-	// this.documentTypeAdapter.release();
-	// this.documentTypeAdapter = null;
-	// }
+//	protected void releaseDocumentType() {
+//		if (this.documentTypeAdapter == null)
+//			return;
+//		this.documentTypeAdapter.release();
+//		this.documentTypeAdapter = null;
+//	}
+
 	/**
 	 * <p>
 	 * EXPERIMENTAL! Based on the <a
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
index 0af16d8..795fbab 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
@@ -23,7 +23,7 @@
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.parser.regions.XMLParserRegionFactory;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
index b2e881a..7211076 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005 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
@@ -28,14 +28,14 @@
 	 */
 	public void initializeDefaultPreferences() {
 		IEclipsePreferences node = new DefaultScope().getNode(XMLCorePlugin.getDefault().getBundle().getSymbolicName());
-
+		
 		// formatting preferences
 		node.putInt(XMLCorePreferenceNames.LINE_WIDTH, 72);
 		node.putBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
 		node.put(XMLCorePreferenceNames.INDENTATION_CHAR, XMLCorePreferenceNames.TAB);
 		node.putInt(XMLCorePreferenceNames.INDENTATION_SIZE, 1);
 		node.putBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS, false);
-
+		
 		// cleanup preferences
 		node.putBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, true);
 		node.putBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, true);
@@ -47,11 +47,5 @@
 		node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
 		node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, "UTF-8");//$NON-NLS-1$
 		node.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-
-		// this could be made smarter by actually looking up the content
-		// type's valid extensions
-		node.put(XMLCorePreferenceNames.DEFAULT_EXTENSION, "xml"); //$NON-NLS-1$
-		
-		node.putBoolean(XMLCorePreferenceNames.WARN_NO_GRAMMAR, false);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
index 25c379e..74d0f7f 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005 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
@@ -20,17 +20,7 @@
 	private XMLCorePreferenceNames() {
 		// empty private constructor so users cannot instantiate class
 	}
-
-	/**
-	 * The default extension to use when none is specified in the New File
-	 * Wizard.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-
-
+	
 	/**
 	 * The maximum width of a line before a line split is needed.
 	 * <p>
@@ -38,7 +28,7 @@
 	 * </p>
 	 */
 	public static final String LINE_WIDTH = "lineWidth";//$NON-NLS-1$
-
+	
 	/**
 	 * Indicates if all blanks lines should be cleared during formatting.
 	 * Blank lines will be kept when false.
@@ -91,7 +81,7 @@
 	 * </p>
 	 */
 	public static final String SPLIT_MULTI_ATTRS = "splitMultiAttrs";//$NON-NLS-1$
-
+	
 	/**
 	 * Indicates whether or not cleanup processor should format source.
 	 * <p>
@@ -146,20 +136,9 @@
 	 * delimiters.
 	 * <p>
 	 * Value is of type <code>String</code>.<br />
-	 * Possible values: {CR, CRLF, LF, NO_TRANSLATION}
-	 * </p>
+	 * Possible values: {CR, CRLF, LF, NO_TRANSLATION} 
+	 * </p> 
 	 * 
 	 */
 	public static final String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
-	
-	/**
-	 * Indicates whether or not a warning should be produced when validating a
-	 * file that specifies not grammar.
-	 * <p>
-	 * Value is of type <code>boolean</code>.<br />
-	 * Possible values: {TRUE, FALSE}
-	 * </p>
-	 * 
-	 */
-	public static final String WARN_NO_GRAMMAR = "warnNoGrammar";//$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
index d6f52ff..da0e1de 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
@@ -13,7 +13,7 @@
 package org.eclipse.wst.xml.core.internal.provisional.format;
 
 import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.w3c.dom.Node;
 
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java
index 226be22..aee80a1 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java
@@ -8,7 +8,6 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.provisional.format;
@@ -36,7 +35,6 @@
 				String childIndent = lineIndent + singleIndent;
 				childFormatContraints.setCurrentIndent(childIndent);
 				childFormatContraints.setClearAllBlankLines(formatContraints.getClearAllBlankLines());
-				childFormatContraints.setInPreserveSpaceElement(formatContraints.getInPreserveSpaceElement());
 
 				// format each child
 				formatter.format(eachChildNode, childFormatContraints);
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
index 70141e8..7c21b67 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
@@ -8,7 +8,6 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.provisional.format;
@@ -19,11 +18,10 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.document.AttrImpl;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
@@ -106,7 +104,6 @@
 			int startTagStartOffset = node.getStartOffset();
 			IDOMModel structuredModel = node.getModel();
 
-			boolean currentlyInXmlSpacePreserve = formatContraints.getInPreserveSpaceElement();
 			formatStartTag(node, formatContraints);
 			// save new node
 			newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
@@ -128,7 +125,6 @@
 				}
 			}
 
-			formatContraints.setInPreserveSpaceElement(currentlyInXmlSpacePreserve);
 			// format indentation after node
 			formatIndentationAfterNode(newNode, formatContraints);
 		}
@@ -169,8 +165,6 @@
 			String lineDelimiter = node.getModel().getStructuredDocument().getLineDelimiter();
 			int attrLength = attributes.getLength();
 			int lastUndefinedRegionOffset = 0;
-			boolean sawXmlSpace = false;
-			
 			for (int i = 0; i < attrLength; i++) {
 				AttrImpl attr = (AttrImpl) attributes.item(i);
 				ITextRegion nameRegion = attr.getNameRegion();
@@ -185,9 +179,27 @@
 				// check for xml:space attribute
 				if (flatNode.getText(nameRegion).compareTo(XML_SPACE) == 0) {
 					if (valueRegion == null) {
-						// [111674] If nothing has been written yet, treat as preserve, but only as hint
-						formatContraints.setInPreserveSpaceElement(true);
-						// Note we don't set 'sawXmlSpace', so that default or fixed DTD/XSD values may override.
+						ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
+						CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(node);
+						if (elementDeclaration == null)
+							// CMElementDeclaration not found, default to
+							// PRESERVE
+							formatContraints.setClearAllBlankLines(false);
+						else {
+							CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) elementDeclaration.getAttributes().getNamedItem(XML_SPACE);
+							if (attributeDeclaration == null)
+								// CMAttributeDeclaration not found, default
+								// to PRESERVE
+								formatContraints.setClearAllBlankLines(false);
+							else {
+								String defaultValue = attributeDeclaration.getAttrType().getImpliedValue();
+
+								if (defaultValue.compareTo(PRESERVE) == 0)
+									formatContraints.setClearAllBlankLines(false);
+								else
+									formatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
+							}
+						}
 					}
 					else {
 						ISourceGenerator generator = node.getModel().getGenerator();
@@ -204,10 +216,9 @@
 						}
 
 						if (newAttrValue.compareTo(PRESERVE_QUOTED) == 0)
-							formatContraints.setInPreserveSpaceElement(true);
+							formatContraints.setClearAllBlankLines(false);
 						else
-							formatContraints.setInPreserveSpaceElement(false);
-						sawXmlSpace = true;
+							formatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
 					}
 				}
 
@@ -327,34 +338,7 @@
 				}
 			}
 
-			
 			replace(structuredDocument, offset, length, stringBuffer.toString());
-
-			// If we didn't see a xml:space attribute above, we'll look for one in the DTD.
-			// We do not check for a conflict between a DTD's 'fixed' value
-			// and the attribute value found in the instance document, we leave that to the validator.
-			if (! sawXmlSpace)
-			{
-				ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
-				CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(node);
-				if (elementDeclaration != null)
-				{
-					CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();
-					// Check implied values from the DTD way.
-					CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
-					if (attributeDeclaration != null)
-					{
-						// CMAttributeDeclaration found, check it out.
-						String defaultValue = attributeDeclaration.getAttrType().getImpliedValue();
-						
-						// xml:space="preserve" means preserve space, everything else means back to default.
-						if (defaultValue.compareTo(PRESERVE) == 0)
-							formatContraints.setInPreserveSpaceElement(true);
-						else
-							formatContraints.setInPreserveSpaceElement(false);
-					}
-				}
-			}
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java
index bf8a3f8..cca4e8f 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java
@@ -8,7 +8,6 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.provisional.format;
@@ -25,7 +24,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.document.CDATASectionImpl;
@@ -136,7 +135,7 @@
 
 		if (node != null) {
 			IStructuredDocumentRegion firstStructuredDocumentRegion = node.getFirstStructuredDocumentRegion();
-			if (firstStructuredDocumentRegion != null) {
+			if (firstStructuredDocumentRegion != null && firstStructuredDocumentRegion.getText() != null) {
 				String firstStructuredDocumentRegionText = firstStructuredDocumentRegion.getText();
 				result = StringUtils.containsLineDelimiter(firstStructuredDocumentRegionText);
 			}
@@ -160,8 +159,6 @@
 	}
 
 	protected void formatIndentationAfterNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// [111674] If inside xml:space="preserve" element, we bail
-		if (formatContraints.getInPreserveSpaceElement()) return;
 		if (node != null) {
 			IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
 			IStructuredDocument doc = node.getModel().getStructuredDocument();
@@ -242,8 +239,6 @@
 	}
 
 	protected void formatIndentationBeforeNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// [111674] If inside xml:space="preserve" element, we bail
-		if (formatContraints.getInPreserveSpaceElement()) return;
 		if (node != null) {
 			IDOMNode previousSibling = (IDOMNode) node.getPreviousSibling();
 			IStructuredDocument doc = node.getModel().getStructuredDocument();
@@ -327,9 +322,6 @@
 	 * needed anymore?
 	 */
 	protected void formatTrailingText(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// [111674] If inside xml:space="preserve" element, we bail
-		if (formatContraints.getInPreserveSpaceElement()) return;
-
 		String lineDelimiter = node.getModel().getStructuredDocument().getLineDelimiter();
 		String lineIndent = formatContraints.getCurrentIndent();
 		String parentLineIndent = getNodeIndent(node.getParentNode());
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java
index d82cfd7..0d9433f 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java
@@ -8,7 +8,6 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     Jesper Steen Møller - xml:space='preserve' support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.provisional.format;
@@ -19,7 +18,7 @@
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.w3c.dom.Node;
@@ -27,9 +26,6 @@
 
 public class TextNodeFormatter extends NodeFormatter {
 	protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		// [111674] If inside xml:space="preserve" element, we bail
-		if (formatContraints.getInPreserveSpaceElement())
-			return;
 		if (node != null) {
 			IStructuredDocument doc = node.getModel().getStructuredDocument();
 			int line = doc.getLineOfOffset(node.getStartOffset());
@@ -38,8 +34,7 @@
 				lineDelimiter = doc.getLineDelimiter(line);
 				if (lineDelimiter == null)
 					lineDelimiter = ""; //$NON-NLS-1$
-			}
-			catch (BadLocationException e) {
+			} catch (BadLocationException e) {
 				// log for now, unless we find reason not to
 				Logger.log(Logger.INFO, e.getMessage());
 			}
@@ -55,15 +50,14 @@
 				String text = node.getStructuredDocument().get(lineOffset, nodeNameOffset - lineOffset);
 				int usedWidth = getIndentationLength(text);
 				currentAvailableLineWidth = getFormatPreferences().getLineWidth() - usedWidth;
-			}
-			catch (BadLocationException e) {
+			} catch (BadLocationException e) {
 				// log for now, unless we find reason not to
 				Logger.log(Logger.INFO, e.getMessage());
 			}
 
 			String compressedText = getCompressedNodeText(node, formatContraints);
 
-			if (((enoughSpace(parentNode, currentAvailableLineWidth, compressedText)) && (noSiblingsAndNoFollowingComment(node)) && !firstStructuredDocumentRegionContainsLineDelimiters(parentNode)) || node.getStartOffset() == 0) {
+			if (((compressedText.length() <= (currentAvailableLineWidth - node.getParentNode().getNodeName().length() - 3) && !StringUtils.containsLineDelimiter(compressedText)) && (!nodeHasSiblings(node) || (!StringUtils.containsLineDelimiter(node.getNodeValue()) && node.getNextSibling() != null && node.getNextSibling().getNodeType() == Node.COMMENT_NODE && !StringUtils.containsLineDelimiter(node.getNextSibling().getNodeValue()))) && !firstStructuredDocumentRegionContainsLineDelimiters((IDOMNode) node.getParentNode())) || node.getStartStructuredDocumentRegion().getStartOffset() == 0) {
 				// enough space
 				// and text has no line delimiters
 				// and (node has no siblings or followed by inline comment)
@@ -89,8 +83,7 @@
 					compressedText = EMPTY_STRING;
 
 				replaceNodeValue(node, compressedText);
-			}
-			else {
+			} else {
 				// not enough space, need to reflow text
 
 				currentAvailableLineWidth = lineWidth - getIndentationLength(nodeIndentation);
@@ -120,8 +113,7 @@
 							reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
 						}
 					}
-				}
-				else {
+				} else {
 					if (!reflowedText.endsWith(lineDelimiter + nodeIndentation)) {
 						// not already ended with the expected indentation
 
@@ -146,8 +138,7 @@
 								reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
 								reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
 							}
-						}
-						else {
+						} else {
 							// not a comment, just add add indentation to end
 							reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
 							reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
@@ -161,31 +152,6 @@
 		}
 	}
 
-	private boolean noSiblingsAndNoFollowingComment(IDOMNode node) {
-		IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
-		return !nodeHasSiblings(node) || (noLineDelimiter(node) && isComment(nextSibling) && noLineDelimiter(nextSibling));
-	}
-
-	private boolean isComment(IDOMNode node) {
-		boolean result = false;
-		if (node != null) {
-			result = node.getNodeType() == Node.COMMENT_NODE;
-		}
-		return result;
-	}
-
-	private boolean noLineDelimiter(IDOMNode node) {
-		boolean result = false;
-		if (node != null) {
-			result = !StringUtils.containsLineDelimiter(node.getNodeValue());
-		}
-		return result;
-	}
-
-	private boolean enoughSpace(IDOMNode parentNode, int currentAvailableLineWidth, String compressedText) {
-		return compressedText.length() <= (currentAvailableLineWidth - parentNode.getNodeName().length() - 3) && !StringUtils.containsLineDelimiter(compressedText);
-	}
-
 	protected Vector reflowText(String text, int availableWidth) {
 		String[] stringArray = null;
 		boolean clearAllBlankLines = getFormatPreferences().getClearAllBlankLines();
@@ -209,15 +175,13 @@
 					if ((bufferLength + 1 + eachString.length() > availableWidth) || (eachString.compareTo(CR) == 0) || (eachString.compareTo(LF) == 0)) {
 						if ((eachString.compareTo(LF) == 0) && cr) {
 							// do nothing
-						}
-						else {
+						} else {
 							output.add(buffer.toString());
 							buffer = new StringBuffer();
 							bufferLength = 0;
 						}
 						cr = eachString.compareTo(CR) == 0;
-					}
-					else if (buffer.toString().trim().length() > 0) {
+					} else if (buffer.toString().trim().length() > 0) {
 						buffer.append(SPACE);
 						bufferLength++;
 					}
@@ -228,8 +192,7 @@
 				}
 			}
 			output.add(buffer.toString());
-		}
-		else
+		} else
 			output.add(text);
 
 		return output;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java
index 0ac81bf..7391845 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java
@@ -7,7 +7,7 @@
  * It defines the partition types for XML.
  * Clients should reference the partition type Strings defined here directly.
  * 
- * @deprecated use org.eclipse.wst.xml.core.text
+ * @plannedfor 1.0
  */
 public interface IXMLPartitions {
 	
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java
index 6d61095..bd8a9b8 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java
@@ -20,8 +20,8 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
 
 public class StructuredTextPartitionerForXML extends StructuredTextPartitioner implements IStructuredTextPartitioner {
 
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java
deleted file mode 100644
index c16c574..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.eclipse.wst.xml.core.text;
-
-
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types for XML.
- * Clients should reference the partition type Strings defined here directly.
- * 
- * @since 1.1
- */
-public interface IXMLPartitions {
-	
-	String XML_DEFAULT = "org.eclipse.wst.xml.XML_DEFAULT"; //$NON-NLS-1$
-	String XML_CDATA = "org.eclipse.wst.xml.XML_CDATA"; //$NON-NLS-1$
-	String XML_PI = "org.eclipse.wst.xml.XML_PI"; //$NON-NLS-1$
-	String XML_DECLARATION = "org.eclipse.wst.xml.XML_DECL"; //$NON-NLS-1$
-	String XML_COMMENT = "org.eclipse.wst.xml.XML_COMMENT"; //$NON-NLS-1$
-	
-	/*
-	 * This value is used as a prefix to any unknown processing instructions
-	 * we find. The processor target name is converted to uppercase and
-	 * appended to the prefix to create a unique partition type.
-	 */
-	String PROCESSING_INSTRUCTION_PREFIX = "org.eclipse.wst.xml.PROCESSING_INSTRUCTION:"; //$NON-NLS-1$
-
-	/**
-	 * Should match
-	 * org.eclipse.wst.sse.core.dtd.partitioning.StructuredTextPartitionerForDTD.ST_DTD_SUBSET
-	 */
-	String DTD_SUBSET = "org.eclipse.wst.xml.dtd.internal_subset"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 1511912..0000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:38:54 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
index ec7420a..42fb716 100644
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
@@ -1,5 +1,4 @@
-#Tue Apr 04 01:47:57 EDT 2006
-compilers.p.build=0
+#Fri May 27 23:56:32 EDT 2005
 compilers.p.deprecated=1
 compilers.p.illegal-att-value=0
 compilers.p.no-required-att=0
diff --git a/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
index 140f873..8c3d7af 100644
--- a/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
@@ -2,44 +2,42 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xml.ui; singleton:=true
-Bundle-Version: 1.0.100.qualifier
+Bundle-Version: 1.0.2.qualifier
 Bundle-Activator: org.eclipse.wst.xml.ui.internal.XMLUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.wst.xml.ui,
- org.eclipse.wst.xml.ui.internal;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.actions;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.autoedit;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.catalog;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.catalog.icons.etool50;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.catalog.icons.obj16;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.catalog.icons.ovr16;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.contentassist;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.contentoutline;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.correction;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.dialogs;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.dnd;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.doubleclick;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.editor;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.hyperlink;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.nsedit;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.preferences;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.projection;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.properties;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.provisional;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.registry;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.search;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.selection;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.style;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.tabletree;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.taginfo;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.templates;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.text;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.util;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.validation;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.wizards;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.wizards.icons;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
+ org.eclipse.wst.xml.ui.internal,
+ org.eclipse.wst.xml.ui.internal.actions,
+ org.eclipse.wst.xml.ui.internal.autoedit,
+ org.eclipse.wst.xml.ui.internal.catalog,
+ org.eclipse.wst.xml.ui.internal.contentassist,
+ org.eclipse.wst.xml.ui.internal.contentoutline,
+ org.eclipse.wst.xml.ui.internal.correction,
+ org.eclipse.wst.xml.ui.internal.dialogs,
+ org.eclipse.wst.xml.ui.internal.dnd,
+ org.eclipse.wst.xml.ui.internal.doubleclick,
+ org.eclipse.wst.xml.ui.internal.editor,
+ org.eclipse.wst.xml.ui.internal.hyperlink,
+ org.eclipse.wst.xml.ui.internal.nsedit,
+ org.eclipse.wst.xml.ui.internal.preferences,
+ org.eclipse.wst.xml.ui.internal.projection,
+ org.eclipse.wst.xml.ui.internal.properties,
+ org.eclipse.wst.xml.ui.internal.provisional,
+ org.eclipse.wst.xml.ui.internal.registry,
+ org.eclipse.wst.xml.ui.internal.search,
+  org.eclipse.wst.xml.ui.internal.selection,
+ org.eclipse.wst.xml.ui.internal.style,
+ org.eclipse.wst.xml.ui.internal.tabletree,
+ org.eclipse.wst.xml.ui.internal.taginfo,
+ org.eclipse.wst.xml.ui.internal.templates,
+ org.eclipse.wst.xml.ui.internal.text,
+ org.eclipse.wst.xml.ui.internal.util,
+ org.eclipse.wst.xml.ui.internal.validation,
+ org.eclipse.wst.xml.ui.internal.validation.core,
+ org.eclipse.wst.xml.ui.internal.validation.core.errorinfo,
+ org.eclipse.wst.xml.ui.internal.wizards,
+ org.eclipse.wst.xml.ui.internal.wizards.icons,
  org.eclipse.wst.xml.ui.views.contentoutline,
  org.eclipse.wst.xml.ui.views.properties
 Require-Bundle: org.eclipse.ui.ide,
@@ -55,6 +53,5 @@
  org.eclipse.wst.common.uriresolver,
  org.eclipse.wst.xml.core,
  org.eclipse.wst.common.ui,
- org.eclipse.wst.validation,
- com.ibm.icu
-Eclipse-LazyStart: true
+ org.eclipse.wst.validation
+Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.xml.ui/build.properties b/bundles/org.eclipse.wst.xml.ui/build.properties
index d6aa2ff..f12bc55 100644
--- a/bundles/org.eclipse.wst.xml.ui/build.properties
+++ b/bundles/org.eclipse.wst.xml.ui/build.properties
@@ -11,9 +11,11 @@
 #     
 ###############################################################################
 bin.includes = plugin.xml,\
+               xml.jar,\
                icons/,\
                plugin.properties,\
                templates/,\
+               xmleditor.jar,\
                examples/,\
                META-INF/,\
                .,\
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.properties b/bundles/org.eclipse.wst.xml.ui/plugin.properties
index 65978f3..3281929 100644
--- a/bundles/org.eclipse.wst.xml.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.xml.ui/plugin.properties
@@ -12,6 +12,7 @@
 ###############################################################################
 providerName=Eclipse.org
 pluginName=XML UI Plugin
+nlFeatureName=XML UI Plugin NL Support
 XML_Files.name=XML Files
 XML_Source.name=XML Source
 XML_Templates.name=XML Templates
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.xml b/bundles/org.eclipse.wst.xml.ui/plugin.xml
index 371dc26..6415561 100644
--- a/bundles/org.eclipse.wst.xml.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.xml.ui/plugin.xml
@@ -157,7 +157,7 @@
 	<extension point="org.eclipse.ui.editors">
 		<editor
 			name="%XML_Editor.name"
-			icon="$nl$/icons/xmldoc.gif"
+			icon="icons/xmldoc.gif"
 			default="true"
 			contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorActionBarContributor"
 			class="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart"
@@ -198,7 +198,7 @@
 		</category>
 		<wizard
 			name="%_UI_WIZARD_NEW_XML"
-			icon="$nl$/icons/XMLFile.gif"
+			icon="icons/XMLFile.gif"
 			category="org.eclipse.wst.XMLCategory"
 			class="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"
 			id="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard">
@@ -273,7 +273,7 @@
 			category="org.eclipse.ui.Examples/org.eclipse.wst.xml.examples"
 			id="org.eclipse.wst.xml.ui.XMLExampleProjectCreationWizard"
 			project="true"
-			icon="$nl$/icons/newSampleProject_wiz.gif">
+			icon="icons/newSampleProject_wiz.gif">
 			<description>
 				%XMLExampleProjectCreationWizard.description
 			</description>
@@ -368,6 +368,52 @@
 	</extension>
 
 	<!-- ====================================================== -->
+	<!-- Define Assign Validate action on .xml file             -->
+	<!-- ====================================================== -->
+	<extension point="org.eclipse.ui.popupMenus">
+		<objectContribution
+			objectClass="org.eclipse.core.resources.IFile"
+			nameFilter="*.xml"
+			id="org.eclipse.wst.xml.validation.xmlaction">
+			<visibility>
+				<not>
+					<or>
+						<objectState
+							name="projectNature"
+							value="org.eclipse.jst.j2ee.ejb.EJBNature" />
+						<objectState
+							name="projectNature"
+							value="org.eclipse.jst.j2ee.EARNature" />
+					</or>
+				</not>
+			</visibility>
+			<action
+				label="%_UI_MENU_VALIDATE_XML"
+				class="org.eclipse.wst.xml.ui.internal.validation.ValidateXMLFileActionDelegate"
+				enablesFor="1"
+				id="org.eclipse.wst.xml.ui.internal.validation.ValidateXMLFileActionDelegate">
+			</action>
+		</objectContribution>
+	</extension>
+	<!-- ====================================================== -->
+	<!-- Define Validate action on .tld file             -->
+	<!-- ====================================================== -->
+	<extension point="org.eclipse.ui.popupMenus">
+		<objectContribution
+			objectClass="org.eclipse.core.resources.IFile"
+			nameFilter="*.tld"
+			id="org.eclipse.wst.xml.validation.xmlaction">
+			<action
+				label="%_UI_MENU_VALIDATE_XML"
+				class="org.eclipse.wst.xml.ui.internal.validation.ValidateXMLFileActionDelegate"
+				enablesFor="1"
+				id="org.eclipse.wst.xml.ui.internal.validation.ValidateXMLFileActionDelegate">
+			</action>
+		</objectContribution>
+	</extension>
+
+
+	<!-- ====================================================== -->
 	<!-- An extension for creating nested validation messages.  -->
 	<!-- This extension should be moved when the referenced     -->
 	<!-- files dialog is moved to another plugin.               -->
@@ -393,7 +439,54 @@
 		</objectContribution>
 	</extension>
 
-	
+	<!-- ====================================================== -->
+	<!-- Register the XML validator with the validation 		-->
+	<!-- framework. 										    -->
+	<!-- ====================================================== -->
+
+	<extension
+		id="xmlValidator"
+		name="%_UI_XML_VALIDATOR"
+		point="org.eclipse.wst.validation.validator">
+		<validator>
+			<!-- There is a custom XML validator for EJBs -->
+			<projectNature
+				include="false"
+				id="org.eclipse.jst.j2ee.ejb.EJBNature">
+			</projectNature>
+			<!-- There is a custom XML validator for EARs -->
+			<projectNature
+				include="false"
+				id="org.eclipse.jst.j2ee.EARNature">
+			</projectNature>
+			<filter
+				objectClass="org.eclipse.core.resources.IFile"
+				caseSensitive="false"
+				nameFilter="*.xml">
+			</filter>
+			<filter
+				objectClass="org.eclipse.core.resources.IFile"
+				caseSensitive="false"
+				nameFilter="*.gph">
+			</filter>
+			<filter
+				objectClass="org.eclipse.core.resources.IFile"
+				caseSensitive="false"
+				nameFilter="*.wdo-connections">
+			</filter>
+			<filter
+				objectClass="org.eclipse.core.resources.IFile"
+				caseSensitive="false"
+				nameFilter="*.tld" />
+			<helper
+				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
+			</helper>
+			<run
+				class="org.eclipse.wst.xml.ui.internal.validation.Validator">
+			</run>
+		</validator>
+	</extension>
+
 	<extension point="org.eclipse.ui.editorActions">
 		<editorContribution
 			id="org.eclipse.core.runtime.xml.source.editorActions"
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
index bb86b54..f474f57 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
@@ -210,15 +210,11 @@
                 {
                     ICatalogEntry entry = (ICatalogEntry) selectedObject;
                     detailsView.setCatalogElement(entry);
-                }
-                else if (selectedObject instanceof INextCatalog)
+                } else if (selectedObject instanceof INextCatalog)
                 {
                 	INextCatalog entry = (INextCatalog) selectedObject;
                     detailsView.setCatalogElement(entry);
                 }
-                else {
-                	detailsView.setCatalogElement((ICatalogEntry) null); 
-                }
                 
             }
         };
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
index b100daa..ff39ae2 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
@@ -12,7 +12,7 @@
  */
 package org.eclipse.wst.xml.ui.internal.catalog;
 
-import com.ibm.icu.text.Collator;
+import java.text.Collator;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -103,7 +103,7 @@
 				base = image;
 
 				if (base != null) {
-					if (URIHelper.isReadableURI(uri, true)) {
+					if (URIHelper.isReadableURI(uri, false)) {
 						result = base;
 					}
 					else {
@@ -234,10 +234,6 @@
 					}
 				}
 			}
-			else if ( element.equals(XMLCatalogTreeViewer.PLUGIN_SPECIFIED_ENTRIES_OBJECT ) ||
-					element.equals(XMLCatalogTreeViewer.USER_SPECIFIED_ENTRIES_OBJECT) ) {
-				return true;
-			}
 			return result;
 		}
 	}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
index ab38b7e..3f46783 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
@@ -40,10 +40,11 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageEditorSite;
 import org.eclipse.ui.part.MultiPageSelectionProvider;
 import org.eclipse.ui.progress.UIJob;
+import org.eclipse.wst.common.ui.provisional.editors.PostMultiPageEditorSite;
+import org.eclipse.wst.common.ui.provisional.editors.PostMultiPageSelectionProvider;
+import org.eclipse.wst.common.ui.provisional.editors.PostSelectionMultiPageEditorPart;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.ui.StructuredTextEditor;
@@ -52,7 +53,7 @@
 import org.eclipse.wst.xml.ui.internal.Logger;
 import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
 
-public class XMLMultiPageEditorPart extends MultiPageEditorPart {
+public class XMLMultiPageEditorPart extends PostSelectionMultiPageEditorPart {
 
 	/**
 	 * Internal part activation listener, copied from AbstractTextEditor
@@ -363,7 +364,7 @@
 		if (fDesignViewer.getSelectionProvider() instanceof IPostSelectionProvider) {
 			((IPostSelectionProvider) fDesignViewer.getSelectionProvider()).addPostSelectionChangedListener(new ISelectionChangedListener() {
 				public void selectionChanged(SelectionChangedEvent event) {
-					((MultiPageSelectionProvider) getSite().getSelectionProvider()).firePostSelectionChanged(event);
+					((PostMultiPageSelectionProvider) getSite().getSelectionProvider()).firePostSelectionChanged(event);
 				}
 			});
 		}
@@ -524,7 +525,7 @@
 	protected IEditorSite createSite(IEditorPart editor) {
 		IEditorSite site = null;
 		if (editor == fTextEditor) {
-			site = new MultiPageEditorSite(this, editor) {
+			site = new PostMultiPageEditorSite(this, editor) {
 				/**
 				 * @see org.eclipse.ui.part.MultiPageEditorSite#getActionBarContributor()
 				 */
@@ -660,7 +661,7 @@
 	private IPreferenceStore getPreferenceStore() {
 		return XMLUIPlugin.getDefault().getPreferenceStore();
 	}
-
+	
 	StructuredTextEditor getTextEditor() {
 		return fTextEditor;
 	}
@@ -740,13 +741,11 @@
 		saveLastActivePageIndex(newPageIndex);
 
 		if (newPageIndex == fDesignPageIndex) {
-			// design page isn't an IEditorPart, therefore we have to send
-			// selection changes ourselves
 			ISelectionProvider selectionProvider = fDesignViewer.getSelectionProvider();
 			if (selectionProvider != null) {
 				SelectionChangedEvent event = new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection());
 				((MultiPageSelectionProvider) getSite().getSelectionProvider()).fireSelectionChanged(event);
-				((MultiPageSelectionProvider) getSite().getSelectionProvider()).firePostSelectionChanged(event);
+				((PostMultiPageSelectionProvider) getSite().getSelectionProvider()).firePostSelectionChanged(event);
 			}
 		}
 	}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
index 2e72f98..cafcd60 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
@@ -149,7 +149,7 @@
 					break;
 				}
 				case Node.ENTITY_REFERENCE_NODE : {
-					image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ENTITY_REFERENCE);
+					image = image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ENTITY_REFERENCE);
 					break;
 				}
 			}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
index 912a8df..dd2d027 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
@@ -20,8 +20,8 @@
 import org.eclipse.swt.events.DisposeEvent;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Menu;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.ui.internal.actions.NodeAction;
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java
new file mode 100644
index 0000000..6cd89e8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.validation;
+
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
+import org.eclipse.wst.xml.ui.internal.Logger;
+
+                
+/**
+ * This class managers the 'UI' related details of validation
+ * Here's a quick overview of the details : 
+ *   - manages Marker creation based on the results of the validation
+ *   - (optionally) displays dialog to summarize the results of validation
+ * 
+ * @author Craig Salter, IBM
+ * @author Lawrence Mandel, IBM
+ */
+public class ValidateAction extends org.eclipse.wst.xml.ui.internal.validation.core.ValidateAction
+{ 
+  //dw private static final String _UI_MESSAGE_LIMITE_EXCEEDED = "_UI_MESSAGE_LIMITE_EXCEEDED";
+  
+  private InputStream inputStream;
+  
+
+  /**
+   * Constructor.
+   * 
+   * @param file The file to validate.
+   * @param showDialog Whether to display a dialog after validation.
+   */
+  public ValidateAction(IFile file, boolean showDialog)
+  {   
+    super(file, showDialog);
+  }  
+
+  /*
+   * Store additional information in the message parameters
+   * param[0] = the column number of the error
+   * param[1] = the 'squiggle selection strategy' for which DOM part to squiggle
+   * param[2] = the name or value of what is to be squiggled
+   */
+  protected void addInfoToMessage(ValidationMessage validationMessage, IMessage message)
+  { 
+    if (inputStream != null)
+    {
+      XMLMessageInfoHelper messageInfoHelper = new XMLMessageInfoHelper();
+      String[] messageInfo = messageInfoHelper.createMessageInfo(validationMessage.getKey(), validationMessage.getMessageArguments());
+      
+	  message.setAttribute(COLUMN_NUMBER_ATTRIBUTE, new Integer(validationMessage.getColumnNumber()));
+	  message.setAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE, messageInfo[0]);
+	  message.setAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE, messageInfo[1]);
+    }  
+  }
+  
+  protected void validate(final IFile file)
+  {      
+    final XMLValidationOutcome valoutcome = new XMLValidationOutcome();
+    IPath path = file.getLocation();
+    final String uri = createURIForFilePath(path.toString());
+
+    IWorkspaceRunnable op = new IWorkspaceRunnable() 
+    {
+      public void run(IProgressMonitor progressMonitor) throws CoreException 
+      {         
+        XMLValidator validator = XMLValidator.getInstance();
+
+        clearMarkers(file);
+        XMLValidationReport valreport = null;
+        if (inputStream != null)
+        {
+          valreport = validator.validate(uri, inputStream);
+        }
+        else
+        {
+          valreport = validator.validate(uri);
+        }
+        
+        valoutcome.isValid = valreport.isValid();
+        if(valreport.getValidationMessages().length == 0)
+        {
+          valoutcome.hasMessages = false;
+        }
+        else
+        {
+          valoutcome.hasMessages = true;
+        }
+        valoutcome.isGrammarEncountered = valreport.isGrammarEncountered();
+        createMarkers(file, valreport.getValidationMessages());
+        
+        file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
+      }
+    };    
+
+    
+    try
+    {
+      ResourcesPlugin.getWorkspace().run(op, null);
+//      String internalErrorMessage = null;
+//      if (validator.getInternalError() != null)
+//      {
+//        internalErrorMessage =  XMLValidatePlugin.getString("_UI_VALIDATION_INTERNAL_ERROR");
+//        internalErrorMessage += " : " + validator.getInternalError();
+//      }
+                 
+      if (showDialog)
+      {
+        // The file is invalid.
+        if (!valoutcome.isValid)
+        {
+          String title = XMLValidationUIMessages._UI_VALIDATION_FAILED;
+          String message = XMLValidationUIMessages._UI_THE_XML_FILE_IS_NOT_VALID;
+          openErrorDialog(title, message);
+        }
+        else
+        {
+          // The file is valid however warnings were issued.
+          if(valoutcome.hasMessages)
+          {
+            String title = XMLValidationUIMessages._UI_VALIDATION_SUCEEDED;
+            String message = valoutcome.isGrammarEncountered ?
+            			XMLValidationUIMessages._UI_THE_XML_FILE_IS_VALID_WITH_WARNINGS : 
+            				XMLValidationUIMessages._UI_THE_XML_FILE_IS_WELL_FORMED_WITH_WARNINGS + 
+            				XMLValidationUIMessages._UI_NO_GRAMMAR_WARNING;                             
+            
+            openWarningDialog(title, message);
+          }
+          // The file is valid with no warnings.
+          else
+          {
+            String title = XMLValidationUIMessages._UI_VALIDATION_SUCEEDED;
+            String message = valoutcome.isGrammarEncountered ?
+            			XMLValidationUIMessages._UI_THE_XML_FILE_IS_VALID : 
+            				XMLValidationUIMessages._UI_THE_XML_FILE_IS_WELL_FORMED + 
+            				XMLValidationUIMessages._UI_NO_GRAMMAR_WARNING;                             
+            
+            openValidDialog(title, message);
+          }
+        }
+      }
+    }
+
+    catch (CoreException e)
+    {
+      Logger.logException(e);
+    }                           
+  } 
+  
+  /**
+   * An XML specific validation outcome that includes whether a grammar 
+   * was encountered.
+   * 
+   * @author Lawrence Mandel, IBM
+   */
+  protected class XMLValidationOutcome extends ValidationOutcome
+  {
+    public boolean isGrammarEncountered = false;
+  }
+  public void setInputStream(InputStream inputStream)
+  { this.inputStream = inputStream;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateXMLFileActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateXMLFileActionDelegate.java
new file mode 100644
index 0000000..4bd2d95
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateXMLFileActionDelegate.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.validation;
+                                       
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IActionDelegate;
+
+/**
+ * A delegate to invoke XML validation from the context menu's Validate XML option.
+ * 
+ * @author Craig Saler, IBM
+ * @author Lawrence Mandel, IBM
+ */
+public class ValidateXMLFileActionDelegate implements IActionDelegate
+{
+  protected ISelection selection;
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+   */
+  public void run(IAction action)
+  {
+    IFile fileResource = null;
+    try
+ {
+      // CS.. for now the following line tests to ensure the user has xerces jars installed
+      // so that we can perform some 'fail fast' behaviour
+      //
+      Class theClass = Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader()); //$NON-NLS-1$
+      if (theClass == null)
+      {
+       throw(new Exception("Missing Xerces jars in plugin's 'jars' folder"));        //$NON-NLS-1$
+      }
+        
+    if (!selection.isEmpty() && selection instanceof IStructuredSelection)
+    {
+      IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+      Object element = structuredSelection.getFirstElement();
+
+      if (element instanceof IFile)
+      {
+        fileResource = (IFile) element;
+      }
+      else
+      {
+        return;
+      }
+    }
+          
+    if (fileResource != null)
+    {            
+      //IProject project = fileResource.getProject();
+      //URIResolver resolver = (URIResolver) project.getAdapter(URIResolver.class);
+ // if (resolver == null)
+  // resolver = new ProjectResolver(project);
+  //resolver.setFileBaseLocation(fileResource.getLocation().toString());
+  //return resolver;
+      ValidateAction validateAction = new ValidateAction(fileResource, true);
+      validateAction.setValidator(new Validator());
+      validateAction.run();
+    }
+ }
+    catch (Exception e)
+ {
+      // CS... here's where we need to pop up a dialog to tell the user that xerces is not available
+      //
+      String xercesLine1 = XMLValidationUIMessages.ValidateXMLFileActionDelegate_2;
+      String xercesLine2 = XMLValidationUIMessages.ValidateXMLFileActionDelegate_3;
+      String xercesLine3 = XMLValidationUIMessages.ValidateXMLFileActionDelegate_4;
+      MessageDialog.openError(Display.getDefault().getActiveShell(), XMLValidationUIMessages.ValidateXMLFileActionDelegate_5, xercesLine1 + xercesLine2 + xercesLine3);
+ }
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+   */
+  public void selectionChanged(IAction action, ISelection selection)
+  {
+    this.selection = selection;
+  }   
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java
new file mode 100644
index 0000000..c31ef45
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.validation;
+
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Locale;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.validation.internal.core.Message;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.IRuleGroup;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+
+/**
+ * A validator to plug the XML validator into the validation framework.
+ * 
+ * @author Craig Salter, IBM
+ * @author Lawrence Mandel, IBM
+ */
+public class Validator implements IValidator
+{
+	class LocalizedMessage extends Message {
+		private String _message = null;
+
+		public LocalizedMessage(int severity, String messageText) {
+			this(severity, messageText, null);
+		}
+
+		public LocalizedMessage(int severity, String messageText, IResource targetObject) {
+			this(severity, messageText, (Object) targetObject);
+		}
+
+		public LocalizedMessage(int severity, String messageText, Object targetObject) {
+			super(null, severity, null);
+			setLocalizedMessage(messageText);
+			setTargetObject(targetObject);
+		}
+
+		public void setLocalizedMessage(String message) {
+			_message = message;
+		}
+
+		public String getLocalizedMessage() {
+			return _message;
+		}
+
+		public String getText() {
+			return getLocalizedMessage();
+		}
+
+		public String getText(ClassLoader cl) {
+			return getLocalizedMessage();
+		}
+
+		public String getText(Locale l) {
+			return getLocalizedMessage();
+		}
+
+		public String getText(Locale l, ClassLoader cl) {
+			return getLocalizedMessage();
+		}
+	}
+	
+  private final String GET_FILE = "getFile"; //$NON-NLS-1$
+  public final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
+
+	static boolean shouldValidate(IFile file) {
+		IResource resource = file;
+		do {
+			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
+				return false;
+			}
+			resource = resource.getParent();
+		}
+		while ((resource.getType() & IResource.PROJECT) == 0);
+		return true;
+	}
+
+  /**
+   * Validate the given file.
+   * 
+   * @param file The file to validate.
+   */
+  public void validate(IFile file)
+  {
+    ValidateAction validateAction = new ValidateAction(file, false);
+    validateAction.setValidator(this);
+    validateAction.run();	
+  }
+  public void validate(IFile file, InputStream inputStream, IReporter reporter)
+  {
+    ValidateAction validateAction = new ValidateAction(file, false);
+    validateAction.setValidator(this);
+    if (inputStream != null)
+    {
+      validateAction.setInputStream(inputStream);
+      validateAction.setReporter(reporter);
+    }
+    validateAction.run(); 
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wtp.validation.core.IValidator#validate(org.eclipse.wtp.validation.core.IHelper, org.eclipse.wtp.validation.core.IReporter, org.eclipse.wtp.validation.core.IFileDelta[])
+   */
+  public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
+	 String[] fileURIs = helper.getURIs();
+     if (fileURIs != null && fileURIs.length > 0) 
+    {
+      for (int i = 0; i < fileURIs.length; i++) 
+      {
+        String fileName = fileURIs[i];
+        if (fileName != null)
+        {          
+          Object []parms = {fileName};
+
+          IFile file = (IFile) helper.loadModel(GET_FILE, parms);
+          if (file != null && shouldValidate(file)) 
+          { //the helper might not have the file stored in it. could have an InputStream
+            if (helper.loadModel("inputStream") instanceof InputStream) //$NON-NLS-1$
+            {
+              validate(file, (InputStream)helper.loadModel("inputStream"), reporter); //do we need the fileName?  what is int ruleGroup? //$NON-NLS-1$
+            }
+            else
+            {
+              //if (((Helper)helper).isInJavaBuildPath(file) &&
+              //    !((WorkbenchContext)helper).isInJavaSourcePath(file))
+              //{
+              //  continue;
+              //}
+              validateIfNeeded(file, helper, reporter);
+            }
+          }
+        }
+      }
+    }
+    else 
+    {
+      Object []parms = {this.getClass().getName()};
+      Collection files = (Collection) helper.loadModel(GET_PROJECT_FILES, parms);
+      Iterator iter = files.iterator();
+      while (iter.hasNext()) 
+      {
+        IFile file = (IFile) iter.next();
+        validateIfNeeded(file, helper, reporter);
+      }
+    }
+  }
+  
+  /**
+   * Validate the given file and use the reporter for the validation messages.
+   * 
+   * @param file The file to validate.
+   * @param reporter The reporter to report the validation messages.
+   * @param ruleGroup
+   */
+  public void validate(IFile file, IReporter reporter, int ruleGroup)
+  {  
+    ValidateAction validateAction = new ValidateAction(file, false);
+    validateAction.setValidator(this);
+    validateAction.run();  
+  }
+  
+  /**
+   * Validate the given file if validation is required.
+   * 
+   * @param file The file to validate.
+   * @param helper An aid for the validation.
+   * @param reporter The reporter to report the validation messages.
+   */
+  protected void validateIfNeeded(IFile file, IValidationContext helper, IReporter reporter)
+  {
+    Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(XMLUIMessages.MESSAGE_XML_VALIDATION_MESSAGE_UI_, new String[]{file.getFullPath().toString()}));
+    reporter.displaySubtask(this, message);
+
+    Integer ruleGroupInt = (Integer)helper.loadModel(IRuleGroup.PASS_LEVEL, null); // pass in a "null" so that loadModel doesn't attempt to cast the result into a RefObject
+    int ruleGroup = (ruleGroupInt == null) ? IRuleGroup.PASS_FULL : ruleGroupInt.intValue();
+
+    validate(file, reporter, ruleGroup);
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wtp.validation.core.IValidator#cleanup(org.eclipse.wtp.validation.core.IReporter)
+   */
+  public void cleanup(IReporter reporter)
+  {
+	// Nothing to do.
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLMessageInfoHelper.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLMessageInfoHelper.java
new file mode 100644
index 0000000..c08b6dc
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLMessageInfoHelper.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.validation;
+
+public class XMLMessageInfoHelper
+{
+  public XMLMessageInfoHelper()
+  {
+    super();
+  }
+
+  /**
+   *  returns an array containing information about what should be underlined with the red "squiggles"
+   *  using the errorKey, and the messageArguments
+   *  <br>Position 0 of the array returned contains the selection Strategy,or what DOM Element to underline.  
+   *  For example "ATTRIBUTE_NAME"  
+   *  <br>Position 1 contains the name or value to squiggle.
+   *  <p>For example, if we wanted to squiggle the attribute name of an attribute name
+   *  foo this method would return {"ATTRIBUTE_NAME", "foo"}
+   *  </p>
+   *  @param errorKey the error key given by the Xerces parser
+   *  @param messageArguments the arguments used by Xerces to "fill in the blanks" of their messages
+   *  @return an array containing the squiggle information
+   *  @see org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator
+   *  
+   */
+  public String[] createMessageInfo(String errorKey, Object[] messageArguments)
+  { 
+    String selectionStrategy = null;
+    String nameOrValue = null;
+
+    if (errorKey.equals("cvc-complex-type.2.4.a") || errorKey.equals("cvc-complex-type.2.4.d") || errorKey.equals("cvc-complex-type.2.4.b") || errorKey.equals("MSG_CONTENT_INVALID") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+        | errorKey.equals("MSG_CONTENT_INCOMPLETE") || errorKey.equals("MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED") || errorKey.equals("cvc-complex-type.4")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+    {
+      selectionStrategy = "START_TAG"; //$NON-NLS-1$
+    }
+    else if (errorKey.equals("cvc-type.3.1.3")) //$NON-NLS-1$
+    {
+      selectionStrategy = "TEXT"; //$NON-NLS-1$
+    }
+    else if (errorKey.equals("cvc-complex-type.2.3")) //$NON-NLS-1$
+    {
+    	selectionStrategy = "FIRST_NON_WHITESPACE_TEXT"; //$NON-NLS-1$
+    }
+    else if (errorKey.equals("cvc-type.3.1.1")) //$NON-NLS-1$
+    {
+      selectionStrategy = "ALL_ATTRIBUTES"; //$NON-NLS-1$
+    }
+    else if (errorKey.equals("cvc-complex-type.3.2.2") || errorKey.equals("MSG_ATTRIBUTE_NOT_DECLARED")) //$NON-NLS-1$ //$NON-NLS-2$
+    {
+      selectionStrategy = "ATTRIBUTE_NAME"; //$NON-NLS-1$
+	  //in this case we need nameOrValue to be the name of the attribute to underline
+	  nameOrValue = (String)messageArguments[1];
+    }
+    else if (errorKey.equals("cvc-attribute.3") || errorKey.equals("MSG_ATTRIBUTE_VALUE_NOT_IN_LIST") || errorKey.equals("cvc-complex-type.3.1")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+    {	
+    	selectionStrategy = "ATTRIBUTE_VALUE";   //$NON-NLS-1$
+		//in this case we need nameOrValue to be the name of the Attribute
+    	if (errorKey.equals("cvc-attribute.3") || errorKey.equals("cvc-complex-type.3.1")) //$NON-NLS-1$ //$NON-NLS-2$
+    	{ nameOrValue = (String)messageArguments[1];
+    	}
+    	else if (errorKey.equals("MSG_ATTRIBUTE_VALUE_NOT_IN_LIST")) //$NON-NLS-1$
+    	{	nameOrValue = (String)messageArguments[0];
+    	}
+    }
+    else if (errorKey.equals("cvc-elt.4.2")) //$NON-NLS-1$
+    {	selectionStrategy="VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE"; //$NON-NLS-1$
+		//in this case we need nameOrValue to be the value of the attribute we want to unerline
+    	nameOrValue = (String)messageArguments[1];	
+    }
+    else if (errorKey.equals("EntityNotDeclared")) //$NON-NLS-1$
+    {  	selectionStrategy="TEXT_ENTITY_REFERENCE"; //$NON-NLS-1$
+        nameOrValue = (String)messageArguments[0];
+    }
+    else if (errorKey.equals("ElementUnterminated")) //$NON-NLS-1$
+	{
+		selectionStrategy = "ENTIRE_ELEMENT"; //$NON-NLS-1$
+	}
+    String messageInfo[] = new String[2];
+    messageInfo[0] = selectionStrategy != null? selectionStrategy: ""; //$NON-NLS-1$
+    messageInfo[1] = nameOrValue;
+    return messageInfo;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java
index 04e67ec..bdd6994 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java
@@ -27,6 +27,16 @@
 		// initialize resource bundle
 		NLS.initializeMessages(BUNDLE_NAME, XMLValidationUIMessages.class);
 	}
+	public static String _UI_VALIDATION_INTERNAL_ERROR;
+	public static String _UI_VALIDATION_FAILED;
+	public static String _UI_VALIDATION_SUCEEDED;
+	public static String _UI_THE_XML_FILE_IS_NOT_VALID;
+	public static String _UI_THE_XML_FILE_IS_VALID;
+	public static String _UI_THE_XML_FILE_IS_VALID_WITH_WARNINGS;
+	public static String _UI_THE_XML_FILE_IS_WELL_FORMED;
+	public static String _UI_THE_XML_FILE_IS_WELL_FORMED_WITH_WARNINGS;
+	public static String _UI_NO_GRAMMAR_WARNING;
+	public static String _UI_MESSAGE_LIMITE_EXCEEDED;
 	public static String _UI_REF_FILE_ERROR_DESCRIPTION;
 	public static String _UI_REF_FILE_ERROR_MESSAGE;
 	public static String _UI_REF_FILE_ERROR_DETAILS;
@@ -34,6 +44,10 @@
 	public static String _UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE;
 	public static String _UI_SAVE_DIRTY_FILE_MESSAGE;
 	public static String _UI_SAVE_DIRTY_FILE_TITLE;
+	public static String ValidateXMLFileActionDelegate_2;
+	public static String ValidateXMLFileActionDelegate_3;
+	public static String ValidateXMLFileActionDelegate_4;
+	public static String ValidateXMLFileActionDelegate_5;
 	public static String TaskListTableViewer_0;
 	public static String TaskListTableViewer_1;
 	public static String TaskListTableViewer_2;
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidator.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidator.java
new file mode 100644
index 0000000..1f3cb21
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidator.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.validation;
+
+import java.io.InputStream;
+
+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
+import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
+import org.eclipse.wst.xml.core.internal.validation.eclipse.ErrorCustomizationPluginRegistryReader;
+
+/**
+ * An XML validator specific to Eclipse. This validator will wrap the internal
+ * XML validator an provide automatic URI resolver support.
+ * Using this class is equivalent to using the internal XML validator and registering
+ * the URI resolver.
+ * 
+ * @author Lawrence Mandel, IBM
+ */
+public class XMLValidator
+{
+  private static XMLValidator instance = null;
+  private org.eclipse.wst.xml.core.internal.validation.XMLValidator validator = null;
+  
+  /**
+   * Return the one and only instance of the XML validator. The validator
+   * can be reused and cannot be customized so there should only be one instance of it.
+   * 
+   * @return The one and only instance of the XML validator.
+   */
+  public static XMLValidator getInstance()
+  {
+    if(instance == null)
+    {
+      instance = new XMLValidator();
+    }
+    return instance;
+  }
+  /**
+   * Constructor. Create the XML validator and set the URI resolver.
+   */
+  protected XMLValidator()
+  {
+    validator = new org.eclipse.wst.xml.core.internal.validation.XMLValidator();
+    validator.setURIResolver(URIResolverPlugin.createResolver());
+    new ErrorCustomizationPluginRegistryReader().readRegistry();
+  }
+  /**
+   * Validate the file at the given URI.
+   * 
+   * @param uri The URI of the file to validate.
+   */
+  public XMLValidationReport validate(String uri)
+  {
+    return validator.validate(uri);
+  }
+  /**
+   * Validate the InputStream
+   * 
+   * @param uri The URI of the file to validate.
+   * @param inputStream The input stream to validate.
+   */
+  public XMLValidationReport validate(String uri, InputStream inputStream)
+  {
+    return validator.validate(uri, inputStream);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/ValidateAction.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/ValidateAction.java
new file mode 100644
index 0000000..449ee12
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/ValidateAction.java
@@ -0,0 +1,431 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.validation.core;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
+import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
+import org.eclipse.wst.xml.core.internal.validation.core.logging.ILogger;
+import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
+import org.eclipse.wst.xml.ui.internal.Logger;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
+import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
+
+/**
+ * A general validate action class that can be extended by validators. This class
+ * provides methods to run the action, add markers to a file and will handle
+ * showing a dialog with the results of validation (if requested) and prompt to
+ * save dirty files (if requested.)
+ */
+public abstract class ValidateAction extends Action
+{
+  // Locally used, non-UI strings.
+  private static final String REFERENCED_FILE_ERROR_OPEN = "referencedFileError("; //$NON-NLS-1$
+
+  private static final String REFERENCED_FILE_ERROR_CLOSE = ")"; //$NON-NLS-1$
+
+  private static final String REFERENCED_FILE_ERROR = "referencedFileError"; //$NON-NLS-1$
+
+  private static final String GROUP_NAME = "groupName"; //$NON-NLS-1$
+  
+  private static final String FILE_PROTOCOL_NO_SLASH = "file:"; //$NON-NLS-1$
+  private static final String FILE_PROTOCOL = "file:///"; //$NON-NLS-1$
+  
+  protected static final String COLUMN_NUMBER_ATTRIBUTE = "columnNumber"; //$NON-NLS-1$
+  protected static final String SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE = "squiggleSelectionStrategy"; //$NON-NLS-1$
+  protected static final String SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE = "squiggleNameOrValue"; //$NON-NLS-1$
+
+  protected boolean showDialog = true;
+
+  protected IFile file = null;
+
+  protected IReporter reporter;
+
+  protected IValidator validator;
+
+  /**
+   * Constructor.
+   * 
+   * @param file
+   *          The file to validate.
+   * @param showDialog
+   *          Whether or not to show a dialog when validation is complete.
+   */
+  public ValidateAction(IFile file, boolean showDialog)
+  {
+    this.showDialog = showDialog;
+    this.file = file;
+  }
+
+  /**
+   * Validate the specified file.
+   * 
+   * @param file
+   *          The file to validate.
+   */
+  protected abstract void validate(final IFile file);
+
+  protected void addInfoToMessage (ValidationMessage v, IMessage m)
+  { // This method is overidden by subclasses
+  }
+  
+  /**
+   * Create markers for the valiation messages generated from the validation.
+   * 
+   * @param iFile
+   *          The resource to create the markers on.
+   * @param valmessages
+   *          The array of validation messages.
+   */
+  public void createMarkers(IFile iFile, ValidationMessage[] valmessages)
+  {
+    if (!fileIsOK(iFile))
+    {
+      return;
+    }
+    int nummessages = valmessages.length;
+    for (int i = 0; i < nummessages; i++)
+    {
+      ValidationMessage validationMessage = valmessages[i];
+      String uri = validationMessage.getUri();
+
+      LocalizedMessage message;
+      if (validationMessage.getSeverity() == ValidationMessage.SEV_LOW)
+      {
+        message = new LocalizedMessage(getValidationFrameworkSeverity(IMarker.SEVERITY_WARNING), validationMessage
+            .getMessage(), iFile);
+      }
+      else
+      { 
+        message = new LocalizedMessage(getValidationFrameworkSeverity(IMarker.SEVERITY_ERROR), validationMessage.getMessage(), iFile);
+      }
+      
+      message.setLineNo(validationMessage.getLineNumber());
+      addInfoToMessage(validationMessage, message);
+      
+      List nestederrors = validationMessage.getNestedMessages();
+      if (nestederrors != null && !nestederrors.isEmpty())
+      {
+        message.setGroupName(REFERENCED_FILE_ERROR_OPEN + uri + REFERENCED_FILE_ERROR_CLOSE);
+      }
+
+      getOrCreateReporter().addMessage(getValidator(), message);
+
+      
+    }
+    try
+    {
+      IMarker[] markers = iFile.findMarkers(null, true, IResource.DEPTH_INFINITE);
+      for (int i = 0; i < markers.length; i++)
+      {
+        IMarker marker = markers[i];
+        String groupName = null;
+        try
+        {
+          groupName = (String) marker.getAttribute(GROUP_NAME);
+        }
+        catch (Exception e)
+        {
+        }
+
+        if (groupName != null && groupName.startsWith(REFERENCED_FILE_ERROR))
+        {
+
+          marker.setAttribute(IMarker.DONE, true);
+        }
+      }
+    }
+    catch (CoreException e)
+    {
+      e.printStackTrace();
+    }
+
+  }
+
+  public void clearMarkers(IFile iFile)
+  {
+    if (fileIsOK(iFile))
+    {
+      getOrCreateReporter().removeAllMessages(getValidator(), iFile);
+    }
+  }
+
+  public void run()
+  {
+  	try
+  	{
+  		// CS... a temporary test to avoid performing validation in the absence of xerces 
+  		//
+  		//dw Class theClass = 
+  		Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader()); //$NON-NLS-1$
+  		  		
+  		if (fileIsOK(file))
+  		{
+  			// Check if the editor is dirty for this file. If so, prompt the user to
+  			// save before validating.
+  			if(showDialog)
+  			{
+  				checkIfFileDirty(file);
+  			}
+  			try
+  			{
+  				validate(file);
+  			}
+  			catch (Exception e)
+  			{
+  				ILogger logger = LoggerFactory.getLoggerInstance();
+  				logger.logError("", e); //$NON-NLS-1$
+  				//      e.printStackTrace();
+  			}
+  		}
+  	}
+  	catch (Exception e)
+  	{		
+  	}
+  }
+
+  /**
+   * Test whether the file given is OK to use. A file is OK to use if 1. It is
+   * not null 2. It exists. 3. The project containing the file is accessible.
+   * 
+   * @param file The file to check.
+   * @return True if the file is OK to use, false otherwise.
+   */
+  protected boolean fileIsOK(IFile file)
+  {
+    if (file != null && file.exists() && file.getProject().isAccessible())
+    {
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * Check if the file is dirty. A file is dirty if there is an open editor for
+   * the file that contains changes that haven't been saved.
+   * 
+   * @param file The file to check to see if it is dirty.
+   */
+  protected void checkIfFileDirty(IFile file)
+  {
+    IEditorPart[] dirtyEditors = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow()
+        .getActivePage().getDirtyEditors();
+    int numeditors = dirtyEditors.length;
+    for (int i = 0; i < numeditors; i++)
+    {
+      IEditorInput editorInput = dirtyEditors[i].getEditorInput();
+      if (editorInput instanceof FileEditorInput)
+      {
+        FileEditorInput fileEditorInput = (FileEditorInput) editorInput;
+        if (fileEditorInput.getFile().equals(file))
+        {
+          String message = XMLValidationUIMessages._UI_SAVE_DIRTY_FILE_MESSAGE;
+          String title = XMLValidationUIMessages._UI_SAVE_DIRTY_FILE_TITLE;
+          if (MessageDialog.openQuestion(Display.getDefault().getActiveShell(), title, message))
+          {
+            dirtyEditors[i].doSave(null);
+          }
+          // There can only be one open editor/file so we can break.
+          break;
+        }
+      }
+    }
+  }
+
+  /**
+   * Gets the reporter.
+   * 
+   * @return Returns a IReporter
+   */
+  public IReporter getReporter()
+  {
+    return reporter;
+  }
+
+  /**
+   * Sets the reporter.
+   * 
+   * @param reporter
+   *          The reporter to set
+   */
+  public void setReporter(IReporter reporter)
+  {
+    this.reporter = reporter;
+  }
+
+  /**
+   * Gets the validator.
+   * 
+   * @return Returns a IValidator
+   */
+  public IValidator getValidator()
+  {
+    return validator;
+  }
+
+  /**
+   * Sets the validator.
+   * 
+   * @param validator
+   *          The validator to set
+   */
+  public void setValidator(IValidator validator)
+  {
+    this.validator = validator;
+  }
+
+  protected IReporter getOrCreateReporter()
+  {
+    if (reporter == null)
+    { 
+      reporter = new WorkbenchReporter(file.getProject(), new NullProgressMonitor());
+    }
+    return reporter;
+  }
+
+  /**
+   * Originally from *validation.Helper
+   * 
+   * @param severity
+   *          The severity given.
+   * @return The validation framework severity corresponding to the error.
+   */
+  protected int getValidationFrameworkSeverity(int severity)
+  {
+    switch (severity) {
+    case IMarker.SEVERITY_ERROR:
+      return IMessage.HIGH_SEVERITY;
+    case IMarker.SEVERITY_WARNING:
+      return IMessage.NORMAL_SEVERITY;
+    case IMarker.SEVERITY_INFO:
+      return IMessage.LOW_SEVERITY;
+    }
+    return IMessage.LOW_SEVERITY;
+  }
+  
+  /**
+   * Open an error dialog with the given title and message. Show the problems view
+   * if it is not already visible.
+   * 
+   * @param title The title of the error dialog.
+   * @param message The message in the error dialog.
+   */
+  protected void openErrorDialog(String title, String message)
+  {
+    showProblemsView();
+    MessageDialog.openError(Display.getDefault().getActiveShell(), title, message);
+  }
+  
+  /**
+   * Open an warning dialog with the given title and message. Show the problems view
+   * if it is not already visible.
+   * 
+   * @param title The title of the warning dialog.
+   * @param message The message in the warning dialog.
+   */
+  protected void openWarningDialog(String title, String message)
+  {
+    showProblemsView();
+    MessageDialog.openWarning(Display.getDefault().getActiveShell(), title, message);
+  }
+  
+  /**
+   * Open a valid dialog with the given title and message. 
+   * 
+   * @param title The title of the valid dialog.
+   * @param message The message in the valid dialog.
+   */
+  protected void openValidDialog(String title, String message)
+  {
+    MessageDialog.openInformation(Display.getDefault().getActiveShell(), title, message);
+  }
+  
+  /**
+   * Show the problems view if it is not already visible.
+   */
+  protected void showProblemsView()
+  {
+    IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+    IWorkbenchPage page = dw.getActivePage();
+    IWorkbenchPart activePart = page.getActivePart();
+    try
+    {
+      if (page != null)
+      {
+        page.showView(IPageLayout.ID_PROBLEM_VIEW);
+      }
+    }
+    catch (PartInitException e)
+    {
+    	Logger.logException(e);
+    }
+    page.activate(activePart);
+  }
+  
+  /**
+   * Format a file name into a correct URI.
+   * 
+   * @param filename The file name to format.
+   * @return The formatted URI.
+   */
+  protected String createURIForFilePath(String filename)
+  {
+  	if(!filename.startsWith(FILE_PROTOCOL_NO_SLASH))
+    {
+      while(filename.startsWith("/")) //$NON-NLS-1$
+      {
+        filename = filename.substring(1);
+      }
+      filename = FILE_PROTOCOL + filename;
+    }
+  	return filename;
+  }
+  
+  /**
+   * The validation outcome class holds the results from validating
+   * a file.
+   * 
+   * @author Lawrence Mandel, IBM
+   */
+  protected class ValidationOutcome
+  {
+    public boolean isValid = true;
+
+    public boolean hasMessages = false;
+
+    public ValidationOutcome()
+    {
+    }
+  }
+}
+
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties
index 5faa59a..3cdd57d 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties
@@ -9,6 +9,20 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 ### Constants for strings  
+providerName=Eclipse.org
+pluginName=XML Validator
+nlFeatureName=XML Validator NL Support
+    
+_UI_VALIDATION_INTERNAL_ERROR                    = Internal Error 
+_UI_VALIDATION_FAILED                            = Validation Failed
+_UI_VALIDATION_SUCEEDED                          = Validation Succeeded
+_UI_THE_XML_FILE_IS_NOT_VALID                    = The XML file is not valid.  See the Problems view for a list of the validation errors.
+_UI_THE_XML_FILE_IS_VALID                        = The XML file is valid. 
+_UI_THE_XML_FILE_IS_VALID_WITH_WARNINGS          = The XML file is valid however warnings have been issued. See the Problems view for the warning messages. 
+_UI_THE_XML_FILE_IS_WELL_FORMED                  = The XML file is well formed. 
+_UI_THE_XML_FILE_IS_WELL_FORMED_WITH_WARNINGS    = The XML file is well formed however warnings have been issued. See the Problems view for the warning messages. 
+_UI_NO_GRAMMAR_WARNING                           = Warning : No grammar constraints detected for the document.
+_UI_MESSAGE_LIMITE_EXCEEDED                      = The XML file is not valid.  The message limit for the Problems view has been exceeded.  To see all the messages increase the limit and validate again.
 
 #
 # Referenced File Dialog Related Message
@@ -23,6 +37,12 @@
 #
 # Dirty File Dialog Related Messages
 #
+_UI_SAVE_DIRTY_FILE_MESSAGE         = An open editor contains changes to this file that have not been saved. Do you want to save the file before running validation? (If you do not save the file the previously saved version will be validated.)
+_UI_SAVE_DIRTY_FILE_TITLE           = Save file?
+ValidateXMLFileActionDelegate_2=Required files xercesImpl.jar and xmlParserAPIs.jar cannot be found.\n\n
+ValidateXMLFileActionDelegate_3=Download Xerces 2.6.2 and place xercesImpl.jar and xmlParserAPIs.jar in a folder entitled jars in the org.eclipse.wst.xml.validation plugin.\n\n
+ValidateXMLFileActionDelegate_4=For more information see www.eclipse.org/webtools/wst/components/xml/xercesInfo.xml.
+ValidateXMLFileActionDelegate_5=Missing Xerces
 TaskListTableViewer_0=Description
 TaskListTableViewer_1=Resource
 TaskListTableViewer_2=Location
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
index e8de054..f0ae26b 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
@@ -26,7 +26,6 @@
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -273,12 +272,14 @@
 
     protected boolean validatePage() {
 		String fullFileName = getFileName();
-		if (!extensionValidForContentType(fullFileName)) {
-			setErrorMessage(NLS.bind(XMLWizardsMessages._ERROR_BAD_FILENAME_EXTENSION, getValidExtensions().toString()));
+		String fileExtension = (new Path(fullFileName)).getFileExtension();
+		if (fileExtension != null && (!getValidExtensions().contains(fileExtension))) {
+			setErrorMessage(XMLWizardsMessages._ERROR_BAD_FILENAME_EXTENSION);
 			return false;
 		}
-		// no fileExtension, let's check for this file with default file extension
-		fullFileName += defaultFileExtension;
+		// no fileExtension, let's check for this file with an .xml
+		// extension
+		fullFileName += ".xml"; //$NON-NLS-1$
 		if ((getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false) && (getFileName().compareTo("") != 0)) //$NON-NLS-1$
 		{
 			Path fullPath = new Path(getContainerFullPath().toString() + '/' + fullFileName);
@@ -321,32 +322,6 @@
 		}
 		return fValidExtensions;
 	}
-	
-	/**
-	 * Verifies if fileName is valid name for content type. Takes base content
-	 * type into consideration.
-	 * 
-	 * @param fileName
-	 * @return true if extension is valid for this content type
-	 */
-	boolean extensionValidForContentType(String fileName) {
-		boolean valid = false;
-
-		IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForXML.ContentTypeID_XML);
-		// there is currently an extension
-		if (fileName.lastIndexOf('.') != -1) {
-			// check what content types are associated with current extension
-			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
-			int i = 0;
-			while (i < types.length && !valid) {
-				valid = types[i].isKindOf(type);
-				++i;
-			}
-		}
-		else
-			valid = true; // no extension so valid
-		return valid;
-	}
   }
 }
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
index e6c4b11..f645262 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
@@ -10,7 +10,7 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.wizards;
 
-import com.ibm.icu.text.Collator;
+import java.text.Collator;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Vector;
@@ -18,7 +18,6 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.util.Assert;
@@ -50,14 +49,12 @@
 import org.eclipse.ui.part.PageBook;
 import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
 import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilder;
 import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
 import org.eclipse.wst.xml.ui.internal.Logger;
 import org.eclipse.wst.xml.ui.internal.dialogs.NamespaceInfoErrorHelper;
 import org.eclipse.wst.xml.ui.internal.dialogs.SelectFileOrXMLCatalogIdPanel;
@@ -152,9 +149,7 @@
 		newFilePage.setTitle(XMLWizardsMessages._UI_WIZARD_CREATE_XML_FILE_HEADING);
 		newFilePage.setDescription(XMLWizardsMessages._UI_WIZARD_CREATE_XML_FILE_EXPL);
 		newFilePage.defaultName = (grammarURI != null) ? URIHelper.removeFileExtension(URIHelper.getLastSegment(grammarURI)) : "NewFile"; //$NON-NLS-1$
-		Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
-		String ext = preference.getString(XMLCorePreferenceNames.DEFAULT_EXTENSION);
-		newFilePage.defaultFileExtension = "."+ext; //$NON-NLS-1$
+		newFilePage.defaultFileExtension = ".xml"; //$NON-NLS-1$
 		newFilePage.filterExtensions = filePageFilterExtensions;
 		addPage(newFilePage);
 
@@ -257,7 +252,7 @@
 			if (result) {
 				fileName = newFilePage.getFileName();
 				if ((new Path(fileName)).getFileExtension() == null) {
-					newFilePage.setFileName(fileName.concat(newFilePage.defaultFileExtension));
+					newFilePage.setFileName(fileName.concat(".xml")); //$NON-NLS-1$
 				}
 
 				IFile newFile = newFilePage.createNewFile();
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
index 42393a0..b4e5252 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
@@ -57,7 +57,7 @@
 _UI_INVALID_GRAMMAR_ERROR             = Invalid Grammar
 
 !NewModelWizard
-_ERROR_BAD_FILENAME_EXTENSION         = The file name must end in one of the following extensions {0}.
+_ERROR_BAD_FILENAME_EXTENSION         = The specified file name must have a recognized extension (e.g. '.xml').
 _ERROR_FILE_ALREADY_EXISTS            = The same file already exists.
 _ERROR_ROOT_ELEMENT_MUST_BE_SPECIFIED = A root element must be specified.
 _UI_LABEL_ERROR_SCHEMA_INVALID_INFO   = The schema file contains errors. Open it in the XML schema editor for details.
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
index 8bf1f56..5ce7c87 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
@@ -27,7 +27,7 @@
 import org.eclipse.jface.text.information.IInformationProvider;
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
@@ -37,8 +37,8 @@
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
 import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.internal.autoedit.AutoEditStrategyForTabs;
 import org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML;
 import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
@@ -103,8 +103,8 @@
 		if (fConfiguredContentTypes == null) {
 			String[] xmlTypes = StructuredTextPartitionerForXML.getConfiguredContentTypes();
 			fConfiguredContentTypes = new String[xmlTypes.length + 2];
-			fConfiguredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION;
-			fConfiguredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION;
+			fConfiguredContentTypes[0] = IStructuredPartitionTypes.DEFAULT_PARTITION;
+			fConfiguredContentTypes[1] = IStructuredPartitionTypes.UNKNOWN_PARTITION;
 			int index = 0;
 			System.arraycopy(xmlTypes, 0, fConfiguredContentTypes, index += 2, xmlTypes.length);
 		}
@@ -114,10 +114,10 @@
 	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
 		IContentAssistProcessor[] processors = null;
 
-		if ((partitionType == IStructuredPartitions.DEFAULT_PARTITION) || (partitionType == IXMLPartitions.XML_DEFAULT)) {
+		if ((partitionType == IStructuredPartitionTypes.DEFAULT_PARTITION) || (partitionType == IXMLPartitions.XML_DEFAULT)) {
 			processors = new IContentAssistProcessor[]{new XMLContentAssistProcessor()};
 		}
-		else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
+		else if (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION) {
 			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessor()};
 		}
 
@@ -204,7 +204,7 @@
 
 	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
 		IInformationProvider provider = null;
-		if ((partitionType == IStructuredPartitions.DEFAULT_PARTITION) || (partitionType == IXMLPartitions.XML_DEFAULT)) {
+		if ((partitionType == IStructuredPartitionTypes.DEFAULT_PARTITION) || (partitionType == IXMLPartitions.XML_DEFAULT)) {
 			provider = new XMLInformationProvider();
 		}
 		return provider;
@@ -231,7 +231,7 @@
 
 		// look for appropriate text hover processor to return based on
 		// content type and state mask
-		if ((contentType == IStructuredPartitions.DEFAULT_PARTITION) || (contentType == IXMLPartitions.XML_DEFAULT)) {
+		if ((contentType == IStructuredPartitionTypes.DEFAULT_PARTITION) || (contentType == IXMLPartitions.XML_DEFAULT)) {
 			// check which of xml's text hover is handling stateMask
 			TextHoverManager manager = SSEUIPlugin.getDefault().getTextHoverManager();
 			TextHoverManager.TextHoverDescriptor[] hoverDescs = manager.getTextHovers();
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
index 7026279..0c470f9 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
@@ -213,8 +213,6 @@
 	public static String EOL_Unix;
 	public static String EOL_Mac;
 	public static String EOL_NoTranslation;
-	public static String XMLFilesPreferencePage_ExtensionLabel;
-	public static String XMLFilesPreferencePage_ExtensionError;
 	public static String Content_assist_UI_;
 	public static String Automatically_make_suggest_UI_;
 	public static String Prompt_when_these_characte_UI_;
@@ -286,8 +284,6 @@
 	public static String StructureSelectPrevious_tooltip;
 	public static String StructureSelectPrevious_description;
 	public static String MESSAGE_XML_VALIDATION_MESSAGE_UI_;
-	public static String Warn_no_grammar_specified;
-	public static String Validating_files;
 
 
 	static {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
index 897cbfa..fed4031 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
@@ -240,10 +240,6 @@
 EOL_Unix=UNIX
 EOL_Mac=Mac
 EOL_NoTranslation=No translation
-Validating_files=Validating files
-Warn_no_grammar_specified=Warn when no grammar is specified
-XMLFilesPreferencePage_ExtensionLabel=Add this suffix (if not specified):
-XMLFilesPreferencePage_ExtensionError=Suffix must be one of the following {0}.
 ## XML Source preference page
 Content_assist_UI_=Content assist
 Automatically_make_suggest_UI_=Automatically ma&ke suggestions
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java
index 5521493..b483aa0 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java
@@ -16,9 +16,9 @@
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.document.CommentImpl;
 import org.eclipse.wst.xml.ui.internal.Logger;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java
index 81ddbd2..cc7a56a 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java
@@ -25,9 +25,9 @@
 import org.eclipse.ui.IViewActionDelegate;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.xml.core.internal.cleanup.CleanupProcessorXML;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java
index ed716d7..b3291e8 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java
@@ -14,7 +14,7 @@
 
 package org.eclipse.wst.xml.ui.internal.actions;
 
-import com.ibm.icu.text.Collator;
+import java.text.Collator;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java
index a762cea..8ac71d9 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java
@@ -16,9 +16,9 @@
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.document.CommentImpl;
 import org.eclipse.wst.xml.ui.internal.Logger;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java
index 5c6710f..017e616 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java
@@ -21,8 +21,8 @@
 import org.eclipse.jface.text.TextSelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.xml.ui.internal.Logger;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
index 591c0c9..e0056c6 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
@@ -22,8 +22,8 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
index 4438385..033c0d1 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
@@ -26,10 +26,10 @@
 import org.eclipse.jface.text.contentassist.IContextInformationValidator;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -149,7 +149,7 @@
 			if (attributes != null) {
 				for (int i = 0; i < attributes.getLength(); i++) {
 					CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attributes.item(i);
-					
+					// CMVC 246618
 					int isRequired = 0;
 					if (attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) {
 						isRequired = XMLRelevanceConstants.R_REQUIRED;
@@ -180,7 +180,8 @@
 						if (attrAtLocationHasValue) {
 							// only propose the name
 							proposedText = getRequiredName(node, attrDecl);
-							proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), attrImage, proposedText, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired, true);		
+							proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), attrImage, proposedText, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired, true); // CMVC
+							// 269884
 						}
 						// no attribute exists or is elsewhere, generate
 						// minimally
@@ -211,7 +212,6 @@
 	}
 
 	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-		
 		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
 
 		// Find the attribute region and name for which this position should
@@ -288,14 +288,8 @@
 							String possibleValue = (String) j.next();
 							currentValid = currentValid || possibleValue.equals(currentValue);
 							if (matchString.length() == 0 || possibleValue.startsWith(matchString)) {
-								
-								String rString = "\"" + possibleValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
-								int rOffset = contentAssistRequest.getReplacementBeginPosition();
-								int rLength = contentAssistRequest.getReplacementLength();
-								int cursorAfter = possibleValue.length() + 1;
-								String displayString = "\"" + possibleValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
-								
-								CustomCompletionProposal proposal = new CustomCompletionProposal(rString, rOffset, rLength, cursorAfter, image, displayString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+								CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + possibleValue + "\"", //$NON-NLS-2$//$NON-NLS-1$
+											contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), possibleValue.length() + 1, image, possibleValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
 								contentAssistRequest.addProposal(proposal);
 							}
 						}
@@ -305,14 +299,12 @@
 					// FIXED values
 					String value = attrDecl.getAttrType().getImpliedValue();
 					if (value != null && value.length() > 0) {
-						String rValue = "\"" + value + "\"";//$NON-NLS-2$//$NON-NLS-1$
-						CustomCompletionProposal proposal = new CustomCompletionProposal(rValue, 
-									contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), rValue.length() + 1, image, rValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+						CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + value + "\"", //$NON-NLS-2$//$NON-NLS-1$
+									contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), value.length() + 1, image, value, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
 						contentAssistRequest.addProposal(proposal);
 						if (currentValue.length() > 0 && !value.equals(currentValue)) {
-							rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
-							proposal = new CustomCompletionProposal(rValue,
-										contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), rValue.length() + 1, image, rValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+							proposal = new CustomCompletionProposal("\"" + currentValue + "\"", //$NON-NLS-2$//$NON-NLS-1$
+										contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), currentValue.length() + 1, image, currentValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
 							contentAssistRequest.addProposal(proposal);
 						}
 					}
@@ -323,9 +315,8 @@
 				proposedInfo = getAdditionalInfo(null, elementDecl);
 				CustomCompletionProposal proposal = null;
 				if (currentValue != null && currentValue.length() > 0) {
-					String rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
-					proposal = new CustomCompletionProposal(rValue,
-								contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 1, image, rValue, //$NON-NLS-2$//$NON-NLS-1$
+					proposal = new CustomCompletionProposal("\"" + currentValue + "\"", //$NON-NLS-2$//$NON-NLS-1$
+								contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 1, image, "\"" + currentValue + "\"", //$NON-NLS-2$//$NON-NLS-1$
 								null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
 					contentAssistRequest.addProposal(proposal);
 				}
@@ -389,7 +380,7 @@
 	 * Add the proposals for a completely empty document
 	 */
 	protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
-		// nothing
+		addXMLProposal(contentAssistRequest);
 	}
 
 	/**
@@ -486,6 +477,7 @@
 		boolean addProposal = false;
 
 		if (node.getNodeType() == Node.ELEMENT_NODE) {
+			// fix for CMVC 261790
 			// ////////////////////////////////////////////////////////////////////////////////////
 			IStructuredDocument sDoc = (IStructuredDocument) fTextViewer.getDocument();
 			IStructuredDocumentRegion xmlEndTagOpen = sDoc.getRegionAtCharacterOffset(contentAssistRequest.getReplacementBeginPosition());
@@ -544,8 +536,9 @@
 				addProposal = true;
 			}
 		}
+		// fix for CMVC 261790
 		// ////////////////////////////////////////////////////////////////////////////////////
-		// sometimes the node is not null, but
+		// fix for CMVC 263163, sometimes the node is not null, but
 		// getNodeValue() is null, put in a null check
 		else if (node.getNodeValue() != null && node.getNodeValue().indexOf("</") != -1) { //$NON-NLS-1$
 			// the case where "</" is started, but the nodes comes in as a
@@ -560,6 +553,7 @@
 				addProposal = true;
 			}
 		}
+		// end fix for CMVC 261790
 		// ////////////////////////////////////////////////////////////////////////////////////
 		else if (node.getNodeType() == Node.DOCUMENT_NODE) {
 			setErrorMessage(UNKNOWN_CONTEXT);
@@ -628,6 +622,8 @@
 
 		// make sure xmlpi is root element
 		// don't want doctype proposal if XMLPI isn't first element...
+		// CMVC 242943
+		// CMVC 245532
 		Node first = owningDocument.getFirstChild();
 		boolean xmlpiIsFirstElement = (first != null && first.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE);
 		boolean insertDoctype = xmlpiIsFirstElement;
@@ -642,10 +638,10 @@
 				}
 				// skip white space and text
 				while ((child = child.getNextSibling()) != null && (child.getNodeType() == Node.TEXT_NODE)) {
-					// just skipping
 				}
 				// check if theres a node inbetween XMLPI and cursor position
 				if (child != null && child instanceof IDOMNode) {
+					// CMVC 257486
 					if (contentAssistRequest.getReplacementBeginPosition() >= ((IDOMNode) child).getEndOffset() || !xmlpiIsFirstElement) {
 						insertDoctype = false;
 					}
@@ -654,7 +650,10 @@
 			}
 		}
 
-		if (xmlpiFound && owningDocument.getDoctype() == null && isCursorAfterXMLPI(contentAssistRequest) && insertDoctype) {
+		if (!xmlpiFound) {
+			addXMLProposal(contentAssistRequest);
+		}
+		else if (owningDocument.getDoctype() == null && isCursorAfterXMLPI(contentAssistRequest) && insertDoctype) {
 			addDocTypeProposal(contentAssistRequest);
 		}
 	}
@@ -707,6 +706,7 @@
 					// prompt with the closer for the start tag and an end tag
 					// if one is not present
 					if (node.getEndStructuredDocumentRegion() == null) {
+						// FIX FOR CMVC 247482
 						// make sure tag name is actually what it thinks it
 						// is...(eg. <%@ vs. <jsp:directive)
 						IStructuredDocumentRegion sdr = contentAssistRequest.getDocumentRegion();
@@ -765,6 +765,7 @@
 		Node parent = contentAssistRequest.getParent();
 		String error = null;
 
+		// CMVC #242943 shouldn't have proposals before XMLPI
 		// (nsd) This is only valid at the document element level
 		// only valid if it's XML (check added 2/17/2004)
 		if (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE && ((IDOMDocument) parent).isXMLType() && !isCursorAfterXMLPI(contentAssistRequest)) {
@@ -773,7 +774,8 @@
 		// only want proposals if cursor is after doctype...
 		if (!isCursorAfterDoctype(contentAssistRequest))
 			return;
-		
+
+		// CMVC 248081
 		// fix for meta-info comment nodes.. they currently "hide" other
 		// proposals because the don't
 		// have a content model (so can't propose any children..)
@@ -858,15 +860,13 @@
                             }
                               
 						}
-
-						//int markupAdjustment = getContentGenerator().getMinimalStartTagLength(parent, elementDecl);
+						// Account for the &lt; and &gt;. If attributes were
+						// added, the cursor will be placed
+						// at the offset before of the first character of the
+						// first attribute name.
+						int markupAdjustment = getContentGenerator().getMinimalStartTagLength(parent, elementDecl);
 						if (beginsWith(tagname, matchString)) {
 							String proposedText = getRequiredText(parent, elementDecl);
-							
-							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
-							// place cursor in first empty quotes
-							int markupAdjustment = getCursorPositionForProposedText(proposedText);
-							
 							String proposedInfo = getAdditionalInfo(parentDecl, elementDecl);
                             int relevance = isStrictCMNodeSuggestion ? XMLRelevanceConstants.R_STRICTLY_VALID_TAG_INSERTION : XMLRelevanceConstants.R_TAG_INSERTION; 
 							CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), markupAdjustment, image, tagname, null, proposedInfo, relevance);
@@ -902,6 +902,9 @@
 				xmlpiFound = xmlpiFound || xmlpi;
 				doctypeFound = doctypeFound || doctype;
 			}
+			if (!xmlpiFound && contentAssistRequest.getReplacementBeginPosition() < minimumOffset) {
+				addXMLProposal(contentAssistRequest);
+			}
 
 			if (contentAssistRequest.getReplacementBeginPosition() >= minimumOffset) {
 				List childDecls = getAvailableRootChildren((Document) parent, childPosition);
@@ -967,16 +970,8 @@
 								cursorAdjustment = proposedText.length();
 							}
 							else {
-								// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
-								StringBuffer sb = new StringBuffer();
-								getContentGenerator().generateTag(parent, ed, sb);
-								// since it's a name proposal, assume '<' is already there
-								// only return the rest of the tag
-								proposedText = sb.toString().substring(1);
-								cursorAdjustment = getCursorPositionForProposedText(proposedText);
-								
-								//cursorAdjustment = proposedText.length() + 1;
-								//proposedText += "></" + getRequiredName(parent, elementDecl) + ">"; //$NON-NLS-2$//$NON-NLS-1$
+								cursorAdjustment = proposedText.length() + 1;
+								proposedText += "></" + getRequiredName(parent, elementDecl) + ">"; //$NON-NLS-2$//$NON-NLS-1$
 							}
 						}
 					}
@@ -1009,57 +1004,37 @@
 					continue;
 				String proposedText = null;
 				int cursorAdjustment = 0;
-				if(ed instanceof CMElementDeclaration) {
-					// proposedText = getRequiredName(parent, ed);
-					StringBuffer sb = new StringBuffer();
-					getContentGenerator().generateTag(parent, (CMElementDeclaration)ed, sb);
-					// tag starts w/ '<', but we want to compare to name
-					proposedText = sb.toString().substring(1);
-					
-					if (!beginsWith(proposedText, matchString))
-						continue;
-					
-					cursorAdjustment = getCursorPositionForProposedText(proposedText);
-				
+				proposedText = getRequiredName(parent, ed);
+				if (!beginsWith(proposedText, matchString))
+					continue;
+				if ((node != null && node.getAttributes() != null && node.getAttributes().getLength() > 0) || ((node.getNodeType() != Node.TEXT_NODE) && node.getFirstStructuredDocumentRegion().isEnded())) {
+					cursorAdjustment = proposedText.length();
+				}
+				else {
+					cursorAdjustment = proposedText.length();
 					if (ed instanceof CMElementDeclaration) {
 						CMElementDeclaration elementDecl = (CMElementDeclaration) ed;
 						if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
 							proposedText += getContentGenerator().getStartTagClose(parent, elementDecl);
 							cursorAdjustment = proposedText.length();
 						}
+						else {
+							cursorAdjustment = proposedText.length() + 1;
+							proposedText += "></" + getRequiredName(parent, elementDecl) + ">"; //$NON-NLS-2$//$NON-NLS-1$
+						}
 					}
-				
-					String proposedInfo = getAdditionalInfo(null, ed);
-					Image image = CMImageUtil.getImage(ed);
-					if (image == null) {
-						image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-					}
-					CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), cursorAdjustment, image, getRequiredName(parent, ed), null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
-					contentAssistRequest.addProposal(proposal);
 				}
+				String proposedInfo = getAdditionalInfo(null, ed);
+				Image image = CMImageUtil.getImage(ed);
+				if (image == null) {
+					image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
+				}
+				CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), cursorAdjustment, image, getRequiredName(parent, ed), null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
+				contentAssistRequest.addProposal(proposal);
 			}
 		}
 	}
-	/**
-	 * this is the position the cursor should be in after the proposal is applied
-	 * @param proposedText
-	 * @return  the position the cursor should be in after the proposal is applied
-	 */
-	private int getCursorPositionForProposedText(String proposedText) {
-		int cursorAdjustment;
-		cursorAdjustment = proposedText.indexOf("\"\"") + 1; //$NON-NLS-1$
-		// otherwise, after the first tag
-		if(cursorAdjustment==0)
-			cursorAdjustment = proposedText.indexOf('>') + 1;
-		if(cursorAdjustment==0)
-			cursorAdjustment = proposedText.length() + 1;
-		
-		return cursorAdjustment;
-	}
 
-	/**
-	 * @deprecated XML proposal is added via xml declaration template instead
-	 */
 	protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
 		String proposedText = "<?xml version=\"1.0\" encoding=\"" + ContentTypeEncodingPreferences.getUserPreferredCharsetName(ContentTypeIdForXML.ContentTypeID_XML) + "\"?>"; //$NON-NLS-2$//$NON-NLS-1$
 		ICompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION), proposedText, null, null, XMLRelevanceConstants.R_XML_DECLARATION);
@@ -1114,7 +1089,7 @@
 	protected boolean beginsWith(String aString, String prefix) {
 		if (aString == null || prefix == null)
 			return true;
-		// (pa) matching independent of case to be consistant with Java
+		// (pa) 221190 matching independent of case to be consistant with Java
 		// editor CA
 		return aString.toLowerCase().startsWith(prefix.toLowerCase());
 	}
@@ -1545,8 +1520,7 @@
 			}
 			else {
 				if (sdRegion.getRegions().get(0).getType() != DOMRegionContext.XML_END_TAG_OPEN) {
-					int replaceLength = documentPosition - sdRegion.getStartOffset(completionRegion);
-					contentAssistRequest = newContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), replaceLength, matchString);
+					contentAssistRequest = newContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
 					addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
 				}
 				else {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java
index 2ee1bd1..5675ab1 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java
@@ -22,7 +22,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.w3c.dom.Node;
 
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
index be38e4f..2c27e61 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
@@ -12,8 +12,8 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.contentassist;
 
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java
index 8b8b749..79097c7 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java
@@ -16,7 +16,7 @@
 import org.eclipse.jface.text.templates.TemplateContext;
 import org.eclipse.jface.text.templates.TemplateProposal;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
 
 /**
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
index c324112..eaac54e 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
@@ -29,8 +29,8 @@
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
 
 
 /**
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java
index 7dda160..28356d3 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java
@@ -39,7 +39,7 @@
 				if (displayString1 != null && displayString2 != null)
 					//relevance = displayString1.compareTo(displayString2);
 					// // this didn't mix caps w/ lowercase
-					relevance = com.ibm.icu.text.Collator.getInstance().compare(displayString1, displayString2);
+					relevance = java.text.Collator.getInstance().compare(displayString1, displayString2);
 			}
 		}
 		// otherwise if it's not ISEDRelevanceCompletionProposal, don't sort
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java
index 16118e6..7c10986 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java
@@ -106,7 +106,7 @@
 		if (!hasEndTag && !isJSPTag) {
 
 			// create appropriate close tag text
-			String proposedText = "</" + tagName; //$NON-NLS-1$
+			String proposedText = proposedText = "</" + tagName; //$NON-NLS-1$
 			String viewerText = viewer.getTextWidget().getText();
 			if (viewerText.length() >= documentPosition && viewerText.length() >= 2 && documentPosition >= 2) {
 				String last2chars = viewerText.substring(documentPosition - 2, documentPosition);
@@ -125,7 +125,7 @@
 		else if (!hasEndTag && isJSPTag) {
 
 			// create appropriate close tag text
-			String proposedText = "%"; //$NON-NLS-1$
+			String proposedText = proposedText = "%"; //$NON-NLS-1$
 			String viewerText = viewer.getTextWidget().getText();
 
 			// TODO (pa) make it smarter to add "%>" or just ">" if % is
@@ -196,7 +196,7 @@
 		if (!hasEndTag) {
 
 			// create appropriate close tag text
-			String proposedText = "</" + tagName; //$NON-NLS-1$
+			String proposedText = proposedText = "</" + tagName; //$NON-NLS-1$
 			String viewerText = viewer.getTextWidget().getText();
 			if (viewerText.length() >= documentPosition && viewerText.length() >= 2 && documentPosition >= 2) {
 				String last2chars = viewerText.substring(documentPosition - 2, documentPosition);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/BufferedStructureUpdater.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/BufferedStructureUpdater.java
new file mode 100644
index 0000000..1669ddb
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/BufferedStructureUpdater.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.contentoutline;
+
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.w3c.dom.Node;
+
+
+/**
+ * Can handle multiple subsequent calls to processNode(..) by buffering them
+ * w/ a RefreshStructureJob. Only one refresh is performed (on the UI Thread)
+ * on the minimal affected area of the tree at the end of the batch of updates
+ * (after the last update is processed).
+ * 
+ * @author pavery
+ */
+class BufferedStructureUpdater {
+
+	private RefreshStructureJob fRefreshJob = null;
+
+	/**
+	 * @param structuredViewer
+	 *            the viewer we are updating
+	 * @param node
+	 *            the specific node that changed
+	 */
+	public synchronized void processNode(StructuredViewer structuredViewer, Node node) {
+		// refresh on structural and "unknown" changes
+		// it would be nice to not refresh the viewer if it's not visible
+		// but only refresh when it's brought back to the front
+		if (structuredViewer.getControl() != null) {
+			getRefreshJob().refresh(structuredViewer, node);
+		}
+	}
+
+	private synchronized RefreshStructureJob getRefreshJob() {
+		if (fRefreshJob == null)
+			fRefreshJob = new RefreshStructureJob();
+		return fRefreshJob;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
index 02e4c46..286b385 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
@@ -47,7 +47,7 @@
 	}
 
 	JFaceNodeAdapterFactory fAdapterFactory;
-	private RefreshStructureJob fRefreshJob = null;
+	private BufferedStructureUpdater fUpdater = null;
 
 	public JFaceNodeAdapter(JFaceNodeAdapterFactory adapterFactory) {
 		super();
@@ -169,19 +169,18 @@
 		return nodeName.toString();
 	}
 
-
 	public Object getParent(Object object) {
 		Node node = (Node) object;
 		return node.getParentNode();
 	}
 
-	private synchronized RefreshStructureJob getRefreshJob() {
-		if (fRefreshJob == null)
-			fRefreshJob = new RefreshStructureJob();
-		return fRefreshJob;
+	private BufferedStructureUpdater getStructureUpdater() {
+		if (fUpdater == null) {
+			fUpdater = new BufferedStructureUpdater();
+		}
+		return fUpdater;
 	}
 
-
 	public boolean hasChildren(Object object) {
 		// (pa) 20021217
 		// cmvc defect 235554 > use child.getNextSibling() instead of
@@ -217,28 +216,26 @@
 		// (That is, may be be worthy of job manager management). If they are
 		// found to be important enough to leave in,
 		// there's probably some optimization that can be done.
-		if (notifier instanceof Node) {
-			Collection listeners = fAdapterFactory.getListeners();
-			Iterator iterator = listeners.iterator();
+		Collection listeners = fAdapterFactory.getListeners();
+		Iterator iterator = listeners.iterator();
 
-			while (iterator.hasNext()) {
-				Object listener = iterator.next();
-				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90637
-				// if (notifier instanceof Node && (listener instanceof
-				// StructuredViewer) && (eventType ==
-				// INodeNotifier.STRUCTURE_CHANGED || (eventType ==
-				// INodeNotifier.CHANGE && changedFeature == null))) {
-				if ((listener instanceof StructuredViewer) && (eventType == INodeNotifier.STRUCTURE_CHANGED || eventType == INodeNotifier.CONTENT_CHANGED || (eventType == INodeNotifier.CHANGE))) {
-					if (DEBUG) {
-						System.out.println("JFaceNodeAdapter notified on event type > " + eventType); //$NON-NLS-1$
-					}
+		while (iterator.hasNext()) {
+			Object listener = iterator.next();
+			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90637
+			// if (notifier instanceof Node && (listener instanceof
+			// StructuredViewer) && (eventType ==
+			// INodeNotifier.STRUCTURE_CHANGED || (eventType ==
+			// INodeNotifier.CHANGE && changedFeature == null))) {
+			if (notifier instanceof Node && (listener instanceof StructuredViewer) && (eventType == INodeNotifier.STRUCTURE_CHANGED || (eventType == INodeNotifier.CHANGE))) {
+				if (DEBUG) {
+					System.out.println("JFaceNodeAdapter notified on event type > " + eventType); //$NON-NLS-1$
+				}
 
-					// refresh on structural and "unknown" changes
-					StructuredViewer structuredViewer = (StructuredViewer) listener;
-					// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5230
-					if (structuredViewer.getControl() != null) {
-						getRefreshJob().refresh(structuredViewer, (Node) notifier);
-					}
+				// refresh on structural and "unknown" changes
+				StructuredViewer structuredViewer = (StructuredViewer) listener;
+				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5230
+				if (structuredViewer.getControl() != null) {
+					getStructureUpdater().processNode(structuredViewer, (Node) notifier);
 				}
 			}
 		}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
index 7ee81ba..46788a2 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
@@ -13,6 +13,7 @@
 package org.eclipse.wst.xml.ui.internal.contentoutline;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -42,9 +43,9 @@
 
 	/** debug flag */
 	static final boolean DEBUG;
-	private static final long UPDATE_DELAY = 250;
+	private static final long UPDATE_DELAY = 200;
 	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/refreshStructure"); //$NON-NLS-1$
+		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/outline"); //$NON-NLS-1$
 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
 	}
 	/** List of refresh requests (Nodes) */
@@ -56,33 +57,24 @@
 		super(XMLUIMessages.refreshoutline_0); //$NON-NLS-1$
 		setPriority(Job.LONG);
 		setSystem(true);
-		fRequests = new ArrayList(2);
+		fRequests = new ArrayList(1);
 	}
 
 	private synchronized void addRequest(Node node) {
+		// if we already have a request which contains the new request,
+		// discare the new request
 		int size = fRequests.size();
-		if (size > 0) {
-			for (int i = 0; i < size; i++) {
-				/*
-				 * If we already have a request which contains the new
-				 * request, discard the new request
-				 */
-				Node node2 = (Node) fRequests.get(i);
-				if (contains(node2, node))
-					return;
-				/*
-				 * If new request contains any existing requests, replace it
-				 * with new request
-				 */
-				if (contains(node, node2)) {
-					fRequests.set(i, node);
-					return;
-				}
-			}
+		for (int i = 0; i < size; i++) {
+			if (contains((Node) fRequests.get(i), node))
+				return;
 		}
-		else {
-			fRequests.add(node);
+		// if new request is contains any existing requests,
+		// remove those
+		for (Iterator it = fRequests.iterator(); it.hasNext();) {
+			if (contains(node, (Node) it.next()))
+				it.remove();
 		}
+		fRequests.add(node);
 	}
 
 	private synchronized void addViewer(StructuredViewer viewer) {
@@ -92,8 +84,6 @@
 	}
 
 	/**
-	 * @param root
-	 * @param possible
 	 * @return if the root is parent of possible, return true, otherwise
 	 *         return false
 	 */
@@ -153,17 +143,21 @@
 	 * 
 	 * @param node
 	 */
-	private void doRefresh(final Node node, final StructuredViewer[] viewers) {
+	private void doRefresh(final Node node) {
 		final Display display = PlatformUI.getWorkbench().getDisplay();
 		display.asyncExec(new Runnable() {
 			public void run() {
+
 				if (DEBUG)
 					System.out.println("refresh on: [" + node.getNodeName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
 
+				StructuredViewer[] viewers = (StructuredViewer[]) fViewers.toArray(new StructuredViewer[0]);
+				fViewers.clear();
+
 				for (int i = 0; i < viewers.length; i++) {
 					if (!viewers[i].getControl().isDisposed()) {
-						if (node.getNodeType() == Node.DOCUMENT_NODE) {
-							viewers[i].refresh(true);
+						if (node instanceof Document) {
+							viewers[i].refresh();
 						}
 						else {
 							viewers[i].refresh(node, true);
@@ -180,19 +174,13 @@
 
 	/**
 	 * This method also synchronized because it accesses the fRequests queue
-	 * and fViewers list
 	 * 
-	 * @return an array containing and array of the currently requested Nodes
-	 *         to refresh and the viewers in which to refresh them
+	 * @return an array of the currently requested Nodes to refresh
 	 */
-	private synchronized Object[] getRequests() {
+	private synchronized Node[] getRequests() {
 		Node[] toRefresh = (Node[]) fRequests.toArray(new Node[fRequests.size()]);
 		fRequests.clear();
-
-		StructuredViewer[] viewers = (StructuredViewer[]) fViewers.toArray(new StructuredViewer[fViewers.size()]);
-		fViewers.clear();
-
-		return new Object[]{toRefresh, viewers};
+		return toRefresh;
 	}
 
 	/**
@@ -204,23 +192,20 @@
 		if (node == null)
 			return;
 
-		addViewer(viewer);
+		cancel();
 		addRequest(node);
+		addViewer(viewer);
 		schedule(UPDATE_DELAY);
 	}
 
 	protected IStatus run(IProgressMonitor monitor) {
 		IStatus status = Status.OK_STATUS;
 		try {
-			// Retrieve BOTH viewers and Nodes on one block
-			Object[] requests = getRequests();
-			Node[] nodes = (Node[]) requests[0];
-			StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
-
-			for (int i = 0; i < nodes.length; i++) {
+			Node[] toRefresh = getRequests();
+			for (int i = 0; i < toRefresh.length; i++) {
 				if (monitor.isCanceled())
 					throw new OperationCanceledException();
-				doRefresh(nodes[i], viewers);
+				doRefresh(toRefresh[i]);
 			}
 		}
 		finally {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java
index 8ed78e4..2638e27 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java
@@ -17,7 +17,7 @@
 import org.eclipse.jface.text.contentassist.IContentAssistant;
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 
 /**
  * Correction assistant for XML
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java
index c80e455..b64b7b4 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java
@@ -14,7 +14,7 @@
 
 package org.eclipse.wst.xml.ui.internal.dialogs;
 
-import com.ibm.icu.text.Collator;
+import java.text.Collator;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Comparator;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
index 24f7560..645c98e 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
@@ -15,8 +15,8 @@
 import org.eclipse.jface.text.DefaultTextDoubleClickStrategy;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
index cb48441..e4976bf 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
@@ -18,11 +18,11 @@
 import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
 import org.eclipse.jface.text.hyperlink.URLHyperlink;
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
@@ -304,7 +304,7 @@
 					int regLength = valueRegion.getTextLength();
 					String attValue = att.getValueRegionText();
 					if (StringUtils.isQuoted(attValue)) {
-						++regOffset;
+						regOffset = ++regOffset;
 						regLength = regLength - 2;
 					}
 					hyperRegion = new Region(regOffset, regLength);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java
index 99d9353..3343b01 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java
@@ -22,8 +22,8 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
index e571669..3340219 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2004 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
@@ -12,30 +12,19 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.preferences;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Vector;
 
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
 import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
 
@@ -44,16 +33,12 @@
 
 	protected Combo fEndOfLineCode = null;
 	private Vector fEOLCodes = null;
-	private Text fDefaultSuffix = null;
-	private List fValidExtensions = null;
-	private Button fWarnNoGrammar = null;
 
 	protected Control createContents(Composite parent) {
 		Composite composite = (Composite) super.createContents(parent);
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_FILES_HELPID);
 		createContentsForCreatingOrSavingGroup(composite);
 		createContentsForCreatingGroup(composite);
-		createContentsForValidatingGroup(composite);
 
 		setSize(composite);
 		loadPreferences();
@@ -62,18 +47,12 @@
 	}
 
 	protected void createContentsForCreatingGroup(Composite parent) {
-		Group creatingGroup = createGroup(parent, 2);
+		Group creatingGroup = createGroup(parent, 1);
 		creatingGroup.setText(XMLUIMessages.Creating_files);
 
-		// Default extension for New file Wizard
-		createLabel(creatingGroup, XMLUIMessages.XMLFilesPreferencePage_ExtensionLabel);
-		fDefaultSuffix = createTextField(creatingGroup);
-		fDefaultSuffix.addModifyListener(this);
+		createLabel(creatingGroup, XMLUIMessages.Encoding_desc);
 
-		Label label = createLabel(creatingGroup, XMLUIMessages.Encoding_desc);
-		((GridData) label.getLayoutData()).horizontalSpan = 2;
 		fEncodingSettings = new EncodingSettings(creatingGroup, XMLUIMessages.Encoding);
-		((GridData) fEncodingSettings.getLayoutData()).horizontalSpan = 2;
 	}
 
 	protected void createContentsForCreatingOrSavingGroup(Composite parent) {
@@ -89,47 +68,11 @@
 		populateLineDelimiters();
 	}
 
-	protected void createContentsForValidatingGroup(Composite parent) {
-		Group validatingGroup = createGroup(parent, 2);
-		validatingGroup.setText(XMLUIMessages.Validating_files);
-
-		if (fWarnNoGrammar == null) {
-			fWarnNoGrammar = createCheckBox(validatingGroup, XMLUIMessages.Warn_no_grammar_specified);
-		}
-	}
-
-	public void dispose() {
-		fDefaultSuffix.removeModifyListener(this);
-		super.dispose();
-	}
-
 	protected void doSavePreferenceStore() {
 		XMLCorePlugin.getDefault().savePluginPreferences(); // model
 	}
 
 	/**
-	 * Get content type associated with this new file wizard
-	 * 
-	 * @return IContentType
-	 */
-	protected IContentType getContentType() {
-		return Platform.getContentTypeManager().getContentType(ContentTypeIdForXML.ContentTypeID_XML);
-	}
-
-	/**
-	 * Get list of valid extensions
-	 * 
-	 * @return List
-	 */
-	private List getValidExtensions() {
-		if (fValidExtensions == null) {
-			IContentType type = getContentType();
-			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
-		}
-		return fValidExtensions;
-	}
-
-	/**
 	 * Return the currently selected line delimiter preference
 	 * 
 	 * @return a line delimiter constant from CommonEncodingPreferenceNames
@@ -154,13 +97,9 @@
 	protected void initializeValues() {
 		initializeValuesForCreatingOrSavingGroup();
 		initializeValuesForCreatingGroup();
-		initializeValuesForValidatingGroup();
 	}
 
 	protected void initializeValuesForCreatingGroup() {
-		String suffix = getModelPreferences().getString(XMLCorePreferenceNames.DEFAULT_EXTENSION);
-		fDefaultSuffix.setText(suffix);
-
 		String encoding = getModelPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
 
 		fEncodingSettings.setIANATag(encoding);
@@ -175,31 +114,18 @@
 			setCurrentEOLCode(CommonEncodingPreferenceNames.NO_TRANSLATION);
 	}
 
-	protected void initializeValuesForValidatingGroup() {
-		boolean warnNoGrammarButtonSelected = getModelPreferences().getBoolean(XMLCorePreferenceNames.WARN_NO_GRAMMAR);
-
-
-		if (fWarnNoGrammar != null) {
-			fWarnNoGrammar.setSelection(warnNoGrammarButtonSelected);
-		}
-	}
-
 	protected void performDefaults() {
 		performDefaultsForCreatingOrSavingGroup();
 		performDefaultsForCreatingGroup();
-		performDefaultsForValidatingGroup();
 
 		super.performDefaults();
 	}
 
 	protected void performDefaultsForCreatingGroup() {
-		String suffix = getModelPreferences().getDefaultString(XMLCorePreferenceNames.DEFAULT_EXTENSION);
-		fDefaultSuffix.setText(suffix);
-
 		String encoding = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
 
 		fEncodingSettings.setIANATag(encoding);
-		// fEncodingSettings.resetToDefaultEncoding();
+		//		fEncodingSettings.resetToDefaultEncoding();
 	}
 
 	protected void performDefaultsForCreatingOrSavingGroup() {
@@ -211,14 +137,6 @@
 			setCurrentEOLCode(CommonEncodingPreferenceNames.NO_TRANSLATION);
 	}
 
-	protected void performDefaultsForValidatingGroup() {
-		boolean warnNoGrammarButtonSelected = getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.WARN_NO_GRAMMAR);
-
-		if (fWarnNoGrammar != null) {
-			fWarnNoGrammar.setSelection(warnNoGrammarButtonSelected);
-		}
-	}
-
 	public boolean performOk() {
 		boolean result = super.performOk();
 
@@ -264,13 +182,9 @@
 	protected void storeValues() {
 		storeValuesForCreatingOrSavingGroup();
 		storeValuesForCreatingGroup();
-		storeValuesForValidatingGroup();
 	}
 
 	protected void storeValuesForCreatingGroup() {
-		String suffix = fDefaultSuffix.getText();
-		getModelPreferences().setValue(XMLCorePreferenceNames.DEFAULT_EXTENSION, suffix);
-
 		getModelPreferences().setValue(CommonEncodingPreferenceNames.OUTPUT_CODESET, fEncodingSettings.getIANATag());
 	}
 
@@ -278,29 +192,4 @@
 		String eolCode = getCurrentEOLCode();
 		getModelPreferences().setValue(CommonEncodingPreferenceNames.END_OF_LINE_CODE, eolCode);
 	}
-
-	protected void storeValuesForValidatingGroup() {
-		if (fWarnNoGrammar != null) {
-			boolean warnNoGrammarButtonSelected = fWarnNoGrammar.getSelection();
-			getModelPreferences().setValue(XMLCorePreferenceNames.WARN_NO_GRAMMAR, warnNoGrammarButtonSelected);
-		}
-	}
-
-	protected void validateValues() {
-		boolean isValid = false;
-		Iterator i = getValidExtensions().iterator();
-		while (i.hasNext() && !isValid) {
-			String extension = (String) i.next();
-			isValid = extension.equalsIgnoreCase(fDefaultSuffix.getText());
-		}
-
-		if (!isValid) {
-			setErrorMessage(NLS.bind(XMLUIMessages.XMLFilesPreferencePage_ExtensionError, getValidExtensions().toString()));
-			setValid(false);
-		}
-		else {
-			setErrorMessage(null);
-			setValid(true);
-		}
-	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java
index 3c06ddf..f54b49d 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java
@@ -4,12 +4,12 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.source.projection.IProjectionListener;
 import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Document;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
index c3855fe..4e1325f 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
@@ -52,20 +52,12 @@
 
 	private static final boolean fSetExpertFilter = false;
 
-	/**
-	 * derive categories from CMDataTypes; disabled until display strings can
-	 * be planned
-	 */
+	// derive categories from CMDataTypes; disabled until display strings can
+	// be planned
 	private final static boolean fShouldDeriveCategories = false;
 
 	private final static boolean fSortEnumeratedValues = true;
-
-	/**
-	 * Note: we want the default fCaseSensitive to be true, but, to avoid
-	 * meaningless double initialization, we leave default here, and set in
-	 * constructor only.
-	 */
-	private boolean fCaseSensitive;
+	private boolean fCaseSensitive = true;
 	private IPropertyDescriptor[] fDescriptors = null;
 	private Node fNode = null;
 
@@ -73,60 +65,17 @@
 
 	public XMLPropertySource(INodeNotifier target) {
 		super();
-		fNode = initNode(target);
-		fCaseSensitive = initCaseSensitive(fNode);
-
-	}
-
-	/** seperate method just to isolate error processing */
-	private Node initNode(INodeNotifier target) {
-		Node node = null;
-		if (target instanceof Node) {
-			node = (Node) target;
-		}
-		else {
-			throw new IllegalArgumentException("XMLPropertySource is only for Nodes");
-		}
-		return node;
-	}
-
-	private boolean initCaseSensitive(Node node) {
-		// almost all tags are case senstive, except that old HTML
-		boolean caseSensitive = true;
-		DocumentTypeAdapter adapter = null;
-		if (node instanceof IDOMNode) {
-			adapter = getDocTypeFromDOMNode(node);
-		}
-		if (adapter != null) {
-			caseSensitive = (adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE);
-		}
-		return caseSensitive;
-	}
-
-	/**
-	 * by "internal spec" the DOCTYPE adapter is only available from Document
-	 * Node
-	 * 
-	 * @return {@link DocumentTypeAdapter}
-	 */
-	private DocumentTypeAdapter getDocTypeFromDOMNode(Node node) {
-		DocumentTypeAdapter adapter = null;
-		Document ownerDocument = node.getOwnerDocument();
-		if (ownerDocument == null) {
-			// if ownerDocument is null, then fNode must be the Document Node
-			// [old, old comment]
-			// hmmmm, guess not. See
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=130233
-			// guess this is used for many INodeNotifiers, not just XML.
-			// (and DTD's use IDOMNode? ... that doesn't sound quite right
-			// ... but, maybe a seperate issue).
-			if (node instanceof Document) {
-				ownerDocument = (Document) node;
+		fNode = (Node) target;
+		if (fNode instanceof IDOMNode) {
+			Document ownerDocument = fNode.getOwnerDocument();
+			if (ownerDocument == null) {
+				// if ownerDocument is null, then it must be the Document Node
+				ownerDocument = (Document) fNode;
 			}
+			DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((INodeNotifier) ownerDocument).getAdapterFor(DocumentTypeAdapter.class);
+			if (adapter != null)
+				fCaseSensitive = adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE;
 		}
-		adapter = (DocumentTypeAdapter) ((INodeNotifier) ownerDocument).getAdapterFor(DocumentTypeAdapter.class);
-
-		return adapter;
 	}
 
 	private String[] _getValidFixedStrings(CMAttributeDeclaration attrDecl, CMDataType helper) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java
index be90c39..9fac53e 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java
@@ -13,8 +13,8 @@
 package org.eclipse.wst.xml.ui.internal.search;
 
 import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
 
 /**
  * Configures a FindOccurrencesProcessor with XML partitions and regions
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
index 5b553d8..860a4f9 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2004 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
@@ -98,7 +98,6 @@
 				sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Element____1 + SPACE + BOLD_END);
 				sb.append(node.getNodeName());
 				sb.append(PARAGRAPH_END);
-				printDocumentation(sb, node);
 				if (ed.getContentType() == CMElementDeclaration.PCDATA) {
 					CMDataType dataType = ed.getDataType();
 					if (dataType != null) {
@@ -112,16 +111,17 @@
 						sb.append(description + PARAGRAPH_END);
 					}
 				}
+				printDocumentation(sb, node);
 			} else if (node.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
 				CMAttributeDeclaration ad = (CMAttributeDeclaration) node;
 				sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Attribute____3 + SPACE + BOLD_END);
 				sb.append(node.getNodeName());
 				sb.append(PARAGRAPH_END);
-				printDocumentation(sb, node);
 				CMDataType dataType = ad.getAttrType();
 				if (dataType != null) {
 					printDataTypeInfo(sb, dataType);
 				}
+				printDocumentation(sb, node);
 			} else if (node.getNodeType() == CMNode.DATA_TYPE) {
 				sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Data_Type____4 + SPACE + BOLD_END);
 				sb.append(node.getNodeName());
@@ -150,6 +150,7 @@
 	protected void printDocumentation(StringBuffer sb, CMNode node) {
 		CMNodeList nodeList = (CMNodeList) node.getProperty("documentation"); //$NON-NLS-1$
 		if ((nodeList != null) && (nodeList.getLength() > 0)) {
+			sb.append(NEW_LINE);
 			for (int i = 0; i < nodeList.getLength(); i++) {
 				CMDocumentation documentation = (CMDocumentation) nodeList.item(i);
 				String doc = documentation.getValue();
@@ -157,7 +158,6 @@
 					sb.append(PARAGRAPH_START + doc.trim() + PARAGRAPH_END);
 				}
 			}
-			sb.append(NEW_LINE);
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java
index 937bafa..bb2177d 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2004 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
@@ -27,7 +27,6 @@
 import org.eclipse.wst.sse.core.internal.util.Debug;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.taginfo.AbstractHoverProcessor;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
@@ -45,16 +44,16 @@
 /**
  * Provides hover help documentation for xml tags
  * 
+ * @author amywu
  * @see org.eclipse.jface.text.ITextHover
  */
-public class XMLTagInfoHoverProcessor extends AbstractHoverProcessor {
+public class XMLTagInfoHoverProcessor implements ITextHover {
 	protected MarkupTagInfoProvider fInfoProvider = null;
 
 	/**
 	 * Constructor for XMLTextHoverProcessor.
 	 */
 	public XMLTagInfoHoverProcessor() {
-		// nothing
 	}
 
 	/**
@@ -62,7 +61,7 @@
 	 * 
 	 * @return String any documentation information to display
 	 *         <code>null</code> if there is nothing to display.
-	 * 
+	 *  
 	 */
 	protected String computeHoverHelp(ITextViewer textViewer, int documentPosition) {
 		String result = null;
@@ -274,8 +273,7 @@
 							return new Region(flatNode.getStartOffset(region), region.getTextLength());
 						}
 					}
-				}
-				catch (BadLocationException e) {
+				} catch (BadLocationException e) {
 					Logger.logException(e);
 				}
 			}
@@ -313,8 +311,7 @@
 							return new Region(flatNode.getStartOffset(region), region.getTextLength());
 						}
 					}
-				}
-				catch (BadLocationException e) {
+				} catch (BadLocationException e) {
 					Logger.logException(e);
 				}
 			}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
index 6dc6364..27ae4eb 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
@@ -17,23 +17,20 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.validation.internal.core.IMessageAccess;
 import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IProjectValidationContext;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
 import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
@@ -77,7 +74,7 @@
 	}
 
 	// My Implementation of IHelper
-	class MyHelper implements IProjectValidationContext {
+	class MyHelper implements IValidationContext {
 		InputStream inputStream;
 
 		IFile file;
@@ -110,13 +107,6 @@
 				return new String[]{file.getFullPath().toString()};
 			return new String[0];
 		}
-
-		public IProject getProject() {
-      if (file != null) {        
-        return file.getProject();
-      }
-      return null;
-		}
 	}
 
 	// My Implementation of IReporter
@@ -190,14 +180,7 @@
 					// Validate the file:
 					IValidationContext vHelper = new MyHelper(new ByteArrayInputStream(byteArray), file);
 					MyReporter vReporter = new MyReporter();
-					if(validator instanceof IValidatorJob)
-					{
-					  ((IValidatorJob)validator).validateInJob(vHelper, vReporter);
-					}
-					else
-					{
-					  validator.validate(vHelper, vReporter);
-					}
+					validator.validate(vHelper, vReporter);
 					List messages = vReporter.list;
 
 					// set the offset and length
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java
index 7c1b16a..985e3dd 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java
@@ -20,7 +20,7 @@
  * 
  */
 public class DelegatingSourceValidatorForXML extends DelegatingSourceValidator {
-	private final static String VALIDATOR_CLASS = "org.eclipse.wst.xml.core.internal.validation.eclipse.Validator"; //$NON-NLS-1$
+	private final static String VALIDATOR_CLASS = "org.eclipse.wst.xml.ui.internal.validation.Validator"; //$NON-NLS-1$
 
 	public DelegatingSourceValidatorForXML() {
 		super();
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
index 1b28fe0..95e9390 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
@@ -18,8 +18,8 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
index 6c37951..2f19d61 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
@@ -31,7 +31,7 @@
 import org.eclipse.wst.common.ui.internal.dnd.ViewerDragAdapter;
 import org.eclipse.wst.common.ui.internal.dnd.ViewerDropAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.core.internal.util.StringUtils;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
 import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
diff --git a/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
index f9bd082..6cdb4d2 100644
--- a/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,6 +1,6 @@
-#Mon Jan 30 23:39:29 EST 2006
+#Mon Jan 30 18:54:33 EST 2006
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
 org.eclipse.jdt.core.compiler.compliance=1.4
@@ -34,7 +34,6 @@
 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
@@ -49,7 +48,6 @@
 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
 org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
diff --git a/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 83ee912..0000000
--- a/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Jan 30 23:28:33 EST 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
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 50a9ebb..390939c 100644
--- a/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
@@ -2,16 +2,15 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %_UI_PLUGIN_NAME
 Bundle-SymbolicName: org.eclipse.wst.xsd.core; singleton:=true
-Bundle-Version: 1.0.101.qualifier
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.wst.xsd.core.internal.XSDCorePlugin
-Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xsd.contentmodel.internal;x-internal:=true,
- org.eclipse.wst.xsd.contentmodel.internal.util;x-internal:=true,
- org.eclipse.wst.xsd.core.internal;x-internal:=true,
- org.eclipse.wst.xsd.core.internal.validation,
- org.eclipse.wst.xsd.core.internal.validation.eclipse
-Require-Bundle: org.eclipse.core.runtime,
+Export-Package: org.eclipse.wst.xsd.contentmodel.internal,
+ org.eclipse.wst.xsd.contentmodel.internal.util,
+ org.eclipse.wst.xsd.core.internal,
+ org.eclipse.wst.xsd.core.internal.validation
+Require-Bundle: org.eclipse.core.runtime.compatibility,
  org.eclipse.emf.ecore,
  org.eclipse.wst.common.uriresolver,
  org.eclipse.xsd,
@@ -20,5 +19,6 @@
  org.eclipse.core.resources,
  org.eclipse.wst.validation,
  org.apache.xerces
-Eclipse-LasyStart: true
+Eclipse-AutoStart: true
+Plugin-Class: org.eclipse.wst.xsd.core.internal.XSDCorePlugin
 
diff --git a/bundles/org.eclipse.wst.xsd.core/plugin.properties b/bundles/org.eclipse.wst.xsd.core/plugin.properties
index 31c32c9..35666bf 100644
--- a/bundles/org.eclipse.wst.xsd.core/plugin.properties
+++ b/bundles/org.eclipse.wst.xsd.core/plugin.properties
@@ -16,7 +16,21 @@
 _UI_PLUGIN_NAME                           = XSD Core Plugin
 XSD_Content_Type=XSD
 
-_UI_XML_SCHEMA_VALIDATOR                  = XML Schema Validator
-_UI_XERCES_VALIDATOR_DELEGATE       	  = Xerces-based XML Schema Validator
+!
+! XSDEditor Menu bar contributor
+!
 
-Bundle-Vendor.0 = Eclipse.org
\ No newline at end of file
+_UI_MENU_VALIDATE_XML                     = &Validate XML Schema
+
+!
+! Validate Schema 
+!
+_UI_DIALOG_XML_SCHEMA_INVALID_TITLE       = Validation Failed
+_UI_DIALOG_XML_SCHEMA_VALID_TITLE         = Validation Succeeded
+_UI_DIALOG_XML_SCHEMA_VALID_TEXT          = The XML schema file is valid.
+_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS = The XML schema file is valid however warnings have been issued. See the Problems view for the warning messages.
+_UI_DIALOG_XML_SCHEMA_INVALID_TEXT        = The XML schema file is not valid. See the Problems view for the error messages.
+_UI_DIALOG_XML_SCHEMA_LIMITE_EXCEEDED     = The XML schema file is not valid.  The message limit for the Problems view has been exceeded.  To see all the messages increase the limit and validate again.
+
+
+_UI_XML_SCHEMA_VALIDATOR                  = XML Schema Validator
diff --git a/bundles/org.eclipse.wst.xsd.core/plugin.xml b/bundles/org.eclipse.wst.xsd.core/plugin.xml
index e4a0932..d0e75f7 100644
--- a/bundles/org.eclipse.wst.xsd.core/plugin.xml
+++ b/bundles/org.eclipse.wst.xsd.core/plugin.xml
@@ -18,42 +18,5 @@
 			class="org.eclipse.wst.xsd.contentmodel.internal.CMDocumentFactoryXSD">
 		</factory>
 	</extension>
-	
-	<!-- ====================================================== -->
-	<!-- Register the XSD validator with the validation 		-->
-	<!-- framework. 										    -->
-	<!-- ====================================================== -->
-	<extension
-		id="xsdValidator"
-		name="%_UI_XML_SCHEMA_VALIDATOR"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.xsd">
-			</filter>
-			
-			<helper
-				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
-			</helper>
-			
-			<run
-         async="true"
-         class="org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator"
-         enabled="true"
-         fullBuild="true"
-         incremental="true">
-			</run>
-		</validator>
-	</extension>
-
-	<extension
-       point="org.eclipse.wst.validation.validatorDelegates">
-    	<delegate
-        	class="org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator"
-			name="%_UI_XERCES_VALIDATOR_DELEGATE"
-        	target="org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator"/>
-	 </extension>	
 
 </plugin>
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidationMessages.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidationMessages.java
deleted file mode 100644
index 701f2bc..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidationMessages.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- * 
- */
-package org.eclipse.wst.xsd.core.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XSD Validation
- */
-public class XSDValidationMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xsd.core.internal.validation.xsdvalidation";//$NON-NLS-1$
-
-	public static String Message_XSD_validation_message_ui;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, XSDValidationMessages.class);
-	}
-
-	private XSDValidationMessages() {
-		// cannot create new instance
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java
index 2d528ed..f16d9c0 100644
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java
+++ b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java
@@ -34,7 +34,7 @@
  */
 public class XSDValidator
 {
-  protected URIResolver uriresolver = null;
+  private URIResolver uriresolver = null;
 
   public ValidationReport validate(String uri)
   {
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java
deleted file mode 100644
index 1b7f773..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.core.internal.validation.eclipse;
-
-import java.io.InputStream;
-
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.eclipse.wst.xsd.core.internal.validation.XSDValidationMessages;
-
-public class Validator extends AbstractNestedValidator
-{
-	 
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#getValidatorName()
-   */
-  protected String getValidatorName() 
-  {
-	return XSDValidationMessages.Message_XSD_validation_message_ui;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
-   */
-  public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context)
-  {  
-	XSDValidator validator = XSDValidator.getInstance();
-
-	ValidationReport valreport = null;
-	if (inputstream != null)
-	{
-	  valreport = validator.validate(uri, inputstream);
-	}
-	else
-	{
-	  valreport = validator.validate(uri);
-	}
-		        
-	return valreport;
-  }
-	  
-  /**
-   * Store additional information in the message parameters. For XSD validation there
-   * are three additional pieces of information to store:
-   * param[0] = the column number of the error
-   * param[1] = the 'squiggle selection strategy' for which DOM part to squiggle
-   * param[2] = the name or value of what is to be squiggled
-   * 
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#addInfoToMessage(org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage, org.eclipse.wst.validation.internal.provisional.core.IMessage)
-   */
-  protected void addInfoToMessage(ValidationMessage validationMessage, IMessage message)
-  { 
-	String key = validationMessage.getKey();
-	if(key != null)
-	{
-	  XSDMessageInfoHelper messageInfoHelper = new XSDMessageInfoHelper();
-	  String[] messageInfo = messageInfoHelper.createMessageInfo(key, validationMessage.getMessage());
-
-	  message.setAttribute(COLUMN_NUMBER_ATTRIBUTE, new Integer(validationMessage.getColumnNumber()));
-	  message.setAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE, messageInfo[0]);
-	  message.setAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE, messageInfo[1]);
-	}
-  }
-
-  /*
-   * (non-Javadoc)
-   * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#getValidatorID()
-   */
-  protected String getValidatorID()
-  {
-    // Because this class is used as a delegate, return the id of the validator
-    // which delegates to this class.
-
-    return XSDDelegatingValidator.class.getName();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDDelegatingValidator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDDelegatingValidator.java
deleted file mode 100644
index 3f615ba..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDDelegatingValidator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.core.internal.validation.eclipse;
-
-import org.eclipse.wst.validation.internal.delegates.DelegatingValidator;
-
-/**
- * This class provides a unique name (class name) which the validation framework
- * will use to identify the XSD validator. The actual delegating validator
- * functionality is provided by the base class. The actual validation
- * functionality is provided by the delegates registered with this class as
- * their target.
- */
-public class XSDDelegatingValidator extends DelegatingValidator
-{
-  /**
-   * Default constructor.
-   */
-  public XSDDelegatingValidator()
-  {
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDMessageInfoHelper.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDMessageInfoHelper.java
deleted file mode 100644
index 1016583..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDMessageInfoHelper.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.core.internal.validation.eclipse;
-
-
-/**
- * The XSDMessageInfoHelper creates a string with the
- */
-public class XSDMessageInfoHelper
-{
-  public XSDMessageInfoHelper()
-  { super();
-  }
-
-  public String[] createMessageInfo(String errorKey, String errorMessage)
-  { 
-    //Now map the error key to what we would want to underline:
-    String nameOrValue = "";
-    String selectionStrategy = "";
-    if(errorKey != null)
-    {
-      if (errorKey.equals("s4s-elt-invalid-content.1") || errorKey.equals("s4s-elt-must-match.1") || 
-    		  errorKey.equals("s4s-att-must-appear") || errorKey.equals("s4s-elt-invalid-content.2"))
-      { 
-    	selectionStrategy = "START_TAG";
-      }
-      else if (errorKey.equals("s4s-att-not-allowed"))
-      { 
-    	selectionStrategy = "ATTRIBUTE_NAME";
-        nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
-      }
-      else if (errorKey.equals("s4s-att-invalid-value"))
-      { 
-    	selectionStrategy = "ATTRIBUTE_VALUE";
-        nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
-      }
-      else if (errorKey.equals("s4s-elt-character"))
-      { 
-    	selectionStrategy = "TEXT";
-      }
-      else if (errorKey.equals("src-resolve.4.2") || errorKey.equals("src-resolve"))
-      { 
-    	selectionStrategy = "VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE";
-        nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
-      }
-    }
-    String messageInfo[] = new String[2];
-    messageInfo[0] = selectionStrategy;
-    messageInfo[1] = nameOrValue;
-    return messageInfo;    
-  }
-
-  /**
-   * This method is used to get the value between the first pair of single quotes
-   * It is used to extract information from the error Message (for example
-   * an attribute name)
-   * 
-   * @param s
-   * 		The string to extract the value from.
-   */
-  protected String getFirstStringBetweenSingleQuotes(String s)
-  {
-    int first = s.indexOf("'");
-    int second = s.indexOf("'", first + 1);
-    String betweenQuotes = null;
-    if (first != -1 && second != -1)
-    { betweenQuotes = s.substring(first + 1, second);
-    }
-    return betweenQuotes;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDValidator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDValidator.java
deleted file mode 100644
index 7eb1ba6..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDValidator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.core.internal.validation.eclipse;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-
-
-/**
- * An XSD validator specific to Eclipse. This validator will wrap the internal
- * XSD validator an provide automatic URI resolution support.
- * Using this class is equivalent to using the internal XSD validator and registering
- * the URI resolver from the URI resolution framework.
- */
-public class XSDValidator extends org.eclipse.wst.xsd.core.internal.validation.XSDValidator
-{
-  private static XSDValidator instance = null;
-  
-  /**
-   * Return the one and only instance of the XSD validator. The validator
-   * can be reused and cannot be customized so there should only be one instance of it.
-   * 
-   * @return The one and only instance of the XSD validator.
-   */
-  public static XSDValidator getInstance()
-  {
-    if(instance == null)
-    {
-      instance = new XSDValidator();
-    }
-    return instance;
-  }
-  /**
-   * Constructor. Create the XSD validator and set the URI resolver.
-   */
-  protected XSDValidator()
-  {
-    this.setURIResolver(URIResolverPlugin.createResolver());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/xsdvalidation.properties b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/xsdvalidation.properties
deleted file mode 100644
index 83c032e..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/xsdvalidation.properties
+++ /dev/null
@@ -1,52 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 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
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-### Constants for strings  
-providerName=Eclipse.org
-pluginName=XML Validator
-nlFeatureName=XML Validator NL Support
-
-# validation strings
-Message_XSD_validation_message_ui=XML Schema Validator validating {0}
-    
-_UI_VALIDATION_INTERNAL_ERROR                    = Internal Error 
-_UI_VALIDATION_FAILED                            = Validation Failed
-_UI_VALIDATION_SUCEEDED                          = Validation Succeeded
-_UI_THE_XML_FILE_IS_NOT_VALID                    = The XML file is not valid.  See the Problems view for a list of the validation errors.
-_UI_THE_XML_FILE_IS_VALID                        = The XML file is valid. 
-_UI_THE_XML_FILE_IS_VALID_WITH_WARNINGS          = The XML file is valid however warnings have been issued. See the Problems view for the warning messages. 
-_UI_THE_XML_FILE_IS_WELL_FORMED                  = The XML file is well formed. 
-_UI_THE_XML_FILE_IS_WELL_FORMED_WITH_WARNINGS    = The XML file is well formed however warnings have been issued. See the Problems view for the warning messages. 
-_UI_NO_GRAMMAR_WARNING                           = Warning : No grammar constraints detected for the document.
-_UI_MESSAGE_LIMITE_EXCEEDED                      = The XML file is not valid.  The message limit for the Problems view has been exceeded.  To see all the messages increase the limit and validate again.
-
-#
-# Referenced File Dialog Related Message
-#
-_UI_REF_FILE_ERROR_DESCRIPTION      = The errors below were detected when validating the file "{0}" via the file "{1}".  In most cases these errors can be detected by validating "{2}" directly.  However it is possible that errors will only occur when {2} is validated in the context of {3}.
-_UI_REF_FILE_ERROR_MESSAGE          = Referenced file contains errors ({0}).  For more information, right click on the message and select "Show Details..."
-_UI_REF_FILE_ERROR_DETAILS          = Referenced File Error Details
-
-_UI_DETAILS_INFORMATION_UNAVAILABLE       = Details Information Unavailable
-_UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE = Details information currently unavailable.  Please revalidate the file to regenerate the error details.
-
-#
-# Dirty File Dialog Related Messages
-#
-_UI_SAVE_DIRTY_FILE_MESSAGE         = An open editor contains changes to this file that have not been saved. Do you want to save the file before running validation? (If you do not save the file the previously saved version will be validated.)
-_UI_SAVE_DIRTY_FILE_TITLE           = Save file?
-ValidateXMLFileActionDelegate_2=Required files xercesImpl.jar and xmlParserAPIs.jar cannot be found.\n\n
-ValidateXMLFileActionDelegate_3=Download Xerces 2.6.2 and place xercesImpl.jar and xmlParserAPIs.jar in a folder entitled jars in the org.eclipse.wst.xml.validation plugin.\n\n
-ValidateXMLFileActionDelegate_4=For more information see www.eclipse.org/webtools/wst/components/xml/xercesInfo.xml.
-ValidateXMLFileActionDelegate_5=Missing Xerces
-TaskListTableViewer_0=Description
-TaskListTableViewer_1=Resource
-TaskListTableViewer_2=Location
-TaskListTableViewer_3=line 
diff --git a/bundles/org.eclipse.wst.xsd.ui/.classpath b/bundles/org.eclipse.wst.xsd.ui/.classpath
index d36ddbe..ed58bc2 100644
--- a/bundles/org.eclipse.wst.xsd.ui/.classpath
+++ b/bundles/org.eclipse.wst.xsd.ui/.classpath
@@ -1,12 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="src-refactor"/>
-	<classpathentry kind="src" path="src-adt"/>
-	<classpathentry kind="src" path="src-adt-xsd"/>
-	<classpathentry kind="src" path="src-common"/>
-	<classpathentry kind="src" path="src-adt-xsd-typeviz"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="src-validation"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src-search"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs
index 02e064f..efba9c0 100644
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,69 +1,69 @@
-#Mon Feb 27 17:20:28 EST 2006

-eclipse.preferences.version=1

-org.eclipse.jdt.core.builder.cleanOutputFolder=clean

-org.eclipse.jdt.core.builder.duplicateResourceTask=warning

+#Fri Dec 10 00:29:03 EST 2004

+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled

+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled

+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error

+org.eclipse.jdt.core.compiler.debug.lineNumber=generate

+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore

+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning

+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=error

+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning

+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled

+org.eclipse.jdt.core.compiler.problem.unusedImport=error

+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore

+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning

 org.eclipse.jdt.core.builder.invalidClasspath=abort

 org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch

-org.eclipse.jdt.core.circularClasspath=error

-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled

-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled

-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled

-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2

-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve

-org.eclipse.jdt.core.compiler.compliance=1.4

-org.eclipse.jdt.core.compiler.debug.lineNumber=generate

+org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore

+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore

 org.eclipse.jdt.core.compiler.debug.localVariable=generate

-org.eclipse.jdt.core.compiler.debug.sourceFile=generate

-org.eclipse.jdt.core.compiler.doc.comment.support=enabled

-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100

-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning

 org.eclipse.jdt.core.compiler.problem.deprecation=warning

-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled

-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled

+org.eclipse.jdt.core.compiler.source=1.3

+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error

+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore

+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore

+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore

+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve

+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning

+org.eclipse.jdt.core.compiler.compliance=1.5

 org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore

 org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning

-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore

-org.eclipse.jdt.core.compiler.problem.finalParameterBound=error

-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning

-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning

+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled

 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning

+org.eclipse.jdt.core.builder.cleanOutputFolder=clean

 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning

-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore

-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore

+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore

+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore

 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled

-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled

+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore

+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore

+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled

+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2

+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning

+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled

+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public

 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private

 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore

-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning

-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore

-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled

-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public

-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore

-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled

-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private

-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning

-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning

-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning

-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore

 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning

-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore

-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled

-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning

-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore

-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore

-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore

-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore

-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore

-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=error

-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore

-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

-org.eclipse.jdt.core.compiler.problem.unusedImport=error

-org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore

-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore

-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled

-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled

-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore

-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error

-org.eclipse.jdt.core.compiler.source=1.3

+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled

 org.eclipse.jdt.core.incompatibleJDKLevel=ignore

+eclipse.preferences.version=1

+org.eclipse.jdt.core.circularClasspath=error

+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled

+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100

+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore

+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore

+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private

+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled

+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore

+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning

+org.eclipse.jdt.core.compiler.debug.sourceFile=generate

+org.eclipse.jdt.core.compiler.doc.comment.support=enabled

+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning

 org.eclipse.jdt.core.incompleteClasspath=error

+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore

+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled

+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore

+org.eclipse.jdt.core.builder.duplicateResourceTask=warning

+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled

diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index a232d89..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Feb 27 17:20:24 EST 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
index d03520d..91c80fe 100644
--- a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
@@ -2,90 +2,63 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %_UI_PLUGIN_NAME
 Bundle-SymbolicName: org.eclipse.wst.xsd.ui; singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Activator: org.eclipse.wst.xsd.editor.XSDEditorPlugin
-Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
+Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xsd.adt.actions,
- org.eclipse.wst.xsd.adt.design,
- org.eclipse.wst.xsd.adt.design.directedit,
- org.eclipse.wst.xsd.adt.design.editparts,
- org.eclipse.wst.xsd.adt.design.editparts.model,
- org.eclipse.wst.xsd.adt.design.editpolicies,
- org.eclipse.wst.xsd.adt.design.figures,
- org.eclipse.wst.xsd.adt.edit,
- org.eclipse.wst.xsd.adt.editor,
- org.eclipse.wst.xsd.adt.facade,
- org.eclipse.wst.xsd.adt.outline,
- org.eclipse.wst.xsd.adt.properties,
- org.eclipse.wst.xsd.adt.typeviz.design.figures,
- org.eclipse.wst.xsd.adt.typeviz.design.layouts,
- org.eclipse.wst.xsd.editor,
- org.eclipse.wst.xsd.editor.internal.actions,
- org.eclipse.wst.xsd.editor.internal.adapters,
- org.eclipse.wst.xsd.editor.internal.commands,
- org.eclipse.wst.xsd.editor.internal.design.editparts,
- org.eclipse.wst.xsd.editor.internal.design.editparts.model,
- org.eclipse.wst.xsd.editor.internal.design.editpolicies,
- org.eclipse.wst.xsd.editor.internal.design.figures,
- org.eclipse.wst.xsd.editor.internal.design.layouts,
- org.eclipse.wst.xsd.editor.internal.dialogs,
- org.eclipse.wst.xsd.editor.internal.icons,
- org.eclipse.wst.xsd.editor.internal.navigation,
- org.eclipse.wst.xsd.editor.internal.preferences,
- org.eclipse.wst.xsd.editor.internal.search,
- org.eclipse.wst.xsd.editor.internal.utils,
- org.eclipse.wst.xsd.ui.common.actions,
- org.eclipse.wst.xsd.ui.common.commands,
- org.eclipse.wst.xsd.ui.common.properties.providers,
- org.eclipse.wst.xsd.ui.common.properties.sections,
- org.eclipse.wst.xsd.ui.common.properties.sections.appinfo,
- org.eclipse.wst.xsd.ui.common.util,
+Export-Package: org.eclipse.wst.xsd.ui.internal,
  org.eclipse.wst.xsd.ui.internal.actions,
- org.eclipse.wst.xsd.ui.internal.nsedit;x-internal:=true,
+ org.eclipse.wst.xsd.ui.internal.commands,
+ org.eclipse.wst.xsd.ui.internal.dialogs.types.common,
+ org.eclipse.wst.xsd.ui.internal.dialogs.types.xml,
+ org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd,
+ org.eclipse.wst.xsd.ui.internal.dnd,
+ org.eclipse.wst.xsd.ui.internal.gef.util.editparts,
+ org.eclipse.wst.xsd.ui.internal.gef.util.figures,
+ org.eclipse.wst.xsd.ui.internal.graph,
+ org.eclipse.wst.xsd.ui.internal.graph.editparts,
+ org.eclipse.wst.xsd.ui.internal.graph.editpolicies,
+ org.eclipse.wst.xsd.ui.internal.graph.figures,
+ org.eclipse.wst.xsd.ui.internal.graph.model,
+ org.eclipse.wst.xsd.ui.internal.icons,
+ org.eclipse.wst.xsd.ui.internal.preferences,
+ org.eclipse.wst.xsd.ui.internal.properties,
+ org.eclipse.wst.xsd.ui.internal.properties.section,
+ org.eclipse.wst.xsd.ui.internal.provider,
  org.eclipse.wst.xsd.ui.internal.refactor,
- org.eclipse.wst.xsd.ui.internal.refactor.actions;x-internal:=true,
+ org.eclipse.wst.xsd.ui.internal.refactor.actions,
+ org.eclipse.wst.xsd.ui.internal.refactor.delete,
  org.eclipse.wst.xsd.ui.internal.refactor.rename,
- org.eclipse.wst.xsd.ui.internal.refactor.structure;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.refactor.util;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.refactor.wizard;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.search;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.search.actions;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.text;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.util;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.validation;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.widgets;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.wizards;x-internal:=true
-Require-Bundle: org.eclipse.ui.views.properties.tabbed,
- org.apache.xerces,
- org.eclipse.core.runtime,
+ org.eclipse.wst.xsd.ui.internal.refactor.structure,
+ org.eclipse.wst.xsd.ui.internal.text,
+ org.eclipse.wst.xsd.ui.internal.util,
+ org.eclipse.wst.xsd.ui.internal.validation,
+ org.eclipse.wst.xsd.ui.internal.widgets,
+ org.eclipse.wst.xsd.ui.internal.wizards
+Require-Bundle: org.eclipse.core.runtime.compatibility,
  org.eclipse.wst.common.uriresolver,
  org.eclipse.wst.sse.ui,
  org.eclipse.wst.sse.core,
- org.eclipse.wst.common.core,
  org.eclipse.wst.xml.core,
  org.eclipse.wst.xml.ui,
  org.eclipse.wst.common.ui,
  org.eclipse.jface.text,
  org.eclipse.xsd,
  org.eclipse.gef,
- org.eclipse.draw2d,
- org.eclipse.xsd,
  org.eclipse.jface,
  org.eclipse.ui.editors,
  org.eclipse.ui.workbench.texteditor,
  org.eclipse.ui,
  org.eclipse.ui.views,
  org.eclipse.ui.ide,
- org.eclipse.emf.ecore.edit,
  org.eclipse.core.resources,
+ org.eclipse.wst.common.ui.properties,
  org.eclipse.xsd.edit,
  org.eclipse.emf.edit,
  org.eclipse.emf.edit.ui,
  org.eclipse.wst.validation,
  org.eclipse.ltk.core.refactoring,
  org.eclipse.ltk.ui.refactoring,
- org.eclipse.wst.xsd.core,
- org.eclipse.search,
- com.ibm.icu
-Eclipse-LazyStart: true
+ org.eclipse.wst.xsd.core
+Eclipse-AutoStart: true
+Plugin-Class: org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin
diff --git a/bundles/org.eclipse.wst.xsd.ui/build.properties b/bundles/org.eclipse.wst.xsd.ui/build.properties
index 856249a..607430b 100644
--- a/bundles/org.eclipse.wst.xsd.ui/build.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/build.properties
@@ -8,18 +8,17 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-source.. = src-search/,\
-           src-refactor/,\
-           src-adt/,\
-           src-adt-xsd/,\
-           src-adt-xsd-typeviz/,\
-           src-common/
+source.. = src/,\
+					   src-validation
 bin.includes = .,\
                plugin.xml,\
                icons/,\
+               image/,\
+               doc/,\
                plugin.properties,\
+               samples/,\
+               w3c/,\
                META-INF/,\
                about.html
 src.includes = build.properties,\
                component.xml
-output.. = bin/
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/XSDAttributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/icons/XSDAttributeGroupRef.gif
deleted file mode 100644
index a89fa8f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/XSDAttributeGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/XSDElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/icons/XSDElementRef.gif
deleted file mode 100644
index 8712930..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/XSDElementRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/icons/XSDGroupRef.gif
deleted file mode 100644
index 34a7fb3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/XSDGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif b/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif
deleted file mode 100644
index 1936e21..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif b/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif
deleted file mode 100644
index 13dae59..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif
deleted file mode 100644
index b872bee..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif
deleted file mode 100644
index b6922ac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif
deleted file mode 100644
index d94ff10..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif
deleted file mode 100644
index d94ff10..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif
deleted file mode 100644
index 1dc19a3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif
deleted file mode 100644
index 1dc19a3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif
deleted file mode 100644
index 5c287e9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif b/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif
deleted file mode 100644
index 6fe6f0e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/newChoice.gif b/bundles/org.eclipse.wst.xsd.ui/icons/newChoice.gif
deleted file mode 100644
index eca1446..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/newChoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/newSequence2.gif b/bundles/org.eclipse.wst.xsd.ui/icons/newSequence2.gif
deleted file mode 100644
index 9e3968c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/newSequence2.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributeGroupRef.gif
deleted file mode 100644
index 0ea47d2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributeGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif
deleted file mode 100644
index 61e1e25..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/sample.gif b/bundles/org.eclipse.wst.xsd.ui/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.properties b/bundles/org.eclipse.wst.xsd.ui/plugin.properties
index 21af0ae..01944f1 100644
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/plugin.properties
@@ -32,16 +32,13 @@
 _UI_CREATE_A_NEW_SCHEMA        = Create a new XML schema file
 
 ! New property tabs
-_UI_LABEL_GENERAL          = General
-_UI_LABEL_ATTRIBUTES       = Attributes
-_UI_LABEL_DOCUMENTATION    = Documentation
-_UI_LABEL_TYPE_CONSTRAINTS = Constraints
-_UI_LABEL_APPLICATION_INFO = Application Info
-_UI_LABEL_EXTENSIONS       = Extensions
-_UI_LABEL_FACETS           = Facets
-_UI_LABEL_ENUMERATIONS     = Enumerations
-_UI_LABEL_NAMESPACE        = Namespace
-_UI_LABEL_ADVANCED         = Advanced
+_UI_LABEL_GENERAL       = General
+_UI_LABEL_OTHER         = Other
+_UI_LABEL_ATTRIBUTES    = Attributes
+_UI_LABEL_DOCUMENTATION = Documentation
+_UI_LABEL_FACETS        = Facets
+_UI_LABEL_ENUMERATIONS  = Enumerations
+_UI_LABEL_NAMESPACE     = Namespace
 
 _UI_LABEL_READ_ONLY     = read-only
 _UI_LABEL_KIND          = Kind:
@@ -517,11 +514,10 @@
 !
 ! Validate Schema 
 !
-_UI_DIALOG_XML_SCHEMA_INVALID_TITLE       = Validation Failed
-_UI_DIALOG_XML_SCHEMA_VALID_TITLE         = Validation Succeeded
-_UI_DIALOG_XML_SCHEMA_VALID_TEXT          = The XML schema file is valid.
-_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS = The XML schema file is valid however warnings have been issued. See the Problems view for the warning messages.
-_UI_DIALOG_XML_SCHEMA_INVALID_TEXT        = The XML schema file is not valid. See the Problems view for the error messages.
+_UI_DIALOG_XML_SCHEMA_INVALID_TITLE  = Validation Failed
+_UI_DIALOG_XML_SCHEMA_VALID_TITLE    = Validation Succeeded
+_UI_DIALOG_XML_SCHEMA_VALID_TEXT     = The XML schema file is valid.
+_UI_DIALOG_XML_SCHEMA_LIMITE_EXCEEDED  = The XML schema file is not valid.  The message limit for the Tasks view has been exceeded.  Please increase the limit and try again.
 
 !
 ! Combo-box choices 
@@ -546,6 +542,8 @@
 _UI_GENERATE_DDL_TITLE          = Generate DDL
 _UI_GENERATE_DDL_DESCRIPTION    = Generate DDL from the selected XML schema file.
 
+_UI_XML_SCHEMA_VALIDATOR            = XML Schema Validator
+
 ! Generation from the Schema model - pre-condition check
 _UI_DIALOG_TITLE_GRAMMAR_ERROR      = Invalid Grammar
 _UI_DIALOG_INFO_SCHEMA_INVALID      = The schema file contains errors. Open it in the XML Schema editor and validate it for details.
@@ -829,7 +827,3 @@
 _UI_LABEL_TARGETNAMESPACE_CHANGE       = Target Namespace Change
 _INFO_RESET_ATTRIBUTE_GROUP_REFERENCE  = Reset attribute group reference
 _INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE = Remove attribute group reference
-
-Bundle-Vendor.0 = Eclipse.org
-search.declarations.label = Declarations
-search.references.label = References
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.xml b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
index d480cf1..564798d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
@@ -7,11 +7,12 @@
 			name="%_UI_EDITOR_NAME"
 			default="true"
 			icon="icons/XSDFile.gif"
-            contributorClass="org.eclipse.wst.xsd.editor.XSDMultiPageEditorContributor"
-            class="org.eclipse.wst.xsd.editor.InternalXSDMultiPageEditor"
-            id="org.eclipse.wst.xsd.editor.InternalXSDMultiPageEditor">
+			contributorClass="org.eclipse.wst.xsd.ui.internal.XSDActionBarContributor"
+			class="org.eclipse.wst.xsd.ui.internal.XSDEditor"
+			id="org.eclipse.wst.xsd.ui.XSDEditor">
             <contentTypeBinding
                 contentTypeId="org.eclipse.wst.xsd.core.xsdsource" />
+                
 		</editor>
 	</extension>
 
@@ -49,23 +50,22 @@
 		<page
 			name="%_UI_XML_SCHEMA_PREFERENCE"
 			category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.wst.xsd.editor.internal.preferences.XSDPreferencePage"
-			id="org.eclipse.wst.xsd.editor.internal.preferences.XSDPreferencePage">
+			class="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
+			id="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage">
 		</page>
 	</extension>
-<!--
 	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
 		<provisionalDefinition
 			type="preferencepages"
 			value="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
 			target="org.eclipse.wst.xsd.ui.internal.XSDEditor.source" />
-     		<sourceViewerConfiguration
+		<sourceViewerConfiguration
 			class="org.eclipse.wst.xsd.ui.internal.StructuredTextViewerConfigurationXSD"
 			target="org.eclipse.wst.xsd.core.xsdsource" />
 		<contentOutlineConfiguration
 			class="org.eclipse.wst.xsd.ui.internal.XSDContentOutlineConfiguration"
-			target="org.eclipse.wst.xsd.core.xsdsource" /> 
-	</extension>  -->
+			target="org.eclipse.wst.xsd.core.xsdsource" />
+	</extension>
 
 	<!-- ==================================================== -->
 	<!-- Support help on the tags                             -->
@@ -78,138 +78,67 @@
 		</annotationFile>
 		</extension>
 	-->
-	
-	
-   <extension 
-   		point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
-     <propertyContributor
-           contributorId="org.eclipse.wst.xsd.editor"
-           labelProvider="org.eclipse.wst.xsd.ui.common.properties.providers.XSDSectionLabelProvider">
-         <propertyCategory category="General"/>
-   		 <propertyCategory category="Documentation"/>
-         <propertyCategory category="Advanced"/>
-     </propertyContributor>
-   </extension>
-
-   <extension 
-    	point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
-      <propertyTabs 
-            contributorId="org.eclipse.wst.xsd.editor">
+	<extension
+		point="org.eclipse.wst.common.ui.properties.propertyContributor">
+		<propertyContributor
+			contributorId="org.eclipse.wst.xsd.ui.internal.XSDEditor"
+			sectionDescriptorProvider="org.eclipse.wst.xsd.ui.internal.properties.section.XSDSectionDescriptorProvider"
+			labelProvider="org.eclipse.wst.xsd.ui.internal.properties.section.XSDSectionLabelProvider">
+			<propertyCategory category="general"></propertyCategory>
+			<propertyCategory category="namespace"></propertyCategory>
+			<propertyCategory category="other"></propertyCategory>
+			<propertyCategory category="attributes"></propertyCategory>
+			<propertyCategory category="enumerations">
+			</propertyCategory>
+			<propertyCategory category="documentation">
+			</propertyCategory>
+			<propertyCategory category="facets"></propertyCategory>
+		</propertyContributor>
+	</extension>
+	<extension
+		point="org.eclipse.wst.common.ui.properties.propertyTabs">
+		<propertyTabs
+			contributorId="org.eclipse.wst.xsd.ui.internal.XSDEditor">
 			<propertyTab
 				label="%_UI_LABEL_GENERAL"
-				category="General"
-				id="property.tab.general">
+				category="general"
+				id="org.eclipse.wst.xmlwebservices.general">
 			</propertyTab>
 			<propertyTab
-				label="%_UI_LABEL_TYPE_CONSTRAINTS"
-				category="General"
-				afterTab="property.tab.general"
-				id="property.tab.typeconstraints">
+				label="%_UI_LABEL_NAMESPACE"
+				category="namespace"
+				afterTab="org.eclipse.wst.xmlwebservices.general"
+				id="org.eclipse.wst.xmlwebservices.namespace">
+			</propertyTab>
+			<propertyTab
+				label="%_UI_LABEL_OTHER"
+				category="other"
+				id="org.eclipse.wst.xmlwebservices.other">
+			</propertyTab>
+			<propertyTab
+				label="%_UI_LABEL_ATTRIBUTES"
+				category="attributes"
+				id="org.eclipse.wst.xmlwebservices.attributes">
 			</propertyTab>
 			<propertyTab
 				label="%_UI_LABEL_ENUMERATIONS"
-				category="General"
-				afterTab="property.tab.general"
-				id="property.tab.enumerations">
+				category="enumerations"
+				id="org.eclipse.wst.xmlwebservices.enumerations">
 			</propertyTab>
 			<propertyTab
 				label="%_UI_LABEL_DOCUMENTATION"
-				category="Documentation"
-				afterTab="property.tab.general"
-				id="property.tab.documentation">
+				category="documentation"
+				id="org.eclipse.wst.xmlwebservices.documentation">
 			</propertyTab>
 			<propertyTab
-				label="%_UI_LABEL_EXTENSIONS"
-				category="Documentation"
-				afterTab="property.tab.general"
-				id="property.tab.extensions">
+				label="%_UI_SECTION_ADVANCED_ATTRIBUTES"
+				category="facets"
+				id="org.eclipse.wst.xmlwebservices.facets">
 			</propertyTab>
-    </propertyTabs>
- </extension>
+		</propertyTabs>
+	</extension>
 
 
-<extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
-   <propertySections contributorId="org.eclipse.wst.xsd.editor">
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDSchemaSection"  
-	 	id="prop.section.XSDSchemaSection">
-	    <input type="org.eclipse.xsd.XSDSchema">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.SchemaLocationSection" 
-	 	id="prop.section.SchemaLocationSection">
-	    <input type="org.eclipse.xsd.XSDSchemaCompositor">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDComplexTypeSection"  
-	 	id="prop.section.XSDComplexTypeSection">
-	    <input type="org.eclipse.xsd.XSDComplexTypeDefinition">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDElementDeclarationSection"  
-	 	id="prop.section.XSDElementDeclarationSection">
-	    <input type="org.eclipse.xsd.XSDElementDeclaration">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDAttributeDeclarationSection"
-	 	id="prop.section.XSDAttributeDeclarationSection">
-	    <input type="org.eclipse.xsd.XSDAttributeDeclaration">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDAttributeGroupDefinitionSection"  
-	 	id="prop.section.XSDAttributeGroupDefinitionSection">
-	    <input type="org.eclipse.xsd.XSDAttributeGroupDefinition">
-	    </input>
-	 </propertySection>	
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDModelGroupSection"  
-	 	id="prop.section.XSDModelGroupSection">
-	    <input type="org.eclipse.xsd.XSDModelGroup">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDModelGroupDefinitionSection"  
-	 	id="prop.section.XSDModelGroupDefinitionSection">
-	    <input type="org.eclipse.xsd.XSDModelGroupDefinition">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.general" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDSimpleTypeSection"
-	 	id="prop.section.XSDSimpleTypeSection">
-	    <input type="org.eclipse.xsd.XSDSimpleTypeDefinition">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.typeconstraints" 
-        class="org.eclipse.wst.xsd.ui.common.properties.sections.XSDFacetSection"
-        filter="org.eclipse.wst.xsd.ui.common.properties.sections.XSDFacetSectionFilter"
-	 	id="prop.section.XSDFacetSection">
-	    <input type="org.eclipse.xsd.XSDConcreteComponent">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.documentation" 
-	 	class="org.eclipse.wst.xsd.ui.common.properties.sections.AnnotationSection" 
-	 	id="prop.section.AnnotationSection">
-	    <input type="org.eclipse.xsd.XSDConcreteComponent">
-	    </input>
-	 </propertySection>
-	 <propertySection tab="property.tab.extensions" 
-	 	class="org.eclipse.wst.xsd.ui.common.properties.sections.ApplicationInfoSection" 
-	 	id="prop.section.ExtensionsSection">
-	    <input type="org.eclipse.xsd.XSDConcreteComponent">
-	    </input>
-	 </propertySection>
-  </propertySections>
-</extension>
-
-  <extension-point id="ApplicationInformationDescription" name="ApplicationInformationDescription"/>
-
-  <extension-point id="XSDEditorExtensionConfiguration" name="XSDEditorExtensionConfiguration"/>
-
 	<extension
 		point="org.eclipse.wst.xml.core.catalogContributions">
 		<catalogContribution id="default">
@@ -245,6 +174,39 @@
 			parentId="org.eclipse.ui.textEditorScope" />
 	</extension>
 
+	<extension point="org.eclipse.ui.commands">
+		<command
+			name="%command.xsd.refactor.rename.element.name"
+			description="%command.xsd.refactor.rename.element.description"
+			categoryId="org.eclipse.ui.category.edit"
+			id="org.eclipse.wst.xsd.ui.refactor.rename.element">
+		</command>
+		<keyBinding
+			keySequence="Alt+Shift+R"
+			contextId="org.eclipse.wst.xsd.ui.text.editor.context"
+			commandId="org.eclipse.wst.xsd.ui.refactor.rename.element"
+			keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
+		</keyBinding>
+	</extension>
+
+	<extension point="org.eclipse.ui.commands">
+		<command
+			name="%command.xsd.refactor.makeElementGlobal.element.name"
+			description="%command.xsd.refactor.makeElementGlobal.element.description"
+			categoryId="org.eclipse.ui.category.edit"
+			id="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal">
+		</command>
+	</extension>
+
+	<extension point="org.eclipse.ui.commands">
+		<command
+			name="%command.xsd.refactor.makeTypeGlobal.element.name"
+			description="%command.xsd.refactor.makeTypeGlobal.element.description"
+			categoryId="org.eclipse.ui.category.edit"
+			id="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal">
+		</command>
+	</extension>
+
 	<!-- this extension point is used to augment the ModelQuery to provide schema specific guided editing -->
 	<extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
 		<modelQueryExtension
@@ -253,157 +215,85 @@
 		</modelQueryExtension>
 	</extension>
 
-	<!-- ============================================================================== -->
-	<!-- Register the XSDSearchParticpant against for XMLComponentSearchPatterns 		-->
-	<!-- ============================================================================== -->	
-	 <extension   
-		point="org.eclipse.wst.common.core.searchParticipants">
-		<searchParticipant
-			id="org.eclipse.wst.xsd.search.XSDSearchParticipant"
-			class="org.eclipse.wst.xsd.ui.internal.search.XSDSearchParticipant">
-			<enablement>
-			   <or>
-			      <with variable="pattern">
-					<instanceof value="org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern"/>			   
-				  </with>
-				</or>
-			</enablement>
-		</searchParticipant>
-	</extension>
-
-	<!-- ============================================================================== -->	 
-    <!-- Register a 'rename' participant this enables us to provide refactoring for     --> 
-    <!-- renamed XML Schema components (e.g. elements, types etc.)                      --> 
-	<!-- ============================================================================== -->	 
-	<extension
+	<!--extension
 		point="org.eclipse.ltk.core.refactoring.renameParticipants">
 		<renameParticipant
-			name="%xsd.resource.rename.participant.name"
-			class="org.eclipse.wst.xsd.ui.internal.refactor.rename.XSDComponentRenameParticipant"
-			id="org.eclipse.wst.xsd.refactoring.XSDComponentRenameParticipant">
-			<enablement>
-				<with variable="element">
-					<instanceof
-						value="org.eclipse.xsd.XSDNamedComponent">
-					</instanceof>
-				</with>
-			</enablement>
+		name="%xsd.resource.rename.participant.name"
+		class="org.eclipse.wst.xsd.ui.internal.refactor.rename.XSDResourceRenameParticipant"
+		id="org.eclipse.wst.xsd.ui.refactoring.XSDResourceRenameParticipant">
+		<enablement>
+		<with
+		variable="element">
+		<instanceof
+		value="org.eclipse.core.resources.IResource">
+		</instanceof>
+		</with>
+		</enablement>
 		</renameParticipant>
-		
-	</extension>
-	
-	<!-- ============================================================================== -->	 
-    <!-- Register a 'rename' participant this enables us to provide refactoring for     --> 
-    <!-- renamed resources.                                                             --> 
-	<!-- ============================================================================== -->	 
-<!--
-    <extension
-		point="org.eclipse.ltk.core.refactoring.renameParticipants">
-		<renameParticipant
-			name="%xsd.resource.rename.participant.name"
-			class="org.eclipse.wst.xsd.ui.internal.refactor.rename.ResourceRenameParticipant"
-			id="org.eclipse.wst.xsd.refactoring.XSDResourceRenameParticipant">
-			<enablement>
-				<with variable="element">
-					<instanceof value="org.eclipse.core.resources.IResource"/>
-				</with>
-			</enablement>
-		</renameParticipant>
-	</extension>
-	-->
-	<!-- ============================================================================================== -->
-	<!-- Register the  'Refactor', 'References' and 'Declarations' items to the design view	            -->
-	<!-- ============================================================================================== -->	    
-   <extension point="org.eclipse.ui.popupMenus"> 
-      <objectContribution 
-         id="org.eclipse.wst.xsd.ui.refactoring.menu.objectContrib" 
-         objectClass="org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter">  
-         <action
-            id="org.eclipse.wst.xsd.ui.search.declarations.action" 
-            enablesFor="1"
-            style="pulldown"
-            menubarPath="search-slot"
-            label="%search.declarations.label"
-            class="org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchDeclarationsGroupActionDelegate"> 
-         </action>          
-         <action
-            id="org.eclipse.wst.xsd.ui.search.references.action" 
-            enablesFor="1"
-            style="pulldown"
-            menubarPath="search-slot"
-            label="%search.references.label"
-            class="org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchReferencesGroupActionDelegate"> 
-         </action>
-         <action
-            id="org.eclipse.wst.xsd.ui.refactoring.menu.refactorGroup.object" 
-            enablesFor="1"
-            style="pulldown"
-            menubarPath="refactoring-slot"
-            label="%refactoringActionSet.label" 
-            class="org.eclipse.wst.xsd.ui.internal.refactor.actions.XSDRefactorGroupActionDelegate"> 
-         </action>   
-      </objectContribution>         
-      <!-- here we add the 'refactor' menu item to the source view -->
-      <viewerContribution
-        id="org.eclipse.wst.xsd.ui.refactoring.menu.source"
-        targetID="org.eclipse.wst.xsd.core.xsdsource.source.EditorContext">
-	    <action id="org.eclipse.wst.xsd.ui.refactoring.menu.refactorGroup.source"
-       		style="pulldown"
-            menubarPath="additions"
-            label="%refactoring.menu.label" 
-            class="org.eclipse.wst.xsd.ui.internal.refactor.actions.XSDRefactorGroupActionDelegate"> 
-  	    </action>
-       </viewerContribution>       
-     </extension>
+		</extension-->
 
-	
 	<!-- 
 		The following extension to the file context menu is temporary until resource 
 		navigator will provide allow to extend refactor menu        
 	-->
-	
-	<!--extension point="org.eclipse.ui.popupMenus">
-	 <objectContribution
+	<!--
+		<extension point="org.eclipse.ui.popupMenus">
+		<objectContribution
 		objectClass="org.eclipse.core.resources.IFile"
 		nameFilter="*.xsd"
 		id="org.wst.xsd.ui.rename">
 		<menu id="refactorXSDResource" path="additions" label="%refactoring.menu.label">
-		  <separator name="refactor"/>
+		<separator name="refactor"/>
 		</menu>
-	<action
+		<action
 		label="%refactoring.renameAction.label"
 		menubarPath="refactorXSDResource/refactor"
 		class="org.eclipse.wst.xsd.ui.internal.refactor.actions.RenameResourceActionDelegate"
 		enablesFor="1"
 		id="org.eclipse.wst.xsd.ui.refactoring.actions.RenameResource">
-	 </action>
-	 </objectContribution>
-	</extension-->	
-
-	<extension point="org.eclipse.ui.commands">
-		<command
-			name="%command.xsd.refactor.rename.element.name"
-			description="%command.xsd.refactor.rename.element.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.xsd.ui.refactor.rename.element">
-		</command>
-		<command
-			name="%command.xsd.refactor.makeElementGlobal.element.name"
-			description="%command.xsd.refactor.makeElementGlobal.element.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal">
-		</command>
-		<command
-			name="%command.xsd.refactor.makeTypeGlobal.element.name"
-			description="%command.xsd.refactor.makeTypeGlobal.element.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal">
-		</command>
-		<command
-			name="%command.xsd.refactor.renameTargetNamespace.name"
-			description="%command.xsd.refactor.renameTargetNamespace.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.xsd.ui.refactor.renameTargetNamespace">
-		</command>
+		</action>
+		</objectContribution>
+		</extension>
+	-->
+	
+	<!-- ====================================================== -->
+	<!-- Define Assign Validate action on .xsd file             -->
+	<!-- ====================================================== -->
+	<extension point="org.eclipse.ui.popupMenus">
+		<objectContribution
+			objectClass="org.eclipse.core.resources.IFile"
+			nameFilter="*.xsd"
+			id="org.eclipse.wst.xsd.validation.xsdvalidationaction">
+			<action
+				label="%_UI_MENU_VALIDATE_XML"
+				class="org.eclipse.wst.xsd.ui.internal.validation.ValidateSchemaActionDelegate"
+				enablesFor="1"
+				id="org.eclipse.wst.xsd.ui.internal.validation.ValidateSchemaActionDelegate">
+			</action>
+		</objectContribution>
 	</extension>
+
+	<!-- ====================================================== -->
+	<!-- Register the XSD validator with the validation 		-->
+	<!-- framework. 										    -->
+	<!-- ====================================================== -->
+	<extension
+		id="xsdValidator"
+		name="%_UI_XML_SCHEMA_VALIDATOR"
+		point="org.eclipse.wst.validation.validator">
+		<validator>
+			<filter
+				objectClass="org.eclipse.core.resources.IFile"
+				caseSensitive="false"
+				nameFilter="*.xsd">
+			</filter>
+			<helper
+				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
+			</helper>
+			<run
+				class="org.eclipse.wst.xsd.ui.internal.validation.Validator">
+			</run>
+		</validator>
+	</extension>
+
 </plugin>
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/BoxFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/BoxFigure.java
deleted file mode 100644
index a41d899..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/BoxFigure.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.figures;
-
-import java.util.Iterator;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.adt.typeviz.design.layouts.ColumnData;
-
-public class BoxFigure extends Figure
-{
-  protected ColumnData columnData = new ColumnData();  
-  public HeadingFigure headingFigure;
-  Figure contentPane;
-  
-  public boolean isSelected = false;
-
-  public BoxFigure()
-  {
-    super();
-    headingFigure = new HeadingFigure();   
-    add(headingFigure);
-
-    contentPane = new Figure()
-    {
-      public void paint(Graphics graphics)
-      {
-        super.paint(graphics);
-        boolean isFirst = false;
-        for (Iterator i = getChildren().iterator(); i.hasNext();)
-        {
-          Figure figure = (Figure) i.next();
-          if (isFirst)
-          {
-            isFirst = false;
-          }
-          else
-          {
-            Rectangle r = figure.getBounds();
-            graphics.drawLine(r.x, r.y + 1, r.x + r.width, r.y + 1);
-          }
-        }
-      }
-    };
-    contentPane.setLayoutManager(new ToolbarLayout());
-    add(contentPane);
-    headingFigure.setForegroundColor(ColorConstants.black); 
-  }
-
-  public void paint(Graphics graphics)
-  {
-    super.paint(graphics);
-    /*
-    // Fill for the header section
-    //
-    Rectangle r = getBounds().getCopy();
-    graphics.setBackgroundColor(ColorConstants.darkGray);
-    Color gradient1 = ColorConstants.lightGray;
-    if (isSelected)
-    {
-      gradient1 = ColorConstants.lightBlue;
-    }
-    Color gradient2 = ColorConstants.white;
-    graphics.setForegroundColor(gradient1);
-    graphics.setBackgroundColor(gradient2);
-    graphics.fillGradient(r.x + 1, r.y + 1, r.width - 2, nodeNameLabel.getBounds().height - 1, true);
-    nodeNameLabel.paint(graphics);
-    */
-  }
-
-  public IFigure getContentPane()
-  {
-    return contentPane;
-  }
-
-  public Label getNameLabel()
-  {
-    return headingFigure.getLabel();
-  }
-  
-  public HeadingFigure getHeadingFigure()
-  {
-    return headingFigure;
-  }
-  
-  public ColumnData getColumnData()
-  {
-    return columnData;
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/CompartmentFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/CompartmentFigure.java
deleted file mode 100644
index 7e329bc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/CompartmentFigure.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.figures;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.wst.xsd.adt.design.editparts.StructureEditPart;
-import org.eclipse.wst.xsd.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.adt.typeviz.design.layouts.RowLayout;
-
-public class CompartmentFigure extends Figure implements ICompartmentFigure
-{
-  public Label nodeNameLabel;
-  protected Figure contentPane;
-  protected Figure annotationArea;
-  public Figure rowFigure;
-
-  public CompartmentFigure()
-  {
-    super();
-
-    rowFigure = new Figure();
-    add(rowFigure);
-
-    annotationArea = new Figure();
-    ToolbarLayout annotationLayout = new ToolbarLayout(false);
-    annotationLayout.setStretchMinorAxis(true);
-    annotationArea.setLayoutManager(annotationLayout);
-
-    // Need this to show content model structure on the left side of the figure
-    rowFigure.add(annotationArea);
-
-    contentPane = new Figure()
-    {
-      public void paint(Graphics graphics)
-      {
-        super.paint(graphics);
-        graphics.pushState();
-        try
-        {
-          boolean isFirst = true;
-          Color oldColor = graphics.getForegroundColor();
-          graphics.setForegroundColor(ColorConstants.lightGray);
-          for (Iterator i = getChildren().iterator(); i.hasNext();)
-          {
-            Figure figure = (Figure) i.next();
-            Rectangle r = figure.getBounds();
-//            if (figure instanceof FieldFigure)
-//            {
-//               Rectangle rChild = ((FieldFigure)figure).getNameFigure().getBounds();
-//               graphics.drawLine(rChild.right(), rChild.y, rChild.right(), rChild.bottom());
-//               graphics.setForegroundColor(ColorConstants.darkGray);
-//            }
-            if (isFirst)
-            {
-              isFirst = false;
-//               graphics.drawLine(r.x, r.y, r.x, r.y + r.height);
-            }
-            else
-            {
-              graphics.setForegroundColor(ColorConstants.white);
-              graphics.setBackgroundColor(ColorConstants.lightGray);              
-              graphics.fillGradient(r.x, r.y, r.width, 1, false);    
-//              graphics.drawLine(r.x, r.y, r.x + r.width, r.y);
-//            graphics.drawLine(r.x, r.y, r.x, r.y + r.height);
-            }
-          }
-          graphics.setForegroundColor(oldColor);
-        }
-        finally
-        {
-          graphics.popState();
-        }
-      }
-    };
-    contentPane.setLayoutManager(new ToolbarLayout());
-    rowFigure.add(contentPane);
-
-    RowLayout rowLayout = new RowLayout();
-    rowFigure.setLayoutManager(rowLayout);
-    rowLayout.setConstraint(annotationArea, "annotation");
-    rowLayout.setConstraint(contentPane, "contentPane");
-  }
-
-  public IFigure getContentPane()
-  {
-    return contentPane;
-  }
-
-  public IFigure getAnnotationPane()
-  {
-    return annotationArea;
-  }
-  
-  public void editPartAttached(EditPart owner)
-  {   
-    StructureEditPart structureEditPart = null;
-    for (EditPart parent = owner.getParent(); parent != null; parent = parent.getParent())
-    {
-      if (parent instanceof StructureEditPart)
-      {
-        structureEditPart = (StructureEditPart) parent;
-        break;
-      }
-    }
-    RowLayout rowLayout = (RowLayout)rowFigure.getLayoutManager();
-    IStructureFigure typeFigure = structureEditPart.getStructureFigure();    
-    Assert.isTrue(typeFigure instanceof StructureFigure, "Expected object of type StructureFigure");    
-    rowLayout.setColumnData(((StructureFigure)typeFigure).getColumnData());            
-  }
-
-  public void addSelectionFeedback()
-  {
-  }
-
-  public void removeSelectionFeedback()
-  {
-  }   
-  
-  public void refreshVisuals(Object model)
-  {
-    // TODO Auto-generated method stub
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/FieldFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/FieldFigure.java
deleted file mode 100644
index 2a90266..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/FieldFigure.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.figures;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.design.editparts.StructureEditPart;
-import org.eclipse.wst.xsd.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.adt.typeviz.design.layouts.RowLayout;
-
-public class FieldFigure extends Figure implements IFieldFigure
-{
-  // TODO: put this color is some common class
-  public static final Color cellColor = new Color(null, 224, 233, 246);
-  
-  // Formatting constraints
-  public static final int TOP_MARGIN = 2; // pixels
-  public static final int BOTTOM_MARGIN = TOP_MARGIN + 1; // extra pixel for the
-                                                          // footer line
-  public static final int LEFT_MARGIN = 2;
-  public static final int RIGHT_MARGIN = LEFT_MARGIN;
-  public static final int RIGHT_SIDE_PADDING = 6;
-
-  // States requiring decorators, and their icons
-  // protected static final Image errorIcon = ICON_ERROR;
-
-  // Labels which handle presentation of name and type
-  public Figure rowFigure;
-  protected Label nameLabel;
-  protected Label nameAnnotationLabel;  // for occurrence text, or error icons
-  protected Label typeLabel;
-  protected Label typeAnnotationLabel;  // for occurrence text, or error icons
-  protected Label toolTipLabel;
-
-  public FieldFigure()
-  {
-    super();
-    setLayoutManager(new ToolbarLayout());
-//    setOpaque(true);
-    rowFigure = new Figure();
-//    rowFigure.setOpaque(true);
-    RowLayout rowLayout = new RowLayout();
-    rowFigure.setLayoutManager(rowLayout);
-
-    add(rowFigure);
-
-    nameLabel = new Label();
-    nameLabel.setBorder(new MarginBorder(3, 5, 3, 5));
-    nameLabel.setLabelAlignment(PositionConstants.LEFT);
-    nameLabel.setOpaque(true);
-    rowFigure.add(nameLabel);
-    
-    nameAnnotationLabel = new Label();
-    nameAnnotationLabel.setBorder(new MarginBorder(3, 5, 3, 5));
-    nameAnnotationLabel.setLabelAlignment(PositionConstants.LEFT);
-    nameAnnotationLabel.setOpaque(true);
-    rowFigure.add(nameAnnotationLabel);
-    
-    toolTipLabel = new Label();
-    nameLabel.setToolTip(toolTipLabel);
-    typeLabel = new Label();
-    
-    // cs : we need to add some additional padding to the right
-    // so that when we edit the field there's room for the combobox's arrow
-    // and the type name won't be partially obscured
-    //
-    typeLabel.setBorder(new MarginBorder(3, 5, 3, 20));
-    typeLabel.setLabelAlignment(PositionConstants.LEFT);
-    typeLabel.setOpaque(true);
-    rowFigure.add(typeLabel);
-
-    typeAnnotationLabel = new Label() {
-      
-      public Dimension getPreferredSize(int wHint, int hHint)
-      {
-        if (getText() == null || getText().equals(""))
-        {
-          return new Dimension(0, 0);
-        }
-        return super.getPreferredSize(wHint, hHint);
-      };
-    };
-    typeAnnotationLabel.setBorder(new MarginBorder(3, 5, 3, 5));
-    typeAnnotationLabel.setLabelAlignment(PositionConstants.LEFT);
-    typeAnnotationLabel.setOpaque(true);
-    rowFigure.add(typeAnnotationLabel);
-    typeAnnotationLabel.setToolTip(toolTipLabel);
-    
-    rowLayout.setConstraint(nameLabel, "name");
-    rowLayout.setConstraint(nameAnnotationLabel, "nameAnnotation");
-    rowLayout.setConstraint(typeLabel, "type");
-    rowLayout.setConstraint(typeAnnotationLabel, "typeAnnotation");
-  }
-
-  /**
-   * @return Returns the "name" string used by this figure.
-   */
-  public String getName()
-  {
-    return nameLabel.getText();
-  }
-
-  /**
-   * @return Returns the figure representing the attribute name
-   */
-  public Label getNameLabel()
-  {
-    return nameLabel;
-  }
-
-  /**
-   * @return Returns the "type" string used by this figure.
-   */
-  public String getType()
-  {
-    return typeLabel.getText();
-  }
-
-  /**
-   * @return Returns the figure representing the attribute's type
-   */
-  public Label getTypeLabel()
-  {
-    return typeLabel;
-  }
-
-  /**
-   * @param name
-   *          Set the "name" string used by this figure.
-   */
-  public void setName(String name)
-  {
-    nameLabel.setText(name);
-  }
-
-  /**
-   * @param type
-   *          Set the "type" string used by this figure.
-   */
-  public void setType(String type)
-  {
-    typeLabel.setText(type);
-  }
-  
-  public void setTypeToolTipText(String toolTip)
-  {
-    setNameToolTipText(toolTip);
-  }
-
-  public void setNameToolTipText(String toolTip)
-  {
-    if (toolTip.length() > 0)
-    {
-      nameLabel.setToolTip(toolTipLabel);
-      toolTipLabel.setText(toolTip);
-    }
-    else
-    {
-      nameLabel.setToolTip(null);
-    }
-  }
-  
-  public void setNameAnnotationLabel(String text)
-  {
-    nameAnnotationLabel.setText(text);
-  }
-
-  public void setNameAnnotationLabelIcon(Image icon)
-  {
-    nameAnnotationLabel.setIcon(icon);
-  }
-  
-  public Label getNameAnnotationLabel()
-  {
-    return nameAnnotationLabel;
-  }
-  
-  public void setTypeAnnotationLabel(String text)
-  {
-    typeAnnotationLabel.setText(text);
-  }
-
-  public void setTypeAnnotationLabelIcon(Image icon)
-  {
-    typeAnnotationLabel.setIcon(icon);
-  }
-
-  public Label getTypeAnnotationLabel()
-  {
-    return typeAnnotationLabel;
-  }
-  
-  public void recomputeLayout()
-  {
-    RowLayout layout = (RowLayout)rowFigure.getLayoutManager();
-    if (layout != null && layout.getColumnData() != null)
-    {
-      layout.getColumnData().clearColumnWidths();
-    }    
-  }
-  
-  public void editPartAttached(EditPart owner)
-  {
-    StructureEditPart structureEditPart = null;
-    for (EditPart parent = owner.getParent(); parent != null; parent = parent.getParent())
-    {
-      if (parent instanceof StructureEditPart)
-      {
-        structureEditPart = (StructureEditPart) parent;
-        break;
-      }
-    }
-    RowLayout rowLayout = (RowLayout)rowFigure.getLayoutManager();
-    IStructureFigure typeFigure = structureEditPart.getStructureFigure();    
-    Assert.isTrue(typeFigure instanceof StructureFigure, "Expected object of type StructureFigure");    
-    rowLayout.setColumnData(((StructureFigure)typeFigure).getColumnData());   
-  }
-  
-  public void addSelectionFeedback()
-  {
-    rowFigure.setBackgroundColor(cellColor); 
-  }
-  
-  public void removeSelectionFeedback()
-  {
-    rowFigure.setBackgroundColor(getBackgroundColor());   
-  }
-  
-  public void refreshVisuals(Object model)
-  {
-    // TODO Auto-generated method stub
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/HeadingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/HeadingFigure.java
deleted file mode 100644
index 041396b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/HeadingFigure.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Color;
-
-public class HeadingFigure extends Figure
-{
-  public static final Color headerColor = new Color(null, 224, 233, 246);
-  Label label;
-  Color[] gradientColor = {ColorConstants.white,  
-                           ColorConstants.lightGray,
-                           ColorConstants.lightBlue,
-                           ColorConstants.gray};
-  boolean isSelected = false;
-  boolean isReadOnly = false;
-  
-  public HeadingFigure()
-  {
-    label = new Label();
-    label.setBorder(new MarginBorder(2));
-    ToolbarLayout toolbarLayout = new ToolbarLayout(false);
-    toolbarLayout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
-    setLayoutManager(toolbarLayout);
-    add(label);
-  }
-  
-  public void setGradientColors(Color[] colors)
-  {
-    this.gradientColor = colors;
-  }
-  
-  public void setSelected(boolean isSelected)
-  {
-    this.isSelected = isSelected;
-  }
-
-  public void setIsReadOnly(boolean isReadOnly)
-  {
-    this.isReadOnly = isReadOnly;
-  }
-  
-  public void paint(Graphics graphics)
-  {
-    super.paint(graphics);
-    
-    graphics.pushState();
-    try
-    {
-      // Fill for the header section
-      //
-      Rectangle r = getBounds().getCopy();
-      graphics.setBackgroundColor(ColorConstants.lightGray);
-  
-      Color gradient1 = isReadOnly ? gradientColor[1] : headerColor;
-      if (isSelected && isReadOnly) gradient1 = gradientColor[3];
-      else if (isSelected && !isReadOnly) gradient1 = gradientColor[2];
-      Color gradient2 = gradientColor[0];
-      graphics.setForegroundColor(gradient1);
-      graphics.setBackgroundColor(gradient2);
-      Rectangle labelBounds = label.getBounds();
-      graphics.fillGradient(r.x+1, r.y+1, r.width-2, labelBounds.height - 2, true);    
-      graphics.setForegroundColor(ColorConstants.darkGray);
-      label.paint(graphics);    
-    }
-    finally
-    {
-      graphics.popState();
-    }
-  }
-
-  public Label getLabel()
-  {
-    return label;
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/RoundedLineBorder.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/RoundedLineBorder.java
deleted file mode 100644
index aac092b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/RoundedLineBorder.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.swt.graphics.Color;
-
-public class RoundedLineBorder extends LineBorder
-{
-  protected int arcLength;   
-  protected int lineStyle = Graphics.LINE_SOLID;
-
-  public RoundedLineBorder(Color c, int width, int arcLength)
-  {
-    super(c, width);     
-    this.arcLength = arcLength;
-  }
-
-  public RoundedLineBorder(int width, int arcLength)
-  {
-    super(width);     
-    this.arcLength = arcLength;
-  }
-  
-  public RoundedLineBorder(Color c, int width, int arcLength, int lineStyle)
-  {
-    super(c, width);
-    this.arcLength = arcLength;
-    this.lineStyle = lineStyle;
-  }
-
-  public RoundedLineBorder(int width, int arcLength, int lineStyle)
-  {
-    super(width);
-    this.arcLength = arcLength;
-    this.lineStyle = lineStyle;
-  }
-
-  public void paint(IFigure figure, Graphics graphics, Insets insets)
-  {
-    int rlbWidth = getWidth();
-    tempRect.setBounds(getPaintRectangle(figure, insets));
-    if (rlbWidth%2 == 1)
-    {
-      tempRect.width--;
-      tempRect.height--;
-    }
-    tempRect.shrink(rlbWidth/2,rlbWidth/2);
-    graphics.setLineWidth(rlbWidth);
-    graphics.setLineStyle(lineStyle);
-    if (getColor() != null)
-      graphics.setForegroundColor(getColor());
-    graphics.drawRoundRectangle(tempRect, arcLength, arcLength);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/StructureFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/StructureFigure.java
deleted file mode 100644
index 8d3d14d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/StructureFigure.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-
-
-public class StructureFigure extends BoxFigure implements IStructureFigure
-{
-  public void editPartAttached(EditPart owner)
-  {
-    // nothing to do here :-)
-  }
-
-  public void addSelectionFeedback()
-  {
-    LineBorder boxFigureLineBorder = (LineBorder)getBorder();
-    boxFigureLineBorder.setWidth(2);
-    // TODO (cs) need to fix this
-    //boxFigureLineBorder.setColor(getComplexType().isReadOnly() ? ColorConstants.darkGray : ColorConstants.darkBlue);  
-    getHeadingFigure().setSelected(true);
-    repaint();
-  }
-
-  public void removeSelectionFeedback()
-  {
-    LineBorder boxFigureLineBorder = (LineBorder)getBorder();
-    boxFigureLineBorder.setWidth(1);
-    getHeadingFigure().setSelected(false);
-    repaint();
-  }  
-  
-  public boolean hitTestHeader(Point location)
-  {
-    IFigure target = getHeadingFigure();
-    Rectangle b = target.getBounds().getCopy();
-    target.translateToAbsolute(b);  
-    return b.contains(location);
-  }
-  
-  public void refreshVisuals(Object model)
-  {
-    IStructure structure = (IStructure)model;
-    getNameLabel().setText(structure.getName());    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/TypeVizFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/TypeVizFigureFactory.java
deleted file mode 100644
index b0e977a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/figures/TypeVizFigureFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.wst.xsd.editor.internal.design.figures.IModelGroupFigure;
-import org.eclipse.wst.xsd.editor.internal.design.figures.ModelGroupFigure;
-
-public class TypeVizFigureFactory implements IExtendedFigureFactory
-{  
-  public IStructureFigure createStructureFigure(Object model)
-  {
-    StructureFigure figure = new StructureFigure();
-    figure.setBorder(new LineBorder(1));    
-    ToolbarLayout toolbarLayout = new ToolbarLayout();
-    toolbarLayout.setStretchMinorAxis(true);
-    figure.setLayoutManager(toolbarLayout);
-
-    if (model instanceof ITreeElement)
-    {
-      figure.getNameLabel().setIcon(((ITreeElement)model).getImage());
-    }    
-    //figure.getHeadingFigure().setIsReadOnly(getComplexType().isReadOnly());
-    // we should organize ITreeElement and integrate it with the facade    
-    return figure;
-  }
-
-  public IFieldFigure createFieldFigure(Object model)
-  {
-    // TODO Auto-generated method stub
-    return new FieldFigure();
-  }
-  
-  public ICompartmentFigure createCompartmentFigure(Object model)
-  {
-    CompartmentFigure figure = new CompartmentFigure();
-    figure.setBorder(new MarginBorder(1));
-    ToolbarLayout toolbarLayout = new ToolbarLayout(false);
-    toolbarLayout.setStretchMinorAxis(true);
-    figure.setLayoutManager(toolbarLayout);
-    return figure;
-  }  
-  
-  public IModelGroupFigure createModelGroupFigure(Object model)
-  {
-    // TODO Auto-generated method stub
-    return new ModelGroupFigure();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/layouts/ColumnData.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/layouts/ColumnData.java
deleted file mode 100644
index 5c82e84..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/layouts/ColumnData.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.layouts;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-public class ColumnData
-{
-  HashMap map = new HashMap();
-  
-  class Entry
-  {
-    int width = 0;
-    int weight = 1;
-  }
-  
-  public void clearColumnWidths()
-  {
-    for (Iterator i = map.values().iterator(); i.hasNext();)
-    {
-      Entry entry = (Entry)i.next();
-      entry.width = 0;
-    }  
-  }  
-  
-  private Entry lookupOrCreateColumnEntry(String identifier)
-  {
-    Entry entry = (Entry)map.get(identifier);
-    if (entry == null)
-    {
-      entry = new Entry();
-      map.put(identifier, entry);
-    }  
-   return entry; 
-  }  
-  
-  void stretchColumnWidthIfNeeded(String identifier, int width)
-  {
-    Entry entry = lookupOrCreateColumnEntry(identifier);
-    entry.width = Math.max(entry.width, width);
-  }
-  
-  int getColumnWidth(String identifier)
-  {
-    Entry entry = (Entry)map.get(identifier);
-    if (entry != null)
-    {
-      return entry.width;
-    }  
-    else
-    {
-      return 0;//hmm should we return -1 ?
-    }  
-  }
-  
-  int getColumnWeight(String identifier)
-  {
-    Entry entry = (Entry)map.get(identifier);
-    if (entry != null)
-    {
-      return entry.weight;
-    }  
-    else
-    {
-      return 0;
-    }  
-  }
-  
-  public void setColumnWeight(String identifier, int weight)
-  {
-    Entry entry = lookupOrCreateColumnEntry(identifier);
-    entry.weight = weight;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/layouts/RowLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/layouts/RowLayout.java
deleted file mode 100644
index 21fc9bf..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/adt/typeviz/design/layouts/RowLayout.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.typeviz.design.layouts;
-
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class RowLayout extends AbstractLayout
-{
-  // layout is associated with a parent context
-  // any layout manager under the parent context is connected
-  // column rows are maintained accross container boundaries  
-  protected ColumnData columnData;
-  protected HashMap figureToContstraintMap = new HashMap();
-  
-  public RowLayout()
-  {
-    super();
-  }
-  
-
-  // this method computes the minimum size required to display the figures
-  //
-  private Dimension calculateChildrenSize(IFigure container, List children, int wHint, int hHint, boolean preferred)
-  {
-    Dimension childSize;
-    IFigure child;
-    int height = 0;
-    int width = 0;
-    
-    //IRowFigure figure = (IRowFigure)container;
-    
-    // for each cell in the row
-    //
-    for (int i = 0; i < children.size(); i++)
-    {
-      child = (IFigure) children.get(i);
-      String columnIdenifier = (String)getConstraint(child);
-             
-      // first we compute the child size without regard for columnData
-      //
-      childSize = child.getPreferredSize(wHint, hHint);// : child.getMinimumSize(wHint, hHint);
-        
-      // now that the columnData has been populated we can consider if the row needs to be larger
-      //
-      int effectiveWidth = childSize.width;
-      if (columnIdenifier != null)
-      {  
-        columnData.stretchColumnWidthIfNeeded(columnIdenifier, childSize.width);
-        effectiveWidth = columnData.getColumnWidth(columnIdenifier);
-      }                       
-      height = Math.max(childSize.height, height);
-      width += effectiveWidth;
-    }  
-    return new Dimension(width, height);
-  }
-  
-  
-  
-  protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
-  {    
-    List children = container.getChildren();
-    Dimension prefSize = calculateChildrenSize(container, children, wHint, hHint, true);
-    //System.out.println("preferredSize=" + prefSize);
-    return prefSize;
-  }
-
-  public void layout(IFigure parent)
-  {
-    // layout a table with the columns aligned      
-    //IRowFigure rowFigure = (IRowFigure)parent;    
-    Rectangle clientArea = parent.getClientArea();   
-    List children = parent.getChildren();
-    Rectangle r = new Rectangle();
-    r.x = clientArea.x;
-    r.y = clientArea.y;
-    r.height = clientArea.height;
-    
-    int childrenSize = children.size();
-    Rectangle[] bounds = new Rectangle[childrenSize];
-    
-    // for each cell in the row
-    //
-    int requiredWidth = 0;
-    int totalColumnWeight = 0;
-    for (int i = 0; i < childrenSize; i++)
-    {
-      IFigure child = (IFigure) children.get(i);
-      //String columnIdenifier = figure.getColumnIdentifier(child);             
-      // first we compute the child size without regard for columnData
-      //
-      Dimension childSize = child.getPreferredSize(-1, -1);
-      
-      int columnWidth = -1;
-      //String columnIdentifier = rowFigure.getColumnIdentifier(child);
-      String columnIdentifier = (String)getConstraint(child);
-      if (columnIdentifier != null)
-      {
-        //columnData.stretchColumnWidthIfNeeded(columnIdentifier, childSize.width);        
-        columnWidth = columnData.getColumnWidth(columnIdentifier);
-        totalColumnWeight += columnData.getColumnWeight(columnIdentifier);
-        //System.out.println("columnWidth(" + columnIdentifier + ")=" + columnWidth);        
-      }  
-      r.width = Math.max(childSize.width, columnWidth);
-      requiredWidth += r.width;
-      bounds[i] = new Rectangle(r);      
-      r.x += r.width;
-    }          
-    if (totalColumnWeight < 1)
-    {
-      totalColumnWeight = 1;
-    }
-    //System.out.println("clientArea.width=" + clientArea.width + ", " + r.x);
-    int extraWidth = Math.max(clientArea.width - requiredWidth, 0);    
-    //System.out.println("extraWidth=" + extraWidth + " totalColumnWeight=" + totalColumnWeight);  
-    int extraWidthAllocated = 0;
-    for (int i = 0; i < childrenSize; i++)
-    {
-      IFigure child = (IFigure) children.get(i);      
-      Rectangle b = bounds[i];    
-      if (extraWidth > 0)
-      {  
-        String columnIdentifier = (String)getConstraint(child);
-        if (columnIdentifier != null)
-        {        
-          int weight = columnData.getColumnWeight(columnIdentifier);
-          float fraction = (float)weight / (float)totalColumnWeight;
-          int extraWidthForChild = (int)(extraWidth * fraction);
-          //System.out.println("extraWidthForChild(" + fraction + ")=" + extraWidthForChild);        
-          b.width += extraWidthForChild;        
-          b.x += extraWidthAllocated;
-          extraWidthAllocated += extraWidthForChild;
-        }  
-        else
-        {
-          b.x += extraWidthAllocated;
-        }
-      }
-      child.setBounds(new Rectangle(b));  
-    }  
-  }
-
-  public ColumnData getColumnData()
-  {
-    return columnData;
-  }
-
-  public void setColumnData(ColumnData columnData)
-  {
-    this.columnData = columnData;
-  }    
-  
-  public Object getConstraint(IFigure child)
-  {
-    return figureToContstraintMap.get(child);
-  }
-  
-  public void setConstraint(IFigure child, Object constraint)
-  {
-    figureToContstraintMap.put(child, constraint);
-  }
-  
-  public void invalidate()
-  {
-    //figureToContstraintMap.clear();
-    //this.columnData.clearColumnWidths();
-    super.invalidate();
-    //System.out.println("invalidate");    
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/BaseHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/BaseHyperlinkDetector.java
deleted file mode 100644
index ca26c9a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/BaseHyperlinkDetector.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Base class for hyperlinks detectors. Provides a framework and common code for
- * hyperlink detectors. TODO: Can we pull this class further up the inheritance
- * hierarchy?
- */
-public abstract class BaseHyperlinkDetector implements IHyperlinkDetector
-{
-  /*
-   * (non-Javadoc)
-   */
-  public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks)
-  {
-    if (region == null || textViewer == null)
-    {
-      return null;
-    }
-
-    List hyperlinks = new ArrayList(0);
-    IDocument document = textViewer.getDocument();
-    int offset = region.getOffset();
-
-    IDOMNode node = getCurrentNode(document, offset);
-
-    // This call allows us to determine whether an attribute is linkable,
-    // without incurring the cost of asking for the target component.
-
-    if (!isLinkable(node))
-    {
-      return null;
-    }
-
-    IRegion hyperlinkRegion = getHyperlinkRegion(node);
-
-    // createHyperlink is a template method. Derived classes, should override.
-
-    IHyperlink hyperlink = createHyperlink(document, node, hyperlinkRegion);
-
-    if (hyperlink != null)
-    {
-      hyperlinks.add(hyperlink);
-    }
-
-    if (hyperlinks.size() == 0)
-    {
-      return null;
-    }
-
-    return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
-  }
-
-  /**
-   * Determines whether a node is "linkable" that is, the component it refers to
-   * can be the target of a "go to definition" navigation.
-   * 
-   * @param node the node to test, must not be null;
-   * @return true if the node is linkable, false otherwise.
-   */
-  private boolean isLinkable(IDOMNode node)
-  {
-    if (node == null)
-    {
-      return false;
-    }
-
-    short nodeType = node.getNodeType();
-
-    boolean isLinkable = false;
-
-    if (nodeType == Node.ATTRIBUTE_NODE)
-    {
-      IDOMAttr attr = (IDOMAttr) node;
-      String name = attr.getName();
-
-      // isLinkableAttribute is a template method. Derived classes should
-      // override.
-
-      isLinkable = isLinkableAttribute(name);
-    }
-
-    return isLinkable;
-  }
-
-  /**
-   * Determines whether an attribute is "linkable" that is, the component it
-   * points to can be the target of a "go to definition" navigation. Derived
-   * classes should override.
-   * 
-   * @param name the attribute name. Must not be null.
-   * @return true if the attribute is linkable, false otherwise.
-   */
-  protected abstract boolean isLinkableAttribute(String name);
-
-  /**
-   * Creates a hyperlink based on the selected node. Derived classes should
-   * override.
-   * 
-   * @param document the source document.
-   * @param node the node under the cursor.
-   * @param region the text region to use to create the hyperlink.
-   * @return a new IHyperlink for the node or null if one cannot be created.
-   */
-  protected abstract IHyperlink createHyperlink(IDocument document, IDOMNode node, IRegion region);
-
-  /**
-   * Locates the attribute node under the cursor.
-   * 
-   * @param offset the cursor offset.
-   * @param parent the parent node
-   * @return an IDOMNode representing the attribute if one is found at the
-   *         offset or null otherwise.
-   */
-  protected IDOMNode getAttributeNode(int offset, IDOMNode parent)
-  {
-    IDOMAttr attrNode = null;
-    NamedNodeMap map = parent.getAttributes();
-
-    for (int index = 0; index < map.getLength(); index++)
-    {
-      attrNode = (IDOMAttr) map.item(index);
-      boolean located = attrNode.contains(offset);
-      if (located)
-      {
-        if (attrNode.hasNameOnly())
-        {
-          attrNode = null;
-        }
-        break;
-      }
-    }
-
-    if (attrNode == null)
-    {
-      return parent;
-    }
-    return attrNode;
-  }
-
-  /**
-   * Returns the node the cursor is currently on in the document or null if no
-   * node is selected
-   * 
-   * @param offset the current cursor offset.
-   * @return IDOMNode either element, doctype, text, attribute or null
-   */
-  private IDOMNode getCurrentNode(IDocument document, int offset)
-  {
-    IndexedRegion inode = null;
-    IStructuredModel sModel = null;
-
-    try
-    {
-      sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-      inode = sModel.getIndexedRegion(offset);
-      if (inode == null)
-        inode = sModel.getIndexedRegion(offset - 1);
-    }
-    finally
-    {
-      if (sModel != null)
-        sModel.releaseFromRead();
-    }
-
-    if (inode instanceof IDOMNode)
-    {
-      IDOMNode node = (IDOMNode) inode;
-
-      if (node.hasAttributes())
-      {
-        node = getAttributeNode(offset, node);
-      }
-      return node;
-    }
-
-    return null;
-  }
-
-  /**
-   * Get the text region corresponding to an IDOMNode.
-   * 
-   * @param node the node for which we want the text region. Must not be null.
-   * @return an IRegion for the node, or null if the node is not recognized.
-   */
-  protected IRegion getHyperlinkRegion(IDOMNode node)
-  {
-    if (node == null)
-    {
-      return null;
-    }
-
-    IRegion hyperRegion = null;
-    short nodeType = node.getNodeType();
-
-    switch (nodeType)
-    {
-      case Node.ELEMENT_NODE : 
-        {
-          hyperRegion = new Region(node.getStartOffset(), node.getEndOffset() - node.getStartOffset());
-        }
-      break;
-      case Node.ATTRIBUTE_NODE : 
-        {
-          IDOMAttr att = (IDOMAttr) node;
-  
-          int regOffset = att.getValueRegionStartOffset();
-  
-          // ISSUE: We are using a deprecated method here. Is there
-          // a better way to get what we need?
-  
-          ITextRegion valueRegion = att.getValueRegion();
-          if (valueRegion != null)
-          {
-            int regLength = valueRegion.getTextLength();
-            String attValue = att.getValueRegionText();
-  
-            // Do not include quotes in attribute value region.
-            if (StringUtils.isQuoted(attValue))
-            {
-              regOffset = ++regOffset;
-              regLength = regLength - 2;
-            }
-            hyperRegion = new Region(regOffset, regLength);
-          }
-        }
-        break;
-      default :
-        // Do nothing.
-        break;
-    }
- 
-    return hyperRegion;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/ISelectionMapper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/ISelectionMapper.java
deleted file mode 100644
index 516cf7f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/ISelectionMapper.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import org.eclipse.jface.viewers.ISelection;
-
-public interface ISelectionMapper
-{
-  ISelection mapSelection(ISelection selectedObject);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/InternalXSDMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/InternalXSDMultiPageEditor.java
deleted file mode 100644
index b00f1d3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/InternalXSDMultiPageEditor.java
+++ /dev/null
@@ -1,895 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.RootEditPart;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.INavigationLocation;
-import org.eclipse.ui.INavigationLocationProvider;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
-import org.eclipse.wst.xml.core.internal.document.NodeImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.adt.actions.AddFieldAction;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.adt.editor.ADTMultiPageEditor;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.editor.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.XSDEditPartFactory;
-import org.eclipse.wst.xsd.editor.internal.navigation.DesignViewNavigationLocation;
-import org.eclipse.wst.xsd.editor.internal.navigation.MultiPageEditorTextSelectionNavigationLocation;
-import org.eclipse.wst.xsd.editor.internal.utils.OpenOnSelectionHelper;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDAttributeGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDComplexTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDSimpleTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.common.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.common.actions.SetTypeAction;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelReconcileAdapter;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class InternalXSDMultiPageEditor extends ADTMultiPageEditor implements ITabbedPropertySheetPageContributor, IPropertyListener, INavigationLocationProvider
-{
-  ResourceSet resourceSet;
-  Resource xsdResource;
-  // IModel model;
-  IStructuredModel structuredModel;
-  XSDSchema xsdSchema;
-  private OutlineTreeSelectionChangeListener fOutlineListener;
-  private SourceEditorSelectionListener fSourceEditorSelectionListener;
-  private XSDSelectionManagerSelectionListener fXSDSelectionListener;
-  private StructuredTextEditor structuredTextEditor;
-
-  public IModel buildModel(IFileEditorInput editorInput)
-  {
-    try
-    {
-      EPackage.Registry reg = EPackage.Registry.INSTANCE;
-      XSDPackage xsdPackage = (XSDPackage) reg.getEPackage(XSDPackage.eNS_URI);
-      xsdSchema = xsdPackage.getXSDFactory().createXSDSchema();
-      resourceSet = XSDSchemaImpl.createResourceSet();
-      IFile resourceFile = editorInput.getFile();
-      structuredModel = StructuredModelManager.getModelManager().getModelForEdit(resourceFile);
-      // If the resource is in the workspace....
-      // otherwise the user is trying to open an external file
-      if (resourceFile != null)
-      {
-        String pathName = resourceFile.getFullPath().toString();
-        xsdResource = resourceSet.getResource(URI.createPlatformResourceURI(pathName), true);
-        resourceSet.getResources().add(xsdResource);
-        Object obj = xsdResource.getContents().get(0);
-        if (obj instanceof XSDSchema)
-        {
-          xsdSchema = (XSDSchema) obj;
-          xsdSchema.setElement(((IDOMModel) structuredModel).getDocument().getDocumentElement());
-          model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema);
-        }
-        
-        // If the input schema is from the WSDL Editor, then use that inline schema
-        if (editorInput instanceof XSDFileEditorInput)
-        {
-          xsdSchema = ((XSDFileEditorInput) editorInput).getSchema();
-          model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema);
-        }
-        if (xsdSchema.getElement() != null)
-          
-          // TODO (cs) ... we need to look into performance issues when we add elements
-          // seems to be that formatting is causig lots of notification and things get terribly slow
-          // I'm specializing the method below to add an isModelStateChanging check that should
-          // help here ... but we need to investigate further
-          new XSDModelReconcileAdapter(xsdSchema.getElement().getOwnerDocument(), xsdSchema)
-          {
-            public void handleNotifyChange(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index)
-            {
-              if (notifier instanceof NodeImpl)
-              {
-                NodeImpl nodeImpl = (NodeImpl)notifier;
-                if (!nodeImpl.getModel().isModelStateChanging())
-                {  
-                  //System.out.println("handleNotifyChange " + eventType);
-                  super.handleNotifyChange(notifier, eventType, feature, oldValue, newValue, index);
-                }  
-              }
-            }
-          };
-        xsdResource.setModified(false);
-      }
-    }
-    catch (StackOverflowError e)
-    {
-    }
-    catch (Exception ex)
-    {
-    }
-    return model;
-  }
-
-  public void dispose()
-  {
-    structuredModel.releaseFromEdit();
-    if (fOutlinePage != null)
-    {
-      if (fOutlinePage instanceof ConfigurableContentOutlinePage && fOutlineListener != null)
-      {
-        ((ConfigurableContentOutlinePage) fOutlinePage).removeDoubleClickListener(fOutlineListener);
-      }
-      if (fOutlineListener != null)
-      {
-        fOutlinePage.removeSelectionChangedListener(fOutlineListener);
-      }
-    }
-    getSelectionManager().removeSelectionChangedListener(fXSDSelectionListener);
-    super.dispose();
-  }
-
-  protected void configureGraphicalViewer()
-  {
-    super.configureGraphicalViewer();
-    // get edit part factory from extension
-    EditPartFactory editPartFactory = XSDEditorPlugin.getDefault().getXSDEditorConfiguration().getEditPartFactory();
-    if (editPartFactory != null)
-    {
-      graphicalViewer.setEditPartFactory(editPartFactory);
-    }
-    else
-    {
-      // otherwise use default
-      graphicalViewer.setEditPartFactory(new XSDEditPartFactory());
-    }
-  }
-
-  public Object getAdapter(Class type)
-  {
-    if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class)
-    {
-      XSDTabbedPropertySheetPage page = new XSDTabbedPropertySheetPage(this);
-      return page;
-    }
-    else if (type == ISelectionProvider.class)
-    {
-      return selectionManager;
-    }  
-    else if (type == XSDSchema.class)
-    {
-      return xsdSchema;
-    }
-    else if (type == IContentOutlinePage.class)
-    {
-      Object adapter = super.getAdapter(type);
-      if (adapter != null)
-      {
-        IContentOutlinePage page = (IContentOutlinePage) adapter;
-        fOutlineListener = new OutlineTreeSelectionChangeListener();
-        page.addSelectionChangedListener(fOutlineListener);
-        if (page instanceof ConfigurableContentOutlinePage)
-        {
-          ((ConfigurableContentOutlinePage) page).addDoubleClickListener(fOutlineListener);
-        }
-        return page;
-      }
-    }
-    else if (type == XSDElementReferenceEditManager.class)
-    {
-    	IEditorInput editorInput = getEditorInput();
-    	if (editorInput instanceof IFileEditorInput)
-    	{
-    		IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
-    		// TODO (cs) currently we assume the schema editor will only ever edit a
-    		// single schema
-    		/// but if we want to enable the schema editor to edit wsdl files we
-    		// should pass in
-    		// an array of schemas
-    		// hmm.. perhaps just pass in a ResourceSet
-    		XSDSchema[] schemas = {xsdSchema};
-    		return new XSDElementReferenceEditManager(fileEditorInput.getFile(), schemas);
-    	}
-    }
-    else if (type == XSDTypeReferenceEditManager.class)
-    {
-      IEditorInput editorInput = getEditorInput();
-      if (editorInput instanceof IFileEditorInput)
-      {
-        IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
-        // TODO (cs) currently we assume the schema editor will only ever edit a
-        // single schema
-        // but if we want to enable the schema editor to edit wsdl files we
-        // should pass in
-        // an array of schemas
-        // hmm.. perhaps just pass in a ResourceSet
-        XSDSchema[] schemas = {xsdSchema};
-        return new XSDTypeReferenceEditManager(fileEditorInput.getFile(), schemas);
-      }
-    }
-    else if (type == ITextEditor.class)
-    {
-      return getTextEditor();
-    }
-    else if (type == ISelectionMapper.class)
-    {
-      return new XSDSelectionMapper();
-    }  
-    return super.getAdapter(type);
-  }
-
-  public String getContributorId()
-  {
-    return "org.eclipse.wst.xsd.editor";
-  }
-
-  public XSDSchema getXSDSchema()
-  {
-    return xsdSchema;
-  }
-
-  public StructuredTextEditor getTextEditor()
-  {
-    return structuredTextEditor;
-  }
-
-  protected void createSourcePage()
-  {
-    try
-    {
-      structuredTextEditor = new StructuredTextEditor();
-      int index = addPage(structuredTextEditor, getEditorInput());
-      setPageText(index, "Source");
-      structuredTextEditor.update();
-      structuredTextEditor.setEditorPart(this);
-      structuredTextEditor.addPropertyListener(this);
-      firePropertyChange(PROP_TITLE);
-    }
-    catch (PartInitException e)
-    {
-      ErrorDialog.openError(getSite().getShell(), "Error creating nested text editor", null, e.getStatus());
-    }
-  }
-
-  /**
-   * Method openOnGlobalReference. The comp argument is a resolved xsd schema
-   * object from another file. This is created and called from another schema
-   * model to allow F3 navigation to open a new editor and choose the referenced
-   * object within that editor context
-   * 
-   * @param comp
-   */
-  public void openOnGlobalReference(XSDConcreteComponent comp)
-  {
-    XSDNamedComponent namedComponent = openOnSelectionHelper.openOnGlobalReference(comp);
-    
-    if (namedComponent != null)
-    {
-      XSDBaseAdapter adapter = (XSDBaseAdapter) XSDAdapterFactory.getInstance().adapt(namedComponent);
-      getSelectionManager().setSelection(new StructuredSelection(adapter));
-      IAction action = getActionRegistry().getAction(SetInputToGraphView.ID);
-      if (action != null)
-      {
-        action.run();
-      }
-    }
-  }
-  
-  protected OpenOnSelectionHelper openOnSelectionHelper;
-
-  public OpenOnSelectionHelper getOpenOnSelectionHelper()
-  {
-    return openOnSelectionHelper;
-  }
-
-  /**
-   * Creates the pages of the multi-page editor.
-   */
-  protected void createPages()
-  {
-    model = buildModel((IFileEditorInput) getEditorInput());
-    selectionProvider = getSelectionManager();
-    getEditorSite().setSelectionProvider(selectionProvider);
-    createGraphPage();
-    createSourcePage();
-    openOnSelectionHelper = new OpenOnSelectionHelper(getTextEditor(), getXSDSchema());
-    ISelectionProvider provider = getTextEditor().getSelectionProvider();
-    fSourceEditorSelectionListener = new SourceEditorSelectionListener();
-    if (provider instanceof IPostSelectionProvider)
-    {
-      ((IPostSelectionProvider) provider).addPostSelectionChangedListener(fSourceEditorSelectionListener);
-    }
-    else
-    {
-      provider.addSelectionChangedListener(fSourceEditorSelectionListener);
-    }
-    fXSDSelectionListener = new XSDSelectionManagerSelectionListener();
-    getSelectionManager().addSelectionChangedListener(fXSDSelectionListener);
-  }
-
-  protected void createActions()
-  {
-    super.createActions();
-    ActionRegistry registry = getActionRegistry();
-    BaseSelectionAction action = new AddFieldAction(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new DeleteAction(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDElementAction(this, AddXSDElementAction.ID, "Add Element", false);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDElementAction(this, AddXSDElementAction.REF_ID, "Add Element Ref", true);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDModelGroupAction(this, XSDCompositor.SEQUENCE_LITERAL, AddXSDModelGroupAction.SEQUENCE_ID);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDModelGroupAction(this, XSDCompositor.CHOICE_LITERAL, AddXSDModelGroupAction.CHOICE_ID);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDModelGroupAction(this, XSDCompositor.ALL_LITERAL, AddXSDModelGroupAction.ALL_ID);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDModelGroupDefinitionAction(this, false);
-    action.setId(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITION_ID);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDModelGroupDefinitionAction(this, true);
-    action.setId(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITIONREF_ID);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDComplexTypeDefinitionAction(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDSimpleTypeDefinitionAction(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new AddXSDAttributeDeclarationAction(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new OpenInNewEditor(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new ShowPropertiesViewAction(this);
-    registry.registerAction(action);
-    action = new AddXSDAttributeGroupDefinitionAction(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    action = new DeleteXSDConcreteComponentAction(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-    
-    SetTypeAction setNewComplexTypeAction = new SetTypeAction("New...", SetTypeAction.SET_NEW_TYPE_ID, this);
-    setNewComplexTypeAction.setSelectionProvider(getSelectionManager());
-    registry.registerAction(setNewComplexTypeAction);
-        
-    SetTypeAction setExistingTypeAction = new SetTypeAction("Browse...", SetTypeAction.SELECT_EXISTING_TYPE_ID, this);
-    setExistingTypeAction.setSelectionProvider(getSelectionManager());
-    registry.registerAction(setExistingTypeAction);
-
-    addMultiplicityMenu(registry);
-  }
-  
-  protected void addMultiplicityMenu(ActionRegistry registry)
-  {
-    SetMultiplicityAction oneMultiplicity = new SetMultiplicityAction(this, "1..1 (" + "Required" + ")", SetMultiplicityAction.REQUIRED_ID);
-    oneMultiplicity.setMaxOccurs(1);
-    oneMultiplicity.setMinOccurs(1);
-    oneMultiplicity.setSelectionProvider(getSelectionManager());
-    registry.registerAction(oneMultiplicity);
-
-    SetMultiplicityAction zeroOrMoreMultiplicity = new SetMultiplicityAction(this, "0..* (" + "Zero or more" + ")", SetMultiplicityAction.ZERO_OR_MORE_ID);
-    zeroOrMoreMultiplicity.setMaxOccurs(-1);
-    zeroOrMoreMultiplicity.setMinOccurs(0);
-    zeroOrMoreMultiplicity.setSelectionProvider(getSelectionManager());
-    registry.registerAction(zeroOrMoreMultiplicity);
-    
-    SetMultiplicityAction zeroOrOneMultiplicity = new SetMultiplicityAction(this, "0..1 (" + "Optional" + ")", SetMultiplicityAction.ZERO_OR_ONE_ID);
-    zeroOrOneMultiplicity.setMaxOccurs(1);
-    zeroOrOneMultiplicity.setMinOccurs(0);
-    zeroOrOneMultiplicity.setSelectionProvider(getSelectionManager());
-    registry.registerAction(zeroOrOneMultiplicity);
-
-    SetMultiplicityAction oneOrMoreMultiplicity = new SetMultiplicityAction(this, "1..* (" + "One or more" + ")", SetMultiplicityAction.ONE_OR_MORE_ID);
-    oneOrMoreMultiplicity.setMaxOccurs(-1);
-    oneOrMoreMultiplicity.setMinOccurs(1);
-    oneOrMoreMultiplicity.setSelectionProvider(getSelectionManager());
-    registry.registerAction(oneOrMoreMultiplicity);
-    
-  }
-
-
-  /**
-   * Closes all project files on project close.
-   */
-  public void resourceChanged(final IResourceChangeEvent event)
-  {
-    if (event.getType() == IResourceChangeEvent.PRE_CLOSE)
-    {
-      Display.getDefault().asyncExec(new Runnable()
-      {
-        public void run()
-        {
-          IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
-          for (int i = 0; i < pages.length; i++)
-          {
-            if (((FileEditorInput) structuredTextEditor.getEditorInput()).getFile().getProject().equals(event.getResource()))
-            {
-              IEditorPart editorPart = pages[i].findEditor(structuredTextEditor.getEditorInput());
-              pages[i].closeEditor(editorPart, true);
-            }
-          }
-        }
-      });
-    }
-  }
-
-  /**
-   * Returns <code>true</code> if the command stack is dirty
-   * 
-   * @see org.eclipse.ui.ISaveablePart#isDirty()
-   */
-  public boolean isDirty()
-  {
-    super.isDirty();
-    return structuredTextEditor.isDirty() || getCommandStack().isDirty();
-  }
-
-  /*
-   * This method is just to make firePropertyChanged accessbible from some
-   * (anonomous) inner classes.
-   */
-  protected void _firePropertyChange(int property)
-  {
-    super.firePropertyChange(property);
-  }
-
-  /**
-   * Posts the update code "behind" the running operation.
-   */
-  protected void postOnDisplayQue(Runnable runnable)
-  {
-    IWorkbench workbench = PlatformUI.getWorkbench();
-    IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
-    if (windows != null && windows.length > 0)
-    {
-      Display display = windows[0].getShell().getDisplay();
-      display.asyncExec(runnable);
-    }
-    else
-      runnable.run();
-  }
-
-  /**
-   * Indicates that a property has changed.
-   * 
-   * @param source
-   *          the object whose property has changed
-   * @param propId
-   *          the id of the property which has changed; property ids are
-   *          generally defined as constants on the source class
-   */
-  public void propertyChanged(Object source, int propId)
-  {
-    switch (propId)
-    {
-      // had to implement input changed "listener" so that
-      // strucutedText could tell it containing editor that
-      // the input has change, when a 'resource moved' event is
-      // found.
-      case IEditorPart.PROP_INPUT :
-      case IEditorPart.PROP_DIRTY : {
-        if (source == structuredTextEditor)
-        {
-          if (structuredTextEditor.getEditorInput() != getEditorInput())
-          {
-            setInput(structuredTextEditor.getEditorInput());
-            // title should always change when input changes.
-            // create runnable for following post call
-            Runnable runnable = new Runnable()
-            {
-              public void run()
-              {
-                _firePropertyChange(IWorkbenchPart.PROP_TITLE);
-              }
-            };
-            // Update is just to post things on the display queue
-            // (thread). We have to do this to get the dirty
-            // property to get updated after other things on the
-            // queue are executed.
-            postOnDisplayQue(runnable);
-          }
-        }
-        break;
-      }
-      case IWorkbenchPart.PROP_TITLE : {
-        // update the input if the title is changed
-        if (source == structuredTextEditor)
-        {
-          if (structuredTextEditor.getEditorInput() != getEditorInput())
-          {
-            setInput(structuredTextEditor.getEditorInput());
-          }
-        }
-        break;
-      }
-      default : {
-        // propagate changes. Is this needed? Answer: Yes.
-        if (source == structuredTextEditor)
-        {
-          firePropertyChange(propId);
-        }
-        break;
-      }
-    }
-  }
-  /**
-   * Listener on SSE's outline page's selections that converts DOM selections
-   * into xsd selections and notifies XSD selection manager
-   */
-  class OutlineTreeSelectionChangeListener implements ISelectionChangedListener, IDoubleClickListener
-  {
-    public OutlineTreeSelectionChangeListener()
-    {
-    }
-
-    private ISelection getXSDSelection(ISelection selection)
-    {
-      ISelection sel = null;
-      if (selection instanceof IStructuredSelection)
-      {
-        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-        Object o = structuredSelection.getFirstElement();
-        if (o != null)
-          sel = new StructuredSelection(o);
-      }
-      return sel;
-    }
-
-    /**
-     * Determines DOM node based on object (xsd node)
-     * 
-     * @param object
-     * @return
-     */
-    private Object getObjectForOtherModel(Object object)
-    {
-      Node node = null;
-      if (object instanceof Node)
-      {
-        node = (Node) object;
-      }
-      else if (object instanceof XSDComponent)
-      {
-        node = ((XSDComponent) object).getElement();
-      }
-      else if (object instanceof CategoryAdapter)
-      {
-        node = ((CategoryAdapter) object).getXSDSchema().getElement();
-      }
-      else if (object instanceof XSDBaseAdapter)
-      {
-        if (((XSDBaseAdapter) object).getTarget() instanceof XSDConcreteComponent)
-        {
-          node = ((XSDConcreteComponent) ((XSDBaseAdapter) object).getTarget()).getElement();
-        }
-      }
-      // the text editor can only accept sed nodes!
-      //
-      if (!(node instanceof IDOMNode))
-      {
-        node = null;
-      }
-      return node;
-    }
-
-    public void doubleClick(DoubleClickEvent event)
-    {
-      /*
-       * Selection in outline tree changed so set outline tree's selection into
-       * editor's selection and say it came from outline tree
-       */
-      if (getSelectionManager() != null && getSelectionManager().getEnableNotify())
-      {
-        ISelection selection = getXSDSelection(event.getSelection());
-        if (selection != null)
-        {
-          getSelectionManager().setSelection(selection, fOutlinePage);
-        }
-        if (getTextEditor() != null && selection instanceof IStructuredSelection)
-        {
-          int start = -1;
-          int length = 0;
-          Object o = ((IStructuredSelection) selection).getFirstElement();
-          if (o != null)
-            o = getObjectForOtherModel(o);
-          if (o instanceof IndexedRegion)
-          {
-            start = ((IndexedRegion) o).getStartOffset();
-            length = ((IndexedRegion) o).getEndOffset() - start;
-          }
-          if (start > -1)
-          {
-            getTextEditor().selectAndReveal(start, length);
-          }
-        }
-      }
-    }
-
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      /*
-       * Selection in outline tree changed so set outline tree's selection into
-       * editor's selection and say it came from outline tree
-       */
-      if (getSelectionManager() != null && getSelectionManager().getEnableNotify())
-      {
-        ISelection selection = getXSDSelection(event.getSelection());
-        if (selection != null)
-        {
-          getSelectionManager().setSelection(selection, fOutlinePage);
-        }
-      }
-    }
-  }
-  /**
-   * Listener on SSE's source editor's selections that converts DOM selections
-   * into xsd selections and notifies XSD selection manager
-   */
-  private class SourceEditorSelectionListener implements ISelectionChangedListener
-  {
-    /**
-     * Determines XSD node based on object (DOM node)
-     * 
-     * @param object
-     * @return
-     */
-    private Object getXSDNode(Object object)
-    {
-      // get the element node
-      Element element = null;
-      if (object instanceof Node)
-      {
-        Node node = (Node) object;
-        if (node != null)
-        {
-          if (node.getNodeType() == Node.ELEMENT_NODE)
-          {
-            element = (Element) node;
-          }
-          else if (node.getNodeType() == Node.ATTRIBUTE_NODE)
-          {
-            element = ((Attr) node).getOwnerElement();
-          }
-        }
-      }
-      Object o = element;
-      if (element != null)
-      {
-        Object modelObject = getXSDSchema().getCorrespondingComponent(element);
-        if (modelObject != null)
-        {
-          o = modelObject;
-          o = XSDAdapterFactory.getInstance().adapt((Notifier) modelObject);
-        }
-      }
-      return o;
-    }
-
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      if (getSelectionManager().getEnableNotify() && getActivePage() == 1)
-      {
-        ISelection selection = event.getSelection();
-        if (selection instanceof IStructuredSelection)
-        {
-          List xsdSelections = new ArrayList();
-          for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();)
-          {
-            Object domNode = i.next();
-            Object xsdNode = getXSDNode(domNode);
-            if (xsdNode != null)
-            {
-              xsdSelections.add(xsdNode);
-            }
-          }
-          if (!xsdSelections.isEmpty())
-          {
-            StructuredSelection xsdSelection = new StructuredSelection(xsdSelections);
-            getSelectionManager().setSelection(xsdSelection, getTextEditor().getSelectionProvider());
-          }
-        }
-      }
-    }
-  }
-  /**
-   * Listener on XSD's selection manager's selections that converts XSD
-   * selections into DOM selections and notifies SSE's selection provider
-   */
-  private class XSDSelectionManagerSelectionListener implements ISelectionChangedListener
-  {
-    /**
-     * Determines DOM node based on object (xsd node)
-     * 
-     * @param object
-     * @return
-     */
-    private Object getObjectForOtherModel(Object object)
-    {
-      Node node = null;
-      if (object instanceof Node)
-      {
-        node = (Node) object;
-      }
-      else if (object instanceof XSDComponent)
-      {
-        node = ((XSDComponent) object).getElement();
-      }
-      else if (object instanceof CategoryAdapter)
-      {
-        node = ((CategoryAdapter) object).getXSDSchema().getElement();
-      }
-      else if (object instanceof XSDBaseAdapter)
-      {
-        if (((XSDBaseAdapter) object).getTarget() instanceof XSDConcreteComponent)
-        {
-          node = ((XSDConcreteComponent) ((XSDBaseAdapter) object).getTarget()).getElement();
-        }
-      }
-      // the text editor can only accept sed nodes!
-      //
-      if (!(node instanceof IDOMNode))
-      {
-        node = null;
-      }
-      return node;
-    }
-
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      // do not fire selection in source editor if selection event came
-      // from source editor
-      if (event.getSource() != getTextEditor().getSelectionProvider())
-      {
-        ISelection selection = event.getSelection();
-        if (selection instanceof IStructuredSelection)
-        {
-          List otherModelObjectList = new ArrayList();
-          for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();)
-          {
-            Object modelObject = i.next();
-            Object otherModelObject = getObjectForOtherModel(modelObject);
-            if (otherModelObject != null)
-            {
-              otherModelObjectList.add(otherModelObject);
-            }
-          }
-          if (!otherModelObjectList.isEmpty())
-          {
-            // here's an ugly hack... if we allow text selections to fire during
-            // SetInputToGraphView action we screw up the navigation history!
-            //            
-            //TODO (cs) ... we need to prevent the source editor from messing up the navigation history
-            //
-            if (getActivePage() == 1)
-            {  
-              StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
-              getTextEditor().getSelectionProvider().setSelection(nodeSelection);
-            }  
-          }
-        }
-      }
-    }
-  }
-
-  public INavigationLocation createEmptyNavigationLocation()
-  {
-    if (getActivePage() == 0)
-    {
-      return new DesignViewNavigationLocation(this);
-    }
-    else
-    {
-      return new MultiPageEditorTextSelectionNavigationLocation(getTextEditor(), false);
-    }
-  }
-
-  public INavigationLocation createNavigationLocation()
-  {
-    if (getActivePage() == 0)
-    {
-      try
-      {
-        RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
-        EditPart editPart = rootEditPart.getContents();
-        if (editPart instanceof RootContentEditPart)
-        {
-          RootContentEditPart rootContentEditPart = (RootContentEditPart)editPart;
-          Object input = rootContentEditPart.getInput();      
-          if (input instanceof Adapter)
-          {
-            XSDConcreteComponent concreteComponent = (XSDConcreteComponent)((Adapter)input).getTarget();
-            return new DesignViewNavigationLocation(this, concreteComponent);
-          }
-        }   
-      }
-      catch (Exception e)
-      {
-        e.printStackTrace();
-      }
-      return null;
-    }
-    else
-    {
-      return new MultiPageEditorTextSelectionNavigationLocation(getTextEditor(), true);
-    }
-  }
-}  
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Logger.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Logger.java
deleted file mode 100644
index a53578c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Logger.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
-	private static final String PLUGIN_ID = "org.eclipse.wst.xsd.ui"; //$NON-NLS-1$
-	
-	public static final int ERROR = IStatus.ERROR; // 4
-	public static final int ERROR_DEBUG = 200 + ERROR;
-	public static final int INFO = IStatus.INFO; // 1
-	public static final int INFO_DEBUG = 200 + INFO;
-
-	public static final int OK = IStatus.OK; // 0
-
-	public static final int OK_DEBUG = 200 + OK;
-
-	private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-	public static final int WARNING = IStatus.WARNING; // 2
-	public static final int WARNING_DEBUG = 200 + WARNING;
-
-	/**
-	 * Adds message to log.
-	 * 
-	 * @param level
-	 *            severity level of the message (OK, INFO, WARNING, ERROR,
-	 *            OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
-	 * @param message
-	 *            text to add to the log
-	 * @param exception
-	 *            exception thrown
-	 */
-	protected static void _log(int level, String message, Throwable exception) {
-		if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
-			if (!isDebugging())
-				return;
-		}
-
-		int severity = IStatus.OK;
-		switch (level) {
-			case INFO_DEBUG :
-			case INFO :
-				severity = IStatus.INFO;
-				break;
-			case WARNING_DEBUG :
-			case WARNING :
-				severity = IStatus.WARNING;
-				break;
-			case ERROR_DEBUG :
-			case ERROR :
-				severity = IStatus.ERROR;
-		}
-		message = (message != null) ? message : "null"; //$NON-NLS-1$
-		Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
-		Bundle bundle = Platform.getBundle(PLUGIN_ID);
-		if (bundle != null) 
-			Platform.getLog(bundle).log(statusObj);
-	}
-
-	/**
-	 * Prints message to log if category matches /debug/tracefilter option.
-	 * 
-	 * @param message
-	 *            text to print
-	 * @param category
-	 *            category of the message, to be compared with
-	 *            /debug/tracefilter
-	 */
-	protected static void _trace(String category, String message, Throwable exception) {
-		if (isTracing(category)) {
-			message = (message != null) ? message : "null"; //$NON-NLS-1$
-			Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
-			Bundle bundle = Platform.getBundle(PLUGIN_ID);
-			if (bundle != null) 
-				Platform.getLog(bundle).log(statusObj);
-		}
-	}
-
-	/**
-	 * @return true if the platform is debugging
-	 */
-	public static boolean isDebugging() {
-		return Platform.inDebugMode();
-	}
-
-	/**
-	 * Determines if currently tracing a category
-	 * 
-	 * @param category
-	 * @return true if tracing category, false otherwise
-	 */
-	public static boolean isTracing(String category) {
-		if (!isDebugging())
-			return false;
-
-		String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
-		if (traceFilter != null) {
-			StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
-			while (tokenizer.hasMoreTokens()) {
-				String cat = tokenizer.nextToken().trim();
-				if (category.equals(cat)) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-
-	public static void log(int level, String message) {
-		_log(level, message, null);
-	}
-
-	public static void log(int level, String message, Throwable exception) {
-		_log(level, message, exception);
-	}
-
-	public static void logException(String message, Throwable exception) {
-		_log(ERROR, message, exception);
-	}
-
-	public static void logException(Throwable exception) {
-		_log(ERROR, exception.getMessage(), exception);
-	}
-
-	public static void trace(String category, String message) {
-		_trace(category, message, null);
-	}
-
-	public static void traceException(String category, String message, Throwable exception) {
-		_trace(category, message, exception);
-	}
-
-	public static void traceException(String category, Throwable exception) {
-		_trace(category, exception.getMessage(), exception);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Messages.java
deleted file mode 100644
index 0c335f7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Messages.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS
-{
-  static 
-  {
-    NLS.initializeMessages("org.eclipse.wst.xsd.editor" + ".Messages", Messages.class);
-  }
-
-  public Messages()
-  {
-    super();
-  }
-  
-  public static String UI_LABEL_BASE_TYPE;
-  public static String UI_LABEL_DERIVED_BY;
-  public static String UI_LABEL_INHERIT_FROM;
-  public static String UI_LABEL_INHERIT_BY;
-  public static String UI_LABEL_DOCUMENTATION;
-  public static String UI_LABEL_APP_INFO;
-  public static String UI_LABEL_SET_TYPE;
-  public static String UI_LABEL_TYPE;
-  public static String UI_LABEL_MINOCCURS;
-  public static String UI_LABEL_MAXOCCURS;
-  public static String UI_NO_TYPE;
-  public static String UI_PAGE_HEADING_REFERENCE;
-  public static String UI_LABEL_READ_ONLY;
-  public static String UI_LABEL_COMPONENTS;
-
-
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Messages.properties
deleted file mode 100644
index 82f42e0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/Messages.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2006 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
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-
-UI_LABEL_BASE_TYPE = Base Type:
-UI_LABEL_DERIVED_BY = Derived By:
-
-UI_LABEL_INHERIT_FROM = Inherit From:
-UI_LABEL_INHERIT_BY = Inherit By:
-
-UI_LABEL_DOCUMENTATION = Documentation
-UI_LABEL_APP_INFO = App Info
-
-UI_LABEL_SET_TYPE = Set Type
-UI_LABEL_TYPE = Type:
-
-UI_LABEL_MINOCCURS = Minimum Occurrence:
-UI_LABEL_MAXOCCURS = Maximum Occurrence:
-
-UI_PAGE_HEADING_REFERENCE = Reference
-UI_LABEL_READ_ONLY = Read-Only
-
-UI_NO_TYPE = No Type
-
-UI_LABEL_COMPONENTS				= Components:
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorConfiguration.java
deleted file mode 100644
index 1ba155b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorConfiguration.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.xsd.editor.internal.actions.IXSDToolbarAction;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.design.figures.IExtendedFigureFactory;
-
-public class XSDEditorConfiguration
-{
-  public static final String XSDEDITORCONFIGURATIONEXTENSIONID = "org.eclipse.wst.xsd.ui.XSDEditorExtensionConfiguration";
-  public static final String CLASSNAME = "class";
-  public static final String ADAPTERFACTORY = "adapterFactory";
-  public static final String TOOLBARACTION = "toolbarAction";
-  public static final String FIGUREFACTORY = "figureFactory";
-  public static final String EDITPARTFACTORY = "editPartFactory";
-
-  List definedExtensionsList = null;
-
-  public XSDEditorConfiguration()
-  {
-
-  }
-
-  public XSDAdapterFactory getAdapterFactory()
-  {
-    if (definedExtensionsList == null)
-    {
-      readXSDConfigurationRegistry();
-    }
-    if (!definedExtensionsList.isEmpty())
-    {
-      return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getAdapterFactory();
-    }
-    return null;
-  }
-
-  public EditPartFactory getEditPartFactory()
-  {
-    if (definedExtensionsList == null)
-    {
-      readXSDConfigurationRegistry();
-    }
-    if (!definedExtensionsList.isEmpty())
-    {
-      return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getEditPartFactory();
-    }
-    return null;
-  }
-
-  public IExtendedFigureFactory getFigureFactory()
-  {
-    if (definedExtensionsList == null)
-    {
-      readXSDConfigurationRegistry();
-    }
-    if (!definedExtensionsList.isEmpty())
-    {
-      return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getFigureFactory();
-    }
-    return null;
-  }
-
-  public List getToolbarActions()
-  {
-    if (definedExtensionsList == null)
-    {
-      readXSDConfigurationRegistry();
-    }
-    if (!definedExtensionsList.isEmpty())
-    {
-      return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getActionList();
-    }
-    return Collections.EMPTY_LIST;
-  }
-
-  protected Object loadClass(IConfigurationElement element, String classString)
-  {
-    String pluginId = element.getDeclaringExtension().getContributor().getName();
-
-    try
-    {
-      Class theClass = Platform.getBundle(pluginId).loadClass(classString);
-      Object instance = theClass.newInstance();
-
-      return instance;
-    }
-    catch (Exception e)
-    {
-
-    }
-    return null;
-  }
-
-  public void readXSDConfigurationRegistry()
-  {
-    IConfigurationElement[] xsdEditorExtensionList = Platform.getExtensionRegistry().getConfigurationElementsFor(XSDEDITORCONFIGURATIONEXTENSIONID);
-
-    boolean definedExtensionsExist = (xsdEditorExtensionList != null && xsdEditorExtensionList.length > 0);
-
-    definedExtensionsList = new ArrayList();
-
-    if (definedExtensionsExist)
-    {
-      for (int i = 0; i < xsdEditorExtensionList.length; i++)
-      {
-        XSDEditorExtensionProperties properties = new XSDEditorExtensionProperties();
-        definedExtensionsList.add(properties);
-
-        IConfigurationElement element = xsdEditorExtensionList[i];
-        String adapterFactoryClass = element.getAttribute(ADAPTERFACTORY);
-        if (adapterFactoryClass != null)
-        {
-          Object object = loadClass(element, adapterFactoryClass);
-          XSDAdapterFactory adapterFactory = null;
-          if (object instanceof XSDAdapterFactory)
-          {
-            adapterFactory = (XSDAdapterFactory) object;
-            properties.setAdapterFactory(adapterFactory);
-          }
-        }
-
-        String figureFactoryClass = element.getAttribute(FIGUREFACTORY);
-        if (figureFactoryClass != null)
-        {
-          Object object = loadClass(element, figureFactoryClass);
-          IExtendedFigureFactory figureFactory = null;
-          if (object instanceof IExtendedFigureFactory)
-          {
-            figureFactory = (IExtendedFigureFactory) object;
-            properties.setFigureFactoryList(figureFactory);
-          }
-        }
-
-        IConfigurationElement[] toolbarActions = element.getChildren(TOOLBARACTION);
-        List actionList = new ArrayList();
-        if (toolbarActions != null)
-        {
-          for (int j = 0; j < toolbarActions.length; j++)
-          {
-            IConfigurationElement actionElement = toolbarActions[j];
-            String actionClass = actionElement.getAttribute(CLASSNAME);
-            IXSDToolbarAction action = null;
-            if (actionClass != null)
-            {
-              Object object = loadClass(actionElement, actionClass);
-              if (object instanceof IXSDToolbarAction)
-              {
-                action = (IXSDToolbarAction) object;
-                actionList.add(action);
-              }
-            }
-          }
-        }
-        properties.setActionList(actionList);
-
-        String editPartFactoryClass = element.getAttribute(EDITPARTFACTORY);
-        if (editPartFactoryClass != null)
-        {
-          Object object = loadClass(element, editPartFactoryClass);
-          EditPartFactory editPartFactory = null;
-          if (object instanceof EditPartFactory)
-          {
-            editPartFactory = (EditPartFactory) object;
-            properties.setEditPartFactoryList(editPartFactory);
-          }
-        }
-
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorContextIds.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorContextIds.java
deleted file mode 100644
index 1e4bfc5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorContextIds.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-/**
- * Context help id constants.
- */
-public interface XSDEditorContextIds 
-{
-  public static final String PLUGIN_NAME = "org.eclipse.wst.xsd.ui.internal";
-
-  /* CONTEXT_IDs New XSD Wizard uses the WizardNewFileCreationPage from org.eclipse.ui.dialogs */
- 
-  /* CONTEXT_IDs for XSDEditor follow the xsdexxx context IDs */
-
-  /* CONTEXT_ID xsde0010 for XSD Editor Design View */
-  public static final String XSDE_SCHEMA_DESIGN_VIEW      = PLUGIN_NAME + ".xsde0010";
-  /* no CONTEXT_ID for File Name Text Edit (not editable) */
-  /* CONTEXT_ID xsde0020 for Version Text Edit */
-  public static final String XSDE_SCHEMA_VERSION          = PLUGIN_NAME + ".xsde0020";
-  /* CONTEXT_ID xsde0030 for Language Text Edit */
-  public static final String XSDE_SCHEMA_LANGUAGE         = PLUGIN_NAME + ".xsde0030";
-  /* CONTEXT_ID xsde0040 for Namespace Group */
-  public static final String XSDE_SCHEMA_NAMESPACE_GROUP  = PLUGIN_NAME + ".xsde0040";
-  /* CONTEXT_ID xsde0050 for Prefix Text Edit */
-  public static final String XSDE_SCHEMA_PREFIX           = PLUGIN_NAME + ".xsde0050";
-  /* CONTEXT_ID xsde0060 for Target namespace Text Edit */
-  public static final String XSDE_SCHEMA_TARGET_NAMESPACE = PLUGIN_NAME + ".xsde0060";
-  /* CONTEXT_ID xsde0070 for Apply Push Button */
-  public static final String XSDE_SCHEMA_APPLY            = PLUGIN_NAME + ".xsde0070";
-  /* CONTEXT_ID xsde0080 for Attribute form default Combo Box */
-  public static final String XSDE_SCHEMA_ATTRIBUTE        = PLUGIN_NAME + ".xsde0080";
-  /* CONTEXT_ID xsde0090 for Element form default Combo Box */
-  public static final String XSDE_SCHEMA_ELEMENT          = PLUGIN_NAME + ".xsde0090";
-  /* CONTEXT_ID xsde0100 for Block default Combo Box */
-  public static final String XSDE_SCHEMA_BLOCK            = PLUGIN_NAME + ".xsde0100";
-  /* CONTEXT_ID xsde0110 for Final Default Combo Box */
-  public static final String XSDE_SCHEMA_FINAL            = PLUGIN_NAME + ".xsde0110";
-
-  
-  /* CONTEXT_ID xsde0200 for Annotations Comment Group - only used generically */
-  /* CONTEXT_ID      - used in Documentation Design View */
-  /* CONTEXT_ID      - used in App Info Design View */
-  public static final String XSDE_ANNOTATION_COMMENT_GROUP = PLUGIN_NAME + ".xsde0200";
-  /* CONTEXT_ID xsde0210 for Annotations Comment Group - only used generically */
-  /* CONTEXT_ID      - used in Documentation Design View */
-  /* CONTEXT_ID      - used in App Info Design View */
-  public static final String XSDE_ANNOTATION_COMMENT       = PLUGIN_NAME + ".xsde0210";
-  
-  /* CONTEXT_ID xsde0300 for Documentation Design View */
-  public static final String XSDE_DOCUMENTATION_DESIGN_VIEW   = PLUGIN_NAME + ".xsde0300";
-  /* CONTEXT_ID xsde0310 for Source Text Edit */
-  public static final String XSDE_DOCUMENTATION_SOURCE        = PLUGIN_NAME + ".xsde0310";
-  /* CONTEXT_ID xsde0320 for Language Text Edit */
-  public static final String XSDE_DOCUMENTATION_LANGUAGE      = PLUGIN_NAME + ".xsde0320";
-  /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
-  /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
-
-  /* CONTEXT_ID xsde0400 for App Info Design View */
-  public static final String XSDE_APP_INFO_DESIGN_VIEW = PLUGIN_NAME + ".xsde0400";
-  /* CONTEXT_ID xsde0410 for App Info Source Text Edit */
-  public static final String XSDE_APP_INFO_SOURCE = PLUGIN_NAME + ".xsde0410";
-  /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
-  /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
-
-  /* CONTEXT_ID xsde0500 for Complex Type Design View */
-  public static final String XSDE_COMPLEX_DESIGN_VIEW = PLUGIN_NAME + ".xsde0500";
-  /* CONTEXT_ID xsde0510 for Name Text Edit */
-  public static final String XSDE_COMPLEX_NAME        = PLUGIN_NAME + ".xsde0510";
-  /* CONTEXT_ID xsde0520 for Abstract Combo Box */
-  public static final String XSDE_COMPLEX_ABSTRACT    = PLUGIN_NAME + ".xsde0520";
-  /* CONTEXT_ID xsde0530 for Mixed Combo Box */
-  public static final String XSDE_COMPLEX_MIXED       = PLUGIN_NAME + ".xsde0530";
-  /* CONTEXT_ID xsde0540 for Block Combo Box */
-  public static final String XSDE_COMPLEX_BLOCK       = PLUGIN_NAME + ".xsde0540";
-  /* CONTEXT_ID xsde0550 for Final Combo Box */
-  public static final String XSDE_COMPLEX_FINAL       = PLUGIN_NAME + ".xsde0550";
-
-  /* CONTEXT_ID xsde0600 for Simple Type Design View */
-  public static final String XSDE_SIMPLE_DESIGN_VIEW = PLUGIN_NAME + ".xsde0600";
-  /* CONTEXT_ID xsde0610 for Name Text Edit */
-  public static final String XSDE_SIMPLE_NAME        = PLUGIN_NAME + ".xsde0610";
-
-  /* CONTEXT_ID for Global Element and Element Design Views are the same */
-  /* CONTEXT_ID xsde0700 for Element Design View */
-  public static final String XSDE_ELEMENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde0700";
-  /* CONTEXT_ID xsde0710 for Element Name Text Edit */
-  public static final String XSDE_ELEMENT_NAME         = PLUGIN_NAME + ".xsde0710";
-  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID User-defined complex type Radio Button is from Type Helper xsde0940 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-  /* CONTEXT_ID xsde0720 for Abstract Check Box */
-  public static final String XSDE_ELEMENT_ABSTRACT     = PLUGIN_NAME + ".xsde0720";
-  /* CONTEXT_ID xsde0730 for Nillable Check Box */
-  public static final String XSDE_ELEMENT_NILLABLE     = PLUGIN_NAME + ".xsde0730";
-  /* CONTEXT_ID xsde0740 for Value Group */
-  public static final String XSDE_ELEMENT_VALUE        = PLUGIN_NAME + ".xsde0740";
-  /* CONTEXT_ID xsde0750 for Fixed Radio Button */
-  public static final String XSDE_ELEMENT_FIXED        = PLUGIN_NAME + ".xsde0750";
-  /* CONTEXT_ID xsde0760 for Default Radio Button */
-  public static final String XSDE_ELEMENT_DEFAULT      = PLUGIN_NAME + ".xsde0760";
-  /* CONTEXT_ID xsde0770 for Value Group */
-  public static final String XSDE_ELEMENT_VALUE_GROUP  = PLUGIN_NAME + ".xsde0770";
-  /* CONTEXT_ID xsde0780 for Minimum Text Edit */
-  public static final String XSDE_ELEMENT_MINIMUM      = PLUGIN_NAME + ".xsde0780";
-  /* CONTEXT_ID xsde0790 for Maximum Text Edit */
-  public static final String XSDE_ELEMENT_MAXIMUM      = PLUGIN_NAME + ".xsde0790";
-  /* CONTEXT_ID xsde0800 for Block Combo Box */
-  public static final String XSDE_ELEMENT_BLOCK        = PLUGIN_NAME + ".xsde0800";
-  /* CONTEXT_ID xsde0810 for Final Combo Box */
-  public static final String XSDE_ELEMENT_FINAL        = PLUGIN_NAME + ".xsde0810";
-  /* CONTEXT_ID xsde0820 for Substitution Group Combo Box */
-  public static final String XSDE_ELEMENT_SUBSTITUTION = PLUGIN_NAME + ".xsde0820";
-  /* CONTEXT_ID xsde0830 for Form Qualification Combo Box */                    
-  public static final String XSDE_ELEMENT_FORM         = PLUGIN_NAME + ".xsde0830";
-
-  /* CONTEXT_ID xsde0900 for Type Helper Group - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  /* CONTEXT_ID      - used in Global Attribute Design View */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  /* CONTEXT_ID      - used in Union Design View */
-  public static final String XSDE_TYPE_HELPER_GROUP    = PLUGIN_NAME + ".xsde0900";
-  /* CONTEXT_ID xsde0910 for None Radio Button - only used generically */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  /* CONTEXT_ID      - used in Union Design View */
-  public static final String XSDE_TYPE_HELPER_NONE     = PLUGIN_NAME + ".xsde0910";
-  /* CONTEXT_ID xsde0920 for Built-in simple type Radio Button - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  /* CONTEXT_ID      - used in Global Attribute Design View */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  /* CONTEXT_ID      - used in Union Design View */
-  public static final String XSDE_TYPE_HELPER_BUILT_IN = PLUGIN_NAME + ".xsde0920";
-  /* CONTEXT_ID xsde0930 for User-defined simple type Radio Button - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  /* CONTEXT_ID      - used in Global Attribute Design View */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  /* CONTEXT_ID      - used in Union Design View */
-  public static final String XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE = PLUGIN_NAME + ".xsde0930";
-  /* CONTEXT_ID xsde0940 for User-defined complex type Radio Button - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  public static final String XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX = PLUGIN_NAME + ".xsde0940";
-  /* CONTEXT_ID xsde0950 for Type information Combo Box - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  /* CONTEXT_ID      - used in Global Attribute Design View */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  public static final String XSDE_TYPE_HELPER_TYPE = PLUGIN_NAME + ".xsde0950";
-
-  /* CONTEXT_ID xsde1000 for Attribute Design View */
-  public static final String XSDE_ATTRIBUTE_DESIGN_VIEW = PLUGIN_NAME + ".xsde1000";
-  /* CONTEXT_ID xsde1010 for Attribute Name Text Edit */
-  public static final String XSDE_ATTRIBUTE_NAME        = PLUGIN_NAME + ".xsde1010";
-  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-  /* CONTEXT_ID xsde1020 for Value Group */
-  public static final String XSDE_ATTRIBUTE_VALUE_GROUP = PLUGIN_NAME + ".xsde1020";
-  /* CONTEXT_ID xsde1030 for Fixed Radio Button */
-  public static final String XSDE_ATTRIBUTE_FIXED       = PLUGIN_NAME + ".xsde1030";
-  /* CONTEXT_ID xsde1040 for Default Radio Button */
-  public static final String XSDE_ATTRIBUTE_DEFAULT     = PLUGIN_NAME + ".xsde1040";
-  /* CONTEXT_ID xsde1050 for Value Text Edit */
-  public static final String XSDE_ATTRIBUTE_VALUE       = PLUGIN_NAME + ".xsde1050";
-  /* CONTEXT_ID xsde1060 for Usage Combo Box */
-  public static final String XSDE_ATTRIBUTE_USAGE       = PLUGIN_NAME + ".xsde1060";
-  /* CONTEXT_ID xsde1070 for Form qualificaiton Combo Box */
-  public static final String XSDE_ATTRIBUTE_FORM        = PLUGIN_NAME + ".xsde1070";
-
-  /* CONTEXT_ID xsde1100 for Element Ref Window Design View */
-  public static final String XSDE_ELEMENT_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1100";
-  /* CONTEXT_ID xsde1110 for Reference Name Combo Box */
-  public static final String XSDE_ELEMENT_REF_REFERENCE   = PLUGIN_NAME + ".xsde1110";
-  /* CONTEXT_ID xsde1120 for Minimum Text Edit */
-  public static final String XSDE_ELEMENT_REF_MINIMUM     = PLUGIN_NAME + ".xsde1120";
-  /* CONTEXT_ID xsde1130 for Maximum Text Edit */
-  public static final String XSDE_ELEMENT_REF_MAXIMUM     = PLUGIN_NAME + ".xsde1130";
-  
-  /* CONTEXT_ID xsde1200 for Simple Content Design View - used generically */
-  /* CONTEXT_ID      - used in Simple Content Design View */ 
-  /* CONTEXT_ID      - used in Complex Content Design View */
-    public static final String XSDE_SIMPLE_CONTENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde1200";
-  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-  /* CONTEXT_ID xsde1210 for Derived by Combo Box - used generically */
-  /* CONTEXT_ID      - used in Simple Content Design View */ 
-  /* CONTEXT_ID      - used in Complex Content Design View */
-  public static final String XSDE_SIMPLE_CONTENT_DERIVED = PLUGIN_NAME + ".xsde1210";
-
-  /* CONTEXT_ID xsde1300 for Restriction Design View */
-  public static final String XSDE_RESTRICTION_DESIGN_VIEW  = PLUGIN_NAME + ".xsde1300";
-  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-  /* CONTEXT_ID xsde1310 for Facets Group */
-  public static final String XSDE_RESTRICTION_FACETS_GROUP = PLUGIN_NAME + ".xsde1310";
-  /* CONTEXT_ID xsde1320 for Facets Table */
-  public static final String XSDE_RESTRICTION_FACETS       = PLUGIN_NAME + ".xsde1320";
-
-  /* CONTEXT_ID xsde1400 for List Design View */
-  public static final String XSDE_LIST_DESIGN_VIEW  = PLUGIN_NAME + ".xsde1400";
-  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-
-  /* CONTEXT_ID xsde1500 for Attribute Group Design View */
-  public static final String XSDE_ATTRIBUTE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde1500";
-  /* CONTEXT_ID xsde1510 for Name Text Edit */
-  public static final String XSDE_ATTRIBUTE_GROUP_NAME = PLUGIN_NAME + ".xsde1510";
-
-  /* CONTEXT_ID for Global Attribute and Attribute Design Views are the same */
-  /* CONTEXT_ID xsde1600 for Attribute Group Reference Design View */
-  public static final String XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1600";
-  /* CONTEXT_ID xsde1610 for Reference Name Combo Box */
-  public static final String XSDE_ATTRIBUTE_GROUP_REF_NAME = PLUGIN_NAME + ".xsde1610";
-
-  /* CONTEXT_ID xsde1700 for Attribute Reference Design View */
-  public static final String XSDE_ATTRIBUTE_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1700";
-  /* CONTEXT_ID xsde1710 for Reference Name Combo Box */
-  public static final String XSDE_ATTRIBUTE_REF_NAME = PLUGIN_NAME + ".xsde1710";
-
-  /* CONTEXT_ID xsde1800 for Pattern Design View */
-  public static final String XSDE_PATTERN_DESIGN_VIEW = PLUGIN_NAME + ".xsde1800";
-  /* CONTEXT_ID xsde1810 for Value Text Edit */
-  public static final String XSDE_PATTERN_VALUE   = PLUGIN_NAME + ".xsde1810";
-  /* CONTEXT_ID xsde1820 for Create Regular Expression Push Button */
-  public static final String XSDE_PATTERN_REGULAR = PLUGIN_NAME + ".xsde1820";
-
-  /* CONTEXT_ID xsde1900 for Enum Design View */
-  public static final String XSDE_ENUM_DESIGN_VIEW = PLUGIN_NAME + ".xsde1900";
-  /* CONTEXT_ID xsde1910 for Value Text Edit */
-  public static final String XSDE_ENUM_VALUE       = PLUGIN_NAME + ".xsde1910";
-  
-  /* CONTEXT_ID xsde2000 for Include Design Page */
-  public static final String XSDE_INCLUDE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2000";
-  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
-  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */ 
-  
-  /* CONTEXT_ID xsde2100 for Include Helper Select Push Button - used generically */
-  /* CONTEXT_ID      - used in Include Design View */
-  /* CONTEXT_ID      - used in Import Design View */
-  public static final String XSDE_INCLUDE_HELPER_SELECT = PLUGIN_NAME + ".xsde2100";
-
-  /* CONTEXT_ID xsde2200 for Import Design Page */
-  public static final String XSDE_IMPORT_DESIGN_VIEW = PLUGIN_NAME + ".xsde2200";
-  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
-  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
-  /* CONTEXT_ID xsde2210 for Prefix Text Edit */
-  public static final String XSDE_IMPORT_PREFIX      = PLUGIN_NAME + ".xsde2210";
-  /* no CONTEXT_ID for Namespace Text Edit (not editable) */
-
-  /* CONTEXT_ID xsde2300 for Redefine Design View */
-  public static final String XSDE_REDEFINE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2300";
-  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
-  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
-
-  /* CONTEXT_ID xsde2400 for Group Design View */
-  public static final String XSDE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde2400";
-  /* CONTEXT_ID xsde2410 for Name Text Edit */
-  public static final String XSDE_GROUP_NAME        = PLUGIN_NAME + ".xsde2410";
-
-  /* CONTEXT_ID xsde2500 for Group Scope Design View */
-  public static final String XSDE_GROUP_SCOPE_DESIGN_VIEW   = PLUGIN_NAME + ".xsde2500";
-  /* CONTEXT_ID xsde2510 for Content model Group */
-  public static final String XSDE_GROUP_SCOPE_CONTENT_GROUP = PLUGIN_NAME + ".xsde2510";
-  /* CONTEXT_ID xsde2520 for Sequence Radio Button */
-  public static final String XSDE_GROUP_SCOPE_SEQUENCE = PLUGIN_NAME + ".xsde2520";
-  /* CONTEXT_ID xsde2530 for Choice Radio Button */
-  public static final String XSDE_GROUP_SCOPE_CHOICE   = PLUGIN_NAME + ".xsde2530";
-  /* CONTEXT_ID xsde2540 for All Radio Button */
-  public static final String XSDE_GROUP_SCOPE_ALL      = PLUGIN_NAME + ".xsde2540";
-  /* CONTEXT_ID xsde2550 for Minimum Text Edit */
-  public static final String XSDE_GROUP_SCOPE_MINIMUM  = PLUGIN_NAME + ".xsde2550";
-  /* CONTEXT_ID xsde2560 for Maximum Text Edit*/
-  public static final String XSDE_GROUP_SCOPE_MAXIMUM  = PLUGIN_NAME + ".xsde2560";
-
-  /* CONTEXT_ID xsde2600 for Group Ref Design View */
-  public static final String XSDE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2600";
-  /* CONTEXT_ID xsde2610 for Reference name Combo Box */
-  public static final String XSDE_GROUP_REF_REFERENCE   = PLUGIN_NAME + ".xsde2610";
-  /* CONTEXT_ID xsde2620 for Minimum Text Edit */
-  public static final String XSDE_GROUP_REF_MINIMUM     = PLUGIN_NAME + ".xsde2620";
-  /* CONTEXT_ID xsde2630 for Maximum Text Edit */
-  public static final String XSDE_GROUP_REF_MAXIMUM     = PLUGIN_NAME + ".xsde2630";
-
-  /* CONTEXT_ID xsde2700 for Unique Design View */
-  public static final String XSDE_UNIQUE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2700";
-  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
-  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
-  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
-  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
-  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
-  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
-  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
-  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-  
-  /* CONTEXT_ID xsde2800 for Unique Base Name Text Edit - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_NAME = PLUGIN_NAME + ".xsde2800";
-  /* CONTEXT_ID xsde2810 for Selector Group - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_SELECTOR_GROUP = PLUGIN_NAME + ".xsde2810";
-  /* CONTEXT_ID xsde2820 for Selector Multi-line Edit - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_SELECTOR       = PLUGIN_NAME + ".xsde2820";
-  /* CONTEXT_ID xsde2830 for Fields Group - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_FIELDS_GROUP   = PLUGIN_NAME + ".xsde2830";
-  /* CONTEXT_ID xsde2840 for Source Text Edit - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_SOURCE         = PLUGIN_NAME + ".xsde2840";
-  /* CONTEXT_ID xsde2850 for Add Push Button - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_ADD            = PLUGIN_NAME + ".xsde2850";
-  /* CONTEXT_ID xsde2860 for Remove Push Button - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_REMOVE         = PLUGIN_NAME + ".xsde2860";
-  /* CONTEXT_ID xsde2870 for Target List Box - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_TARGET         = PLUGIN_NAME + ".xsde2870";
-
-  /* CONTEXT_ID xsde2900 for Key Design View */
-  public static final String XSDE_KEY_DESIGN_VIEW = PLUGIN_NAME + ".xsde2900";
-  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
-  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
-  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
-  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
-  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
-  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
-  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
-  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-  /* CONTEXT_ID xsde2900 for Key Design View */
-  
-  /* CONTEXT_ID xsde2950 for Key Ref Design View */
-  public static final String XSDE_KEY_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2950";
-  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
-  /* CONTEXT_ID xsde2960 for Reference Key Combo Box */
-  public static final String XSDE_KEY_REF_REFERENCE = PLUGIN_NAME + ".xsde2960";
-  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
-  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
-  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
-  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
-  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
-  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
-  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-
-  /* CONTEXT_ID xsde3000 for Any Element Design View */
-  public static final String XSDE_ANY_ELEMENT_VIEW = PLUGIN_NAME + ".xsde3000";
-  /* CONTEXT_ID xsde3010 for Namespace Text Edit */
-  public static final String XSDE_ANY_ELEMENT_NAMESPACE = PLUGIN_NAME + ".xsde3010";
-  /* CONTEXT_ID xsde3020 for Process Contents Combo Box */
-  public static final String XSDE_ANY_ELEMENT_PROCESS   = PLUGIN_NAME + ".xsde3020";
-  /* CONTEXT_ID xsde3030 for Minimum Text Edit */
-  public static final String XSDE_ANY_ELEMENT_MINIMUM   = PLUGIN_NAME + ".xsde3030";
-  /* CONTEXT_ID xsde3040 for Maximum Text Edit */
-  public static final String XSDE_ANY_ELEMENT_MAXIMUM   = PLUGIN_NAME + ".xsde3040";
-
-  /* CONTEXT_ID xsde3100 for Any Attribute Design View */
-  public static final String XSDE_ANY_ATTRIBUTE_VIEW = PLUGIN_NAME + ".xsde3100";
-  /* CONTEXT_ID xsde3110 for Namespace Text Edit */
-  public static final String XSDE_ANY_ATTRIBUTE_NAMESPACE = PLUGIN_NAME + ".xsde3110";
-  /* CONTEXT_ID xsde3120 for Process Contents Combo Box */
-  public static final String XSDE_ANY_ATTRIBUTE_PROCESS   = PLUGIN_NAME + ".xsde3120";
-
-  /* no CONTEXT_ID for Union Design View - uses a generic interface */
-  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-
-  /* CONTEXT_ID xsde3200 for Notation Design View */
-  public static final String XSDE_NOTATION_VIEW = PLUGIN_NAME + ".xsde3200";
-
-  /* CONTEXT_ID xsde4000 for Source View */
-  public static final String XSDE_SOURCE_VIEW = PLUGIN_NAME + ".xsde4000";
-
-  /* CONTEXT_IDs for Regular Expression Wizard follow the xsdrxxx context IDs */
-  
-  /* CONTEXT_ID xsdr0010 for Compose Regular Expression Page */
-  public static final String XSDR_COMPOSITION_PAGE         = PLUGIN_NAME + ".xsdr0010";
-  /* CONTEXT_ID xsdr0015 for Token Contents Combo Box */
-  public static final String XSDR_COMPOSITION_TOKEN = PLUGIN_NAME + ".xsdr0015";
-  /* CONTEXT_ID xsdr0020 for Occurrece Group */
-  public static final String XSDR_COMPOSITION_OCCURRENCE_GROUP = PLUGIN_NAME + ".xsdr0020";
-  /* CONTEXT_ID xsdr0030 for Just once Radio Button */
-  public static final String XSDR_COMPOSITION_JUST_ONCE    = PLUGIN_NAME + ".xsdr0030";
-  /* CONTEXT_ID xsdr0040 for Zero or more Radio Button */
-  public static final String XSDR_COMPOSITION_ZERO_OR_MORE = PLUGIN_NAME + ".xsdr0040";
-  /* CONTEXT_ID xsdr0050 for One or more Radio Button */
-  public static final String XSDR_COMPOSITION_ONE_OR_MORE  = PLUGIN_NAME + ".xsdr0050";
-  /* CONTEXT_ID xsdr0060 for Optional Radio Button */
-  public static final String XSDR_COMPOSITION_OPTIONAL     = PLUGIN_NAME + ".xsdr0060";
-  /* CONTEXT_ID xsdr0070 for Repeat Radio Button */
-  public static final String XSDR_COMPOSITION_REPEAT       = PLUGIN_NAME + ".xsdr0070";
-  /* CONTEXT_ID xsdr0080 for Range Radio Button */
-  public static final String XSDR_COMPOSITION_RANGE        = PLUGIN_NAME + ".xsdr0080";
-  /* CONTEXT_ID xsdr0090 for Repeat Text Edit */
-  public static final String XSDR_COMPOSITION_REPEAT_TEXT  = PLUGIN_NAME + ".xsdr0090";
-  /* CONTEXT_ID xsdr0100 for Range Minimum Text Edit */
-  public static final String XSDR_COMPOSITION_RANGE_MIN    = PLUGIN_NAME + ".xsdr0100";
-  /* CONTEXT_ID xsdr0110 for Range Maximum Text Edit */
-  public static final String XSDR_COMPOSITION_RANGE_MAX    = PLUGIN_NAME + ".xsdr0110";
-  /* CONTEXT_ID xsdr0120 for Add Push Button */
-  public static final String XSDR_COMPOSITION_ADD          = PLUGIN_NAME + ".xsdr0120";
-  /* CONTEXT_ID xsdr0130 for Current Regular Expression Text Edit */
-  public static final String XSDR_COMPOSITION_CURRENT      = PLUGIN_NAME + ".xsdr0130";
-
-  /* CONTEXT_ID xsdr0200 for Test Regular Expression Page */
-  public static final String XSDR_TEST_PAGE   = PLUGIN_NAME + ".xsdr0200";
-  /* no CONTEXT_ID for Regular Expression Text Edit (not editable) */
-  /* CONTEXT_ID xsdr0210 for Sample Text Text Edit */
-  public static final String XSDR_TEST_SAMPLE = PLUGIN_NAME + ".xsdr0210";
-
-  /* CONTEXT_IDs for Preferences Page follows the xsdpxxx context IDs */
-  
-  /* CONTEXT_ID xsdp0010 for XML Schema Preferences Page */
-  public static final String XSDP_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0010";
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorExtensionProperties.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorExtensionProperties.java
deleted file mode 100644
index f0464ea..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorExtensionProperties.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.design.figures.IExtendedFigureFactory;
-
-public class XSDEditorExtensionProperties
-{
-  XSDAdapterFactory adapterFactory;
-  IExtendedFigureFactory figureFactory;
-  EditPartFactory editPartFactory;
-  List actionList;
-
-  public XSDEditorExtensionProperties()
-  {
-
-  }
-
-  public void setActionList(List actionList)
-  {
-    this.actionList = actionList;
-  }
-
-  public void setAdapterFactory(XSDAdapterFactory adapterFactory)
-  {
-    this.adapterFactory = adapterFactory;
-  }
-
-  public void setEditPartFactoryList(EditPartFactory editPartFactory)
-  {
-    this.editPartFactory = editPartFactory;
-  }
-
-  public void setFigureFactoryList(IExtendedFigureFactory figureFactory)
-  {
-    this.figureFactory = figureFactory;
-  }
-
-  public List getActionList()
-  {
-    return actionList;
-  }
-
-  public XSDAdapterFactory getAdapterFactory()
-  {
-    return adapterFactory;
-  }
-
-  public EditPartFactory getEditPartFactory()
-  {
-    return editPartFactory;
-  }
-
-  public IExtendedFigureFactory getFigureFactory()
-  {
-    return figureFactory;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorPlugin.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorPlugin.java
deleted file mode 100644
index 25580d1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDEditorPlugin.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.plugin.*;
-import org.eclipse.wst.xsd.ui.common.properties.sections.appinfo.ApplicationInformationPropertiesRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.osgi.framework.BundleContext;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.*;
-
-public class XSDEditorPlugin extends AbstractUIPlugin
-{
-  public static final String PLUGIN_ID = "org.eclipse.wst.xsd.ui";
-  public static final String CONST_XSD_DEFAULT_PREFIX_TEXT = "org.eclipse.wst.xmlschema.xsdDefaultPrefixText";
-  public static final String CONST_PREFERED_BUILT_IN_TYPES = "org.eclipse.wst.xmlschema.preferedBuiltInTypes"; 
-  public static final String CUSTOM_LIST_SEPARATOR = "\n";
-  public static final String APPINFO_EXTENSIONID = "org.eclipse.wst.xsd.ui.ApplicationInformationDescription";
-  public final static String DEFAULT_TARGET_NAMESPACE = "http://www.example.org";
-  
-	//The shared instance.
-	private static XSDEditorPlugin plugin;
-	//Resource bundle.
-	private ResourceBundle resourceBundle;
-  private ApplicationInformationPropertiesRegistry registry;
-  private XSDEditorConfiguration xsdEditorConfiguration = null;
-  
-  public static final String CONST_USE_SIMPLE_EDIT_MODE = PLUGIN_ID + ".useSimpleEditMode";
-  public static final String CONST_SHOW_INHERITED_CONTENT = PLUGIN_ID + ".showInheritedContent";
-
-  public static final String CONST_XSD_LANGUAGE_QUALIFY = "org.eclipse.wst.xmlschema.xsdQualify";
-  public static final String CONST_DEFAULT_TARGET_NAMESPACE = "org.eclipse.wst.xmlschema.defaultTargetnamespaceText";
-	/**
-	 * The constructor.
-	 */
-	public XSDEditorPlugin() {
-		super();
-		plugin = this;
-	}
-
-	/**
-	 * This method is called upon plug-in activation
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-	}
-
-	/**
-	 * This method is called when the plug-in is stopped
-	 */
-	public void stop(BundleContext context) throws Exception {
-		super.stop(context);
-		plugin = null;
-		resourceBundle = null;
-	}
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static XSDEditorPlugin getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * Returns the string from the plugin's resource bundle,
-	 * or 'key' if not found.
-	 */
-	public static String getResourceString(String key) {
-		ResourceBundle bundle = XSDEditorPlugin.getDefault().getResourceBundle();
-		try {
-			return (bundle != null) ? bundle.getString(key) : key;
-		} catch (MissingResourceException e) {
-			return key;
-		}
-	}
-  
-  public static String getResourceString(String key, Object o)
-  {
-      return getResourceString(key, new Object[] { o});
-  }
-
-  public static String getResourceString(String key, Object[] objects)
-  {
-      return MessageFormat.format(getResourceString(key), objects);
-  }
-	
-  public static String getResourceString(String key, Object o1, Object o2)
-  {
-      return getResourceString(key, new Object[] { o1, o2});
-  }
-
-	/**
-	 * Returns the plugin's resource bundle,
-	 */
-	public ResourceBundle getResourceBundle() {
-		try {
-			if (resourceBundle == null)
-				// resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.xsd.editor.EditorPluginResources");
-        resourceBundle = Platform.getResourceBundle(getBundle());
-		} catch (MissingResourceException x) {
-			resourceBundle = null;
-		}
-		return resourceBundle;
-	}
-
-	/**
-	 * Returns an image descriptor for the image file at the given
-	 * plug-in relative path.
-	 *
-	 * @param path the path
-	 * @return the image descriptor
-	 */
-	public static ImageDescriptor getImageDescriptor(String path) {
-		return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.wst.xsd.ui", path);
-	}
-	
-	public static ImageDescriptor getImageDescriptor(String name, boolean getBaseURL) {
-		try {
-			URL installURL = getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
-			String imageString = getBaseURL ? "icons/" + name : name;
-
-			URL imageURL = new URL(installURL, imageString);
-			return ImageDescriptor.createFromURL(imageURL);
-		} catch (MalformedURLException e) {
-			return null;
-		}
-	}
-
-	
-	public static XSDEditorPlugin getPlugin() {
-		return plugin;
-	}
-
-	public static String getXSDString(String key) {
-		return getResourceString(key);
-	}
-
-  /**
-   * This gets the string resource and does one substitution.
-   */
-  public String getString(String key, Object s1) {
-    return MessageFormat.format(Platform.getResourceBundle(getBundle()).getString(key), new Object[]{s1});
-  }
-  
-	public static Image getXSDImage(String iconName) {
-		return getDefault().getImage("internal/" + iconName);
-	}
-
-	public Image getImage(String iconName) {
-		ImageRegistry imageRegistry = getImageRegistry();
-
-		if (imageRegistry.get(iconName) != null) {
-			return imageRegistry.get(iconName);
-		}
-		else {
-			imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
-			return imageRegistry.get(iconName);
-		}
-	}
-	
-	public URL getBaseURL() {
-		return getDescriptor().getInstallURL();
-	}
-
-	public Image getIconImage(String object) {
-		try {
-			return ExtendedImageRegistry.getInstance().getImage(new URL(getBaseURL() + "icons/" + object + ".gif"));
-		}
-		catch (MalformedURLException exception) {
-			System.out.println("Failed to load image for '" + object + "'");
-		}
-		return null;
-	}
-
-  public boolean getShowInheritedContent()
-  {
-    return getPreferenceStore().getBoolean(CONST_SHOW_INHERITED_CONTENT);
-  }
-  
-  protected void initializeDefaultPreferences(IPreferenceStore store)
-  {
-    store.setDefault(CONST_SHOW_INHERITED_CONTENT, false);
-    store.setDefault(CONST_XSD_DEFAULT_PREFIX_TEXT, "xsd");
-    
-    //Even the last item in the list must contain a trailing List separator
-    store.setDefault(CONST_PREFERED_BUILT_IN_TYPES,     		
-    		"boolean"+ CUSTOM_LIST_SEPARATOR +
-    		"date" + CUSTOM_LIST_SEPARATOR +
-    		"dateTime" + CUSTOM_LIST_SEPARATOR +
-    		"double" + CUSTOM_LIST_SEPARATOR +
-    		"float" + CUSTOM_LIST_SEPARATOR +
-    		"hexBinary" + CUSTOM_LIST_SEPARATOR +
-    		"int" + CUSTOM_LIST_SEPARATOR +
-    		"string" + CUSTOM_LIST_SEPARATOR +
-    		"time" + CUSTOM_LIST_SEPARATOR);
-  }
-
-  public ApplicationInformationPropertiesRegistry getApplicationInformationPropertiesRegistry()
-  {
-    if (registry == null)
-    {
-      registry = new ApplicationInformationPropertiesRegistry(APPINFO_EXTENSIONID);
-    }
-    return registry;
-  }
-
-  public XSDEditorConfiguration getXSDEditorConfiguration()
-  {
-    if (xsdEditorConfiguration == null)
-    {
-      xsdEditorConfiguration = new XSDEditorConfiguration();
-    }
-    return xsdEditorConfiguration;
-  }
-
-  /**
-   * Get the xml schema default namespace prefix
-   */
-  public String getXMLSchemaPrefix()
-  {
-    return getPreferenceStore().getString(CONST_XSD_DEFAULT_PREFIX_TEXT);
-  }
-
-  
-  
-  
-  
-  
-  
-  
-  
-
-  /**
-   * Get the xml schema default target namespace
-   */
-  public String getXMLSchemaTargetNamespace() {
-    String targetNamespace = getPreferenceStore().getString(CONST_DEFAULT_TARGET_NAMESPACE);
-    if (!targetNamespace.endsWith("/")) {
-      targetNamespace = targetNamespace + "/";
-    }
-    return targetNamespace;
-  }
-
-  /**
-   * Get the xml schema language qualification
-   */
-  public boolean isQualifyXMLSchemaLanguage() {
-    return getPreferenceStore().getBoolean(CONST_XSD_LANGUAGE_QUALIFY);
-  }
-
-  public static Shell getShell() {
-    return getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDElementReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDElementReferenceEditManager.java
deleted file mode 100644
index a5fe714..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDElementReferenceEditManager.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.eclipse.wst.xsd.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-import org.eclipse.wst.xsd.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.editor.internal.dialogs.NewElementDialog;
-import org.eclipse.wst.xsd.editor.internal.search.XSDSearchListDialogDelegate;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDElementCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateElementReferenceAndManageDirectivesCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateElementReferenceCommand;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDElementReferenceEditManager implements ComponentReferenceEditManager
-{  
-  protected IFile currentFile;
-  protected XSDSchema[] schemas;
-  
-  public XSDElementReferenceEditManager(IFile currentFile, XSDSchema[] schemas)
-  {
-    this.currentFile = currentFile;
-    this.schemas = schemas;
-  }
-  
-  public void addToHistory(ComponentSpecification component)
-  {
-    // TODO (cs) implement me!    
-  }
-
-  public IComponentDialog getBrowseDialog()
-  {
-    //XSDSetExistingTypeDialog dialog = new XSDSetExistingTypeDialog(currentFile, schemas);
-    //return dialog;
-    XSDSearchListDialogDelegate dialogDelegate = 
-    	new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.ELEMENT_META_NAME, currentFile, schemas);
-    return dialogDelegate;
-  }
-
-  public IComponentDescriptionProvider getComponentDescriptionProvider()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public ComponentSpecification[] getHistory()
-  {
-    // TODO (cs) implement this properly - should this history be global or local to each editor?
-    // This is something we should play around with ourselves to see what feels right.
-    //
-    List list = new ArrayList();
-    ComponentSpecification result[] = new ComponentSpecification[list.size()];
-    list.toArray(result);
-    return result;
-  }
-
-  public IComponentDialog getNewDialog()
-  {
-    return new NewElementDialog();
-  }
-
-  public ComponentSpecification[] getQuickPicks()
-  {
-    // TODO (cs) implement this properly - we should be providing a list of the 
-    // most 'common' built in schema types here
-    // I believe Trung will be working on a perference page to give us this list
-    // for now let's hard code some values
-    //
-    List list = new ArrayList();
-    
-    ComponentSpecification result[] = new ComponentSpecification[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  
-//TODO not changed yet
-  public void modifyComponentReference(Object referencingObject, ComponentSpecification component)
-  {    
-    if (referencingObject instanceof Adapter)
-    {
-      Adapter adapter = (Adapter)referencingObject;
-      if (adapter.getTarget() instanceof XSDConcreteComponent)
-      {
-        XSDElementDeclaration concreteComponent = (XSDElementDeclaration)adapter.getTarget();
-        if (component.isNew())
-        {  
-          XSDElementDeclaration elementDec = null;
-          if (component.getMetaName() == IXSDSearchConstants.ELEMENT_META_NAME)
-          {  
-            AddXSDElementCommand command = new AddXSDElementCommand("Add Element", concreteComponent.getSchema());
-            command.setNameToAdd(component.getName());
-            command.execute();
-            elementDec = (XSDElementDeclaration) command.getAddedComponent();
-          }
-          if (elementDec != null && elementDec instanceof XSDElementDeclaration)
-          {
-            Command command = new UpdateElementReferenceCommand("Update Element reference",
-            		concreteComponent, elementDec);
-            command.execute();
-          }  
-        }  
-        else
-        {
-          Command command = new UpdateElementReferenceAndManageDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile());
-          command.execute();
-        }  
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDFileEditorInput.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDFileEditorInput.java
deleted file mode 100644
index 7c8ee0a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDFileEditorInput.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDFileEditorInput extends FileEditorInput
-{
-  private IFile file;
-  private XSDSchema schema;
-  private String editorName;
-
-  public XSDFileEditorInput(IFile file, XSDSchema schema) {
-    super(file);
-    if (file == null) {
-      throw new IllegalArgumentException();
-    }
-    this.file = file;
-    this.schema = schema;
-    editorName = file.getName();
-  }
-
-  public IFile getFile()
-  {
-    return file;
-  }
-
-  public XSDSchema getSchema()
-  {
-    return schema;
-  }
-
-  public void setEditorName(String name)
-  {
-    editorName = name;
-  }
- 
-  public String getName()
-  {
-    if (editorName != null)
-    {
-      return editorName;
-    }
-    return super.getName();
-  }
-  
-  public String getToolTipText()
-  {
-    if (schema != null)
-    {
-      String ns = schema.getTargetNamespace();
-      if (ns != null && ns.length() > 0)
-        return "Target Namespace: " + ns;
-      else
-        return "No Namespace";
-    }
-    return super.getToolTipText();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDHyperlink.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDHyperlink.java
deleted file mode 100644
index bd8ee37..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDHyperlink.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * XSDHyperlink knows how to open links from XSD files.
- * 
- * @see XSDHyperlinkDetector
- */
-public class XSDHyperlink implements IHyperlink
-{
-  private IRegion fRegion;
-  private XSDConcreteComponent fComponent;
-
-  public XSDHyperlink(IRegion region, XSDConcreteComponent component)
-  {
-    fRegion = region;
-    fComponent = component;
-  }
-
-  public IRegion getHyperlinkRegion()
-  {
-    return fRegion;
-  }
-
-  public String getTypeLabel()
-  {
-    return null;
-  }
-
-  public String getHyperlinkText()
-  {
-    return null;
-  }
-
-  public void open()
-  {
-    XSDSchema schema = fComponent.getSchema();
-
-    if (schema == null)
-    {
-      return;
-    }
-
-    String schemaLocation = schema.getSchemaLocation();
-    schemaLocation = URIHelper.removePlatformResourceProtocol(schemaLocation);
-    IPath schemaPath = new Path(schemaLocation);
-    IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-
-    boolean fileExists = schemaFile != null && schemaFile.exists();
-
-    if (!fileExists)
-    {
-      return;
-    }
-    IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-    if (workbenchWindow != null)
-    {
-      IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
-      IEditorPart editorPart = workbenchPage.getActiveEditor();
-      
-      workbenchPage.getNavigationHistory().markLocation(editorPart);
-      
-      try
-      {
-        editorPart = IDE.openEditor(workbenchPage, schemaFile, true);
-        if (editorPart instanceof InternalXSDMultiPageEditor)
-        {
-          ((InternalXSDMultiPageEditor) editorPart).openOnGlobalReference(fComponent);
-        }
-      }
-      catch (PartInitException pie)
-      {
-        Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDHyperlinkDetector.java
deleted file mode 100644
index 7bdfa15..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDHyperlinkDetector.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.editor;
-
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Detects hyperlinks for XSD files. Used by the XSD text editor to provide a
- * "Go to declaration" functionality similar with the one provided by the Java
- * editor.
- */
-public class XSDHyperlinkDetector extends BaseHyperlinkDetector
-{
-  /**
-   * Determines whether an attribute is "linkable" that is, the component it
-   * points to can be the target of a "go to definition" navigation. Derived
-   * classes should override.
-   * 
-   * @param name the attribute name. Must not be null.
-   * @return true if the attribute is linkable, false otherwise.
-   */
-  protected boolean isLinkableAttribute(String name)
-  {
-    boolean isLinkable = name.equals(XSDConstants.TYPE_ATTRIBUTE) ||
-      name.equals(XSDConstants.REFER_ATTRIBUTE) || 
-      name.equals(XSDConstants.REF_ATTRIBUTE) || 
-      name.equals(XSDConstants.BASE_ATTRIBUTE) || 
-      name.equals(XSDConstants.SCHEMALOCATION_ATTRIBUTE) || 
-      name.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE) ||
-      name.equals(XSDConstants.ITEMTYPE_ATTRIBUTE) ||
-      name.equals(XSDConstants.MEMBERTYPES_ATTRIBUTE)
-      ;
-
-    return isLinkable;
-  }
-
-  /**
-   * Creates a hyperlink based on the selected node. Derived classes should
-   * override.
-   * 
-   * @param document the source document.
-   * @param node the node under the cursor.
-   * @param region the text region to use to create the hyperlink.
-   * @return a new IHyperlink for the node or null if one cannot be created.
-   */
-  protected IHyperlink createHyperlink(IDocument document, IDOMNode node, IRegion region)
-  {
-    XSDSchema xsdSchema = getXSDSchema(document);
-
-    if (xsdSchema == null)
-    {
-      return null;
-    }
-
-    XSDConcreteComponent targetComponent = getTargetXSDComponent(xsdSchema, node);
-
-    if (targetComponent != null)
-    {
-      IRegion nodeRegion = getHyperlinkRegion(node);
-
-      return new XSDHyperlink(nodeRegion, targetComponent);
-    }
-
-    return null;
-  }
-
-  /**
-   * Finds the XSD component for the given node.
-   * 
-   * @param xsdSchema cannot be null
-   * @param node cannot be null
-   * @return XSDConcreteComponent
-   */
-  private XSDConcreteComponent getTargetXSDComponent(XSDSchema xsdSchema, IDOMNode node)
-  {
-    XSDConcreteComponent component = null;
-
-    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent((Node) node);
-    if (xsdComp instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration elementDecl = (XSDElementDeclaration) xsdComp;
-      if (elementDecl.isElementDeclarationReference())
-      {
-        component = elementDecl.getResolvedElementDeclaration();
-      }
-      else
-      {
-        XSDConcreteComponent typeDef = null;
-        if (elementDecl.getAnonymousTypeDefinition() == null)
-        {
-          typeDef = elementDecl.getTypeDefinition();
-        }
-
-        XSDConcreteComponent subGroupAffiliation = elementDecl.getSubstitutionGroupAffiliation();
-
-        if (typeDef != null && subGroupAffiliation != null)
-        {
-          // we have 2 things we can navigate to, if the
-          // cursor is anywhere on the substitution
-          // attribute
-          // then jump to that, otherwise just go to the
-          // typeDef.
-          if (node instanceof Attr && ((Attr) node).getLocalName().equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
-          {
-            component = subGroupAffiliation;
-          }
-          else
-          {
-            // try to reveal the type now. On success,
-            // then we return true.
-            // if we fail, set the substitution group
-            // as
-            // the object to reveal as a backup plan.
-            // ISSUE: how to set backup?
-            // if (revealObject(typeDef)) {
-            component = typeDef;
-            // }
-            // else {
-            // objectToReveal = subGroupAffiliation;
-            // }
-          }
-        }
-        else
-        {
-          // one or more of these is null. If the
-          // typeDef is
-          // non-null, use it. Otherwise
-          // try and use the substitution group
-          component = typeDef != null ? typeDef : subGroupAffiliation;
-        }
-      }
-    }
-    else if (xsdComp instanceof XSDModelGroupDefinition)
-    {
-      XSDModelGroupDefinition elementDecl = (XSDModelGroupDefinition) xsdComp;
-      if (elementDecl.isModelGroupDefinitionReference())
-      {
-        component = elementDecl.getResolvedModelGroupDefinition();
-      }
-    }
-    else if (xsdComp instanceof XSDAttributeDeclaration)
-    {
-      XSDAttributeDeclaration attrDecl = (XSDAttributeDeclaration) xsdComp;
-      if (attrDecl.isAttributeDeclarationReference())
-      {
-        component = attrDecl.getResolvedAttributeDeclaration();
-      }
-      else if (attrDecl.getAnonymousTypeDefinition() == null)
-      {
-        component = attrDecl.getTypeDefinition();
-      }
-    }
-    else if (xsdComp instanceof XSDAttributeGroupDefinition)
-    {
-      XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) xsdComp;
-      if (attrGroupDef.isAttributeGroupDefinitionReference())
-      {
-        component = attrGroupDef.getResolvedAttributeGroupDefinition();
-      }
-    }
-    else if (xsdComp instanceof XSDIdentityConstraintDefinition)
-    {
-      XSDIdentityConstraintDefinition idConstraintDef = (XSDIdentityConstraintDefinition) xsdComp;
-      if (idConstraintDef.getReferencedKey() != null)
-      {
-        component = idConstraintDef.getReferencedKey();
-      }
-    }
-    else if (xsdComp instanceof XSDSimpleTypeDefinition)
-    {
-      XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComp;
-
-      // Simple types can be one of restriction, list or union.
-
-      XSDVariety variety = typeDef.getVariety();
-      int varietyType = variety.getValue();
-      
-      switch (varietyType)
-      {
-        case XSDVariety.ATOMIC : 
-          {
-            component = typeDef.getBaseTypeDefinition();
-          }
-          break;
-        case XSDVariety.LIST : 
-          {
-            component = typeDef.getItemTypeDefinition();
-          }
-          break;
-        case XSDVariety.UNION : 
-          {
-            List memberTypes = typeDef.getMemberTypeDefinitions();
-            if (memberTypes != null && memberTypes.size() > 0)
-            {
-              // ISSUE: What if there are more than one type?
-              // This could be a case for multiple hyperlinks at the same
-              // location.
-              component = (XSDConcreteComponent) memberTypes.get(0);
-            }
-          }
-          break;
-      }
-    }
-    else if (xsdComp instanceof XSDTypeDefinition)
-    {
-      XSDTypeDefinition typeDef = (XSDTypeDefinition) xsdComp;
-      component = typeDef.getBaseType();
-    }
-    else if (xsdComp instanceof XSDSchemaDirective)
-    {
-      XSDSchemaDirective directive = (XSDSchemaDirective) xsdComp;
-      component = directive.getResolvedSchema();
-    }
-
-    // Avoid types located in the schema for schema (the built in XSD types) 
-    // as we don't want to navigate to their definition.
-    
-    if (component != null)
-    {
-      XSDSchema schema =  component.getSchema();
-
-      if (schema.equals(schema.getSchemaForSchema())) {
-        component = null;
-      }
-    }
-    
-    return component;
-  }
-
-  /**
-   * Gets the xsd schema from document
-   * 
-   * @param document
-   * @return XSDSchema or null of one does not exist yet for document
-   */
-  private XSDSchema getXSDSchema(IDocument document)
-  {
-    XSDSchema schema = null;
-    IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-    if (model != null)
-    {
-      try
-      {
-        if (model instanceof IDOMModel)
-        {
-          IDOMDocument domDoc = ((IDOMModel) model).getDocument();
-          if (domDoc != null)
-          {
-            XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
-            /*
-             * ISSUE: Didn't want to go through initializing schema if it does
-             * not already exist, so just attempted to get existing adapter. If
-             * doesn't exist, just don't bother working.
-             */
-            if (modelAdapter != null)
-              schema = modelAdapter.getSchema();
-          }
-        }
-      }
-      finally
-      {
-        model.releaseFromRead();
-      }
-    }
-    return schema;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDMultiPageEditorContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDMultiPageEditorContributor.java
deleted file mode 100644
index 6eeaa05..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDMultiPageEditorContributor.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
-import org.eclipse.gef.ui.actions.ZoomInRetargetAction;
-import org.eclipse.gef.ui.actions.ZoomOutRetargetAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.ide.IDEActionFactory;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.wst.xsd.editor.internal.actions.IXSDToolbarAction;
-
-/**
- * Manages the installation/deinstallation of global actions for multi-page
- * editors. Responsible for the redirection of global actions to the active
- * editor. Multi-page contributor replaces the contributors for the individual
- * editors in the multi-page editor.
- */
-public class XSDMultiPageEditorContributor extends MultiPageEditorActionBarContributor
-{
-  private IEditorPart activeEditorPart;
-
-  /**
-   * Creates a multi-page contributor.
-   */
-  public XSDMultiPageEditorContributor()
-  {
-    super();
-  }
-
-  /**
-   * Returns the action registed with the given text editor.
-   * 
-   * @return IAction or null if editor is null.
-   */
-  protected IAction getAction(ITextEditor editor, String actionID)
-  {
-    return (editor == null ? null : editor.getAction(actionID));
-  }
-
-  /*
-   * (non-JavaDoc) Method declared in
-   * AbstractMultiPageEditorActionBarContributor.
-   */
-
-  public void setActivePage(IEditorPart part)
-  {
-    if (activeEditorPart == part)
-      return;
-
-    activeEditorPart = part;
-
-    IActionBars actionBars = getActionBars();
-
-    if (part != null)
-    {
-      Object adapter = part.getAdapter(ActionRegistry.class);
-      if (adapter instanceof ActionRegistry)
-      {
-        ActionRegistry registry = (ActionRegistry) adapter;
-        actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), registry.getAction(ActionFactory.UNDO.getId()));
-        actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), registry.getAction(ActionFactory.REDO.getId()));
-        actionBars.updateActionBars();
-      }
-    }
-
-    if (actionBars != null)
-    {
-
-      ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;
-
-      actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor, ITextEditorActionConstants.DELETE));
-      actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor, ITextEditorActionConstants.UNDO));
-      actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor, ITextEditorActionConstants.REDO));
-      actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor, ITextEditorActionConstants.CUT));
-      actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor, ITextEditorActionConstants.COPY));
-      actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor, ITextEditorActionConstants.PASTE));
-      actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor, ITextEditorActionConstants.SELECT_ALL));
-      actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor, ITextEditorActionConstants.FIND));
-      actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor, IDEActionFactory.BOOKMARK.getId()));
-
-      actionBars.updateActionBars();
-    }
-  }
-
-  public void setActiveEditor(IEditorPart part)
-  {
-    IEditorPart activeNestedEditor = null;
-    if (part instanceof MultiPageEditorPart)
-    {
-      activeNestedEditor = ((MultiPageEditorPart) part);
-    }
-    setActivePage(activeNestedEditor);
-    List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      ((IXSDToolbarAction)i.next()).setEditorPart(activeNestedEditor);
-    }
-  }
-
-  public void contributeToMenu(IMenuManager manager)
-  {
-    IMenuManager menu = new MenuManager("&XSD Editor");
-    manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
-
-    // Add extension menu actions
-    List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      menu.add((IXSDToolbarAction)i.next());
-    }
-
-    menu.add((new ZoomInRetargetAction()));
-    menu.add((new ZoomOutRetargetAction()));
-
-    menu.updateAll(true);
-  }
-
-  public void contributeToToolBar(IToolBarManager manager)
-  {
-    manager.add(new Separator());
-    // Add extension toolbar actions
-    List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      manager.add((IXSDToolbarAction)i.next());
-    }
-
-    manager.add(new Separator());
-    String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH };
-    manager.add(new ZoomComboContributionItem(getPage(), zoomStrings));
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDSelectionMapper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDSelectionMapper.java
deleted file mode 100644
index 792e0e4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDSelectionMapper.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-public class XSDSelectionMapper implements ISelectionMapper
-{
-  public ISelection mapSelection(ISelection selection)
-  {
-    List list = new ArrayList();
-    if (selection instanceof StructuredSelection)
-    {  
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      for (Iterator i = structuredSelection.iterator(); i.hasNext(); )
-      {
-        Object o = i.next();
-        if (o instanceof Adapter)
-        {
-          list.add(((Adapter)o).getTarget());
-        }  
-        else
-        {
-          list.add(o);
-        }  
-      }  
-    }
-    return new StructuredSelection(list);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDTabbedPropertySheetPage.java
deleted file mode 100644
index a0d6fa8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDParticleAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-public class XSDTabbedPropertySheetPage extends TabbedPropertySheetPage implements IADTObjectListener
-{
-  XSDBaseAdapter oldSelection;
-  public XSDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
-  {
-    super(tabbedPropertySheetPageContributor);
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
-      Object selected = ((StructuredSelection)selection).getFirstElement();
-      if (selected instanceof XSDBaseAdapter)
-      {
-        XSDBaseAdapter adapter = (XSDBaseAdapter)selected;
-        if (oldSelection != null)
-        {
-          oldSelection.unregisterListener(this);
-          if (oldSelection instanceof XSDElementDeclarationAdapter)
-          {
-            XSDElementDeclaration elem = (XSDElementDeclaration)((XSDElementDeclarationAdapter)oldSelection).getTarget();
-            Adapter adap = XSDAdapterFactory.getInstance().adapt(elem.getContainer());
-            if (adap instanceof XSDParticleAdapter)
-            {
-              XSDParticleAdapter particleAdapter = (XSDParticleAdapter)adap;
-              particleAdapter.unregisterListener(this);
-            }
-          }
-        }
-        if (adapter instanceof XSDElementDeclarationAdapter)
-        {
-          XSDElementDeclaration elem = (XSDElementDeclaration)((XSDElementDeclarationAdapter)adapter).getTarget();
-          Adapter adap = XSDAdapterFactory.getInstance().adapt(elem.getContainer());
-          if (adap instanceof XSDParticleAdapter)
-          {
-            XSDParticleAdapter particleAdapter = (XSDParticleAdapter)adap;
-            particleAdapter.registerListener(this);
-          }
-          if (elem.isElementDeclarationReference())
-          {
-            XSDElementDeclarationAdapter resolvedElementAdapter = (XSDElementDeclarationAdapter)XSDAdapterFactory.getInstance().adapt(elem.getResolvedElementDeclaration());
-            resolvedElementAdapter.registerListener(this);
-          }
-        }
-        adapter.registerListener(this);
-        oldSelection = adapter;
-        Object model = adapter.getTarget();
-        if (model instanceof XSDConcreteComponent)
-        {
-          selection = new StructuredSelection((XSDConcreteComponent)model);
-        }
-        super.selectionChanged(part, selection);
-        return;
-      }
-      super.selectionChanged(part, selection);
-  }
-  
-  public void propertyChanged(Object object, String property)
-  {
-    if (getCurrentTab() != null)
-    {
-      refresh();
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDTypeReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDTypeReferenceEditManager.java
deleted file mode 100644
index f4c4777..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/XSDTypeReferenceEditManager.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-import org.eclipse.wst.xsd.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.editor.internal.dialogs.NewTypeDialog;
-import org.eclipse.wst.xsd.editor.internal.search.XSDSearchListDialogDelegate;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDComplexTypeDefinitionCommand;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDSimpleTypeDefinitionCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateTypeReferenceAndManageDirectivesCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateTypeReferenceCommand;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDTypeReferenceEditManager implements ComponentReferenceEditManager
-{  
-  protected IFile currentFile;
-  protected XSDSchema[] schemas;
-  
-  public XSDTypeReferenceEditManager(IFile currentFile, XSDSchema[] schemas)
-  {
-    this.currentFile = currentFile;
-    this.schemas = schemas;
-  }
-  
-  public void addToHistory(ComponentSpecification component)
-  {
-    // TODO (cs) implement me!    
-  }
-
-  public IComponentDialog getBrowseDialog()
-  {
-    //XSDSetExistingTypeDialog dialog = new XSDSetExistingTypeDialog(currentFile, schemas);
-    //return dialog;
-    XSDSearchListDialogDelegate dialogDelegate = new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.TYPE_META_NAME, currentFile, schemas);
-    return dialogDelegate;
-  }
-
-  public IComponentDescriptionProvider getComponentDescriptionProvider()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public ComponentSpecification[] getHistory()
-  {
-    // TODO (cs) implement this properly - should this history be global or local to each editor?
-    // This is something we should play around with ourselves to see what feels right.
-    //
-    List list = new ArrayList();
-    ComponentSpecification result[] = new ComponentSpecification[list.size()];
-    list.toArray(result);
-    return result;
-  }
-
-  public IComponentDialog getNewDialog()
-  {
-    return new NewTypeDialog();
-  }
-
-  public ComponentSpecification[] getQuickPicks()
-  {
-    // TODO (cs) implement this properly - we should be providing a list of the 
-    // most 'common' built in schema types here
-    // I believe Trung will be working on a perference page to give us this list
-    // for now let's hard code some values
-    //
-    List list = new ArrayList();
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "boolean", null));
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "date", null));
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "dateTime", null));    
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "double", null));
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "float", null)); 
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "hexBinary", null));
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "int", null));    
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string", null));
-    list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "time", null));       
-    ComponentSpecification result[] = new ComponentSpecification[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  
-
-  public void modifyComponentReference(Object referencingObject, ComponentSpecification component)
-  {
-    XSDConcreteComponent concreteComponent = null;
-    if (referencingObject instanceof Adapter)
-    {
-      Adapter adpater = (Adapter)referencingObject;
-      if (adpater.getTarget() instanceof XSDConcreteComponent)
-      {
-        concreteComponent = (XSDConcreteComponent)adpater.getTarget();
-      }
-    }
-    else if (referencingObject instanceof XSDConcreteComponent)
-    {
-      concreteComponent = (XSDConcreteComponent) referencingObject;
-    }
-    
-    if (concreteComponent != null)
-    {
-      if (component.isNew())
-      {  
-        XSDTypeDefinition td = null;
-        if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME)
-        {  
-          AddXSDComplexTypeDefinitionCommand command = new AddXSDComplexTypeDefinitionCommand("Add Complex Type", concreteComponent.getSchema());
-          command.setNameToAdd(component.getName());
-          command.execute();
-          td = command.getCreatedComplexType();
-        }
-        else
-        {
-          AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand("Add Simple Type", concreteComponent.getSchema());
-          command.setNameToAdd(component.getName());
-          command.execute();
-          td = command.getCreatedSimpleType();
-        }  
-        if (td != null)
-        {
-          Command command = new UpdateTypeReferenceCommand(concreteComponent, td);
-          command.execute();
-        }  
-      }  
-      else
-      {  
-        Command command = new UpdateTypeReferenceAndManageDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile());
-        command.execute();
-      }  
-    }  
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/actions/IXSDToolbarAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/actions/IXSDToolbarAction.java
deleted file mode 100644
index d5c6ca8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/actions/IXSDToolbarAction.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-
-public interface IXSDToolbarAction extends IAction
-{
-  public void setEditorPart(IEditorPart editorPart);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/actions/MoveAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/actions/MoveAction.java
deleted file mode 100644
index 810c329..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/actions/MoveAction.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.actions;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class MoveAction extends Action
-{
-  protected List selectedNodes;
-  protected Node parentNode;
-  protected Node previousRefChild, nextRefChild;
-  boolean doInsertBefore;
-  
-  List selectedComponentsList;
-  XSDModelGroup parentModelGroup;
-  XSDConcreteComponent previousRefComponent, nextRefComponent;
-
-  public MoveAction(XSDModelGroup parentComponent, List selectedComponents, XSDConcreteComponent previousRefChildComponent, XSDConcreteComponent nextRefChildComponent)
-  {
-	this.parentModelGroup = parentComponent;
-	this.selectedComponentsList = selectedComponents;
-	this.previousRefComponent = previousRefChildComponent;
-	this.nextRefComponent = nextRefChildComponent;
-	  
-    selectedNodes = new ArrayList(selectedComponents.size());
-    for (Iterator i = selectedComponents.iterator(); i.hasNext(); )
-    {
-      XSDConcreteComponent concreteComponent = (XSDConcreteComponent)i.next();
-      selectedNodes.add(concreteComponent.getElement());
-    }
-    parentNode = parentComponent.getElement();
-    nextRefChild = nextRefChildComponent != null ? nextRefChildComponent.getElement() : null;
-    previousRefChild = previousRefChildComponent != null ? previousRefChildComponent.getElement() : null;
-    
-    doInsertBefore = (nextRefChild != null);
-    if (nextRefComponent != null)
-    {
-      if (nextRefComponent.getContainer().getContainer() == parentModelGroup)
-      {
-    	doInsertBefore = true;
-      }
-    }
-    if (previousRefComponent != null)
-    {
-      if (previousRefComponent.getContainer().getContainer() == parentModelGroup)
-      {
-    	doInsertBefore = false;
-      }
-    }
-  }
-                   
-  public boolean canMove()
-  {                           
-    // TODO... there are likely more restriction to consider here
-    boolean result = true;
-    for (Iterator i = selectedNodes.iterator(); i.hasNext(); )
-    {
-      Node child = (Node)i.next();
-      if (isDecendantOrSelf(child, parentNode)) 
-      {
-        result = false;
-        break;
-      }
-    }   
-    return result;
-  }           
-                  
-  protected boolean isDecendantOrSelf(Node potentialParent, Node node)
-  { 
-    boolean result = false;
-    while (node != null)
-    {
-      if (node == potentialParent)    
-      {
-        result = true;
-        break;
-      }           
-      node = node.getParentNode();
-    }
-    return result;
-  }
-
-  protected IDOMModel getModel()
-  {
-    IDOMModel model = null;
-    if (parentNode instanceof IDOMNode)
-    {                            
-      model = ((IDOMNode)parentNode).getModel();
-    }
-    return model;
-  }
-  
-
-     
-  /*
-   * @see IAction#run()
-   */
-  public void run()
-  {                            
-    try
-    {
-      for (Iterator i = selectedComponentsList.iterator(); i.hasNext(); )
-      {
- 	    XSDConcreteComponent concreteComponent = (XSDConcreteComponent)i.next();
- 	    
-        if (doInsertBefore)
-        {
-          if (concreteComponent == nextRefComponent)
-            continue;
-        }
-        else
-        {
-          if (concreteComponent == previousRefComponent)
-            continue;
-        }
- 	    
- 	    
- 	    for (Iterator particles = parentModelGroup.getContents().iterator(); particles.hasNext(); )
- 	    {
- 	      XSDParticle particle = (XSDParticle) particles.next();
- 	      XSDParticleContent particleContent = particle.getContent();
- 	      if (particleContent == concreteComponent)
- 	      {
- 	    	parentModelGroup.getContents().remove(particle);
- 	    	break;
- 	      }
- 	    }
- 	    int index = 0;
- 	    List particles = parentModelGroup.getContents();
- 	    for (Iterator iterator = particles.iterator(); iterator.hasNext(); )
- 	    {
- 	      XSDParticle particle = (XSDParticle) iterator.next();
- 	      XSDParticleContent particleContent = particle.getContent();
- 	      if (doInsertBefore)
- 	      {
-  	        if (particleContent == nextRefComponent)
- 	        {
-  	          parentModelGroup.getContents().add(index, (XSDParticle)concreteComponent.getContainer());
-  	          break;
- 	        }
- 	      }
- 	      else
- 	      {
- 	    	if (particleContent == previousRefComponent)
- 	    	{
- 	    	  parentModelGroup.getContents().add(index + 1, (XSDParticle)concreteComponent.getContainer());
- 	    	 break;
- 	    	}
- 	      }
- 	      index ++;
- 	    }
- 	    if (particles.size() == 0)
- 	    {
-      	  parentModelGroup.getContents().add((XSDParticle)concreteComponent.getContainer());
- 	    }
-
-      }
-    }
-    catch (Exception e)
-    {         
-      e.printStackTrace();
-    }
-  }
-
-
-  public void repositionBefore(Node child)
-  {   
-    // TODO... when the refChild (inserting as the last element) we need to
-    // special case the way we preserve indentation 
-    Node oldParent = child.getParentNode();
-    if (oldParent != null && nextRefChild != child)
-    {  
-      // consider any indentation text node that preceeds the child
-      //      
-      Node textNode = isWhitespaceTextNode(child.getPreviousSibling()) ? child.getPreviousSibling() : null;
-
-      // remove the child
-      //
-      oldParent.removeChild(child);
-      
-      // Instead of inserting the child immediatlely infront of the refChild, we first check to see if there
-      // is an indentation text node preceeding the refChild.  If we find such a node, we perform the insertion
-      // so that the child is inserted before the indentation text node.
-      Node adjustedRefChild = nextRefChild;
-      if (nextRefChild != null && isWhitespaceTextNode(nextRefChild.getPreviousSibling()))
-      {
-        adjustedRefChild = nextRefChild.getPreviousSibling();
-      }
-          
-      // reposition the child and any indentation text node 
-      //
-      if (doInsertBefore)
-      {
-        try {
-        parentNode.insertBefore(child, adjustedRefChild);
-        if (textNode != null)
-        {
-          oldParent.removeChild(textNode);
-          parentNode.insertBefore(textNode, child);
-        }
-        }
-        catch (Exception e)
-        {
-        	e.printStackTrace();
-        }
-        
-      }
-      else
-      {
-    	adjustedRefChild =  previousRefChild.getNextSibling();
-    	parentNode.insertBefore(child, adjustedRefChild);
-      }
-    }
-  }     
-    
-
-  protected static boolean isWhitespaceTextNode(Node node)
-  {
-    boolean result = false;
-    if (node != null && node.getNodeType() == Node.TEXT_NODE)
-    {
-      String data = ((Text)node).getData();
-      result = (data == null || data.trim().length() == 0);
-    }   
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/CategoryAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/CategoryAdapter.java
deleted file mode 100644
index 6ba89c3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/CategoryAdapter.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDAttributeGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDComplexTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDSimpleTypeDefinitionAction;
-import org.eclipse.xsd.XSDSchema;
-
-public class CategoryAdapter extends XSDBaseAdapter implements IActionProvider, IADTObjectListener
-{
-  protected String text;
-  protected Image image;
-  protected Object parent;
-  protected int groupType;
-  Collection children;
-  XSDSchema xsdSchema;
-
-  public CategoryAdapter(String label, Image image, Collection children, XSDSchema xsdSchema, int groupType)
-  {
-    this.text = label;
-    this.image = image;
-    this.parent = xsdSchema;
-    this.xsdSchema = xsdSchema;
-    this.target = xsdSchema;
-    this.children = children;
-    this.groupType = groupType;
-  }
-
-  public final static int ATTRIBUTES = 1;
-  public final static int ELEMENTS = 2;
-  public final static int TYPES = 3;
-  public final static int GROUPS = 5;
-  public final static int DIRECTIVES = 6;
-  public final static int NOTATIONS = 7;
-  public final static int ATTRIBUTE_GROUPS = 8;
-  public final static int IDENTITY_CONSTRAINTS = 9;
-  public final static int ANNOTATIONS = 10;
-
-  public XSDSchema getXSDSchema()
-  {
-    return xsdSchema;
-  }
-
-  public int getGroupType()
-  {
-    return groupType;
-  }
-
-  public Image getImage()
-  {
-    return image;
-  }
-
-  public String getText()
-  {
-    return text;
-  }
-
-  public ITreeElement[] getChildren()
-  {
-    return (ITreeElement[]) children.toArray(new ITreeElement[0]);
-  }
-
-  public void setChildren(Collection list)
-  {
-    children = list;
-  }
-
-  public Object getParent(Object element)
-  {
-    return xsdSchema;
-  }
-
-  public boolean hasChildren(Object element)
-  {
-    return true;
-  }
-
-  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-  {
-
-  }
-
-  public String[] getActions(Object object)
-  {    
-    Collection actionIDs = new ArrayList();
-    
-    switch (groupType)
-    {
-      case TYPES : {
-        actionIDs.add(AddXSDComplexTypeDefinitionAction.ID);
-        actionIDs.add(AddXSDSimpleTypeDefinitionAction.ID);
-        break;
-      }
-      case ELEMENTS : {
-        actionIDs.add(AddXSDElementAction.ID);
-        break;
-      }
-      case GROUPS : {
-        actionIDs.add(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITION_ID);
-        break;
-      }
-      case ATTRIBUTES : {
-        actionIDs.add(AddXSDAttributeDeclarationAction.ID);
-        break;
-      }
-      case ATTRIBUTE_GROUPS : {
-        actionIDs.add(AddXSDAttributeGroupDefinitionAction.ID);
-        break;
-      }
-      case DIRECTIVES : {
-        break;
-      }
-    }
-    return (String [])actionIDs.toArray(new String[0]);
-  }
-  
-  public void propertyChanged(Object object, String property)
-  {
-    if (getText().equals(property))
-      notifyListeners(this, property);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAdapterFactory.java
deleted file mode 100644
index 7273e03..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAdapterFactory.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSwitch;
-
-public class XSDAdapterFactory extends AdapterFactoryImpl
-{
-  protected static XSDAdapterFactory instance;
-  
-  public static XSDAdapterFactory getInstance()
-  {
-    if (instance == null)
-    {
-      // first use the one defined by the configuration
-      instance = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getAdapterFactory();
-      // if there isn't one, then use the default
-      if (instance == null)
-        instance = new XSDAdapterFactory();
-    }
-    return instance;
-  }
-  
-  public Adapter createAdapter(Notifier target)
-  {
-    XSDSwitch xsdSwitch = new XSDSwitch()
-    {
-      public Object caseXSDSchemaDirective(XSDSchemaDirective object)
-      {
-        return new XSDSchemaDirectiveAdapter();
-      }
-      
-      public Object caseXSDWildcard(XSDWildcard object)
-      {
-        return new XSDWildcardAdapter();
-      }
-      
-      public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object)
-      {
-        return new XSDAttributeGroupDefinitionAdapter();
-      }
-
-      public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
-      {
-        return new XSDModelGroupDefinitionAdapter();
-      }
-      
-      public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object)
-      {
-        return new XSDAttributeDeclarationAdapter();
-      }
-
-      public Object caseXSDAttributeUse(XSDAttributeUse object)
-      {
-        return new XSDAttributeUseAdapter();
-      }
-      
-      public Object caseXSDParticle(XSDParticle object)
-      {
-        return new XSDParticleAdapter();
-      }
-
-      public Object caseXSDElementDeclaration(XSDElementDeclaration object)
-      {
-        return new XSDElementDeclarationAdapter();
-      }
-      
-      public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object)
-      {
-        // TODO Auto-generated method stub
-        return new XSDSimpleTypeDefinitionAdapter();
-      }
-      
-      public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
-      {
-        // we don't like exposing the 'anyType' type as a visible complex type
-        // so we adapt it in a specialized way so that it's treated as simple type
-        // that way it doesn't show up as a reference from a field
-        //
-        if ("anyType".equals(object.getName()))
-        {
-          return new XSDAnyTypeDefinitionAdapter(); 
-        }  
-        else
-        {             
-          return new XSDComplexTypeDefinitionAdapter();
-        }  
-      }
-      
-      public Object caseXSDModelGroup(XSDModelGroup object)
-      {
-        return new XSDModelGroupAdapter();
-      }
-
-      public Object caseXSDSchema(XSDSchema object)
-      {
-        return new XSDSchemaAdapter();
-      }
-    };
-    Object o = xsdSwitch.doSwitch((EObject) target);
-    Adapter result = null;
-    if (o instanceof Adapter)
-    {
-      result = (Adapter) o;
-    }
-    else
-    {
-      System.out.println(target);
-      Thread.dumpStack();
-    }
-    return result;
-  }
-
-  public Adapter adapt(Notifier target)
-  {
-    return adapt(target, this);
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAnyTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAnyTypeDefinitionAdapter.java
deleted file mode 100644
index 1a07e04..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAnyTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-public class XSDAnyTypeDefinitionAdapter extends XSDTypeDefinitionAdapter
-{
-  public boolean isComplexType()
-  {
-    return false;
-  }
-
-  public boolean isFocusAllowed()
-  {
-    return false;
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeDeclarationAdapter.java
deleted file mode 100644
index 5c1333b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeDeclarationAdapter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDAttributeDeclarationAdapter extends XSDBaseAttributeAdapter implements IActionProvider
-{
-  protected XSDAttributeDeclaration getXSDAttributeDeclaration()
-  {
-    return (XSDAttributeDeclaration)target;
-  }
- 
-  protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration()
-  {
-    return getXSDAttributeDeclaration().getResolvedAttributeDeclaration();
-  }
-  
-  public boolean isGlobal()
-  {
-    return getXSDAttributeDeclaration().eContainer() instanceof XSDSchema;
-  }
-
-  public IModel getModel()
-  {
-    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
-    return (IModel)adapter;
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
deleted file mode 100644
index 105af1b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDAttributeGroupDefinitionAdapter extends XSDBaseAdapter implements IStructure, IActionProvider
-{
-
-  public XSDAttributeGroupDefinitionAdapter()
-  {
-    super();
-  }
-
-  public XSDAttributeGroupDefinition getXSDAttributeGroupDefinition()
-  {
-    return (XSDAttributeGroupDefinition) target;
-  }
-
-  public Image getImage()
-  {
-    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
-    if (xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeGroupRef.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeGroup.gif");
-    }
-  }
-
-  public String getText()
-  {
-    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
-    String result = xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference() ? xsdAttributeGroupDefinition.getQName() : xsdAttributeGroupDefinition.getName();
-    return result == null ? "'absent'" : result;
-  }
-
-  public ITreeElement[] getChildren()
-  {
-    XSDAttributeGroupDefinition xsdAttributeGroup = (XSDAttributeGroupDefinition) target;
-    List list = new ArrayList();
-    list.addAll(xsdAttributeGroup.getContents());
-    XSDWildcard wildcard = xsdAttributeGroup.getAttributeWildcardContent();
-    if (wildcard != null)
-    {
-      list.add(wildcard);
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-  }
-  
-  public String[] getActions(Object object)
-  {
-    List list = new ArrayList();
-    list.add(AddXSDAttributeDeclarationAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
-    return (String [])list.toArray(new String[0]);
-  }
-
-  public Command getAddNewFieldCommand(String fieldKind)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getDeleteCommand()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public List getFields()
-  {
-    // TODO (cs) ... review this    
-    ITreeElement[] chidlren = getChildren();
-    return Arrays.asList(chidlren);
-  }
-
-  public IModel getModel()
-  {
-    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeGroupDefinition().getSchema());
-    return (IModel)adapter;
-  }
-
-  public String getName()
-  {
-    // TODO (cs) ... review this
-    return getText();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeUseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeUseAdapter.java
deleted file mode 100644
index d0b6af5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDAttributeUseAdapter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-
-public class XSDAttributeUseAdapter extends XSDBaseAttributeAdapter implements IActionProvider
-{
-  protected XSDAttributeDeclaration getXSDAttributeDeclaration()
-  {
-    return getXSDAttributeUse().getAttributeDeclaration();
-  }
-
-  protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration()
-  {
-    return getXSDAttributeDeclaration().getResolvedAttributeDeclaration();
-  }
-  
-  protected XSDAttributeUse getXSDAttributeUse()
-  {
-    return (XSDAttributeUse)target;
-  }
-
-  public XSDAttributeUseAdapter()
-  {
-    super();
-  }
-
-  public String getText()
-  {
-    return getTextForAttributeUse(getXSDAttributeUse(), true);
-  }
-
-  public String getTextForAttributeUse(XSDAttributeUse attributeUse, boolean showType)
-  {
-    XSDAttributeDeclaration ad = attributeUse.getAttributeDeclaration();
-      
-    StringBuffer result  = new StringBuffer();
-    result.append(getTextForAttribute(ad, showType));
-    /*
-    if (xsdAttributeUse.isSetConstraint())
-    {
-      if (result.length() != 0)
-      {
-        result.append("  ");
-      }
-      result.append('<');
-      result.append(xsdAttributeUse.getConstraint());
-      result.append("=\"");
-      result.append(xsdAttributeUse.getLexicalValue());
-      result.append("\">");
-    }
-    */
-    return result.toString();
-  }
-  
-  public boolean isGlobal()
-  {
-    return false;
-  }
-
-  public IModel getModel()
-  {
-    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
-    return (IModel)adapter;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDBaseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDBaseAdapter.java
deleted file mode 100644
index cbe5ee6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDBaseAdapter.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-public class XSDBaseAdapter extends AdapterImpl implements IADTObject, ITreeElement
-{  
-  protected List listenerList = new ArrayList();
-  
-  public boolean isAdapterForType(Object type)
-  {
-    return type == XSDAdapterFactory.getInstance();
-  }
-  
-  public void populateAdapterList(List notifierList, List adapterList)
-  {
-    for (Iterator i = notifierList.iterator(); i.hasNext(); )
-    {
-      Object obj = i.next();
-      if (obj instanceof XSDConcreteComponent)
-      {
-        XSDConcreteComponent component = (XSDConcreteComponent)obj;
-        adapterList.add(XSDAdapterFactory.getInstance().adapt(component));
-      }
-      else
-      {
-        adapterList.add(obj);
-      }
-    }
-  }  
-  
-  public void registerListener(IADTObjectListener listener)
-  {
-    if (!listenerList.contains(listener))
-    {
-      listenerList.add(listener);
-    }
-  }
-  
-  public void unregisterListener(IADTObjectListener listener)
-  {
-    listenerList.remove(listener);
-  }
-  
-  public void notifyChanged(Notification msg)
-  {
-    super.notifyChanged(msg);
-    notifyListeners(this, null);
-  }
-  
-  protected void notifyListeners(Object changedObject, String property)
-  {
-    List clonedListenerList = new ArrayList();
-    clonedListenerList.addAll(listenerList);
-    for (Iterator i = clonedListenerList.iterator(); i.hasNext(); )
-    {
-      IADTObjectListener listener = (IADTObjectListener)i.next();
-      listener.propertyChanged(this, property);
-    }      
-  }
-    
-  public ITreeElement[] getChildren()
-  {
-    return null;
-  }
-  
-  public Image getImage()
-  {
-    return null;
-  }
-  
-  public String getText()
-  {
-    return "";
-  }
-  
-  public ITreeElement getParent()
-  {
-    return null;
-  }
-  
-  public boolean hasChildren()
-  {
-    if (getChildren() != null)
-    {
-      return getChildren().length > 0;
-    }
-    return false;
-  }
-  
-
-  /**
-   * Implements IField getContainerType.  Get parent Complex Type containing the field
-   * @return IComplexType
-   */
-  public IComplexType getContainerType()
-  {
-    XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent) target;
-    XSDConcreteComponent parent = null;
-    XSDComplexTypeDefinition ct = null;
-    for (parent = xsdConcreteComponent.getContainer(); parent != null; )
-    {
-      if (parent instanceof XSDComplexTypeDefinition)
-      {
-        ct = (XSDComplexTypeDefinition)parent;
-        break;
-      }
-      parent = parent.getContainer();
-    }
-    if (ct != null)
-    {
-      return (IComplexType)XSDAdapterFactory.getInstance().adapt(ct);
-    }
-    return null;
-  }
-  
-  public boolean isReadOnly()
-  {
-    XSDSchema xsdSchema = null;
-    try
-    {
-      IEditorPart editorPart = null;
-      IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-      if (window != null)
-      {
-        IWorkbenchPage page = window.getActivePage();
-        if (page != null)
-        {
-          editorPart = page.getActiveEditor();
-        }
-      }
-      if (target instanceof XSDConcreteComponent)
-      {
-        xsdSchema = ((XSDConcreteComponent)target).getSchema();
-      }
-      if (editorPart == null)
-      {
-        return fallBackCheckIsReadOnly();
-      }
-      
-      XSDSchema editorSchema = (XSDSchema)editorPart.getAdapter(XSDSchema.class);
-      if (xsdSchema != null && xsdSchema == editorSchema)
-      {
-        return false;
-      }
-      else
-      {
-        return fallBackCheckIsReadOnly();
-      }
-    }
-    catch(Exception e)
-    {
-
-    }
-    return true;
-  }
-  
-  private boolean fallBackCheckIsReadOnly()
-  {
-    Element element = ((XSDConcreteComponent)target).getElement();
-    if (element instanceof IDOMNode
-        || element instanceof ElementImpl)
-    {
-       return false;
-    }
-    return true;
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDBaseAttributeAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDBaseAttributeAdapter.java
deleted file mode 100644
index aa3e00f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDBaseAttributeAdapter.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNameCommand;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-// a base adapter for reuse by an AttributeUse and AttributeDeclaration
-//
-public abstract class XSDBaseAttributeAdapter extends XSDBaseAdapter implements IField
-{
-  protected abstract XSDAttributeDeclaration getXSDAttributeDeclaration();
-  protected abstract XSDAttributeDeclaration getResolvedXSDAttributeDeclaration();
-
-  public XSDBaseAttributeAdapter()
-  {
-    super();
-  }
-
-  public String[] getActions(Object object)
-  {
-    List list = new ArrayList();
-    list.add(AddXSDAttributeDeclarationAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
-
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(ShowPropertiesViewAction.ID);
-    return (String[]) list.toArray(new String[0]);
-  }
-
-  public Command getDeleteCommand()
-  {
-    return new DeleteCommand("", getXSDAttributeDeclaration());
-  }
-
-  public String getKind()
-  {
-    return "attribute";
-  }
-
-  public int getMaxOccurs()
-  {
-    // TODO Auto-generated method stub
-    return -3;
-  }
-
-  public int getMinOccurs()
-  {
-    // TODO Auto-generated method stub
-    return -3;
-  }
-
-  public String getName()
-  {
-    XSDAttributeDeclaration resolvedAttributeDeclaration = getResolvedXSDAttributeDeclaration();
-    String name = resolvedAttributeDeclaration.getName();
-    return (name == null) ? "" : name;
-  }
-
-  public IType getType()
-  {
-    XSDTypeDefinition td = getResolvedXSDAttributeDeclaration().getTypeDefinition();
-    return (td != null) ? (IType) XSDAdapterFactory.getInstance().adapt(td) : null;
-  }
-
-  public String getTypeName()
-  {
-    XSDTypeDefinition td = getResolvedXSDAttributeDeclaration().getTypeDefinition();
-    return (td != null) ? td.getName() : "(no type defined)";
-  }
-
-  public String getTypeNameQualifier()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateMaxOccursCommand(int maxOccurs)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateMinOccursCommand(int minOccurs)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateNameCommand(String name)
-  {
-    return new UpdateNameCommand("Update Name", getResolvedXSDAttributeDeclaration(), name);
-  }
-
-  public Command getUpdateTypeNameCommand(String typeName, String quailifier)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.xsd.adt.outline.ITreeElement#getImage()
-   */
-  public Image getImage()
-  {
-    XSDAttributeDeclaration xsdAttributeDeclaration = getXSDAttributeDeclaration();  // don't want the resolved attribute
-    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeRef.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
-    }
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.xsd.adt.outline.ITreeElement#getText()
-   */
-  public String getText()
-  {
-    return getTextForAttribute(getResolvedXSDAttributeDeclaration(), true);
-  }
-
-  public String getTextForAttribute(XSDAttributeDeclaration ad, boolean showType)
-  {
-    ad = ad.getResolvedAttributeDeclaration();
-    String name = ad.getName();
-    StringBuffer result = new StringBuffer();
-    if (name == null)
-    {
-      result.append("'absent'");
-    }
-    else
-    {
-      result.append(name);
-    }
-    if (ad.getAnonymousTypeDefinition() == null && ad.getTypeDefinition() != null)
-    {
-      result.append(" : ");
-      // result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
-      result.append(ad.getTypeDefinition().getName());
-    }
-    return result.toString();
-  }
-
-  public boolean isGlobal()
-  {
-    return false;
-  }
-  
-  public IModel getModel()
-  {
-    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
-    return (IModel)adapter;
-  }  
-
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDChildUtility.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDChildUtility.java
deleted file mode 100644
index 53a3d31..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDChildUtility.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSwitch;
-              
-
-public class XSDChildUtility
-{              
-  static public List getModelChildren(Object model)
-  {
-    XSDChildVisitor visitor = new XSDChildVisitor(model);
-    visitor.visitXSDObject(model);
-    return visitor.list;
-  }
-
-  static public List getImmediateDerivedTypes(XSDComplexTypeDefinition complexType)
-  {
-    ArrayList typesDerivedFrom = new ArrayList();
-
-    // A handy convenience method quickly gets all 
-    // typeDefinitions within our schema; note that 
-    // whether or not this returns types in included, 
-    // imported, or redefined schemas is subject to change
-    List typedefs = complexType.getSchema().getTypeDefinitions();
-
-    for (Iterator iter = typedefs.iterator(); iter.hasNext(); )
-    {
-      XSDTypeDefinition typedef = (XSDTypeDefinition)iter.next();
-      // Walk the baseTypes from this typedef seeing if any 
-      // of them match the requested one
-      if (complexType.equals(typedef.getBaseType()))
-      {
-        // We found it, return the original one and continue
-        typesDerivedFrom.add(typedef);
-      }
-    }
-    return typesDerivedFrom;
-  }
-  // TODO... use the XSDVisitor defined in xsdeditor.util instead
-  //          
-  public static class XSDChildVisitor extends XSDVisitor
-  {
-    Object root;
-    List list = new ArrayList();
-
-    public XSDChildVisitor(Object root)
-    {
-      this.root = root;
-    }                  
-
-    public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
-    {
-      if (xsdModelGroup != root)
-      {
-        list.add(xsdModelGroup); 
-      }                         
-      else
-      {
-        super.visitXSDModelGroup(xsdModelGroup);
-      }
-    }
-
-    public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
-    {
-      if (xsdModelGroupDefinition != root)
-      {
-        list.add(xsdModelGroupDefinition);
-      }                         
-      else
-      {
-        super.visitXSDModelGroupDefinition(xsdModelGroupDefinition);
-      }
-    }
-
-    public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
-    {
-      if (xsdElementDeclaration != root)
-      {
-        list.add(xsdElementDeclaration);
-        
-      }                         
-      else
-      {
-        super.visitXSDElementDeclaration(xsdElementDeclaration);
-      }
-    }
-
-    public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
-    {
-      if (xsdComplexTypeDefinition != root)
-      {                                    
-        if (xsdComplexTypeDefinition.getName() != null || getModelChildren(xsdComplexTypeDefinition).size() > 0)
-        {
-          list.add(xsdComplexTypeDefinition);
-        }
-      }                         
-      else
-      {
-        super.visitXSDComplexTypeDefinition(xsdComplexTypeDefinition);
-      }
-    }    
-
-    public void visitXSDWildcard(XSDWildcard xsdWildCard)
-    {
-      if (xsdWildCard != root)
-      {                                    
-        list.add(xsdWildCard);        
-      }                         
-      else
-      {
-        super.visitXSDWildcard(xsdWildCard);
-      }
-    }
-  }
-               
-
-  public static class XSDVisitor
-  { 
-    int indent = 0;
-                 
-    public void visitXSDObject(Object object)
-    {           
-      if (object == null)
-        return;
-
-      XSDSwitch theSwitch = new XSDSwitch()
-      {   
-        public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
-        {
-          visitXSDComplexTypeDefinition(object);
-          return null;
-        } 
-
-        public Object caseXSDAttributeUse(XSDAttributeUse object)
-        {
-          visitXSDAttributeUse(object);
-          return null;
-        }
-
-        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
-        {
-          visitXSDElementDeclaration(object);
-          return null;
-        }
-
-        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
-        {
-          visitXSDModelGroupDefinition(object);
-          return super.caseXSDModelGroupDefinition(object);
-        }
-
-        public Object caseXSDModelGroup(XSDModelGroup object)
-        {
-          visitXSDModelGroup(object);
-          return super.caseXSDModelGroup(object);
-        }
-
-        public Object caseXSDParticle(XSDParticle object)
-        { 
-          visitXSDParticle(object);
-          return null;
-        } 
-
-        public Object caseXSDSchema(XSDSchema object)
-        { 
-          visitXSDSchema(object);
-          return null;
-        } 
-
-        public Object caseXSDWildcard(XSDWildcard object)
-        { 
-          visitXSDWildcard(object);
-          return null;
-        } 
-      };
-      theSwitch.doSwitch((EObject)object);
-    }
-         
-    public void visitXSDAttributeUse(XSDAttributeUse xsdAttributeUse)
-    {  
-//      printIndented("@" + xsdAttributeUse.getAttributeDeclaration().getName());
-    }
-
-    public void visitXSDSchema(XSDSchema xsdSchema)
-    {         
-//      printIndented("XSDSchema");
-      indent += 2;
-      for (Iterator iterator = xsdSchema.getElementDeclarations().iterator(); iterator.hasNext(); )
-      {
-        visitXSDObject(iterator.next());
-      }
-      indent -= 2;
-    }
-
-    public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
-    {      
-//      printIndented(xsdElementDeclaration.getName());
-      indent += 2;         
-      XSDTypeDefinition td = xsdElementDeclaration.getTypeDefinition();
-      if (td == null)
-      {
-        td = xsdElementDeclaration.getAnonymousTypeDefinition();
-      }                       
-      visitXSDObject(td);
-      indent -= 2;
-    }
-   
-    public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
-    {
-//      printIndented("XSDComplexTypeDefinition : " + xsdComplexTypeDefinition.getContent());
-      indent += 2;
-      for (Iterator i = xsdComplexTypeDefinition.getAttributeUses().iterator(); i.hasNext(); )
-      {        
-        visitXSDObject((XSDAttributeUse)i.next());
-      }
-      visitXSDObject(xsdComplexTypeDefinition.getContent());
-      indent -= 2;
-    }
-
-    public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
-    {
-//      printIndented("XSDModelGroup");
-      indent += 2;
-      for (Iterator iterator = xsdModelGroup.getContents().iterator(); iterator.hasNext(); )
-      {
-        visitXSDObject(iterator.next());
-      } 
-      indent -= 2;
-    }     
-
-    public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
-    {
-//      printIndented("XSDModelGroupDefinition");
-      indent += 2;
-      visitXSDObject(xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup());
-      indent -= 2;
-    }
-
-    public void visitXSDParticle(XSDParticle xsdParticle)
-    {
-//      printIndented("XSDParticle");
-      indent += 2;                 
-      if (xsdParticle.getContent() != null)
-        visitXSDObject(xsdParticle.getContent());
-      indent -= 2;
-    } 
-
-    public void visitXSDWildcard(XSDWildcard object)
-    { 
-//      printIndented("XSDWildcard");
-    }
-
-    public void printIndented(String string)
-    { 
-      //String spaces = "";
-      //for (int i = 0; i < indent; i++)
-      //{
-      //  spaces += " ";
-      //}               
-      //System.out.println(spaces + string);      
-    }
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDComplexTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDComplexTypeDefinitionAdapter.java
deleted file mode 100644
index bf8ce65..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDComplexTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.model.SpaceFiller;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDAttributeGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDElementCommand;
-import org.eclipse.wst.xsd.ui.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNameCommand;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDComplexTypeDefinitionAdapter extends XSDTypeDefinitionAdapter implements IComplexType, IActionProvider, IADTObjectListener
-{
-  protected List fields = null;
-  protected List otherThingsToListenTo = null;
-
-  public XSDComplexTypeDefinition getXSDComplexTypeDefinition()
-  {
-    return (XSDComplexTypeDefinition) target;
-  }
-
-  public IType getSuperType()
-  {
-    XSDTypeDefinition td = getXSDTypeDefinition().getBaseType();
-
-    // test to filter out the 'anyType' type ... don't want to see that
-    //
-    if (td != null && !td.getName().equals("anyType"))
-    {
-      return (IType) XSDAdapterFactory.getInstance().adapt(td);
-    }
-    return null;
-  }
-
-  protected void clearFields()
-  {
-    if (otherThingsToListenTo != null)
-    {
-      for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
-      {
-        Adapter adapter = (Adapter) i.next();
-        if (adapter instanceof IADTObject)
-        {
-          IADTObject adtObject = (IADTObject) adapter;
-          adtObject.unregisterListener(this);
-        }
-      }
-    }
-    fields = null;
-    otherThingsToListenTo = null;
-  }
-
-  public List getFields()
-  {
-    if (fields == null)
-    {
-      fields = new ArrayList();
-      otherThingsToListenTo = new ArrayList();
-
-      XSDVisitorForFields visitor = new XSDVisitorForFieldsWithSpaceFillers();
-      visitor.visitComplexTypeDefinition(getXSDComplexTypeDefinition());
-      populateAdapterList(visitor.concreteComponentList, fields);
-      populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
-      for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
-      {
-        Adapter adapter = (Adapter) i.next();
-        if (adapter instanceof IADTObject)
-        {
-          IADTObject adtObject = (IADTObject) adapter;
-          adtObject.registerListener(this);
-        }
-      }
-    }
-    // System.out.println("fields[" + this + "].size() = " + fields.size());
-    return fields;
-  }
-
-  class XSDVisitorForFieldsWithSpaceFillers extends XSDVisitorForFields
-  {
-    public XSDVisitorForFieldsWithSpaceFillers()
-    {
-      super();
-    }
-
-    public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-    {
-      for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext();)
-      {
-        Object o = it.next();
-        if (o instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attributeUse = (XSDAttributeUse) o;
-          concreteComponentList.add(attributeUse.getAttributeDeclaration());
-          thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration());
-        }
-        else if (o instanceof XSDAttributeGroupDefinition)
-        {
-          XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) o;
-          thingsWeNeedToListenTo.add(attrGroup);
-          if (attrGroup.isAttributeGroupDefinitionReference())
-          {
-            attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
-            if (attrGroup.getContents().size() == 0)
-            {
-              concreteComponentList.add(new SpaceFiller("attribute"));
-            }
-            visitAttributeGroupDefinition(attrGroup);
-          }
-        }
-      }
-    }
-
-    public void visitModelGroup(XSDModelGroup modelGroup)
-    {
-      int numOfChildren = modelGroup.getContents().size();
-      if (numOfChildren == 0)
-      {
-        concreteComponentList.add(new SpaceFiller("element"));
-      }
-      super.visitModelGroup(modelGroup);
-    }
-  }
-
-  public List getModelGroups()
-  {
-    List groups = new ArrayList();
-    groups.addAll(XSDChildUtility.getModelChildren(getXSDComplexTypeDefinition()));
-    return groups;
-  }
-
-  public List getAttributeGroupContent()
-  {
-    EList attrContent = getXSDComplexTypeDefinition().getAttributeContents();
-    List attrUses = new ArrayList();
-    List list = new ArrayList();
-
-    for (Iterator it = attrContent.iterator(); it.hasNext();)
-    {
-      XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) it.next();
-
-      if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-      {
-        XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) attrGroupContent;
-        list.add(XSDAdapterFactory.getInstance().adapt(attributeGroupDefinition));
-        getAttributeUses(attributeGroupDefinition, attrUses);
-      }
-      else
-      {
-        attrUses.add(attrGroupContent);
-        list.add(new TargetConnectionSpaceFiller(this));
-      }
-    }
-    return list;
-  }
-
-  public boolean isComplexType()
-  {
-    return true;
-  }
-
-  public void notifyChanged(Notification msg)
-  {
-    clearFields();
-    super.notifyChanged(msg);
-  }
-
-  public Command getUpdateNameCommand(String newName)
-  {
-    return new UpdateNameCommand("Update Name", getXSDComplexTypeDefinition(), newName);
-  }
-
-  public Command getAddNewFieldCommand(String fieldKind)
-  {
-    return new AddXSDElementCommand("whyDoWeUseThisLabel?", getXSDComplexTypeDefinition());
-  }
-
-  public Command getDeleteCommand()
-  {
-    return new DeleteCommand("", getXSDComplexTypeDefinition());
-  }
-
-  protected class AddNewFieldCommand extends Command
-  {
-    protected String defaultName;
-    protected String fieldKind;
-
-    AddNewFieldCommand(String defaultName, String fieldKind)
-    {
-      this.defaultName = defaultName;
-      this.fieldKind = fieldKind;
-    }
-  }
-
-  public String[] getActions(Object object)
-  {
-    List list = new ArrayList();
-    IWorkbench workbench = PlatformUI.getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-    Object schema = editorPart.getAdapter(XSDSchema.class);
-    
-    list.add(AddXSDElementAction.ID);
-    list.add(AddXSDElementAction.REF_ID);
-    list.add(AddXSDAttributeDeclarationAction.ID);
-    list.add(AddXSDAttributeGroupDefinitionAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(AddXSDModelGroupAction.SEQUENCE_ID);
-    list.add(AddXSDModelGroupAction.CHOICE_ID);
-
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(DeleteAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    if (getXSDComplexTypeDefinition().getSchema() == schema)
-    {
-      if (getXSDComplexTypeDefinition().getContainer() == schema)
-      {
-        list.add(SetInputToGraphView.ID);
-      }
-    }
-    else
-    {
-      list.add(OpenInNewEditor.ID);
-    }
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(ShowPropertiesViewAction.ID);
-    String[] result = new String[list.size()];
-    list.toArray(result);
-    return result;
-  }
-
-  public void propertyChanged(Object object, String property)
-  {
-    clearFields();
-    notifyListeners(this, null);
-  }
-
-  class BogusAction extends Action
-  {
-    BogusAction(String name)
-    {
-      super(name);
-    }
-
-    public void run()
-    {
-      // TODO Auto-generated method stub
-      super.run();
-    }
-  }
-
-  public ITreeElement[] getChildren()
-  {
-    XSDComplexTypeDefinition xsdComplexTypeDefinition = getXSDComplexTypeDefinition();
-    List list = new ArrayList();
-    // Add attributes
-    for (Iterator i = xsdComplexTypeDefinition.getAttributeContents().iterator(); i.hasNext();)
-    {
-      Object obj = i.next();
-      if (obj instanceof XSDAttributeUse)
-      {
-        list.add(obj);
-      }
-      else if (obj instanceof XSDAttributeGroupDefinition)
-      {
-        getAttributeUses((XSDAttributeGroupDefinition) obj, list);
-      }
-    }
-    // get immediate XSD Model Group of this complex type
-    if (xsdComplexTypeDefinition.getContent() != null)
-    {
-      XSDComplexTypeContent xsdComplexTypeContent = xsdComplexTypeDefinition.getContent();
-      if (xsdComplexTypeContent instanceof XSDParticle)
-      {
-        XSDParticleContent particleContent = ((XSDParticle) xsdComplexTypeContent).getContent();
-        if (particleContent instanceof XSDModelGroup)
-        {
-          list.add((XSDModelGroup) particleContent);
-        }
-      }
-    }
-    // get inherited XSD Model Group of this complex type
-    boolean showInheritedContent = XSDEditorPlugin.getPlugin().getShowInheritedContent();
-    if (showInheritedContent)
-    {
-      XSDTypeDefinition typeDef = xsdComplexTypeDefinition.getBaseTypeDefinition();
-      if (typeDef instanceof XSDComplexTypeDefinition)
-      {
-        XSDComplexTypeDefinition baseCT = (XSDComplexTypeDefinition) typeDef;
-        if (baseCT.getTargetNamespace() != null && !baseCT.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-        {
-          if (baseCT.getContent() != null)
-          {
-            XSDComplexTypeContent xsdComplexTypeContent = baseCT.getContent();
-            if (xsdComplexTypeContent instanceof XSDParticle)
-            {
-              XSDParticleContent particleContent = ((XSDParticle) xsdComplexTypeContent).getContent();
-              if (particleContent instanceof XSDModelGroup)
-              {
-                list.add((XSDModelGroup) particleContent);
-              }
-            }
-          }
-        }
-      }
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-  }
-
-  public Image getImage()
-  {
-    return XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif");
-  }
-
-  public String getText()
-  {
-    XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition) target;
-
-    StringBuffer result = new StringBuffer();
-
-    result.append(xsdComplexTypeDefinition.getName() == null ? "local type" : xsdComplexTypeDefinition.getName());
-
-    XSDTypeDefinition baseTypeDefinition = xsdComplexTypeDefinition.getBaseTypeDefinition();
-    if (baseTypeDefinition != null && baseTypeDefinition != xsdComplexTypeDefinition.getContent() && baseTypeDefinition.getName() != null && !XSDConstants.isURType(baseTypeDefinition))
-    {
-      result.append(" : ");
-      result.append(baseTypeDefinition.getQName(xsdComplexTypeDefinition));
-    }
-
-    return result.toString();
-  }
-
-  public void getAttributeUses(XSDAttributeGroupDefinition attributeGroupDefinition, List list)
-  {
-    Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator();
-
-    while (i.hasNext())
-    {
-      XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next();
-
-      if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-      {
-        getAttributeUses((XSDAttributeGroupDefinition) attrGroupContent, list);
-      }
-      else
-      {
-        list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent));
-      }
-    }
-  }
-
-  public IModel getModel()
-  {
-    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDComplexTypeDefinition().getSchema());
-    return (IModel)adapter;
-  }
-
-  public boolean isFocusAllowed()
-  {
-    return true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDElementDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDElementDeclarationAdapter.java
deleted file mode 100644
index d57dda4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDElementDeclarationAdapter.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.adt.design.IAnnotationProvider;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.common.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.common.actions.SetTypeAction;
-import org.eclipse.wst.xsd.ui.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNameCommand;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDElementDeclarationAdapter extends XSDParticleAdapter implements IField, IActionProvider, IAnnotationProvider
-{
-  protected XSDElementDeclaration getXSDElementDeclaration()
-  {
-    return (XSDElementDeclaration) target;
-  }
-
-  public String getName()
-  {
-    String name = getXSDElementDeclaration().getResolvedElementDeclaration().getName();
-    return (name == null) ? "" : name;
-  }
-
-  public String getTypeName()
-  {
-    IType type = getType();
-    if (type != null)
-    {  
-      return type.getName();
-    }
-    return null;
-  }
-
-  public String getTypeNameQualifier()
-  {
-    return getXSDElementDeclaration().getTypeDefinition().getTargetNamespace();
-  }
-
-  public IType getType()
-  {
-    XSDTypeDefinition td = getXSDElementDeclaration().getResolvedElementDeclaration().getTypeDefinition();
-    //if (td != null &&
-    //    td.getTargetNamespace() != null && td.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) return null;
-    return (td != null) ? (IType) XSDAdapterFactory.getInstance().adapt(td) : null;
-  }
- 
-  public Image getImage()
-  {
-    XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
-
-    if (!xsdElementDeclaration.isElementDeclarationReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDElementRef.gif");
-    }
-  }
-
-  public String getText()
-  {
-    XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
-    XSDElementDeclaration resolvedElementDeclaration = xsdElementDeclaration.getResolvedElementDeclaration();
-    //String name = xsdElementDeclaration != resolvedElementDeclaration ? xsdElementDeclaration.getQName() : xsdElementDeclaration.getName();
-    String name = resolvedElementDeclaration.getName();
-
-    StringBuffer result = new StringBuffer();
-    if (name == null)
-    {
-      result.append("'absent'");
-    }
-    else
-    {
-      result.append(name);
-    }
-
-    if (!xsdElementDeclaration.isGlobal())
-    {
-      Element element = xsdElementDeclaration.getElement();
-      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
-      if (hasMinOccurs || hasMaxOccurs)
-      {
-        result.append(" [");
-        if (hasMinOccurs)
-        {
-          int min = ((XSDParticle) xsdElementDeclaration.getContainer()).getMinOccurs();
-          if (min == XSDParticle.UNBOUNDED)
-          {
-            result.append("*");
-          }
-          else
-          {
-            result.append(String.valueOf(min));
-          }
-        }
-        else
-        // print default
-        {
-          int min = ((XSDParticle) xsdElementDeclaration.getContainer()).getMinOccurs();
-          result.append(String.valueOf(min));
-        }
-        if (hasMaxOccurs)
-        {
-          int max = ((XSDParticle) xsdElementDeclaration.getContainer()).getMaxOccurs();
-          result.append("..");
-          if (max == XSDParticle.UNBOUNDED)
-          {
-            result.append("*");
-          }
-          else
-          {
-            result.append(String.valueOf(max));
-          }
-        }
-        else
-        // print default
-        {
-          result.append("..");
-          int max = ((XSDParticle) xsdElementDeclaration.getContainer()).getMaxOccurs();
-          result.append(String.valueOf(max));
-
-        }
-        result.append("]");
-      }
-    }
-
-    if (resolvedElementDeclaration.getAnonymousTypeDefinition() == null && resolvedElementDeclaration.getTypeDefinition() != null)
-    {
-      result.append(" : ");
-      // result.append(resolvedElementDeclaration.getTypeDefinition().getQName(xsdElementDeclaration));
-      result.append(resolvedElementDeclaration.getTypeDefinition().getName());
-    }
-
-    return result.toString();
-
-  }
-
-  public ITreeElement[] getChildren()
-  {
-    XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
-    List list = new ArrayList();
-    XSDTypeDefinition type = null;
-    if (xsdElementDeclaration.isElementDeclarationReference())
-    {
-      type = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
-    }
-    else
-    {
-      type = xsdElementDeclaration.getAnonymousTypeDefinition();
-      if (type == null)
-      {
-        type = xsdElementDeclaration.getTypeDefinition();
-      }
-    }
-
-    if (type instanceof XSDComplexTypeDefinition && type.getTargetNamespace() != null && !type.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-    {
-      XSDComplexTypeDefinition ctType = (XSDComplexTypeDefinition) type;
-      if (ctType != null)
-      {
-        if (xsdElementDeclaration.isGlobal())
-          list.add(ctType);
-      }
-    }
-
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-
-  }
-  
-  public String getKind()
-  {
-    return "element";
-  }
-  
-  public boolean isGlobal()
-  {
-    return getXSDElementDeclaration().eContainer() instanceof XSDSchema;
-  }
-  
-  public boolean isElementDeclarationReference()
-  {
-	  return ((XSDElementDeclaration) target).isElementDeclarationReference();
-  }
-
-  public Command getUpdateMaxOccursCommand(int maxOccurs)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateMinOccursCommand(int minOccurs)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateNameCommand(String name)
-  {
-    return new UpdateNameCommand("Update Name", getXSDElementDeclaration().getResolvedElementDeclaration(), name);
-  }
-
-  public Command getUpdateTypeNameCommand(String typeName, String quailifier)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getDeleteCommand()
-  {
-    // TODO Auto-generated method stub
-    return new DeleteCommand("", getXSDElementDeclaration());
-  }
-  
-  public String[] getActions(Object object)
-  {
-    List list = new ArrayList();
-    if (!isGlobal())
-      list.add(AddXSDElementAction.ID);
-
-    list.add(BaseSelectionAction.SUBMENU_START_ID + "Set Type");
-    list.add(SetTypeAction.SET_NEW_TYPE_ID);
-    list.add(SetTypeAction.SELECT_EXISTING_TYPE_ID);
-    list.add(BaseSelectionAction.SUBMENU_END_ID);
-
-    list.add(BaseSelectionAction.SUBMENU_START_ID + "Set Multiplicity");
-    list.add(SetMultiplicityAction.REQUIRED_ID);
-    list.add(SetMultiplicityAction.ZERO_OR_ONE_ID);
-    list.add(SetMultiplicityAction.ZERO_OR_MORE_ID);
-    list.add(SetMultiplicityAction.ONE_OR_MORE_ID);    
-    list.add(BaseSelectionAction.SUBMENU_END_ID);
-
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(DeleteAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(ShowPropertiesViewAction.ID);
-    return (String [])list.toArray(new String[0]);
-  }
-  
-  public IModel getModel()
-  {
-    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDElementDeclaration().getSchema());
-    return (IModel)adapter;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDEmptyFieldAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDEmptyFieldAdapter.java
deleted file mode 100644
index 8f6b858..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDEmptyFieldAdapter.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IType;
-
-/**
- * @deprecated not used
- */
-public class XSDEmptyFieldAdapter extends XSDBaseAdapter implements IField
-{
-  String kind;
-  public XSDEmptyFieldAdapter()
-  {
-    super();
-  }
-
-  public String getKind()
-  {
-    return kind;
-  }
-  
-  public void setKind(String kind)
-  {
-    this.kind = kind;
-  }
-
-  public String getName()
-  {
-    return null;
-  }
-
-  public String getTypeName()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public String getTypeNameQualifier()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public IType getType()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public int getMinOccurs()
-  {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  public int getMaxOccurs()
-  {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-  
-  public boolean isGlobal()
-  {
-    return false;
-  }
-
-  public Command getUpdateMinOccursCommand(int minOccurs)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateMaxOccursCommand(int maxOccurs)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateTypeNameCommand(String typeName, String quailifier)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateNameCommand(String name)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getDeleteCommand()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public IModel getModel()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDModelGroupAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDModelGroupAdapter.java
deleted file mode 100644
index 0ad1b31..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDModelGroupAdapter.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.common.actions.SetMultiplicityAction;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDModelGroupAdapter extends XSDParticleAdapter implements IActionProvider
-{
-  public static final Image SEQUENCE_ICON_IMAGE = XSDEditorPlugin.getImageDescriptor("newSequence2.gif", true).createImage();
-  public static final Image CHOICE_ICON_IMAGE = XSDEditorPlugin.getImageDescriptor("newChoice.gif", true).createImage();
-  public static final Image ALL_ICON_IMAGE = XSDEditorPlugin.getImageDescriptor("obj16/all.gif", true).createImage();
-
-  XSDModelGroup getXSDModelGroup()
-  {
-    return (XSDModelGroup) target;
-  }
-
-  public XSDModelGroupAdapter()
-  {
-
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.xsd.adt.outline.ITreeElement#getImage()
-   */
-  public Image getImage()
-  {
-    XSDModelGroup xsdModelGroup = getXSDModelGroup();
-    if (XSDCompositor.CHOICE_LITERAL == xsdModelGroup.getCompositor())
-    {
-      return CHOICE_ICON_IMAGE;
-    }
-    else if (XSDCompositor.ALL_LITERAL == xsdModelGroup.getCompositor())
-    {
-      return ALL_ICON_IMAGE;
-    }
-    else
-    {
-      return SEQUENCE_ICON_IMAGE;
-    }
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.xsd.adt.outline.ITreeElement#getText()
-   */
-  public String getText()
-  {
-    XSDModelGroup xsdModelGroup = getXSDModelGroup();
-
-    StringBuffer result = new StringBuffer();
-    String name = xsdModelGroup.getCompositor().getName();
-    if (name != null)
-    {
-      result.append(name);
-    }
-
-    Element element = xsdModelGroup.getElement();
-
-    if (element != null)
-    {
-      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
-      if (hasMinOccurs || hasMaxOccurs)
-      {
-        result.append(" [");
-        if (hasMinOccurs)
-        {
-          int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs();
-          if (min == XSDParticle.UNBOUNDED)
-          {
-            result.append("*");
-          }
-          else
-          {
-            result.append(String.valueOf(min));
-          }
-        }
-        else
-        // print default
-        {
-          int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs();
-          result.append(String.valueOf(min));
-        }
-        if (hasMaxOccurs)
-        {
-          int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
-          result.append("..");
-          if (max == XSDParticle.UNBOUNDED)
-          {
-            result.append("*");
-          }
-          else
-          {
-            result.append(String.valueOf(max));
-          }
-        }
-        else
-        // print default
-        {
-          result.append("..");
-          int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
-          result.append(String.valueOf(max));
-        }
-        result.append("]");
-      }
-    }
-    return result.toString();
-  }
-
-  public ITreeElement[] getChildren()
-  {
-    XSDModelGroup xsdModelGroup = getXSDModelGroup();
-    List list = new ArrayList();
-    for (Iterator i = xsdModelGroup.getContents().iterator(); i.hasNext(); )
-    {
-       Object object = i.next();
-       XSDParticleContent particle = ((XSDParticle)object).getContent();
-       if (particle instanceof XSDElementDeclaration)
-       {
-         list.add((XSDElementDeclaration)particle);
-       }
-       else if (particle instanceof XSDWildcard)
-       {
-         list.add((XSDWildcard)particle);
-       }
-       else if (particle instanceof XSDModelGroup)
-       {
-         list.add((XSDModelGroup)particle);
-       }
-    }
-
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return (ITreeElement []) adapterList.toArray(new ITreeElement[0]);
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDModelGroup element = (XSDModelGroup) object;
-    return element.getContainer();
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider#getActions(java.lang.Object)
-   */
-  public String[] getActions(Object object)
-  {
-     Collection actionIDs = new ArrayList();
-     actionIDs.add(AddXSDElementAction.ID);
-     actionIDs.add(AddXSDElementAction.REF_ID);
-     // Add Element Ref
-     actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
-     actionIDs.add(AddXSDModelGroupAction.SEQUENCE_ID);
-     actionIDs.add(AddXSDModelGroupAction.CHOICE_ID);
-     actionIDs.add(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITIONREF_ID);
-//     actionIDs.add(AddFieldAction.ID);
-     actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
-     // Add Any
-
-     actionIDs.add(BaseSelectionAction.SUBMENU_START_ID + "Set Multiplicity");
-     actionIDs.add(SetMultiplicityAction.REQUIRED_ID);
-     actionIDs.add(SetMultiplicityAction.ZERO_OR_ONE_ID);
-     actionIDs.add(SetMultiplicityAction.ZERO_OR_MORE_ID);
-     actionIDs.add(SetMultiplicityAction.ONE_OR_MORE_ID);    
-     actionIDs.add(BaseSelectionAction.SUBMENU_END_ID);
-    
-     if (!(getParent(target) instanceof XSDModelGroupDefinition))
-     {
-       actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
-       actionIDs.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
-     }    
-     actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
-     actionIDs.add(ShowPropertiesViewAction.ID);
-        
-     return (String [])actionIDs.toArray(new String[0]);
-  }
-
-  public int getMaxOccurs()
-  {
-    return getMaxOccurs(getXSDModelGroup());
-  }
-
-  public int getMinOccurs()
-  {
-    return getMinOccurs(getXSDModelGroup());
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDModelGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDModelGroupDefinitionAdapter.java
deleted file mode 100644
index 700f6d7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDModelGroupDefinitionAdapter.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class XSDModelGroupDefinitionAdapter extends XSDBaseAdapter implements IStructure, IActionProvider
-{
-  public XSDModelGroupDefinitionAdapter()
-  {
-    super();
-  }
-
-  public XSDModelGroupDefinition getXSDModelGroupDefinition()
-  {
-    return (XSDModelGroupDefinition) target;
-  }
-
-  public Image getImage()
-  {
-    XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
-
-    if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDGroupRef.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDGroup.gif");
-    }
-  }
-
-  public String getText()
-  {
-    XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
-    String result = xsdModelGroupDefinition.isModelGroupDefinitionReference() ? xsdModelGroupDefinition.getQName() : xsdModelGroupDefinition.getName();
-    return result == null ? "'absent'" : result;
-  }
-
-  public ITreeElement[] getChildren()
-  {
-    List list = new ArrayList();
-    XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) target).getResolvedModelGroupDefinition().getModelGroup();
-    if (xsdModelGroup != null)
-      list.add(xsdModelGroup);
-
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider#getActions(java.lang.Object)
-   */
-  public String[] getActions(Object object)
-  {
-    Collection list = new ArrayList();
-
-    if (!getXSDModelGroupDefinition().isModelGroupDefinitionReference())
-    {
-      list.add(AddXSDElementAction.ID);
-      list.add(AddXSDElementAction.REF_ID);
-      list.add(BaseSelectionAction.SEPARATOR_ID);
-      list.add(AddXSDModelGroupAction.SEQUENCE_ID);
-      list.add(AddXSDModelGroupAction.CHOICE_ID);
-    }
-    
-    list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
-    return (String [])list.toArray(new String[0]);
-  }
-
-  public Command getAddNewFieldCommand(String fieldKind)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getDeleteCommand()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public List getFields()
-  {
-    List fields = new ArrayList();
-    XSDVisitorForFields visitor = new XSDVisitorForFields();
-    visitor.visitModelGroupDefinition(getXSDModelGroupDefinition());
-    populateAdapterList(visitor.concreteComponentList, fields);
-    
-    // TODO (cs) common a base class for a structure thingee
-    //
-    /*
-    populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
-    for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
-    {
-      Adapter adapter = (Adapter) i.next();
-      if (adapter instanceof IADTObject)
-      {
-        IADTObject adtObject = (IADTObject) adapter;
-        adtObject.registerListener(this);
-      }
-    }*/
-    // System.out.println("fields[" + this + "].size() = " + fields.size());
-    return fields;
-  }
-
-  public IModel getModel()
-  {
-    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDModelGroupDefinition().getSchema());
-    return (IModel)adapter;
-  }
-  public String getName()
-  {
-    return getText();
-  }    
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDParticleAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDParticleAdapter.java
deleted file mode 100644
index d0425e3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDParticleAdapter.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import org.eclipse.wst.xsd.adt.design.IAnnotationProvider;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-
-public class XSDParticleAdapter extends XSDBaseAdapter implements IAnnotationProvider
-{
-  public XSDParticleAdapter()
-  {
-    super();
-  }
-
-  public int getMaxOccurs()
-  {
-    return getMaxOccurs((XSDConcreteComponent) target);
-  }
-
-  public int getMinOccurs()
-  {
-    return getMinOccurs((XSDConcreteComponent) target);
-  }
-
-  public static int getMinOccurs(XSDConcreteComponent component)
-  {
-    int minOccur = -2;
-    if (component != null)
-    {
-      Object o = component.getContainer();
-      if (o instanceof XSDParticle)
-      {
-        if (((XSDParticle) o).isSetMinOccurs())
-        {
-          try
-          {
-            minOccur = ((XSDParticle) o).getMinOccurs();
-          }
-          catch (Exception e)
-          {
-          }
-        }
-      }
-    }
-    return minOccur;
-  }
-
-  public static int getMaxOccurs(XSDConcreteComponent component)
-  {
-    int maxOccur = -2;
-    if (component != null)
-    {
-      Object o = component.getContainer();
-      if (o instanceof XSDParticle)
-      {
-        if (((XSDParticle) o).isSetMaxOccurs())
-        {
-          try
-          {
-            maxOccur = ((XSDParticle) o).getMaxOccurs();
-          }
-          catch (Exception e)
-          {
-          }
-        }
-      }
-    }
-    return maxOccur;
-  }
-
-  public String getNameAnnotationString()
-  {
-    return buildAnnotationString(true);
-  }
-
-  public String getNameAnnotationToolTipString()
-  {
-    return buildAnnotationString(false);
-  }
-
-  public String getTypeAnnotationString()
-  {
-    return null;
-  }
-
-  public String getTypeAnnotationToolTipString()
-  {
-    return null;
-  }
-
-  protected String buildAnnotationString(boolean isForLabel)
-  {
-    String occurenceDescription = "";
-    String toolTipDescription = "";
-    // TODO: set int values as defined constants
-    // -2 means the user didn't specify (so the default is 1)
-    int minOccurs = getMinOccurs();
-    int maxOccurs = getMaxOccurs();
-
-    // This is for the attribute field case, which has no
-    // occurrence attributes
-    if (minOccurs == -3 && maxOccurs == -3)
-    {
-      occurenceDescription = "";
-    }
-    else if (minOccurs == 0 && (maxOccurs == -2 || maxOccurs == 1))
-    {
-      occurenceDescription = "[0..1]";
-      toolTipDescription = "optional";
-    }
-    else if (minOccurs == 0 && maxOccurs == -1)
-    {
-      occurenceDescription = "[0..*]";
-      toolTipDescription = "Zero or more";
-    }
-    else if ((minOccurs == 1 && maxOccurs == -1) || (minOccurs == -2 && maxOccurs == -1))
-    {
-      occurenceDescription = "[1..*]";
-      toolTipDescription = "One or more";
-    }
-    else if ((minOccurs == 1 && maxOccurs == 1) || (minOccurs == -2 && maxOccurs == 1) || (minOccurs == 1 && maxOccurs == -2))
-    {
-      occurenceDescription = "[1..1]";
-      toolTipDescription = "required";
-    }
-    else if (minOccurs == -2 && maxOccurs == -2)
-    {
-      occurenceDescription = "";
-      // none specified, so don't have any toolTip description
-    }
-    else
-    {
-      if (maxOccurs == -2)
-        maxOccurs = 1;
-      String maxSymbol = maxOccurs == -1 ? "*" : "" + maxOccurs;
-      String minSymbol = minOccurs == -2 ? "1" : "" + minOccurs;
-      occurenceDescription = "[" + minSymbol + ".." + maxSymbol + "]";
-      toolTipDescription = "array";
-    }
-
-    if (isForLabel)
-    {
-      return occurenceDescription;
-    }
-    else
-    {
-      return toolTipDescription;
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSchemaAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSchemaAdapter.java
deleted file mode 100644
index 6d418d8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSchemaAdapter.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDComplexTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.common.actions.AddXSDElementAction;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class XSDSchemaAdapter extends XSDBaseAdapter implements IActionProvider, IModel, IADTObjectListener
-{
-  protected List types = null;
-  protected List children;
-
-  protected CategoryAdapter fDirectivesCategory;
-  protected CategoryAdapter fElementsCategory;
-  protected CategoryAdapter fAttributesCategory;
-  protected CategoryAdapter fAttributeGroupsCategory;
-  protected CategoryAdapter fTypesCategory;
-  protected CategoryAdapter fGroupsCategory;
-
-  /**
-   * Create all the category adapters
-   * 
-   * @param xsdSchema
-   */
-  protected void createCategoryAdapters(XSDSchema xsdSchema)
-  {
-    List directivesList = getDirectives(xsdSchema);
-    List elementsList = getGlobalElements(xsdSchema);
-    List attributeGroupList = getAttributeGroupList(xsdSchema);
-    List attributesList = getAttributeList(xsdSchema);
-    List groups = getGroups(xsdSchema);
-    List types = getComplexTypes(xsdSchema);
-    types.addAll(getSimpleTypes(xsdSchema));
-
-    fDirectivesCategory = new CategoryAdapter(XSDEditorPlugin.getResourceString("_UI_GRAPH_DIRECTIVES"), XSDEditorPlugin.getDefault().getIconImage("obj16/directivesheader"), directivesList, xsdSchema, CategoryAdapter.DIRECTIVES);
-    registerListener(fDirectivesCategory);
-
-    fElementsCategory = new CategoryAdapter(XSDEditorPlugin.getResourceString("_UI_GRAPH_ELEMENTS"), XSDEditorPlugin.getDefault().getIconImage("obj16/elementsheader"), elementsList, xsdSchema, CategoryAdapter.ELEMENTS);
-    registerListener(fElementsCategory);
-
-    fAttributesCategory = new CategoryAdapter(XSDEditorPlugin.getResourceString("_UI_GRAPH_ATTRIBUTES"), XSDEditorPlugin.getDefault().getIconImage("obj16/attributesheader"), attributesList, xsdSchema, CategoryAdapter.ATTRIBUTES);
-    registerListener(fAttributesCategory);
-    fAttributeGroupsCategory = new CategoryAdapter(XSDEditorPlugin.getResourceString("_UI_GRAPH_ATTRIBUTE_GROUPS"), XSDEditorPlugin.getDefault().getIconImage("obj16/attributegroupsheader"), attributeGroupList, xsdSchema, CategoryAdapter.ATTRIBUTE_GROUPS);
-    registerListener(fAttributeGroupsCategory);
-
-    fTypesCategory = new CategoryAdapter(XSDEditorPlugin.getResourceString("_UI_GRAPH_TYPES"), XSDEditorPlugin.getDefault().getIconImage("obj16/typesheader"), types, xsdSchema, CategoryAdapter.TYPES);
-    registerListener(fTypesCategory);
-
-    fGroupsCategory = new CategoryAdapter(XSDEditorPlugin.getResourceString("_UI_GRAPH_GROUPS"), XSDEditorPlugin.getDefault().getIconImage("obj16/groupsheader"), groups, xsdSchema, CategoryAdapter.GROUPS);
-    registerListener(fGroupsCategory);
-  }
-
-  public List getTypes()
-  {
-    if (types == null)
-    {
-      types = new ArrayList();
-      XSDSchema schema = (XSDSchema) target;
-      List concreteComponentList = new ArrayList();
-      for (Iterator i = schema.getContents().iterator(); i.hasNext();)
-      {
-        XSDConcreteComponent component = (XSDConcreteComponent) i.next();
-        if (component instanceof XSDTypeDefinition)
-        {
-          concreteComponentList.add(component);
-        }
-      }
-      populateAdapterList(concreteComponentList, types);
-    }
-    return types;
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.xsd.adt.outline.ITreeElement#getChildren()
-   */
-  public ITreeElement[] getChildren()
-  {
-    XSDSchema xsdSchema = (XSDSchema) getTarget();
-
-    children = new ArrayList();
-
-    // just set categoryadapters' children if category adapters are
-    // already created
-    if (fDirectivesCategory != null)
-    {
-      List directivesList = getDirectives(xsdSchema);
-      List elementsList = getGlobalElements(xsdSchema);
-      List attributeGroupList = getAttributeGroupList(xsdSchema);
-      List attributesList = getAttributeList(xsdSchema);
-      List groups = getGroups(xsdSchema);
-      List types = getComplexTypes(xsdSchema);
-      types.addAll(getSimpleTypes(xsdSchema));
-
-      fDirectivesCategory.setChildren(directivesList);
-      fElementsCategory.setChildren(elementsList);
-      fAttributesCategory.setChildren(attributesList);
-      fAttributeGroupsCategory.setChildren(attributeGroupList);
-      fTypesCategory.setChildren(types);
-      fGroupsCategory.setChildren(groups);
-    }
-    else
-    {
-      createCategoryAdapters(xsdSchema);
-    }
-
-    children.add(fDirectivesCategory);
-    children.add(fElementsCategory);
-    children.add(fAttributesCategory);
-    children.add(fAttributeGroupsCategory);
-    children.add(fTypesCategory);
-    children.add(fGroupsCategory);
-
-    return (ITreeElement[]) children.toArray(new ITreeElement[0]);
-  }
-
-  public void notifyChanged(final Notification msg)
-  {
-    class CategoryNotification extends NotificationImpl
-    {
-      protected Object category;
-
-      public CategoryNotification(Object category)
-      {
-        super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
-        this.category = category;
-      }
-
-      public Object getNotifier()
-      {
-        return category;
-      }
-
-      public Object getFeature()
-      {
-        return msg.getFeature();
-      }
-    }
-
-    if (children == null)
-    {
-      getChildren();
-    }
-
-    if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_ReferencingDirectives())
-    {
-      CategoryAdapter adapter = getCategory(CategoryAdapter.DIRECTIVES);
-      Assert.isTrue(adapter != null);
-      XSDSchema xsdSchema = adapter.getXSDSchema();
-      adapter.setChildren(getDirectives(xsdSchema));
-      notifyListeners(new CategoryNotification(adapter), adapter.getText());
-      return;
-    }
-    else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_ElementDeclarations())
-    {
-      CategoryAdapter adapter = getCategory(CategoryAdapter.ELEMENTS);
-      Assert.isTrue(adapter != null);
-      XSDSchema xsdSchema = adapter.getXSDSchema();
-      adapter.setChildren(getGlobalElements(xsdSchema));
-      notifyListeners(new CategoryNotification(adapter), adapter.getText());
-      return;
-    }
-    else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_AttributeDeclarations())
-    {
-      CategoryAdapter adapter = getCategory(CategoryAdapter.ATTRIBUTES);
-      Assert.isTrue(adapter != null);
-      XSDSchema xsdSchema = adapter.getXSDSchema();
-      adapter.setChildren(getAttributeList(xsdSchema));
-      notifyListeners(new CategoryNotification(adapter), adapter.getText());
-      return;
-    }
-    else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_AttributeGroupDefinitions())
-    {
-      CategoryAdapter adapter = getCategory(CategoryAdapter.ATTRIBUTE_GROUPS);
-      Assert.isTrue(adapter != null);
-      XSDSchema xsdSchema = adapter.getXSDSchema();
-      adapter.setChildren(getAttributeGroupList(xsdSchema));
-      notifyListeners(new CategoryNotification(adapter), adapter.getText());
-      return;
-    }
-    else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_TypeDefinitions())
-    {
-      CategoryAdapter adapter = getCategory(CategoryAdapter.TYPES);
-      Assert.isTrue(adapter != null);
-      XSDSchema xsdSchema = adapter.getXSDSchema();
-      List types = getComplexTypes(xsdSchema);
-      types.addAll(getSimpleTypes(xsdSchema));
-
-      adapter.setChildren(types);
-      notifyListeners(new CategoryNotification(adapter), adapter.getText());
-      return;
-    }
-    else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_ModelGroupDefinitions())
-    {
-      CategoryAdapter adapter = getCategory(CategoryAdapter.GROUPS);
-      Assert.isTrue(adapter != null);
-      XSDSchema xsdSchema = adapter.getXSDSchema();
-      adapter.setChildren(getGroups(xsdSchema));
-      notifyListeners(new CategoryNotification(adapter), adapter.getText());
-      return;
-    }
-    else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Annotations())
-    {
-      return;
-    }
-    else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_SchemaLocation())
-    {
-      notifyListeners(msg, null);
-      return;
-    }
-    
-    types = null;
-    getTypes();
-
-    super.notifyChanged(msg);
-  }
-  
-  protected CategoryAdapter getCategory(int category)
-  {
-    int length = children.size();
-    CategoryAdapter adapter = null;
-    for (int i = 0; i < length; i++)
-    {
-      adapter = (CategoryAdapter) children.get(i);
-      if (adapter.getGroupType() ==  category)
-      {
-        break;
-      }
-    }
-    return adapter;
-  }
-
-  protected List getDirectives(XSDSchema schema)
-  {
-    List list = new ArrayList();
-    for (Iterator i = schema.getContents().iterator(); i.hasNext();)
-    {
-      Object o = i.next();
-      if (o instanceof XSDSchemaDirective)
-      {
-        list.add(o);
-      }
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return adapterList;
-  }
-
-  protected List getGlobalElements(XSDSchema schema)
-  {
-    List elements = schema.getElementDeclarations();
-    List list = new ArrayList();
-    for (Iterator i = elements.iterator(); i.hasNext();)
-    {
-      XSDElementDeclaration elem = (XSDElementDeclaration) i.next();
-      if (elem.getRootContainer() == schema)
-      {
-        list.add(elem);
-      }
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return adapterList;
-  }
-
-  /**
-   * @param schema
-   * @return
-   */
-  protected List getComplexTypes(XSDSchema schema)
-  {
-    List allTypes = schema.getTypeDefinitions();
-    List list = new ArrayList();
-    for (Iterator i = allTypes.iterator(); i.hasNext();)
-    {
-      XSDTypeDefinition td = (XSDTypeDefinition) i.next();
-      if (td instanceof XSDComplexTypeDefinition)
-      {
-        XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) td;
-        if (ct.getRootContainer() == schema)
-        {
-          list.add(ct);
-        }
-      }
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return adapterList;
-  }
-
-  protected List getAttributeGroupList(XSDSchema xsdSchema)
-  {
-    List attributeGroupList = new ArrayList();
-    for (Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator(); i.hasNext();)
-    {
-      XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) i.next();
-      if (attrGroup.getRootContainer() == xsdSchema)
-      {
-        attributeGroupList.add(attrGroup);
-      }
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(attributeGroupList, adapterList);
-    return adapterList;
-  }
-
-  protected List getAttributeList(XSDSchema xsdSchema)
-  {
-    List attributesList = new ArrayList();
-    for (Iterator iter = xsdSchema.getAttributeDeclarations().iterator(); iter.hasNext();)
-    {
-      Object o = iter.next();
-      if (o instanceof XSDAttributeDeclaration)
-      {
-        XSDAttributeDeclaration attr = (XSDAttributeDeclaration) o;
-        if (attr != null)
-        {
-          if (attr.getTargetNamespace() != null)
-          {
-            if (!(attr.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema-instance")))
-            {
-              if (attr.getRootContainer() == xsdSchema)
-              {
-                attributesList.add(attr);
-              }
-            }
-          }
-          else
-          {
-            if (attr.getRootContainer() == xsdSchema)
-            {
-              attributesList.add(attr);
-            }
-          }
-        }
-      }
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(attributesList, adapterList);
-    return adapterList;
-  }
-
-  protected List getSimpleTypes(XSDSchema schema)
-  {
-    List allTypes = schema.getTypeDefinitions();
-    List list = new ArrayList();
-    for (Iterator i = allTypes.iterator(); i.hasNext();)
-    {
-      XSDTypeDefinition td = (XSDTypeDefinition) i.next();
-      if (td instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) td;
-        if (st.getRootContainer() == schema)
-        {
-          list.add(st);
-        }
-      }
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return adapterList;
-  }
-
-  protected List getGroups(XSDSchema schema)
-  {
-    List groups = schema.getModelGroupDefinitions();
-    List list = new ArrayList();
-    for (Iterator i = groups.iterator(); i.hasNext();)
-    {
-      XSDModelGroupDefinition group = (XSDModelGroupDefinition) i.next();
-      if (group.getRootContainer() == schema)
-      {
-        list.add(group);
-      }
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return adapterList;
-  }
-  
-  public String[] getActions(Object object)
-  {
-     Collection actionIDs = new ArrayList();
-     actionIDs.add(AddXSDElementAction.ID);
-     actionIDs.add(AddXSDComplexTypeDefinitionAction.ID);
-        
-     return (String [])actionIDs.toArray(new String[0]);
-  }
-
-  public void propertyChanged(Object object, String property)
-  {
-    notifyListeners(object, property);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSchemaDirectiveAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSchemaDirectiveAdapter.java
deleted file mode 100644
index a2a77bf..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSchemaDirectiveAdapter.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDRedefineContent;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDSchemaDirectiveAdapter extends XSDBaseAdapter
-{
-  public Image getImage()
-  {
-    XSDSchemaDirective object = (XSDSchemaDirective) target;
-    if (object instanceof XSDImport)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDImport.gif");
-    }
-    else if (object instanceof XSDInclude)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDInclude.gif");
-    }
-    else if (object instanceof XSDRedefine)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDRedefine.gif");
-    }
-    return null;
-  }
-
-  public String getText()
-  {
-    XSDSchemaDirective directive = (XSDSchemaDirective) target;
-    String result = directive.getSchemaLocation();
-    if (result == null)
-      result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
-    if (result.equals(""))
-      result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
-    return result;
-
-  }
-
-  public ITreeElement[] getChildren()
-  {
-    List list = new ArrayList();
-    if (target instanceof XSDRedefine)
-    {
-      XSDRedefine redefine = (XSDRedefine) target;
-      for (Iterator i = redefine.getContents().iterator(); i.hasNext();)
-      {
-        XSDRedefineContent redefineContent = (XSDRedefineContent) i.next();
-        if (redefineContent instanceof XSDAttributeGroupDefinition)
-        {
-          list.add((XSDAttributeGroupDefinition) redefine);
-        }
-        else if (redefineContent instanceof XSDModelGroupDefinition)
-        {
-          list.add((XSDModelGroupDefinition) redefineContent);
-        }
-        else if (redefineContent instanceof XSDRedefinableComponent)
-        {
-          XSDRedefinableComponent comp = (XSDRedefinableComponent) redefineContent;
-          if (comp instanceof XSDAttributeGroupDefinition)
-          {
-            list.add((XSDAttributeGroupDefinition) comp);
-          }
-          else if (comp instanceof XSDModelGroupDefinition)
-          {
-            list.add((XSDModelGroupDefinition) comp);
-          }
-          else if (comp instanceof XSDComplexTypeDefinition)
-          {
-            list.add((XSDComplexTypeDefinition) comp);
-          }
-          else if (comp instanceof XSDSimpleTypeDefinition)
-          {
-            list.add((XSDSimpleTypeDefinition) comp);
-          }
-        }
-        else if (redefineContent instanceof XSDComplexTypeDefinition)
-        {
-          list.add((XSDComplexTypeDefinition) redefineContent);
-        }
-        else if (redefineContent instanceof XSDSimpleTypeDefinition)
-        {
-          list.add((XSDSimpleTypeDefinition) redefineContent);
-        }
-      }
-
-    }
-    List adapterList = new ArrayList();
-    populateAdapterList(list, adapterList);
-    return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSimpleTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
deleted file mode 100644
index ddc67ee..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSimpleTypeDefinitionAdapter extends XSDTypeDefinitionAdapter implements IType
-{
-  public Image getImage()
-  {
-    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
-
-    if (xsdSimpleTypeDefinition.getContainer() == null)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-
-    if (XSDVariety.LIST_LITERAL == xsdSimpleTypeDefinition.getVariety())
-    {
-      return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_list_obj");
-    }
-    else if (XSDVariety.UNION_LITERAL == xsdSimpleTypeDefinition.getVariety())
-    {
-      return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_union_obj");
-    }
-    else if (XSDVariety.ATOMIC_LITERAL == xsdSimpleTypeDefinition.getVariety())
-    {
-      if (xsdSimpleTypeDefinition.getPrimitiveTypeDefinition() != null)
-      {
-        return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_restrict_obj");
-      }
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-    else if (xsdSimpleTypeDefinition.isSetVariety())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-  }
-  
-  public String getDisplayName()
-  {
-    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
-    return (xsdSimpleTypeDefinition.getName() == null ? "local type" : xsdSimpleTypeDefinition.getName());
-  }
-
-  public String getText()
-  {
-    return getText(true);
-  }
-
-  public String getText(boolean showType)
-  {
-    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
-
-    StringBuffer result = new StringBuffer();
-
-    result.append(xsdSimpleTypeDefinition.getName() == null ? "local type" : xsdSimpleTypeDefinition.getName());
-
-    if (showType)
-    {
-      XSDSimpleTypeDefinition baseTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition();
-      if (baseTypeDefinition != null && XSDVariety.ATOMIC_LITERAL == xsdSimpleTypeDefinition.getVariety())
-      {
-        if (baseTypeDefinition.getName() != null && !xsdSimpleTypeDefinition.getContents().contains(baseTypeDefinition) && !XSDConstants.isAnySimpleType(baseTypeDefinition))
-        {
-          result.append(" : ");
-          result.append(baseTypeDefinition.getQName(xsdSimpleTypeDefinition));
-        }
-      }
-      else
-      {
-        XSDSimpleTypeDefinition itemTypeDefinition = xsdSimpleTypeDefinition.getItemTypeDefinition();
-        if (itemTypeDefinition != null)
-        {
-          if (itemTypeDefinition.getName() != null)
-          {
-            result.append(" : ");
-            result.append(itemTypeDefinition.getQName(xsdSimpleTypeDefinition));
-          }
-        }
-        else
-        {
-          List memberTypeDefinitions = xsdSimpleTypeDefinition.getMemberTypeDefinitions();
-          if (!memberTypeDefinitions.isEmpty())
-          {
-            boolean first = true;
-            for (Iterator members = memberTypeDefinitions.iterator(); members.hasNext();)
-            {
-              XSDSimpleTypeDefinition memberTypeDefinition = (XSDSimpleTypeDefinition) members.next();
-              if (memberTypeDefinition.getName() != null)
-              {
-                if (first)
-                {
-                  result.append(" : ");
-                  first = false;
-                }
-                else
-                {
-                  result.append(" | ");
-                }
-                result.append(memberTypeDefinition.getQName(xsdSimpleTypeDefinition));
-              }
-              else
-              {
-                break;
-              }
-            }
-          }
-          else if (result.length() == 0)
-          {
-            result.append("'absent'");
-          }
-        }
-      }
-    }
-
-    return result.toString();
-  }
-
-  public boolean hasChildren()
-  {
-    return false;
-  }
-  
-  public boolean isComplexType()
-  {
-    return false;
-  }
-
-  public boolean isFocusAllowed()
-  {
-    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
-    if (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
-    {
-      return false;
-    }
-    if (xsdSimpleTypeDefinition.getName() == null)
-    {
-      return false;
-    }
-    return true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDTypeDefinitionAdapter.java
deleted file mode 100644
index 74ece93..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public abstract class XSDTypeDefinitionAdapter extends XSDBaseAdapter implements IType
-{
-  public XSDTypeDefinition getXSDTypeDefinition()
-  {
-    return (XSDTypeDefinition)target;
-  }
-
-  public String getName()
-  {
-    if (getXSDTypeDefinition().eContainer() instanceof XSDSchema)
-    {  
-      return getXSDTypeDefinition().getName();
-    }
-    else 
-    {
-      EObject o = getXSDTypeDefinition().eContainer();
-      if (o instanceof XSDNamedComponent)
-      {
-         XSDNamedComponent ed = (XSDNamedComponent)o;
-         return "(" + ed.getName() + "Type)";               
-      }
-    }
-    return null;
-  }
-
-  public String getQualifier()
-  {
-    return getXSDTypeDefinition().getTargetNamespace();
-  }
-
-  public IType getSuperType()
-  {
-    XSDTypeDefinition td = getXSDTypeDefinition().getBaseType();
-    return td != null ? (IType)XSDAdapterFactory.getInstance().adapt(td) : null;
-  }
-
-  public Command getUpdateNameCommand(String newName)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public boolean isComplexType()
-  {
-    return false;
-  }    
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDVisitor.java
deleted file mode 100644
index 208d8b7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDVisitor.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
-  public XSDVisitor()
-  {
-  }
-  
-  protected XSDSchema schema;
-  
-  public void visitSchema(XSDSchema schema)
-  {
-    this.schema = schema;
-    for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
-      visitAttributeDeclaration(attr);
-    }
-    for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
-      visitTypeDefinition(type);
-    }
-    for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
-      visitElementDeclaration(element);
-    }
-    for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
-      visitIdentityConstraintDefinition(identityConstraint);
-    }
-    for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
-      visitModelGroupDefinition(modelGroup);
-    }
-    for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
-      visitAttributeGroupDefinition(attributeGroup);
-    }
-    for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
-      visitNotationDeclaration(element);
-    }
-    
-  }
-  
-  public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
-  {
-  }
-  
-  public void visitTypeDefinition(XSDTypeDefinition type)
-  {
-    if (type instanceof XSDSimpleTypeDefinition)
-    {
-      visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
-    }
-    else if (type instanceof XSDComplexTypeDefinition)
-    {
-      visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
-    }
-  }
-  
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (element.isElementDeclarationReference())
-    {
-      visitElementDeclaration(element.getResolvedElementDeclaration());
-    }
-    else if (element.getAnonymousTypeDefinition() != null)
-    {
-      visitTypeDefinition(element.getAnonymousTypeDefinition());
-    }
-  }
-  
-  public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
-  {
-  }
-  
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
-  {
-    if (!modelGroupDef.isModelGroupDefinitionReference())
-    {
-      if (modelGroupDef.getModelGroup() != null)
-      {
-        visitModelGroup(modelGroupDef.getModelGroup());
-      }
-    }
-    else
-    {
-      XSDModelGroup modelGroup = modelGroupDef.getResolvedModelGroupDefinition().getModelGroup();
-      if (modelGroup != null)
-      {
-        visitModelGroup(modelGroup);
-      }
-    }
-  }
-
-  public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-  {
-    for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
-    {
-      Object o = it.next();
-      if (o instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse attrUse = (XSDAttributeUse)o;
-        visitAttributeDeclaration(attrUse.getContent());
-      }
-      else if (o instanceof XSDAttributeGroupDefinition)
-      {
-        XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
-        visitAttributeGroupDefinition(attrGroup.getResolvedAttributeGroupDefinition());
-      }
-    }
-  }
-  
-  public void visitNotationDeclaration(XSDNotationDeclaration notation)
-  {
-  }
-  
-  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-  {
-  }
-  
-  public void visitComplexTypeContent(XSDSimpleTypeDefinition content)
-  {
-    
-  }
-  
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    if (type.getContent() != null)
-    {
-      XSDComplexTypeContent complexContent = type.getContent();
-      if (complexContent instanceof XSDSimpleTypeDefinition)
-      {
-        visitComplexTypeContent((XSDSimpleTypeDefinition)complexContent);
-      }
-      else if (complexContent instanceof XSDParticle)
-      {
-        visitParticle((XSDParticle) complexContent);
-      }
-    }
-  }
-  
-  public void visitParticle(XSDParticle particle)
-  {
-    visitParticleContent(particle.getContent());
-  }
-  
-  public void visitParticleContent(XSDParticleContent particleContent)
-  {
-    if (particleContent instanceof XSDModelGroupDefinition)
-    {
-      visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
-    }
-    else if (particleContent instanceof XSDModelGroup)
-    {
-      visitModelGroup((XSDModelGroup)particleContent);
-    }
-    else if (particleContent instanceof XSDElementDeclaration)
-    {
-      visitElementDeclaration((XSDElementDeclaration)particleContent);
-    }
-    else if (particleContent instanceof XSDWildcard)
-    {
-      visitWildcard((XSDWildcard)particleContent);
-    }
-  }
-  
-  public void visitModelGroup(XSDModelGroup modelGroup)
-  {
-    if (modelGroup.getContents() != null)
-    {
-      for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
-      {
-        XSDParticle particle = (XSDParticle) iterator.next();
-        visitParticle(particle);
-      }
-    }
-  }
-  
-  public void visitWildcard(XSDWildcard wildcard)
-  {
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDVisitorForFields.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDVisitorForFields.java
deleted file mode 100644
index 59b236d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDVisitorForFields.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- * 
- */
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDVisitorForFields extends XSDVisitor
-{
-  public XSDVisitorForFields()
-  {
-  }
-
-  public List concreteComponentList = new ArrayList();
-  public List thingsWeNeedToListenTo = new ArrayList();
-  
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
-          
-          visitAttributeDeclaration(attrUse.getContent());
-
-//          if (attrUse.getAttributeDeclaration() != attrUse.getContent())
-//          {
-//            visitAttributeDeclaration(attrUse.getContent());
-//          }
-//          else
-//          {
-//            thingsWeNeedToListenTo.add(attrUse.getAttributeDeclaration());
-//            concreteComponentList.add(attrUse.getAttributeDeclaration());
-//          }
-        }
-        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)attrGroupContent;
-          thingsWeNeedToListenTo.add(attrGroup);
-          if (attrGroup.isAttributeGroupDefinitionReference())
-          {
-            attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
-            visitAttributeGroupDefinition(attrGroup);
-          }
-        }
-      }
-    }   
-    super.visitComplexTypeDefinition(type);
-  }
-  
-  public void visitComplexTypeContent(XSDSimpleTypeDefinition content)
-  {
-    thingsWeNeedToListenTo.add(content);
-    
-    super.visitComplexTypeContent(content);   
-  }
-
-  
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
-  {
-    if (modelGroupDef.isModelGroupDefinitionReference())
-    {
-      // if it's a reference we need to listen to the reference incase it changes
-      thingsWeNeedToListenTo.add(modelGroupDef);      
-    }    
-    // listen to definition incase it changes
-    XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
-    thingsWeNeedToListenTo.add(resolvedModelGroupDef);
-    super.visitModelGroupDefinition(modelGroupDef);      
-  }
-  
-  public void visitModelGroup(XSDModelGroup modelGroup)
-  {
-    super.visitModelGroup(modelGroup);
-    thingsWeNeedToListenTo.add(modelGroup); 
-  }
-  
-  public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-  {
-    for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
-    {
-      Object o = it.next();
-      if (o instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse attributeUse = (XSDAttributeUse)o;
-        concreteComponentList.add(attributeUse.getAttributeDeclaration());
-        thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration());
-      }
-      else if (o instanceof XSDAttributeGroupDefinition)
-      {
-        XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
-        thingsWeNeedToListenTo.add(attrGroup);
-        if (attrGroup.isAttributeGroupDefinitionReference())
-        {
-          attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
-          visitAttributeGroupDefinition(attrGroup);
-        }
-      }
-    }
-  }
-  
-  public void visitParticle(XSDParticle particle)
-  {
-    thingsWeNeedToListenTo.add(particle);
-    super.visitParticle(particle);
-  }
-
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (element.isElementDeclarationReference())
-    {
-      thingsWeNeedToListenTo.add(element);
-      thingsWeNeedToListenTo.add(element.getResolvedElementDeclaration());
-      // now, add the reference as a field
-      concreteComponentList.add(element);
-    }
-    else
-    {
-      concreteComponentList.add(element.getResolvedElementDeclaration());
-      // note... we intentionally ommit the call to super.visitElementDeclaration()
-      // since we don't want to delve down deeper than the element      
-    }
-  }
-  
-  public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
-  {
-    if (attr.isAttributeDeclarationReference())
-    {
-      thingsWeNeedToListenTo.add(attr);
-      thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration());
-      concreteComponentList.add(attr);
-    }
-    else
-    {
-      concreteComponentList.add(attr.getResolvedAttributeDeclaration());
-      thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration());
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDWildcardAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDWildcardAdapter.java
deleted file mode 100644
index 1ab8da8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/adapters/XSDWildcardAdapter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.adapters;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDWildcardAdapter extends XSDBaseAdapter
-{
-
-  public XSDWildcardAdapter()
-  {
-
-  }
-
-  public Image getImage()
-  {
-    XSDWildcard xsdWildcard = (XSDWildcard) target;
-    return XSDEditorPlugin.getXSDImage(xsdWildcard.eContainer() instanceof XSDParticle ? "icons/XSDAny.gif" : "icons/XSDAnyAttribute.gif");
-  }
-
-  public String getText()
-  {
-    XSDWildcard xsdWildcard = (XSDWildcard) target;
-
-    StringBuffer result = new StringBuffer();
-    Element element = xsdWildcard.getElement();
-
-    if (element != null)
-    {
-      result.append(element.getNodeName());
-      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
-      if (hasMinOccurs || hasMaxOccurs)
-      {
-        result.append(" ["); //$NON-NLS-1$
-        if (hasMinOccurs)
-        {
-
-          int min = ((XSDParticle) xsdWildcard.getContainer()).getMinOccurs();
-          if (min == XSDParticle.UNBOUNDED)
-          {
-            result.append("*");
-          }
-          else
-          {
-            result.append(String.valueOf(min));
-          }
-        }
-        else
-        // print default
-        {
-          int min = ((XSDParticle) xsdWildcard.getContainer()).getMinOccurs();
-          result.append(String.valueOf(min));
-        }
-        if (hasMaxOccurs)
-        {
-          int max = ((XSDParticle) xsdWildcard.getContainer()).getMaxOccurs();
-          result.append("..");
-          if (max == XSDParticle.UNBOUNDED)
-          {
-            result.append("*");
-          }
-          else
-          {
-            result.append(String.valueOf(max));
-          }
-        }
-        else
-        // print default
-        {
-          result.append("..");
-          int max = ((XSDParticle) xsdWildcard.getContainer()).getMaxOccurs();
-          result.append(String.valueOf(max));
-        }
-        result.append("]");
-      }
-    }
-    return result.toString();
-
-  }
-
-  public boolean hasChildren()
-  {
-    return false;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDWildcard xsdWildcard = (XSDWildcard) target;
-    return xsdWildcard.getContainer();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/commands/DragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/commands/DragAndDropCommand.java
deleted file mode 100644
index 9ae66fc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/commands/DragAndDropCommand.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.CompartmentEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.ComplexTypeEditPart;
-import org.eclipse.wst.xsd.editor.internal.actions.MoveAction;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.ModelGroupDefinitionReferenceEditPart;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.ModelGroupEditPart;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.TargetConnectionSpacingFigureEditPart;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.XSDGroupsForAnnotationEditPart;
-import org.eclipse.wst.xsd.editor.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.ui.common.commands.BaseCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroup;
-
-
-public class DragAndDropCommand extends BaseCommand
-{ 
-  protected EditPartViewer viewer;    
-  protected ChangeBoundsRequest request;
-  protected BaseFieldEditPart previousChildRefEditPart, nextChildRefEditPart;    
-  public ModelGroupEditPart parentEditPart; 
-  public Point location;
-  protected MoveAction action;    
-  protected boolean canExecute;
-  EditPart target;
-  List modelGroupsList = new ArrayList();
-  List targetSpacesList = new ArrayList();
-
-  public DragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request)
-  {
-    this.viewer = viewer;                    
-    this.request = request;
-
-    location = request.getLocation();
-    target = viewer.findObjectAt(location); 
-    if (viewer instanceof ScrollingGraphicalViewer)
-    {  
-      ScrollingGraphicalViewer sgv = (ScrollingGraphicalViewer)viewer;
-      Point p = ((FigureCanvas)sgv.getControl()).getViewport().getViewLocation();
-      location.y += p.y;
-      location.x += p.x;
-    }
-     
-    List list = request.getEditParts();
-    if (list.size() > 0 && target instanceof BaseFieldEditPart)
-    {
-      BaseFieldEditPart baseFieldEditPart = (BaseFieldEditPart)target;
-      XSDModelGroup targetModelGroup = null;
-      modelGroupsList.clear();
-      targetSpacesList.clear();
-      calculateModelGroupList();
-
-      List modelGroups = new ArrayList(modelGroupsList.size());
-      for (Iterator i = modelGroupsList.iterator(); i.hasNext(); )
-      {
-        ModelGroupEditPart editPart = (ModelGroupEditPart)i.next();
-        modelGroups.add(editPart.getXSDModelGroup());
-      }
-      
-      EditPart compartment = baseFieldEditPart.getParent();
-      parentEditPart = null;
-      if (compartment != null)
-      {
-        List l = compartment.getChildren();
-        Rectangle rectangle = new Rectangle(0, 0, 0, 0), previousRectangle = new Rectangle(0,0,0,0);
-        int index = -1;
-        BaseFieldEditPart childGraphNodeEditPart = null;
-        for (Iterator i = l.iterator(); i.hasNext(); )
-        {
-          EditPart child = (EditPart)i.next();
-          if (child instanceof BaseFieldEditPart)
-          {
-            index ++;
-            previousChildRefEditPart = childGraphNodeEditPart;
-            childGraphNodeEditPart = (BaseFieldEditPart)child;
-            if (previousChildRefEditPart != null)
-            {
-              previousRectangle = previousChildRefEditPart.getFigure().getBounds();
-            }
-            rectangle = childGraphNodeEditPart.getFigure().getBounds();
-            
-            if (location.y < (rectangle.getCenter().y))
-            {
-              nextChildRefEditPart = childGraphNodeEditPart;
-              TargetConnectionSpacingFigureEditPart tSpace = (TargetConnectionSpacingFigureEditPart)targetSpacesList.get(index-1);
-              if (previousRectangle != null && location.y > (previousRectangle.getBottom().y))
-              {
-            	  tSpace = (TargetConnectionSpacingFigureEditPart)targetSpacesList.get(index);
-              }
-              parentEditPart = (ModelGroupEditPart)tSpace.getParent();
-              targetModelGroup = parentEditPart.getXSDModelGroup();
-              break;
-            }            
-            
-//            if (location.y < (rectangle.getCenter().y))
-//            {
-//                nextChildRefEditPart = childGraphNodeEditPart;
-//                TargetConnectionSpacingFigureEditPart previousSpace = null;
-//	           	for (Iterator s = targetSpacesList.iterator(); s.hasNext(); )
-//	        	{
-//	        	  TargetConnectionSpacingFigureEditPart tSpace = (TargetConnectionSpacingFigureEditPart) s.next();
-//	              Rectangle tRect = tSpace.getFigure().getBounds();
-//	              if (location.y < (tRect.getCenter().y + tRect.height/2))
-//	              {
-//	            	parentEditPart = (ModelGroupEditPart)tSpace.getParent();
-//	            	targetModelGroup = parentEditPart.getXSDModelGroup();
-//	            	break;
-//	              }
-//	        	  previousSpace = tSpace;
-//	        	}
-//	           	if (parentEditPart != null)
-//	           		break;
-//            }
-          }
-          else
-          {
-        	  // This is the annotation edit part
-          }
-        } 
-           
-        List editPartsList = request.getEditParts();
-        List concreteComponentList = new ArrayList(editPartsList.size());
-        for (Iterator i = editPartsList.iterator(); i.hasNext(); )
-        {                                                       
-          EditPart editPart = (EditPart)i.next();
-          concreteComponentList.add((XSDConcreteComponent) ((XSDBaseAdapter)editPart.getModel()).getTarget());
-        }
-        XSDConcreteComponent previousRefComponent = null, nextRefComponent = null;
-        if (nextChildRefEditPart != null)
-        {
-          if (nextChildRefEditPart.getModel() instanceof XSDBaseAdapter)
-          {
-            nextRefComponent = (XSDConcreteComponent)((XSDBaseAdapter)nextChildRefEditPart.getModel()).getTarget();
-          }
-        }
-        if (previousChildRefEditPart != null)
-        {
-          if (previousChildRefEditPart.getModel() instanceof XSDBaseAdapter)
-          {
-        	previousRefComponent = (XSDConcreteComponent)((XSDBaseAdapter)previousChildRefEditPart.getModel()).getTarget();
-          }
-        }
-//        System.out.println(previousRefComponent + "\n   " + nextRefComponent);
-        action = new MoveAction(targetModelGroup, concreteComponentList, previousRefComponent, nextRefComponent);
-        canExecute = action.canMove();
-      }            
-    }     
-  }
-             
-  protected void calculateModelGroupList()
-  {
-    EditPart editPart = target;
-    while (editPart != null)
-    {                     
-      if (editPart instanceof ModelGroupEditPart)
-      {
-        ModelGroupEditPart modelGroupEditPart = (ModelGroupEditPart)editPart;
-        modelGroupsList.addAll(getModelGroupEditParts(modelGroupEditPart));
-      }
-      else if (editPart instanceof ComplexTypeEditPart ||
-               editPart instanceof ModelGroupDefinitionReferenceEditPart)
-      {
-        List list = editPart.getChildren();
-        for (Iterator i = list.iterator(); i.hasNext(); )
-        {
-          Object child = i.next();
-          if (child instanceof CompartmentEditPart)
-          {
-            List compartmentList = ((CompartmentEditPart)child).getChildren();
-            for (Iterator it = compartmentList.iterator(); it.hasNext(); )
-            {
-              Object obj = it.next();
-              if (obj instanceof XSDGroupsForAnnotationEditPart)
-              {
-                XSDGroupsForAnnotationEditPart groups = (XSDGroupsForAnnotationEditPart)obj;
-                List groupList = groups.getChildren();
-                for (Iterator iter = groupList.iterator(); iter.hasNext(); )
-                {
-                  Object groupChild = iter.next();
-                  if (groupChild instanceof ModelGroupEditPart)
-                  {
-                    ModelGroupEditPart modelGroupEditPart = (ModelGroupEditPart)groupChild;
-                    modelGroupsList.add(modelGroupEditPart);
-                    modelGroupsList.addAll(getModelGroupEditParts(modelGroupEditPart));
-                  }
-                }
-              }
-            }
-          }
-        }   
-      }
-      editPart = editPart.getParent();
-    }
-  }
-  
-  protected List getModelGroupEditParts(ModelGroupEditPart modelGroupEditPart)
-  {
-	List modelGroupList = new ArrayList();
-    List list = modelGroupEditPart.getChildren();
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      Object object = i.next();
-      if (object instanceof TargetConnectionSpacingFigureEditPart)
-      {
-    	targetSpacesList.add(object);
-      }
-      else if (object instanceof ModelGroupDefinitionReferenceEditPart)
-      {
-    	  ModelGroupDefinitionReferenceEditPart groupRef = (ModelGroupDefinitionReferenceEditPart)object;
-    	  List groupRefChildren = groupRef.getChildren();
-    	  for (Iterator it = groupRefChildren.iterator(); it.hasNext(); )
-    	  {
-    		 Object o = it.next();
-    		 if (o instanceof ModelGroupEditPart)
-    		 {
-   		    	ModelGroupEditPart aGroup = (ModelGroupEditPart)o;
-   		        modelGroupList.add(aGroup);
-   		        modelGroupList.addAll(getModelGroupEditParts(aGroup));
-    		 }
-    	  }
-      }
-      else if (object instanceof ModelGroupEditPart)
-      {
-    	ModelGroupEditPart aGroup = (ModelGroupEditPart)object;
-        modelGroupList.add(aGroup);
-        modelGroupList.addAll(getModelGroupEditParts(aGroup));
-      }
-    }   
-    return modelGroupList;
-  }
-  
-
-  public void execute()
-  {           
-    if (canExecute)
-    { 
-      action.run(); 
-    }
-  }     
-  
-  public void redo()
-  {
-
-  }  
-  
-  public void undo()
-  {
-  }     
-  
-  public boolean canExecute()
-  { 
-    return canExecute;
-  } 
-
-  public PointList getConnectionPoints(Rectangle draggedFigureBounds)
-  {             
-    PointList pointList = null;      
-    if (parentEditPart != null && nextChildRefEditPart != null)
-    {                                
-      pointList = getConnectionPoints(parentEditPart, nextChildRefEditPart, draggedFigureBounds);      
-    }               
-    return pointList != null ? pointList : new PointList();
-  }
-  
-  // This method supports the preview connection line function related to drag and drop
-  //     
-  public PointList getConnectionPoints(ModelGroupEditPart parentEditPart, BaseFieldEditPart childRefEditPart, Rectangle draggedFigureBounds)
-  {           
-    PointList pointList = new PointList();                         
-    int[] data = new int[1];
-    Point a = getConnectionPoint(parentEditPart, childRefEditPart, data);
-    if (a != null)
-    {   
-      int draggedFigureBoundsY = draggedFigureBounds.y + draggedFigureBounds.height/2;
-
-      pointList.addPoint(a); 
-      
-      if (data[0] == 0) // insert between 2 items
-      {                                         
-        int x = a.x + (draggedFigureBounds.x - a.x)/2;
-        pointList.addPoint(new Point(x, a.y));
-        pointList.addPoint(new Point(x, draggedFigureBoundsY));        
-        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-      }
-      else // insert at first or last position
-      {
-        pointList.addPoint(new Point(a.x, draggedFigureBoundsY));   
-        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-      }
-    }       
-    return pointList;
-  }
-
-  // This method supports the preview connection line function related to drag and drop
-  //     
-  protected Point getConnectionPoint(ModelGroupEditPart parentEditPart, BaseFieldEditPart childRefEditPart, int[] data)
-  {                      
-    Point point = null;     
-    List childList = parentEditPart.getChildren();         
-                                                                                                                                               
-    if (parentEditPart.getFigure() instanceof GenericGroupFigure && childList.size() > 0)
-    {   
-      point = new Point();
-
-      Rectangle r = getConnectedEditPartConnectionBounds(parentEditPart);  
-      point.x = r.x + r.width;
-      point.y = r.y + r.height/2;
-    }    
-    return point;
-  }
-
-  protected Rectangle getConnectedEditPartConnectionBounds(ModelGroupEditPart editPart)
-  {
-	return ((GenericGroupFigure)editPart.getFigure()).getIconFigure().getBounds();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/AttributeGroupDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/AttributeGroupDefinitionEditPart.java
deleted file mode 100644
index 3c48693..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/AttributeGroupDefinitionEditPart.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.editor.internal.design.figures.GenericGroupFigure;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-
-public class AttributeGroupDefinitionEditPart extends ConnectableEditPart
-{
-  public static final Image ATTRIBUTE_GROUP_REF_ICON_IMAGE = XSDEditorPlugin.getImageDescriptor("obj16/attributeGroupRef.gif", true).createImage();
-
-  public AttributeGroupDefinitionEditPart()
-  {
-    super();
-  }
-
-  public XSDAttributeGroupDefinition getXSDAttributeGroupDefinition()
-  {
-    if (getModel() instanceof XSDAttributeGroupDefinitionAdapter)
-    {
-      XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter) getModel();
-      return (XSDAttributeGroupDefinition) adapter.getTarget();
-    }
-//    else if (getModel() instanceof XSDAttributeGroupDefinition)
-//    {
-//      return (XSDAttributeGroupDefinition) getModel();
-//    }
-    return null;
-
-  }
-
-  protected IFigure createFigure()
-  {
-    GenericGroupFigure figure = new GenericGroupFigure();
-    figure.getIconFigure().image = ATTRIBUTE_GROUP_REF_ICON_IMAGE;
-    return figure;
-  }
-
-  protected List getModelChildren()
-  {
-    List list = new ArrayList();
-    
-    XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter)getModel();
-    XSDAttributeGroupDefinition attributeGroupDefinition = adapter.getXSDAttributeGroupDefinition();
-    Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator();
-
-    while (i.hasNext())
-    {
-      XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next();
-
-      if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-      {
-        list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent));
-      }
-      else
-      {
-        list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel()));
-      }
-    }
-    
-    if (list.isEmpty())
-    {
-      list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel()));
-    }
-
-    return list;
-  }
-
-
-  public ReferenceConnection createConnectionFigure(BaseEditPart child)
-  {
-    ReferenceConnection connectionFigure = new ReferenceConnection();
-
-    connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure)getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
-
-    if (child instanceof AttributeGroupDefinitionEditPart)
-    {
-      connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((AttributeGroupDefinitionEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
-    }
-    else if (child instanceof TargetConnectionSpacingFigureEditPart)
-    {
-      TargetConnectionSpacingFigureEditPart elem = (TargetConnectionSpacingFigureEditPart) child;
-      connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((TargetConnectionSpacingFigureEditPart) child).getFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
-    }
-
-    connectionFigure.setHighlight(false);
-    return connectionFigure;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ConnectableEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ConnectableEditPart.java
deleted file mode 100644
index 9d9acf1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ConnectableEditPart.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.editor.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.editor.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public abstract class ConnectableEditPart extends BaseEditPart
-{
-  protected ArrayList connectionFigures = new ArrayList();
-  
-  public IExtendedFigureFactory getExtendedFigureFactory()
-  {
-    EditPartFactory factory = getViewer().getEditPartFactory();
-    Assert.isTrue(factory instanceof IExtendedFigureFactory, "EditPartFactory must be an instanceof of IExtendedFigureFactory");    
-    return (IExtendedFigureFactory)factory; 
-  }
-  
-  public ConnectableEditPart()
-  {
-    super();
-  }
-  
-  protected IFigure createFigure()
-  {
-    GenericGroupFigure figure = new GenericGroupFigure();
-    return figure;
-  }
-
-  public XSDConcreteComponent getXSDConcreteComponent()
-  {
-    return (XSDConcreteComponent)((XSDBaseAdapter)getModel()).getTarget();
-  }
-  
-  public List getConnectionFigures()
-  {
-    return connectionFigures;
-  }
-  
-  public abstract ReferenceConnection createConnectionFigure(BaseEditPart child);
-  
-  public void activate()
-  {
-    super.activate();
-    activateConnection();
-  }
-
-  protected void activateConnection()
-  {
-    if (connectionFigures == null)
-    {
-      connectionFigures = new ArrayList();
-    }
-    for (Iterator i = getChildren().iterator(); i.hasNext();)
-    {
-      Object o = i.next();
-      if (o instanceof BaseEditPart)
-      {
-        BaseEditPart g = (BaseEditPart) o;
-        ReferenceConnection figure = createConnectionFigure(g);
-        connectionFigures.add(figure);
-        figure.setPoints(figure.getPoints());
-
-        getLayer(LayerConstants.CONNECTION_LAYER).add(figure);
-      }
-    }
-  }
-  
-  public void deactivate()
-  {
-    super.deactivate();
-    deactivateConnection();
-  }
-
-  protected void deactivateConnection()
-  {
-    // if we have a connection, remove it
-    ReferenceConnection connectionFigure;
-    if (connectionFigures != null && !connectionFigures.isEmpty())
-    {
-      for (Iterator i = connectionFigures.iterator(); i.hasNext();)
-      {
-        connectionFigure = (ReferenceConnection) i.next();
-
-        if (getLayer(LayerConstants.CONNECTION_LAYER).getChildren().contains(connectionFigure))
-        {
-          getLayer(LayerConstants.CONNECTION_LAYER).remove(connectionFigure);
-        }
-      }
-      connectionFigures = null;
-    }
-  }
-
-  public void refresh()
-  {
-    super.refresh();
-    refreshConnection();
-  }
-
-  protected void refreshConnection()
-  {
-    if (!isActive())
-      return;
-
-    if (connectionFigures == null || connectionFigures.isEmpty())
-    {
-      activateConnection();
-    }
-    else
-    {
-      deactivateConnection();
-      activateConnection();
-    }
-  }
-  
-  RectangleFigure selectionFeedbackFigure;
-  public void addFeedback()
-  {
-    ReferenceConnection connectionFigure;
-    if (connectionFigures != null && !connectionFigures.isEmpty())
-    {
-      for (Iterator i = connectionFigures.iterator(); i.hasNext();)
-      {
-        connectionFigure = (ReferenceConnection) i.next();
-        connectionFigure.setHighlight(true);
-      }
-    }
-    GenericGroupFigure figure = (GenericGroupFigure)getFigure();
-    Rectangle r = figure.getIconFigure().getBounds();
-    Rectangle zoomedRect = getZoomedBounds(r);
-    selectionFeedbackFigure = new RectangleFigure();
-    selectionFeedbackFigure.setForegroundColor(ColorConstants.blue);
-    selectionFeedbackFigure.setBounds(zoomedRect);
-    selectionFeedbackFigure.setFill(false);
-    selectionFeedbackFigure.setOpaque(true);
-    selectionFeedbackFigure.setLineWidth(1);
-    getLayer(LayerConstants.FEEDBACK_LAYER).add(selectionFeedbackFigure);
-  }
-  
-  public void removeFeedback()
-  {
-    ReferenceConnection connectionFigure;
-    if (connectionFigures != null && !connectionFigures.isEmpty())
-    {
-      for (Iterator i = connectionFigures.iterator(); i.hasNext();)
-      {
-        connectionFigure = (ReferenceConnection) i.next();
-        connectionFigure.setHighlight(false);
-      }
-    }
-    if (selectionFeedbackFigure != null)
-    {
-      getLayer(LayerConstants.FEEDBACK_LAYER).remove(selectionFeedbackFigure);
-    }
-    selectionFeedbackFigure = null;
-  }
-  
-  protected void refreshVisuals()
-  {
-    super.refreshVisuals();
-    if (selectionFeedbackFigure != null)
-    {
-      GenericGroupFigure figure = (GenericGroupFigure)getFigure();
-      Rectangle r = figure.getIconFigure().getBounds();
-      Rectangle zoomedRect = getZoomedBounds(r);
-      selectionFeedbackFigure.setBounds(zoomedRect);
-      selectionFeedbackFigure.repaint();
-      selectionFeedbackFigure.revalidate();
-    }
-  }
-
-  protected void createEditPolicies()
-  {
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
-  }
-
-  protected void addChildVisual(EditPart childEditPart, int index)
-  {
-    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
-    getContentPane().add(child, index);
-  }
-
-  protected void removeChildVisual(EditPart childEditPart)
-  {
-    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
-    getContentPane().remove(child);
-  }
-  
-  public IFigure getContentPane()
-  {
-    return ((GenericGroupFigure)getFigure()).getContentFigure();
-  }
-
-  public Figure getTargetFigure()
-  {
-    return ((GenericGroupFigure)getFigure()).getTargetFigure();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
deleted file mode 100644
index 33c4989..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.editor.internal.design.figures.GenericGroupFigure;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class ModelGroupDefinitionReferenceEditPart extends ConnectableEditPart
-{
-  public static final Image image = XSDEditorPlugin.getImageDescriptor("XSDGroupRef.gif", true).createImage();
-
-  public ModelGroupDefinitionReferenceEditPart()
-  {
-    super();
-  }
-
-  protected IFigure createFigure()
-  {
-    GenericGroupFigure figure = new GenericGroupFigure();
-    figure.getIconFigure().image = image;
-    return figure;
-  }
-
-  protected List getModelChildren()
-  {
-    List list = new ArrayList();
-
-    XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter)getModel();
-    XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) adapter.getTarget()).getResolvedModelGroupDefinition().getModelGroup();
-    if (xsdModelGroup != null)
-      list.add(XSDAdapterFactory.getInstance().adapt(xsdModelGroup));
-    return list;
-  }
-
-  public ReferenceConnection createConnectionFigure(BaseEditPart child)
-  {
-    ReferenceConnection connectionFigure = new ReferenceConnection();
-
-    connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure)getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
-
-    if (child instanceof ModelGroupEditPart)
-    {
-      connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((ModelGroupEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
-    }
-    connectionFigure.setHighlight(false);
-    return connectionFigure;
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ModelGroupEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ModelGroupEditPart.java
deleted file mode 100644
index d0d299e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ModelGroupEditPart.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDModelGroupAdapter;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.editor.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.editor.internal.design.figures.ModelGroupFigure;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-
-public class ModelGroupEditPart extends ConnectableEditPart
-{
-  protected IFigure createFigure()
-  {
-    return getExtendedFigureFactory().createModelGroupFigure(getModel());
-  }
-  
-  public XSDParticle getXSDParticle()
-  {
-    Object o = getXSDModelGroup().getContainer();
-    return (o instanceof XSDParticle) ? (XSDParticle) o : null;
-  }
-
-  public XSDModelGroup getXSDModelGroup()
-  {
-    if (getModel() instanceof XSDModelGroupAdapter)
-    {
-      XSDModelGroupAdapter adapter = (XSDModelGroupAdapter) getModel();
-      return (XSDModelGroup) adapter.getTarget();
-    }
-//    else if (getModel() instanceof XSDModelGroup)
-//    {
-//      return (XSDModelGroup) getModel();
-//    }
-    return null;
-
-  }
-
-  
-  
-  protected void refreshVisuals()
-  {
-    String iconName = "icons/newSequence.gif";
-    GenericGroupFigure modelGroupFigure = (GenericGroupFigure)getFigure();
-    switch (getXSDModelGroup().getCompositor().getValue())
-    {
-      case XSDCompositor.ALL:
-      {
-        modelGroupFigure.getIconFigure().image = ModelGroupFigure.ALL_ICON_IMAGE;
-        break;
-      }
-      case XSDCompositor.CHOICE:
-      {
-        modelGroupFigure.getIconFigure().image = ModelGroupFigure.CHOICE_ICON_IMAGE;
-        break;
-      }
-      case XSDCompositor.SEQUENCE:
-      {
-        modelGroupFigure.getIconFigure().image = ModelGroupFigure.SEQUENCE_ICON_IMAGE;
-        break;
-      }
-    }
-
-    XSDModelGroupAdapter adapter = (XSDModelGroupAdapter) getModel();
-//    String occurenceDescription = adapter.getNameAnnotationToolTipString();
-//    modelGroupFigure.getIconFigure().setToolTip(occurenceDescription);
-
-    // TODO: commmon this up with XSDParticleAdapter's code
-    
-    // -2 means the user didn't specify (so the default is 1)
-    int minOccurs = adapter.getMinOccurs();
-    int maxOccurs = adapter.getMaxOccurs();
-    String occurenceDescription = "";
-    
-    if (minOccurs == -3 && maxOccurs == -3)
-    {
-      occurenceDescription = "";
-    }
-    else if (minOccurs == 0 && (maxOccurs == -2 || maxOccurs == 1))
-    {
-      occurenceDescription = "[0..1]";
-    }
-    else if ((minOccurs == 1 && maxOccurs == 1) ||
-             (minOccurs == -2 && maxOccurs == 1) ||
-             (minOccurs == 1 && maxOccurs == -2))
-    {
-      occurenceDescription = "[1..1]";
-    }
-    else if (minOccurs == -2 && maxOccurs == -2)
-    {
-      occurenceDescription = "";
-    }
-    else
-    {
-      if (maxOccurs == -2) maxOccurs = 1;
-      String maxSymbol = maxOccurs == -1 ? "*" : "" + maxOccurs;
-      
-      String minSymbol = minOccurs == -2 ? "1" : "" + minOccurs;
-      occurenceDescription = "[" + minSymbol + ".." + maxSymbol + "]";
-    }
-
-    modelGroupFigure.getIconFigure().setToolTipText(occurenceDescription);
-    modelGroupFigure.getIconFigure().repaint();
-
-    refreshConnection();
-  }
-
-  protected List getModelChildren()
-  {
-    List list = new ArrayList();
-    XSDModelGroup xsdModelGroup = getXSDModelGroup();
-    for (Iterator i = xsdModelGroup.getContents().iterator(); i.hasNext();)
-    {
-      XSDParticle next = (XSDParticle) i.next();
-      if (next.getContent() instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) next.getContent();
-        Adapter adapter = XSDAdapterFactory.getInstance().adapt(elementDeclaration);
-        list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)adapter));
-      }
-      if (next.getContent() instanceof XSDModelGroupDefinition)
-      {
-        XSDModelGroupDefinition def = (XSDModelGroupDefinition) next.getContent();
-        Adapter adapter = XSDAdapterFactory.getInstance().adapt(def);
-        list.add(adapter);
-      }
-      else if (next.getTerm() instanceof XSDModelGroup)
-      {
-        XSDModelGroup modelGroup = (XSDModelGroup) next.getTerm();
-        Adapter adapter = XSDAdapterFactory.getInstance().adapt(modelGroup);
-        list.add(adapter);
-      }
-    }
-
-    if (list.size() == 0)
-      list.add(new TargetConnectionSpaceFiller(null));
-
-    return list;
-  }
-
-  public ReferenceConnection createConnectionFigure(BaseEditPart child)
-  {
-    ReferenceConnection connectionFigure = new ReferenceConnection();
-    GenericGroupFigure modelGroupFigure = (GenericGroupFigure)getFigure();
-    connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(modelGroupFigure.getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
-
-    if (child instanceof ModelGroupEditPart)
-    {
-      connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((ModelGroupEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
-    }
-    else if (child instanceof TargetConnectionSpacingFigureEditPart)
-    {
-      TargetConnectionSpacingFigureEditPart elem = (TargetConnectionSpacingFigureEditPart) child;
-      connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(elem.getFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
-    }
-    else if (child instanceof ModelGroupDefinitionReferenceEditPart)
-    {
-      ModelGroupDefinitionReferenceEditPart elem = (ModelGroupDefinitionReferenceEditPart) child;
-      connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(elem.getFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
-    }
-    connectionFigure.setHighlight(false);
-    return connectionFigure;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ReferenceConnection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ReferenceConnection.java
deleted file mode 100644
index 009bff2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/ReferenceConnection.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.swt.graphics.Color;
-
-public class ReferenceConnection extends PolylineConnection
-{
-  protected boolean highlight = false;
-
-  protected static final Color activeConnection = ColorConstants.black;
-  protected static final Color inactiveConnection = new Color(null, 198, 195, 198);
-
-  public ReferenceConnection()
-  {
-    super();
-    setConnectionRouter(new XSDModelGroupRouter());
-  }
-
-  public void setConnectionRouter(ConnectionRouter cr)
-  {
-    if (cr != null && getConnectionRouter() != null && !(getConnectionRouter() instanceof XSDModelGroupRouter))
-      super.setConnectionRouter(cr);
-  }
-
-  public boolean isHighlighted()
-  {
-    return highlight;
-  }
-
-  public void setHighlight(boolean highlight)
-  {
-    this.highlight = highlight;
-    setForegroundColor(highlight ? activeConnection : inactiveConnection);
-    setOpaque(highlight);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/SpaceFillerForFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/SpaceFillerForFieldEditPart.java
deleted file mode 100644
index f57cca7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/SpaceFillerForFieldEditPart.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-public class SpaceFillerForFieldEditPart extends BaseFieldEditPart
-{
-  Label space;
-  public SpaceFillerForFieldEditPart()
-  {
-    super();
-  }
-
-  protected IFigure createFigure()
-  {
-    space = new Label("");
-    space.setIcon(XSDEditorPlugin.getXSDImage("icons/Dot.gif"));
-    space.setBorder(new MarginBorder(3, 0, 3, 0));
-    return space;
-  }
-
-  protected void refreshVisuals()
-  {
-  }
-
-  protected void createEditPolicies()
-  {
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java
deleted file mode 100644
index c26537d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.editor.internal.design.figures.SpacingFigure;
-
-public class TargetConnectionSpacingFigureEditPart extends BaseEditPart
-{
-  public TargetConnectionSpacingFigureEditPart()
-  {
-    super();
-  }
-
-  SpacingFigure figure;
-
-  protected IFigure createFigure()
-  {
-    figure = new SpacingFigure();
-    return figure;
-  }
-
-  public IFigure getConnectionFigure()
-  {
-    return figure;
-  }
-
-  protected void createEditPolicies()
-  {
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDAttributesForAnnotationEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDAttributesForAnnotationEditPart.java
deleted file mode 100644
index f7f17f5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDAttributesForAnnotationEditPart.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDComplexTypeDefinitionAdapter;
-
-public class XSDAttributesForAnnotationEditPart extends BaseEditPart
-{
-  IComplexType complexType;
-  public XSDAttributesForAnnotationEditPart()
-  {
-    super();
-  }
-
-  protected IFigure createFigure()
-  {
-    Figure fig = new Figure();
-    fig.setLayoutManager(new ToolbarLayout());
-    return fig;
-  }
-
-  protected void createEditPolicies()
-  {
-
-  }
-
-  protected List getModelChildren()
-  {
-    IStructure structure =  ((Annotation)getModel()).getOwner();
-    if (structure instanceof IComplexType)
-    {  
-      complexType = (IComplexType)structure;
-      if (complexType instanceof XSDComplexTypeDefinitionAdapter)
-      {
-        XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter) complexType;
-        return adapter.getAttributeGroupContent();
-      }
-    }
-    return Collections.EMPTY_LIST;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDBaseFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDBaseFieldEditPart.java
deleted file mode 100644
index 1af72fe..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDBaseFieldEditPart.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.wst.xsd.adt.design.IAnnotationProvider;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.internal.design.editpolicies.DragAndDropEditPolicy;
-import org.eclipse.wst.xsd.editor.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
-
-public class XSDBaseFieldEditPart extends BaseFieldEditPart
-{
-
-  public XSDBaseFieldEditPart()
-  {
-    super();
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
-   */
-  protected void refreshVisuals()
-  {
-    IFieldFigure figure = getFieldFigure();
-    IField field = (IField) getModel();
-    
-    figure.getNameLabel().setText(field.getName());
-    figure.getTypeLabel().setText(field.getTypeName());
-    figure.refreshVisuals(getModel());
-
-    String occurrenceDescription = "";
-    if (field instanceof IAnnotationProvider)
-    {
-      occurrenceDescription = ((IAnnotationProvider)field).getNameAnnotationString();
-    }
-    
-    figure.getNameAnnotationLabel().setText(occurrenceDescription);
-    
-    figure.recomputeLayout();
-
-    // our model implements ITreeElement
-    if (getModel() instanceof ITreeElement)
-    {
-      figure.getNameLabel().setIcon(((ITreeElement)getModel()).getImage());
-    }
-
-    if (getRoot() != null)
-      ((GraphicalEditPart)getRoot()).getFigure().invalidateTree();
-  }
-
-  public void addNotify()
-  {
-    super.addNotify();
-    getFieldFigure().editPartAttached(this);
-  }
-
-  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
-  protected void createEditPolicies()
-  {
-    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
-    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDEditPartFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDEditPartFactory.java
deleted file mode 100644
index 561bb40..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDEditPartFactory.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.ADTEditPartFactory;
-import org.eclipse.wst.xsd.adt.design.editparts.ColumnEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.CompartmentEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.typeviz.design.figures.TypeVizFigureFactory;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDModelGroupAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.model.SpaceFiller;
-import org.eclipse.wst.xsd.editor.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.editor.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.wst.xsd.editor.internal.design.figures.IModelGroupFigure;
-
-public class XSDEditPartFactory extends ADTEditPartFactory implements IExtendedFigureFactory
-{
-  protected IExtendedFigureFactory delegate;
-  
-  public XSDEditPartFactory()
-  {
-    delegate = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getFigureFactory();
-    if (delegate == null)
-      delegate = new TypeVizFigureFactory();
-  }
-
-  public EditPart createEditPart(EditPart context, Object model)
-  {
-    EditPart child = null;
-    // Override edit part where desired
-    
-    if (model instanceof IField)
-    {
-      if (model instanceof SpaceFiller)
-      {
-        child = new SpaceFillerForFieldEditPart();
-      }
-      else if (context instanceof CompartmentEditPart)
-      {  
-        child = new XSDBaseFieldEditPart();
-      }
-    }
-    else if (model instanceof XSDSimpleTypeDefinitionAdapter)
-    {
-      child = new XSDSimpleTypeEditPart();
-    }
-    else if (model instanceof XSDModelGroupAdapter)
-    {
-      child = new ModelGroupEditPart();
-    }
-    else if (model instanceof Annotation)
-    {
-      Annotation annotation = (Annotation) model;
-      String kind = annotation.getCompartment().getKind();
-      if (kind.equals("element"))
-      {
-        child = new XSDGroupsForAnnotationEditPart();
-      }
-      else if (kind.equals("attribute"))
-      {
-        child = new XSDAttributesForAnnotationEditPart();
-      }
-    }
-    else if (!(context instanceof ColumnEditPart))
-    {   
-      if (model instanceof TargetConnectionSpaceFiller)
-      {
-        child = new TargetConnectionSpacingFigureEditPart();
-      }
-      else if (model instanceof XSDModelGroupDefinitionAdapter)
-      {
-        child = new ModelGroupDefinitionReferenceEditPart();
-      }
-      else if (model instanceof XSDAttributeGroupDefinitionAdapter)
-      {
-        child = new AttributeGroupDefinitionEditPart();
-      }
-    }
-    // if we don't have a specialzied XSD edit part to create
-    // then we simply call the super class to create a generic ADT edit part
-    //
-    if (child == null)
-    {
-      child = super.createEditPart(context, model);
-    }
-
-    // if at this this point we have not created an edit part we simply
-    // create a placeholder edit part to provide the most robust behaviour possible
-    //    
-    if (child == null)
-    {
-      // TODO (cs) log an error message here, since we shouldn't really get here 
-      child = new SpaceFillerForFieldEditPart();
-    }  
-
-    child.setModel(model);
-    return child;
-  }
-
-  protected void checkChild(EditPart child, Object model)
-  {
-    // do nothing since we have contribute our own editparts to the facade
-  }
-
-  public ICompartmentFigure createCompartmentFigure(Object model)
-  {
-    return delegate.createCompartmentFigure(model);
-  }
-  
-  public IStructureFigure createStructureFigure(Object model)
-  {
-    return delegate.createStructureFigure(model);
-  }  
-
-  public IFieldFigure createFieldFigure(Object model)
-  {
-    return delegate.createFieldFigure(model);
-  }
-  
-  public IModelGroupFigure createModelGroupFigure(Object model)
-  {
-    return delegate.createModelGroupFigure(model);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDGroupsForAnnotationEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDGroupsForAnnotationEditPart.java
deleted file mode 100644
index e981285..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDGroupsForAnnotationEditPart.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class XSDGroupsForAnnotationEditPart extends BaseEditPart
-{
-  IComplexType complexType;
-  public XSDGroupsForAnnotationEditPart()
-  {
-    super();
-  }
-
-  protected IFigure createFigure()
-  {
-    Figure fig = new Figure();
-    fig.setLayoutManager(new ToolbarLayout());
-    return fig;
-  }
-
-  protected void createEditPolicies()
-  {
-
-  }
-
-  protected List getModelChildren()
-  {
-    List xsdModelGroupList = new ArrayList();
-    List adapterList = new ArrayList();
-    
-    IStructure structure =  ((Annotation)getModel()).getOwner();
-    if (structure instanceof IComplexType)
-    {  
-      complexType = (IComplexType)structure;
-      if (complexType instanceof XSDComplexTypeDefinitionAdapter)
-      {
-        XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter) complexType;
-        xsdModelGroupList = adapter.getModelGroups();
-      }
-      
-      for (Iterator i = xsdModelGroupList.iterator(); i.hasNext(); )
-      {
-        Object obj = i.next();
-        if (obj instanceof XSDModelGroup)
-        {
-          adapterList.add(XSDAdapterFactory.getInstance().adapt((XSDModelGroup)obj));
-        }
-        else if (obj instanceof XSDModelGroupDefinition)
-        {
-          adapterList.add(XSDAdapterFactory.getInstance().adapt((XSDModelGroupDefinition)obj));
-        }
-      }
-    }
-    else if (structure instanceof XSDModelGroupDefinitionAdapter)
-    {
-      XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter) structure;
-      XSDModelGroup group = adapter.getXSDModelGroupDefinition().getModelGroup();
-      if (group != null)
-      {
-        adapterList.add(XSDAdapterFactory.getInstance().adapt(group));
-      }
-    }
-    
-    return adapterList;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDModelGroupRouter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDModelGroupRouter.java
deleted file mode 100644
index 29e8098..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDModelGroupRouter.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.AbstractRouter;
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Ray;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-// TODO Manhattan connection router is final
-public class XSDModelGroupRouter extends AbstractRouter
-{
-  public XSDModelGroupRouter()
-  {
-    super();
-  }
-  private Map rowsUsed = new HashMap();
-  private Map colsUsed = new HashMap();
-
-  private Map reservedInfo = new HashMap();
-
-  private class ReservedInfo {
-    public List reservedRows = new ArrayList(2);
-    public List reservedCols = new ArrayList(2);
-  }
-
-  private static Ray  UP    = new Ray(0, -1),
-              DOWN  = new Ray(0, 1),
-              LEFT  = new Ray(-1, 0),
-              RIGHT = new Ray(1, 0);
-
-
-  /**
-   * @see ConnectionRouter#invalidate(Connection)
-   */
-  public void invalidate(Connection connection) {
-    removeReservedLines(connection);
-  }
-
-  private int getColumnNear(Connection connection, int r, int n, int x) {
-    int min = Math.min(n, x),
-      max = Math.max(n, x);
-    if (min > r) {
-      max = min;
-      min = r - (min - r);
-    }
-    if (max < r) {
-      min = max;
-      max = r + (r - max);
-    }
-    int proximity = 0;
-    int direction = -1;
-    if (r % 2 == 1)
-      r--;
-    Integer i;
-    while (proximity < r) {
-      i = new Integer(r + proximity * direction);
-      if (!colsUsed.containsKey(i)) {
-        colsUsed.put(i, i);
-        reserveColumn(connection, i);
-        return i.intValue();
-      }
-      int j = i.intValue();
-      if (j <= min)
-        return j + 2;
-      if (j >= max)
-        return j - 2;
-      if (direction == 1)
-        direction = -1;
-      else {
-        direction = 1;
-        proximity += 2;
-      }
-    }
-    return r;
-  }
-
-  /**
-   * Returns the direction the point <i>p</i> is in relation to the given rectangle.
-   * Possible values are LEFT (-1,0), RIGHT (1,0), UP (0,-1) and DOWN (0,1).
-   * 
-   * @param r the rectangle
-   * @param p the point
-   * @return the direction from <i>r</i> to <i>p</i>
-   */
-  protected Ray getDirection(Rectangle r, Point p) {
-    int i, distance = Math.abs(r.x - p.x);
-    Ray direction;
-    
-    direction = LEFT;
-
-    i = Math.abs(r.y - p.y);
-    if (i <= distance) {
-      distance = i;
-      direction = UP;
-    }
-
-    i = Math.abs(r.bottom() - p.y);
-    if (i <= distance) {
-      distance = i;
-      direction = DOWN;
-    }
-
-    i = Math.abs(r.right() - p.x);
-    if (i < distance) {
-      distance = i;
-      direction = RIGHT;
-    }
-
-    return direction;
-  }
-
-  protected Ray getEndDirection(Connection conn) {
-    ConnectionAnchor anchor = conn.getTargetAnchor();
-    Point p = getEndPoint(conn);
-    Rectangle rect;
-    if (anchor.getOwner() == null)
-      rect = new Rectangle(p.x - 1, p.y - 1, 2, 2);
-    else {
-      rect = conn.getTargetAnchor().getOwner().getBounds().getCopy();
-      conn.getTargetAnchor().getOwner().translateToAbsolute(rect);
-    }
-    return getDirection(rect, p);
-  }
-
-  protected int getRowNear(Connection connection, int r, int n, int x) {
-    int min = Math.min(n, x),
-      max = Math.max(n, x);
-    if (min > r) {
-      max = min;
-      min = r - (min - r);
-    }
-    if (max < r) {
-      min = max;
-      max = r + (r - max);
-    }
-
-    int proximity = 0;
-    int direction = -1;
-    if (r % 2 == 1)
-      r--;
-    Integer i;
-    while (proximity < r) {
-      i = new Integer(r + proximity * direction);
-      if (!rowsUsed.containsKey(i)) {
-        rowsUsed.put(i, i);
-        reserveRow(connection, i);
-        return i.intValue();
-      }
-      int j = i.intValue();
-      if (j <= min)
-        return j + 2;
-      if (j >= max)
-        return j - 2;
-      if (direction == 1)
-        direction = -1;
-      else {
-        direction = 1;
-        proximity += 2;
-      }
-    }
-    return r;
-  }
-
-  protected Ray getStartDirection(Connection conn) {
-    ConnectionAnchor anchor = conn.getSourceAnchor();
-    Point p = getStartPoint(conn);
-    Rectangle rect;
-    if (anchor.getOwner() == null)
-      rect = new Rectangle(p.x - 1, p.y - 1, 2, 2);
-    else {
-      rect = conn.getSourceAnchor().getOwner().getBounds().getCopy();
-      conn.getSourceAnchor().getOwner().translateToAbsolute(rect);
-    }
-    return getDirection(rect, p);
-  }
-
-  protected void processPositions(Ray start, Ray end, List positions, 
-                    boolean horizontal, Connection conn) {
-    removeReservedLines(conn);
-
-    int pos[] = new int[positions.size() + 2];
-    if (horizontal)
-      pos[0] = start.x;
-    else
-      pos[0] = start.y;
-    int i;
-    for (i = 0; i < positions.size(); i++) {
-      pos[i + 1] = ((Integer)positions.get(i)).intValue();
-    }
-    if (horizontal == (positions.size() % 2 == 1))
-      pos[++i] = end.x;
-    else
-      pos[++i] = end.y;
-
-    PointList points = new PointList();
-    points.addPoint(new Point(start.x, start.y));
-    Point p;
-    int current, prev, min, max;
-    boolean adjust;
-    for (i = 2; i < pos.length - 1; i++) {
-      horizontal = !horizontal;
-      prev = pos[i - 1];
-      current = pos[i];
-
-      adjust = (i != pos.length - 2);
-      if (horizontal) {
-        if (adjust) {
-          min = pos[i - 2];
-          max = pos[i + 2];
-          pos[i] = current = getRowNear(conn, current, min, max);
-        }
-        p = new Point(prev, current);
-      } else {
-        if (adjust) {
-          min = pos[i - 2];
-          max = pos[i + 2];
-          pos[i] = current = getColumnNear(conn, current, min, max);
-        }
-        p = new Point(current, prev);
-      }
-      points.addPoint(p);
-    }
-    points.addPoint(new Point(end.x, end.y));
-    conn.setPoints(points);
-  }
-
-  /**
-   * @see ConnectionRouter#remove(Connection)
-   */
-  public void remove(Connection connection) {
-    removeReservedLines(connection);
-  }
-
-  protected void removeReservedLines(Connection connection) {
-    ReservedInfo rInfo = (ReservedInfo) reservedInfo.get(connection);
-    if (rInfo == null) 
-      return;
-    
-    for (int i = 0; i < rInfo.reservedRows.size(); i++) {
-      rowsUsed.remove(rInfo.reservedRows.get(i));
-    }
-    for (int i = 0; i < rInfo.reservedCols.size(); i++) {
-      colsUsed.remove(rInfo.reservedCols.get(i));
-    }
-    reservedInfo.remove(connection);
-  }
-
-  protected void reserveColumn(Connection connection, Integer column) {
-    ReservedInfo info = (ReservedInfo) reservedInfo.get(connection);
-    if (info == null) {
-      info = new ReservedInfo();
-      reservedInfo.put(connection, info);
-    }
-    info.reservedCols.add(column);
-  }
-
-  protected void reserveRow(Connection connection, Integer row) {
-    ReservedInfo info = (ReservedInfo) reservedInfo.get(connection);
-    if (info == null) {
-      info = new ReservedInfo();
-      reservedInfo.put(connection, info);
-    }
-    info.reservedRows.add(row);
-  }
-
-  /**
-   * @see ConnectionRouter#route(Connection)
-   */
-  public void route(Connection conn) {
-    if ((conn.getSourceAnchor() == null) || (conn.getTargetAnchor() == null)) 
-      return;
-    int i;
-    Point startPoint = getStartPoint(conn);
-    conn.translateToRelative(startPoint);
-    Point endPoint = getEndPoint(conn);
-    conn.translateToRelative(endPoint);
-
-    Ray start = new Ray(startPoint);
-    Ray end = new Ray(endPoint);
-    Ray average = new Ray(startPoint.x + 2, startPoint.y); // start.getAveraged(end);
-
-    Ray direction = new Ray(start, end);
-    Ray startNormal = getStartDirection(conn);
-    Ray endNormal   = getEndDirection(conn);
-
-    List positions = new ArrayList(5);
-    boolean horizontal = startNormal.isHorizontal();
-    if (horizontal) 
-      positions.add(new Integer(start.y));
-    else
-      positions.add(new Integer(start.x));
-    horizontal = !horizontal;
-
-    if (startNormal.dotProduct(endNormal) == 0) {
-      if ((startNormal.dotProduct(direction) >= 0) 
-        && (endNormal.dotProduct(direction) <= 0)) {
-        // 0
-      } else {
-        // 2
-        if (startNormal.dotProduct(direction) < 0)
-          i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
-        else {
-          if (horizontal) 
-            i = average.y;
-          else 
-            i = average.x;
-        }
-        positions.add(new Integer(i));
-        horizontal = !horizontal;
-
-        if (endNormal.dotProduct(direction) > 0)
-          i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
-        else {
-          if (horizontal) 
-            i = average.y;
-          else 
-            i = average.x;
-        }
-        positions.add(new Integer(i));
-        horizontal = !horizontal;
-      }
-    } else {
-      if (startNormal.dotProduct(endNormal) > 0) {
-        //1
-        if (startNormal.dotProduct(direction) >= 0)
-          i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
-        else
-          i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
-        positions.add(new Integer(i));
-        horizontal = !horizontal;
-      } else {
-        //3 or 1
-        if (startNormal.dotProduct(direction) < 0) {
-          i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
-          positions.add(new Integer(i));
-          horizontal = !horizontal;
-        }
-
-        if (horizontal) 
-          i = average.y;
-        else 
-          i = average.x;
-        positions.add(new Integer(i));
-        horizontal = !horizontal;
-
-        if (startNormal.dotProduct(direction) < 0) {
-          i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
-          positions.add(new Integer(i));
-          horizontal = !horizontal;
-        }
-      }
-    }
-    if (horizontal) 
-      positions.add(new Integer(end.y));
-    else 
-      positions.add(new Integer(end.x));
-    
-    processPositions(start, end, positions, startNormal.isHorizontal(), conn);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDSimpleTypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDSimpleTypeEditPart.java
deleted file mode 100644
index a8a4e34..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/XSDSimpleTypeEditPart.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseTypeConnectingEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.TypeReferenceConnection;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.adt.typeviz.design.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.adt.typeviz.design.figures.StructureFigure;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDSimpleTypeEditPart extends BaseTypeConnectingEditPart
-{
-  StructureFigure figure;
-  protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
-  
-  public XSDSimpleTypeEditPart()
-  {
-    super();
-  }
-  
-  public XSDSimpleTypeDefinition getXSDSimpleTypeDefinition()
-  {
-    return (XSDSimpleTypeDefinition)((XSDSimpleTypeDefinitionAdapter)getModel()).getTarget();
-  }
-
-  protected IFigure createFigure()
-  {
-    figure = new StructureFigure();
-    figure.setBorder(new RoundedLineBorder(1, 10));    
-    ToolbarLayout toolbarLayout = new ToolbarLayout();
-    toolbarLayout.setStretchMinorAxis(true);
-    figure.setLayoutManager(toolbarLayout);
-    figure.getHeadingFigure().getLabel().setIcon(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-    return figure;
-  }
-  
-  protected void refreshVisuals()
-  {
-    String name = ((XSDSimpleTypeDefinitionAdapter)getModel()).getDisplayName();
-    figure.headingFigure.getLabel().setText(name);
-  }
-  
-  public IStructureFigure getStructureFigure()
-  {
-    return (IStructureFigure)getFigure();
-  }
-
-  public IFigure getContentPane()
-  {
-    return getStructureFigure().getContentPane();
-  }
-  
-  
-  protected void createEditPolicies()
-  {
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
-    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
-  }
-
-  public void addFeedback()
-  {
-    getStructureFigure().addSelectionFeedback();
-    super.addFeedback();
-  }
-  
-  public void removeFeedback()
-  {
-    getStructureFigure().removeSelectionFeedback();
-    super.removeFeedback();    
-  }
-
-  public ReferenceConnection createConnectionFigure(BaseEditPart child)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public TypeReferenceConnection createConnectionFigure()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/model/SpaceFiller.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/model/SpaceFiller.java
deleted file mode 100644
index 682a64e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/model/SpaceFiller.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts.model;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-/**
- * Dummy class to add space to field list
- *
- */
-public class SpaceFiller implements IField
-{
-  String kind;
-  public SpaceFiller(String kind)
-  {
-    super();
-    this.kind = kind;
-  }
-
-  public Image getImage()
-  {
-    if (kind.equals("attribute"))
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
-    }
-  }
-  
-  public String getKind()
-  {
-    return kind;
-  }
-  
-  public void setKind(String kind)
-  {
-    this.kind = kind;
-  }
-  
-  public boolean isGlobal()
-  {
-    return false;
-  }
-
-  public IComplexType getContainerType()
-  {
-    return null;
-  }
-
-  public String getName()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public String getTypeName()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public String getTypeNameQualifier()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public IType getType()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public int getMinOccurs()
-  {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  public int getMaxOccurs()
-  {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  public Command getUpdateMinOccursCommand(int minOccurs)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateMaxOccursCommand(int maxOccurs)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateTypeNameCommand(String typeName, String quailifier)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getUpdateNameCommand(String name)
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Command getDeleteCommand()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public void registerListener(IADTObjectListener listener)
-  {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void unregisterListener(IADTObjectListener listener)
-  {
-    // TODO Auto-generated method stub
-    
-  }
-  
-  public boolean isReadOnly()
-  {
-    return true;
-  }
-
-  public IModel getModel()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-}
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/model/TargetConnectionSpaceFiller.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/model/TargetConnectionSpaceFiller.java
deleted file mode 100644
index ff59262..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editparts/model/TargetConnectionSpaceFiller.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editparts.model;
-
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-
-public class TargetConnectionSpaceFiller implements IADTObject
-{
-  private XSDBaseAdapter adapter;
-  
-  public TargetConnectionSpaceFiller(XSDBaseAdapter adapter)
-  {
-    this.adapter = adapter;
-  }
-
-  /**
-   * @deprecated remove this
-   * @return
-   */
-  public XSDBaseAdapter getAdapter()
-  {
-    return adapter;
-  }
-
-  public void registerListener(IADTObjectListener listener)
-  {
-    
-  }
-
-  public void unregisterListener(IADTObjectListener listener)
-  {
-   
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/DragAndDropEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/DragAndDropEditPolicy.java
deleted file mode 100644
index adacf0b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/DragAndDropEditPolicy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editpolicies;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.xsd.editor.internal.commands.DragAndDropCommand;
-
-public class DragAndDropEditPolicy extends org.eclipse.gef.editpolicies.GraphicalEditPolicy
-{ 
-  protected EditPartViewer viewer;
-  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-
-  public DragAndDropEditPolicy(EditPartViewer viewer, SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy)
-  {
-    this.viewer = viewer;
-    this.selectionHandlesEditPolicy = selectionHandlesEditPolicy;
-  }
-
-  public boolean understandsRequest(Request req)
-  {
-    return true;
-  }                           
-
-  
-  public org.eclipse.gef.commands.Command getCommand(Request request)
-  {             
-    DragAndDropCommand command = null;                            
-    if (request instanceof ChangeBoundsRequest)
-    {
-      command = new DragAndDropCommand(viewer, (ChangeBoundsRequest)request);
-      selectionHandlesEditPolicy.setDragAndDropCommand(command);
-    } 
-    return command;             
-  }                                                     
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/GraphNodeDragTracker.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/GraphNodeDragTracker.java
deleted file mode 100644
index 822a91d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/GraphNodeDragTracker.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editpolicies;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-
-                                   
-public class GraphNodeDragTracker extends DragEditPartsTracker 
-{                                     
-  protected EditPart editPart; 
-           
-  public GraphNodeDragTracker(EditPart editPart)
-  {
-    super(editPart);
-    this.editPart = editPart;
-  } 
-                                              
-  protected Command getCommand() 
-  { 
-	Request request = getTargetRequest();
-    return editPart.getCommand(request); 
-  }
-} 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java
deleted file mode 100644
index 05f7842..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.editpolicies;
-                                 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.FreeformLayout;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.editor.internal.commands.DragAndDropCommand;
-
-
-public class SelectionHandlesEditPolicyImpl	extends ADTSelectionFeedbackEditPolicy
-{
-  protected IFigure feedback;
-  protected Rectangle originalLocation;
-  protected DragAndDropCommand dragAndDropCommand;
-  protected Polyline polyLine;
-  protected RectangleFigure ghostShape;
-
-  protected List createSelectionHandles()
-  {              
-    List list = new ArrayList();
-    EditPart editPart = getHost();
-     
-    if (editPart instanceof GraphicalEditPart)
-    {
-      GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
-      IFigure figure = (graphicalEditPart instanceof BaseEditPart) ? 
-                          ((BaseEditPart)graphicalEditPart).getFigure() :
-                          graphicalEditPart.getFigure();
-   
-      Cursor cursorFigure = figure.getCursor();
-      MoveHandleLocator loc = new MoveHandleLocator(figure);    
-      MoveHandle moveHandle = new MoveHandle(graphicalEditPart, loc);     
-      moveHandle.setCursor(cursorFigure);
-      list.add(moveHandle);
-    }
-
-    return list;
-  }   
-  
-
-  public boolean understandsRequest(Request request)
-  {    
-    boolean result = false;
-
-	  if (REQ_MOVE.equals(request.getType()))
-    {  
-		  result = false; // return false to disable move for now 
-    }
-    else
-    {
-	    result = super.understandsRequest(request);
-    }
-    return result;
-  }
-  
-
-  public org.eclipse.gef.commands.Command getCommand(Request request) 
-  {                                          
-    return null;  
-  }   
-
-  public void setDragAndDropCommand(DragAndDropCommand dragAndDropCommand)
-  {
-    this.dragAndDropCommand = dragAndDropCommand;
-  }
-
-  protected org.eclipse.gef.commands.Command getMoveCommand(ChangeBoundsRequest request) 
-  {
-	  ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_MOVE_CHILDREN);
-	  req.setEditParts(getHost());
-	
-	  req.setMoveDelta(request.getMoveDelta());
-	  req.setSizeDelta(request.getSizeDelta());
-	  req.setLocation(request.getLocation());
-
-	  return getHost().getParent().getCommand(req);
-  } 
-
-  public void showSourceFeedback(Request request)
-  {  	
-	  if (REQ_MOVE.equals(request.getType()) ||
-		  REQ_ADD.equals(request.getType()))
-		  showChangeBoundsFeedback((ChangeBoundsRequest)request);
-  }
-
-  protected void showChangeBoundsFeedback(ChangeBoundsRequest request)
-  {
-  	IFigure p = getDragSourceFeedbackFigure();
-  	Rectangle r = originalLocation.getTranslated(request.getMoveDelta());
-  	Dimension resize = request.getSizeDelta();
-  	r.width += resize.width;
-  	r.height+= resize.height;
-  
-  	((GraphicalEditPart)getHost()).getFigure().translateToAbsolute(r);
-   
-  	p.translateToRelative(r);
-    Rectangle pBounds = r.getCopy();                            
-
-    if (dragAndDropCommand != null && dragAndDropCommand.canExecute())
-    {
-      int size = request.getEditParts().size();
-      if (size > 0 && request.getEditParts().get(size - 1) == getHost())
-      {         
-        PointList pointList = dragAndDropCommand.getConnectionPoints(r);
-        if (pointList != null && pointList.size() > 0)
-        {
-          polyLine.setPoints(pointList);
-          
-          Point firstPoint = pointList.getFirstPoint();
-          if (firstPoint != null)
-          {
-            pBounds = pBounds.getUnion(new Rectangle(firstPoint.x, firstPoint.y, 1, 1));
-          }
-        }
-      }
-    }
-    p.setBounds(pBounds);
-    ghostShape.setBounds(r);
-  	p.validate();
-  }        
-
-
-
-
-  protected IFigure getDragSourceFeedbackFigure() 
-  {
-    EditPart editPart = getHost(); 
-    if (feedback == null && editPart instanceof BaseEditPart)
-    {                                       
-      BaseEditPart baseEditPart = (BaseEditPart)editPart;
-		  originalLocation = new Rectangle(baseEditPart.getFigure().getBounds());
-		  feedback = createDragSourceFeedbackFigure(baseEditPart.getFigure());
-	  }
-	  return feedback;
-  }  
-
-  protected IFigure createDragSourceFeedbackFigure(IFigure draggedFigure)
-  {
-		// Use a ghost rectangle for feedback  
-    Figure panel = new Figure();
-    panel.setLayoutManager(new FreeformLayout());
-
-		ghostShape = new RectangleFigure();
-		FigureUtilities.makeGhostShape(ghostShape);
-		ghostShape.setLineStyle(Graphics.LINE_DASHDOT);
-		ghostShape.setForegroundColor(ColorConstants.white);
-    ghostShape.setOpaque(false);
-    
-    Rectangle r = draggedFigure.getBounds();
-    panel.setOpaque(false);
-    panel.add(ghostShape);                 
-
-    polyLine = new Polyline();                         
-    //polyLine.setLineStyle(Graphics.LINE_DASHDOT);      
-    polyLine.setLineWidth(1);
-    panel.add(polyLine);
-
-    panel.setBounds(r);
-		ghostShape.setBounds(r);
-
-		addFeedback(panel);
-
-		return panel;
-	} 
-
-  public void deactivate()
-  {
-	  if (feedback != null)
-    {
-		  removeFeedback(feedback);
-		  feedback = null;
-	  }
-	  hideFocus();
-	  super.deactivate();
-  }
-
-  /**
-   * Erase feedback indicating that the receiver object is 
-   * being dragged.  This method is called when a drag is
-   * completed or cancelled on the receiver object.
-   * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
-   */
-  protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request) 
-  {
-	  if (feedback != null) 
-    {		      
-		  removeFeedback(feedback);
-	  }
-	  feedback = null;
-	  originalLocation = null;
-  }
-
-  /**
-   * Erase feedback indicating that the receiver object is 
-   * being dragged.  This method is called when a drag is
-   * completed or cancelled on the receiver object.
-   * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
-   */
-  public void eraseSourceFeedback(Request request) 
-  {
-    if (REQ_MOVE.equals(request.getType()) ||  REQ_ADD.equals(request.getType()))
-    {
-		  eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
-    }
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/CenteredIconFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/CenteredIconFigure.java
deleted file mode 100644
index 2f62395..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/CenteredIconFigure.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.figures;
-            
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Image;
-
-public class CenteredIconFigure extends RectangleFigure
-{                                                
-  public Image image;
-  protected Label toolTipLabel;
-                               
-  public CenteredIconFigure()
-  {
-    super();
-    setFill(true);   
-    toolTipLabel = new Label();
-  }
-  
-  
-  protected void outlineShape(Graphics graphics)
-  {
-  }
-
-  protected void fillShape(Graphics g)
-  {    
-    super.fillShape(g);    
-    if (image != null)
-    {                         
-      Rectangle r = getBounds();
-      Dimension imageSize = new Dimension(15, 15);
-      g.drawImage(image, r.x + (r.width - imageSize.width)/2, r.y + (r.height - imageSize.height)/2);
-    }
-  }
-  
-  public Label getToolTipLabel()
-  {
-    return toolTipLabel;
-  }
-  
-  public void setToolTipText(String text)
-  {
-    if (text.length() > 0)
-    {
-      setToolTip(toolTipLabel);
-      toolTipLabel.setText(text);
-    }
-    else
-    {
-      setToolTip(null);
-    }
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/GenericGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/GenericGroupFigure.java
deleted file mode 100644
index a80b113..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/GenericGroupFigure.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.figures;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.editor.internal.design.layouts.ModelGroupLayout;
-
-public class GenericGroupFigure extends Figure
-{
-  protected CenteredIconFigure centeredIconFigure;
-  protected Figure contentFigure;
-  
-  public GenericGroupFigure()
-  {
-    super();
-    setLayoutManager(new ModelGroupLayout(true));
-   
-    centeredIconFigure = new CenteredIconFigure();
-    centeredIconFigure.setPreferredSize(new Dimension(15, 15));
-
-    add(centeredIconFigure);
-    contentFigure = new Figure();
-    contentFigure.setLayoutManager(new ModelGroupLayout(false, 0));
-    add(contentFigure);
-  }
-  
-  public void setIconFigure(Image image)
-  {
-    centeredIconFigure.image = image;
-  }
-
-  public CenteredIconFigure getTargetFigure()
-  {
-    return centeredIconFigure;
-  }
-  
-  public CenteredIconFigure getIconFigure()
-  {
-    return centeredIconFigure;
-  }
-  
-  public Figure getContentFigure()
-  {
-    return contentFigure;
-  }
-  
-  public void setToolTipText(String text)
-  {
-    centeredIconFigure.setToolTipText(text);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/IExtendedFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/IExtendedFigureFactory.java
deleted file mode 100644
index 6dbcacb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/IExtendedFigureFactory.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.figures;
-
-import org.eclipse.wst.xsd.adt.design.figures.IFigureFactory;
-
-public interface IExtendedFigureFactory extends IFigureFactory
-{
-  IModelGroupFigure createModelGroupFigure(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/IModelGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/IModelGroupFigure.java
deleted file mode 100644
index 8465ae2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/IModelGroupFigure.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.figures;
-
-import org.eclipse.wst.xsd.adt.design.figures.IADTFigure;
-
-public interface IModelGroupFigure extends IADTFigure
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/ModelGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/ModelGroupFigure.java
deleted file mode 100644
index 83a3c63..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/ModelGroupFigure.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.figures;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-public class ModelGroupFigure extends GenericGroupFigure implements IModelGroupFigure
-{
-  public static final Image SEQUENCE_ICON_IMAGE = XSDEditorPlugin.getImageDescriptor("newSequence2.gif", true).createImage();
-  public static final Image CHOICE_ICON_IMAGE = XSDEditorPlugin.getImageDescriptor("newChoice.gif", true).createImage();
-  public static final Image ALL_ICON_IMAGE = XSDEditorPlugin.getImageDescriptor("obj16/all.gif", true).createImage();
-  
-  public ModelGroupFigure()
-  {
-    super();
-  }
-
-  public void setIconFigure(Image image)
-  {
-    centeredIconFigure.image = image;
-  }
-
-  public void addSelectionFeedback()
-  {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void editPartAttached(EditPart owner)
-  {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void refreshVisuals(Object model)
-  {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void removeSelectionFeedback()
-  {
-    // TODO Auto-generated method stub   
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/SpacingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/SpacingFigure.java
deleted file mode 100644
index 5c1f657..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/figures/SpacingFigure.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.figures;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-public class SpacingFigure extends Label
-{
-  public SpacingFigure()
-  {
-    super("");
-    setIcon(XSDEditorPlugin.getXSDImage("icons/Dot.gif"));
-    setBorder(new MarginBorder(3, 0, 3, 0));
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/layouts/ContainerLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/layouts/ContainerLayout.java
deleted file mode 100644
index 1cfdd71..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/layouts/ContainerLayout.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.layouts;
-                   
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.editor.internal.design.figures.SpacingFigure;
-              
-
-public class ContainerLayout extends AbstractLayout
-{                                         
-  protected boolean isHorizontal;
-  protected int spacing = 0;
-  protected int border = 0; 
-
-  public ContainerLayout()
-  { 
-    this(true, 0); 
-  }             
-
-  public ContainerLayout(boolean isHorizontal, int spacing)
-  {
-    this.isHorizontal = isHorizontal;   
-    this.spacing = spacing;
-  }  
-
-  public void setHorizontal(boolean isHorizontal)
-  {
-    this.isHorizontal = isHorizontal;
-  }  
-
-  public void setSpacing(int spacing)
-  {
-    this.spacing = spacing;
-  }  
-
-  public void setBorder(int border)
-  {
-    this.border = border;
-  }  
-
-  protected int alignFigure(IFigure parent, IFigure child)
-  { 
-    return -1;
-  }
-
-  /**
-   * Calculates and returns the preferred size of the container 
-   * given as input.
-   * 
-   * @param figure  Figure whose preferred size is required.
-   * @return  The preferred size of the passed Figure.
-   * @since 2.0
-   */
-  protected Dimension calculatePreferredSizeHelper(IFigure parent)
-  { 
-    Dimension	preferred = new Dimension();
-  	List children = parent.getChildren();
-		                                        
-	  for (int i=0; i < children.size(); i++)
-    {
-		  IFigure child = (IFigure)children.get(i);      
-    
-      Dimension	childSize = child.getPreferredSize();
-	  
-      if (isHorizontal)
-      {
-		    preferred.width += childSize.width;
-		    preferred.height = Math.max(preferred.height, childSize.height);
-      }
-      else
-      {  
-        preferred.height += childSize.height;
-        preferred.width = Math.max(preferred.width, childSize.width);
-      }
-	  }   
-
-    int childrenSize = children.size();
-    if (childrenSize > 1)
-    {                      
-      if (isHorizontal)    
-      {
-        preferred.width += spacing * (childrenSize - 1);
-      }
-      else
-      {
-		    preferred.height += spacing * (childrenSize - 1);
-      } 
-    }
-                          
-    preferred.width += border * 2;
-    preferred.height += border * 2;
-	  preferred.width += parent.getInsets().getWidth();
-	  preferred.height += parent.getInsets().getHeight();       
-  
-  	return preferred;
-  }
-
-  protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
-  {    
-    Dimension	preferred = null;                                              
-                                  
-    // Here we ensure that an unexpanded container is given a size of (0,0)
-    //
-//    if (parent instanceof IExpandable)
-//    {
-//      IExpandable expandableFigure = (IExpandable)parent;
-//      if (!expandableFigure.isExpanded())
-//      {
-//        preferred = new Dimension(); 
-//      }
-//    }   
-    
-    if (preferred == null)
-    {
-	    preferred = calculatePreferredSizeHelper(parent);    
-    }
-    
-    return preferred;
-  }
-     
-
-  protected void adjustLayoutLocation(IFigure parent, Dimension dimension)
-  {     
-  }   
-
-  public void layout(IFigure parent)
-  {       
-  	List children = parent.getChildren();
- 
-    int rx = 0;
-    Dimension	dimension = new Dimension();                                          
-
-
-	  for (int i=0; i < children.size(); i++)
-    {
-		  IFigure child = (IFigure)children.get(i);
-		  Dimension	childSize = child.getPreferredSize();
-      if (isHorizontal)
-      {   
-        dimension.height = Math.max(dimension.height, childSize.height);
-        rx += childSize.width;
-      }
-      else
-      {
-        dimension.width = Math.max(dimension.width, childSize.width);
-      }
-    }
-
-	  //dimension.width += parent.getInsets().left;
-    //dimension.height += parent.getInsets().top;
-
-    if (isHorizontal)
-    {
-      dimension.height += border*2;
-    	dimension.width += border;
-    }
-    else
-    {
-      dimension.width += border*2;
-    	dimension.height += border;
-    }
-    adjustLayoutLocation(parent, dimension);    
-
-    for (int i=0; i < children.size(); i++)
-    {
-      IFigure child = (IFigure)children.get(i);
-	    Dimension	childSize = child.getPreferredSize();
-        
-      if (isHorizontal)
-      {   
-        int y = -1; 
-    
-        y = alignFigure(parent, child);
-    
-        if (y == -1)
-        {
-           y = (dimension.height - childSize.height) / 2;                                      
-        }                      
-                                                   
-        Rectangle rectangle = new Rectangle(dimension.width, y, childSize.width, childSize.height);
-        rectangle.translate(parent.getClientArea().getLocation());                           
-
-
-        child.setBounds(rectangle);                           
-	      dimension.width += childSize.width; 
-        dimension.width += spacing;       
-
-        if (child instanceof SpacingFigure)
-        {          
-          int availableHorizontalSpace = parent.getClientArea().width - rx;
-          dimension.width += availableHorizontalSpace;
-        }           
-      }
-      else
-      {
-        Rectangle rectangle = new Rectangle(0, dimension.height, childSize.width, childSize.height);
-	      rectangle.translate(parent.getClientArea().getLocation());                                  
-        
-
-        child.setBounds(rectangle);  
-        dimension.height += childSize.height;
-        dimension.height += spacing;
-      }
-	  }	      
-  }                                      
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/layouts/ModelGroupLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/layouts/ModelGroupLayout.java
deleted file mode 100644
index 94eecb0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/design/layouts/ModelGroupLayout.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.design.layouts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.editor.internal.design.figures.SpacingFigure;
-import org.eclipse.wst.xsd.editor.internal.design.figures.ModelGroupFigure;
-
-public class ModelGroupLayout extends AbstractLayout
-{
-  protected boolean isHorizontal;
-  protected int spacing = 7;
-  protected int border = 0;
-
-  public ModelGroupLayout()
-  {
-    this(0);
-  }
-
-  public ModelGroupLayout(boolean isHorizontal)
-  {
-    this.isHorizontal = isHorizontal;
-  }
-
-  public ModelGroupLayout(boolean isHorizontal, int spacing)
-  {
-    this.isHorizontal = isHorizontal;
-    this.spacing = spacing;
-  }
-
-  public ModelGroupLayout(int spacing)
-  {
-    super();
-    this.spacing = spacing;
-  }
-
-  protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
-  {
-    Dimension preferred = new Dimension();
-    List children = container.getChildren();
-
-    for (int i = 0; i < children.size(); i++)
-    {
-      IFigure child = (IFigure) children.get(i);
-
-      Dimension childSize = child.getPreferredSize();
-
-      if (isHorizontal)
-      {
-        preferred.width += childSize.width;
-        preferred.height = Math.max(preferred.height, childSize.height);
-      }
-      else
-      {
-        preferred.height += childSize.height;
-        preferred.width = Math.max(preferred.width, childSize.width);
-      }
-    }
-
-    int childrenSize = children.size();
-    if (childrenSize > 1)
-    {
-      if (isHorizontal)
-      {
-        preferred.width += spacing * (childrenSize - 1);
-      }
-      else
-      {
-        preferred.height += spacing * (childrenSize - 1);
-      }
-    }
-
-    preferred.width += border * 2;
-    preferred.height += border * 2;
-    preferred.width += container.getInsets().getWidth();
-    preferred.height += container.getInsets().getHeight();
-
-    return preferred;
-  }
-
-  public void layout(IFigure container)
-  {
-    List children = container.getChildren();
-
-    int rx = 0;
-    Dimension dimension = new Dimension();
-
-    for (int i = 0; i < children.size(); i++)
-    {
-      IFigure child = (IFigure) children.get(i);
-      Dimension childSize = child.getPreferredSize();
-      if (isHorizontal)
-      {
-        dimension.height = Math.max(dimension.height, childSize.height);
-        rx += childSize.width;
-      }
-      else
-      {
-        dimension.width = Math.max(dimension.width, childSize.width);
-      }
-    }
-
-    if (isHorizontal)
-    {
-      dimension.height += border * 2;
-      dimension.width += border;
-    }
-    else
-    {
-      dimension.width += border * 2;
-      dimension.height += border;
-    }
-
-    Rectangle r = container.getClientArea();
-    dimension = new Dimension(r.width, r.height);
-    Point p = new Point(0, 0);
-
-    for (Iterator i = children.iterator(); i.hasNext();)
-    {
-      IFigure child = (IFigure) i.next();
-      Dimension childSize = child.getPreferredSize();
-
-      if (isHorizontal)
-      {
-        Rectangle rectangle = new Rectangle(p.x, 0, childSize.width, childSize.height);
-
-        // last child
-        if (!i.hasNext())
-        {
-          rectangle.width = dimension.width - rectangle.x;
-        }
-
-        if (p.x == 0)
-        {
-          rectangle.y = r.height / 2 - childSize.height / 2;
-        }
-        else
-        {
-          rectangle.y = r.height / 2 - childSize.height / 2;
-        }
-
-        rectangle.translate(container.getClientArea().getLocation());
-        child.setBounds(rectangle);
-        p.x += childSize.width;
-        p.x += spacing;
-
-      }
-      else
-      {
-        Rectangle rectangle = new Rectangle(0, p.y, childSize.width, childSize.height);
-
-        if (child instanceof SpacingFigure)
-        {
-          rectangle.x = dimension.width + 6;
-        }
-        else if (child instanceof ModelGroupFigure)
-        {
-          rectangle.width = dimension.width - rectangle.x;
-        }
-        else
-        {
-          rectangle.width = dimension.width - rectangle.x;
-        }
-
-        rectangle.translate(container.getClientArea().getLocation());
-        child.setBounds(rectangle);
-        p.y += childSize.height;
-        p.y += spacing;
-      }
-    }
-  }
-
-  public void setSpacing(int spacing)
-  {
-    this.spacing = spacing;
-  }
-
-  protected int alignFigure(IFigure parent, IFigure child)
-  {
-    return -1;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/BuiltInTypesTreeViewerProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/BuiltInTypesTreeViewerProvider.java
deleted file mode 100644
index f140c21..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/BuiltInTypesTreeViewerProvider.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation 
- *     Trung de Irene <trungha@ca.ibm.com>
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-/**
- * This class provides the content for SelectBuiltInTypesForFilterDialog
- * readability Warning: Some simple tricks to tweak efficiency are used
- */
-public class BuiltInTypesTreeViewerProvider {
-	
-	ILabelProvider labelProvider;
-	
-	ITreeContentProvider contentProvider;
-	
-	private static final String CONST_PARENT = "parent";
-	
-	/**
-	 * Currently there are 3 subgroups: Numbers, Data and Time, Other
-	 * Folks can choose to expand to more subgroups
-	 */
-	private static int BUILT_IN_TYPES_SUB_GROUP = 3;
-	
-    static String[] numberTypes = 
-    	{ "base64Binary", "byte", "decimal", "double", "float", "hexBinary",
-    	  "int", "integer", "long", "negativeInteger", "nonNegativeInteger",
-    	  "nonPositiveInteger", "positiveInteger", "short", "unsignedByte",
-    	  "unsignedInt", "unsignedLong", "unsignedShort"};
-    
-    static String[] dateAndTimeTypes =
-    	{ "date", "dateTime", "duration", "gDay",
-    	  "gMonth", "gMonthDay", "gYear", "gYearMonth", "time"};
-	
-	
-    public static List getAllBuiltInTypes() {
-        List items = new ArrayList();
-        //for (int i = 0; i < XSDDOMHelper.dataType.length; i++) {
-        //  items.add(XSDDOMHelper.dataType[i][0]);
-        //}
-        Iterator it = items.iterator();
-        
-        List mainContainer = new ArrayList(BUILT_IN_TYPES_SUB_GROUP);
-        ComponentSpecification header = new ComponentSpecification("", "Root", null);
-        mainContainer.add(header);
-        
-        List numbersGroup = new ArrayList();
-        header = new ComponentSpecification("", "Numbers", null);
-        numbersGroup.add(header);
-        mainContainer.add(numbersGroup);
-        
-        List dateAndTimeGroup = new ArrayList();
-        header = new ComponentSpecification("", "Date and Time", null);
-        dateAndTimeGroup.add(header);
-        mainContainer.add(dateAndTimeGroup);
-        
-        List otherGroup = new ArrayList();
-        header = new ComponentSpecification("", "Other", null);
-        otherGroup.add(header);
-        mainContainer.add(otherGroup);
-
-        while (it.hasNext()) {
-        	Object item = it.next();
-            String name = item.toString();
-
-            ComponentSpecification builtInTypeItem = new ComponentSpecification(name, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, null);
-          
-            // if this built-In Type is in Number group 
-            if ( partOf(name, numberTypes) ){
-            	// Set parent
-            	//builtInTypeItem.addAttributeInfo(CONST_PARENT, numbersGroup);
-            	
-            	numbersGroup.add(builtInTypeItem);
-            }
-            // if this built-In Type is in Date-and-Time group 
-            else if ( partOf(name, dateAndTimeTypes)){
-            	//builtInTypeItem.addAttributeInfo(CONST_PARENT, dateAndTimeGroup);
-            	dateAndTimeGroup.add(builtInTypeItem);
-            }
-            // otherwise, put in Other group
-            else {
-            	//builtInTypeItem.addAttributeInfo(CONST_PARENT, otherGroup);
-            	otherGroup.add(builtInTypeItem);
-            }
-        }
-
-        return mainContainer;
-    }
-    
-    public ILabelProvider getLabelProvider(){
-		if (labelProvider != null)
-			return labelProvider;
-		
-		labelProvider = new BuiltInTypeLabelProvider();
-		return labelProvider;
-	}
-	
-	public ITreeContentProvider getContentProvider() {
-		if (contentProvider != null)
-			return contentProvider;
-		
-		contentProvider = new BuiltInTypesTreeContentProvider();
-		return contentProvider;
-	}
-	
-	/**
-	 * Determines whether an equivalent of 'item' appears in 'array'
-	 * @param item
-	 * @param array
-	 * @return
-	 */
-	private static boolean partOf(String item, String[] array){
-	    for(int i = 0; i < array.length; i++ ){
-	    	if ( item.equals(array[i]) ){
-	    		return true;
-	    	}            		
-	    }
-	    return false;
-	}
-	
-	class BuiltInTypeLabelProvider implements ILabelProvider{
-		public Image getImage(Object element) {			
-			if ( getText(element).equals("Numbers") )
-				return XSDEditorPlugin.getXSDImage("icons/XSDNumberTypes.gif");
-			if ( getText(element).equals("Date and Time") )
-				return XSDEditorPlugin.getXSDImage("icons/XSDDateAndTimeTypes.gif");
-			if ( getText(element).equals("Other") )
-				return XSDEditorPlugin.getXSDImage("icons/browsebutton.gif");
-			if ( element instanceof ComponentSpecification ){
-				return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-			}
-			return null;
-		}
-
-		public String getText(Object element) {
-			ComponentSpecification spec = null;
-			
-			/* if not non-leaf node, the first element has the name for 
-			 * the whole list */
-			if (element instanceof List){
-				spec = (ComponentSpecification) ((List) element).get(0);
-			}
-			else if (element instanceof ComponentSpecification ){
-				spec = (ComponentSpecification) element;
-			}
-			return (String) spec.getName();
-		}
-
-		public void addListener(ILabelProviderListener listener) {
-			
-		}
-
-		public void dispose() {
-		}
-
-		public boolean isLabelProperty(Object element, String property) {
-			return false;
-		}
-
-		public void removeListener(ILabelProviderListener listener) {
-			
-		}  
-		
-	}
-
-
-	class BuiltInTypesTreeContentProvider implements ITreeContentProvider {
-
-		public Object[] getChildren(Object parentElement) {
-			if (parentElement instanceof List) {
-				List parentContent = (List) parentElement;
-				
-				/** Ignore the first element (which contains the name of this list
-				 * ie. 'Numbers', 'Date and time', 'Other') */
-				return parentContent.subList(1, parentContent.size()).toArray();
-			}
-			return new Object[0];
-		}
-
-		public Object[] getElements(Object inputElement) {
-			return getChildren(inputElement);
-		}
-
-		public Object getParent(Object element) {
-		    return null;
-		}
-
-		public boolean hasChildren(Object element) {
-			if (getChildren(element).length > 1) {
-				return true;
-			}
-			return false;
-		}
-
-		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		}
-
-		public void dispose() {
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewComponentDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewComponentDialog.java
deleted file mode 100644
index 123978b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewComponentDialog.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.dialogs;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class NewComponentDialog extends Dialog implements ModifyListener
-{
-  protected Text nameField; 
-  protected Button okButton;
-  protected String name;                             
-  protected String title;
-  protected Label errorMessageLabel;
-  protected List usedNames;
-
-  public NewComponentDialog(Shell parentShell, String title, String defaultName) 
-  {
-    super(parentShell);
-    setShellStyle(getShellStyle() | SWT.RESIZE);
-    name = defaultName;      
-    this.title = title;
-  }
-  
-  public NewComponentDialog(Shell parentShell, String title, String defaultName, List usedNames) 
-  {
-    super(parentShell);
-    setShellStyle(getShellStyle() | SWT.RESIZE);
-    name = defaultName;      
-    this.title = title;
-    this.usedNames = usedNames;
-  }
-
-  public int createAndOpen()
-  {
-    create();
-    getShell().setText(title);
-    setBlockOnOpen(true);
-    return open();
-  }
-
-  protected Control createContents(Composite parent)  
-  {
-    Control control = super.createContents(parent);
-    nameField.forceFocus();
-    nameField.selectAll();  
-    updateErrorMessage();
-    return control;
-  }
-
-
-  protected void createButtonsForButtonBar(Composite parent) 
-  {
-    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-  }
-
-  protected void createHeaderContent(Composite parent)
-  {
-  }
-  
-  protected void createExtendedContent(Composite parent)
-  {
-  }
-
-  protected Control createDialogArea(Composite parent) 
-  {
-    Composite dialogArea = (Composite)super.createDialogArea(parent);
-    
-    createHeaderContent(dialogArea);
-
-    Composite composite = new Composite(dialogArea, SWT.NONE);
-    GridLayout layout = new GridLayout();
-    layout.numColumns = 2;
-    layout.marginWidth = 0;
-    composite.setLayout(layout);
-
-    GridData gdFill= new GridData();
-    gdFill.horizontalAlignment= GridData.FILL;
-    gdFill.grabExcessHorizontalSpace= true;
-    gdFill.verticalAlignment= GridData.FILL;
-    gdFill.grabExcessVerticalSpace= true;
-    composite.setLayoutData(gdFill);
-
-    Label nameLabel = new Label(composite, SWT.NONE);
-    nameLabel.setText("Name:");//XSDEditorPlugin.getXSDString("_UI_LABEL_NAME")); //$NON-NLS-1$
-
-    nameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-    GridData gd= new GridData();
-    gd.horizontalAlignment= GridData.FILL;
-    gd.grabExcessHorizontalSpace= true;
-    gd.widthHint = 200;
-    nameField.setLayoutData(gd);
-    nameField.setText(name);
-    nameField.addModifyListener(this);
-
-    createExtendedContent(dialogArea);
-
-    // error message
-    errorMessageLabel = new Label(dialogArea, SWT.NONE);
-    errorMessageLabel.setText("error message goes here");         
-    GridData gd2 = new GridData();
-    gd2.horizontalAlignment= GridData.FILL;
-    gd2.grabExcessHorizontalSpace= true;
-    gd2.widthHint = 200;
-    errorMessageLabel.setLayoutData(gd2);          
-//    Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-//    errorMessageLabel.setForeground(color);
-
-    return dialogArea;
-  }
-  
-  public void modifyText(ModifyEvent e) 
-  {                        
-    updateErrorMessage();
-  }        
-
-  protected String computeErrorMessage(String name)
-  {
-  	if (usedNames == null)
-  		return null;
-  	
-  	Iterator iterator = usedNames.iterator();
-  	while (iterator.hasNext()) {
-  		if (name.equalsIgnoreCase((String) iterator.next())) {
-  			return "_UI_LABEL_WARNING_DUPLICATE_NAME_EXISTS";
-  		}
-  	}
-  	
-  	return null;
-  }
-
-  protected void updateErrorMessage()
-  {                 
-    String errorMessage = null;
-    String name = nameField.getText().trim();
-    if (name.length() > 0)
-    {                                
-      errorMessage = computeErrorMessage(name);
-    }   
-    else
-    {
-      errorMessage = "";
-    }  
-    errorMessageLabel.setText(errorMessage != null ? errorMessage : "");
-//    okButton.setEnabled(errorMessage == null);
-  }
- 
-  protected void buttonPressed(int buttonId) 
-  {
-    if (buttonId == IDialogConstants.OK_ID)
-    {
-      name = nameField.getText();
-    }
-    super.buttonPressed(buttonId);
-  }
-
-  public String getName()
-  {
-    return name;
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewElementButtonHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewElementButtonHandler.java
deleted file mode 100644
index 82a3c43..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewElementButtonHandler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.dialogs;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.INewComponentHandler;
-
-public class NewElementButtonHandler implements INewComponentHandler
-{
-  public NewElementButtonHandler()
-  {
-  }
-
-  public void openNewComponentDialog()
-  {
-    NewElementDialog newElementDialog = new NewElementDialog();
-    newElementDialog.open();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewElementDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewElementDialog.java
deleted file mode 100644
index b93eade..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewElementDialog.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.dialogs;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-
-public class NewElementDialog extends NewComponentDialog implements IComponentDialog
-{
-	  protected Object setObject;
-	  protected int typeKind;
-	  protected Object selection;
-
-	  public NewElementDialog()
-	  {
-	    super(Display.getCurrent().getActiveShell(), "New Element", "NewElement");    
-	  }
-	  
-	  public int createAndOpen()
-	  {
-	    int returnCode = super.createAndOpen();
-	    if (returnCode == 0)
-	    {
-	      if (setObject instanceof Adapter)
-	      {  
-	        //Command command = new AddComplexTypeDefinitionCommand(getName(), schema);
-	      }        
-	    }  
-	    return returnCode;
-	  }
-
-	  public ComponentSpecification getSelectedComponent()
-	  {
-	    ComponentSpecification componentSpecification =  new ComponentSpecification(null, getName(), null);    
-	    componentSpecification.setMetaName(IXSDSearchConstants.ELEMENT_META_NAME);
-	    componentSpecification.setNew(true);
-	    return componentSpecification;
-	  }
-
-	  public void setInitialSelection(ComponentSpecification componentSpecification)
-	  {
-	    // TODO Auto-generated method stub
-	  }
-	}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewTypeButtonHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewTypeButtonHandler.java
deleted file mode 100644
index 14ae1d7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewTypeButtonHandler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.dialogs;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.INewComponentHandler;
-
-public class NewTypeButtonHandler implements INewComponentHandler
-{
-  public NewTypeButtonHandler()
-  {
-  }
-
-  public void openNewComponentDialog()
-  {
-    NewTypeDialog newTypeDialog = new NewTypeDialog();
-    newTypeDialog.open();
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewTypeDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewTypeDialog.java
deleted file mode 100644
index cf15bfb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/NewTypeDialog.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.dialogs;
-
-import java.net.URL;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-
-public class NewTypeDialog extends NewComponentDialog implements IComponentDialog
-{
-  protected static int SIMPLE_TYPE = 0;
-  protected static int COMPLEX_TYPE = 1;
-  protected Object setObject;
-  protected int typeKind;
-  protected Object selection;
-
-  public NewTypeDialog()
-  {
-    super(Display.getCurrent().getActiveShell(), "New Type", "NewType");    
-  }
-  
-  public int createAndOpen()
-  {
-    int returnCode = super.createAndOpen();
-    if (returnCode == 0)
-    {
-      if (setObject instanceof Adapter)
-      {  
-        //Command command = new AddComplexTypeDefinitionCommand(getName(), schema);
-      }        
-    }  
-    return returnCode;
-  }
-
-  public ComponentSpecification getSelectedComponent()
-  {
-    ComponentSpecification componentSpecification =  new ComponentSpecification(null, getName(), null);    
-    componentSpecification.setMetaName(typeKind == COMPLEX_TYPE ? IXSDSearchConstants.COMPLEX_TYPE_META_NAME : IXSDSearchConstants.SIMPLE_TYPE_META_NAME);
-    componentSpecification.setNew(true);
-    return componentSpecification;
-  }
-
-  public void setInitialSelection(ComponentSpecification componentSpecification)
-  {
-    // TODO Auto-generated method stub
-  }
-
-  protected void createHeaderContent(Composite parent)
-  {
-    final Button complexTypeButton = new Button(parent, SWT.RADIO);
-    complexTypeButton.setText("Complex Type");
-    
-    final Button simpleTypeButton = new Button(parent, SWT.RADIO);
-    simpleTypeButton.setText("Simple Type");
-
-    SelectionAdapter listener = new SelectionAdapter()
-    {
-      public void widgetSelected(SelectionEvent e)
-      {
-        if (e.widget == simpleTypeButton)
-        {
-          typeKind = SIMPLE_TYPE;
-        }
-        else if (e.widget == complexTypeButton)
-        {
-          typeKind = COMPLEX_TYPE;
-        }
-      }
-    };
-    complexTypeButton.setSelection(true);
-    typeKind = COMPLEX_TYPE;
-    simpleTypeButton.addSelectionListener(listener);
-    complexTypeButton.addSelectionListener(listener);
-    Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
-    GridData gd = new GridData(GridData.FILL_BOTH);
-    separator.setLayoutData(gd);
-  }
-
-  protected String getNormalizedLocation(String location)
-  {
-    try
-    {
-      URL url = new URL(location);
-      URL resolvedURL = Platform.resolve(url);
-      location = resolvedURL.getPath();
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-    }
-    return location;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java
deleted file mode 100644
index 9b3d58f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation 
- *     Trung de Irene <trungha@ca.ibm.com>
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-/**
- * The BuiltInTypesFilteringDialog is a SelectionDialog that allows the user to
- *  select a ...
- */
-public class SelectBuiltInTypesForFilteringDialog extends CheckedTreeSelectionDialog {
-
-	public final static String CUSTOM_LIST_SEPARATOR = XSDEditorPlugin.CUSTOM_LIST_SEPARATOR;
-
-	public SelectBuiltInTypesForFilteringDialog(Shell parent, 
-			ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
-		super(parent, labelProvider, contentProvider);
-
-		init();
-	}
-	
-	public CheckboxTreeViewer getTreeViewer(){
-		return super.getTreeViewer();
-	}
-	
-	private void init(){
-		// grey state enable
-		setContainerMode(true);
-		
-		// TODO externalize String
-		setTitle("Set common Built-In types");
-		setMessage("Select the types that you do not want to filter out: ");
-		
-		//super.create();
-		//super.getTreeViewer().setSorter(new ViewerSorter());
-		
-	}
-	
-	/**
-	 *   Returns a String acting as list of built-in types selected by the user
-	 * in the filter dialog (white space acts as the item separator).
-	 *   Suggest using getSelectedBuiltInTypesFromString
-	 * to get a concrete array of selected types.
-	 *   We can only store String in the plugin preference's storage so we have 
-	 * use this method for conversion
-	 */
-	public static String getTypesListInString(Object[] chosenTypes) {
-		String returningList = "";
-		for (int i = 0; i < chosenTypes.length; i++){
-			if ( chosenTypes[i] instanceof ComponentSpecification){
-				ComponentSpecification aType = 
-					(ComponentSpecification) chosenTypes[i];
-
-				returningList += aType.getName() + CUSTOM_LIST_SEPARATOR;
-			}
-			/* else selectedBuiltInTypes[i] instanceof List, ie. a parentNode
-			 * we ignore it. */
-		}
-		return returningList;
-	}
-	
-	/**
-	 * Filters out all built-In type not recorded in the 'listString' and 
-	 * returns the result in a List
-	 * Warning: recursive method
-	 * @param listString 
-	 * @param aContainer 
-	 * 			Containing all types
-	 * @return a subset of what 'aContainer' has as specified by 'listString'
-	 */
-	public static List getSelectedBuiltInTypesFromString(String listString, 
-			List aContainer) {
-		List selectedTypes = new ArrayList();
-
-		// ignore the 'header' item in the container, starting from i = 1
-		for (int i = 1; i < aContainer.size(); i++){
-			Object o = aContainer.get(i);
-			if ( o instanceof ComponentSpecification){
-				ComponentSpecification aType = (ComponentSpecification) o;
-				String typeName = (String) aType.getName();
-				// if typeName's name appears in 'listString'
-				if ( listString.indexOf(typeName + CUSTOM_LIST_SEPARATOR) != -1)
-					selectedTypes.add(o);
-			}
-			else if ( o instanceof List){
-				selectedTypes.addAll( getSelectedBuiltInTypesFromString(listString, (List) o) ); 
-			}
-		}
-		return selectedTypes;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/Dot.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/Dot.gif
deleted file mode 100644
index 210bb24..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/Dot.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/TriangleToolBar.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/TriangleToolBar.gif
deleted file mode 100644
index bd37eb5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/TriangleToolBar.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDDateAndTimeTypes.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDDateAndTimeTypes.gif
deleted file mode 100644
index 4fc84e4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDDateAndTimeTypes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGroupRef.gif
deleted file mode 100644
index 34a7fb3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDNumberTypes.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDNumberTypes.gif
deleted file mode 100644
index 7134210..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDNumberTypes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/appinfo_browse.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/appinfo_browse.gif
deleted file mode 100644
index 85f9baa..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/appinfo_browse.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/appinfo_category.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/appinfo_category.gif
deleted file mode 100644
index 9e665d5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/appinfo_category.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/error_st_obj.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/error_st_obj.gif
deleted file mode 100644
index 0bc6068..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/error_st_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newChoice.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newChoice.gif
deleted file mode 100644
index eca1446..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newChoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newSequence.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newSequence.gif
deleted file mode 100644
index a56782f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newSequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newSequence2.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newSequence2.gif
deleted file mode 100644
index 9e3968c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/newSequence2.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/xmlcatalog_obj.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/xmlcatalog_obj.gif
deleted file mode 100644
index a61441f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/xmlcatalog_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/navigation/DesignViewNavigationLocation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/navigation/DesignViewNavigationLocation.java
deleted file mode 100644
index c6a773e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/navigation/DesignViewNavigationLocation.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.navigation;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.RootEditPart;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.INavigationLocation;
-import org.eclipse.ui.NavigationLocation;
-import org.eclipse.wst.xsd.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDVisitor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * This class exists to support navigation in a context where there is no text 
- * editor page.  In these cases we can't rely on the TextSelectionNavigationLocations
- * so we this class which is designed to work with just the design view.
- */
-public class DesignViewNavigationLocation extends NavigationLocation
-{
-  protected Path path;
-
-  public DesignViewNavigationLocation(IEditorPart part)
-  {
-    super(part);
-    this.path = new Path();
-  }
-  
-  public DesignViewNavigationLocation(IEditorPart part, XSDConcreteComponent component)
-  {
-    super(part);   
-    this.path = Path.computePath(component);  
-  }
-
-  public boolean mergeInto(INavigationLocation currentLocation)
-  {
-    boolean result = false;
-    if (currentLocation instanceof DesignViewNavigationLocation)
-    {
-      DesignViewNavigationLocation loc = (DesignViewNavigationLocation) currentLocation;
-      result = loc.path.toString().equals(path.toString());
-      //System.out.println("path1=" + loc.path.toString());
-      //System.out.println("path2=" + path.toString());
-    }
-    else
-    {
-//      System.out.println("this.editorPart = " + getEditorPart());
-//      System.out.println("that.editorPart = " + currentLocation.getInput());
-//      System.out.println(currentLocation.getClass().getName());
-    }
-    return result;
-  }
-
-  public void restoreLocation()
-  {
-    //System.out.println("resourceLocation " + path.toString());
-    XSDSchema schema = (XSDSchema) getEditorPart().getAdapter(XSDSchema.class);
-    Object viewer = getEditorPart().getAdapter(GraphicalViewer.class);
-    if (viewer instanceof DesignViewGraphicalViewer)
-    {
-      DesignViewGraphicalViewer graphicalViewer = (DesignViewGraphicalViewer) viewer;
-      RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
-      EditPart editPart = rootEditPart.getContents();
-      if (editPart instanceof RootContentEditPart)
-      {
-        XSDConcreteComponent component = Path.computeComponent(schema, path);
-        if (component != null)
-        {
-          Adapter adapter = XSDAdapterFactory.getInstance().adapt(component);
-          if (adapter != null)
-          {
-            ((RootContentEditPart) editPart).setInput(adapter);
-          }
-        }
-      }
-    }
-  }
-
-  public void restoreState(IMemento memento)
-  {
-    String string = memento.getString("path");
-    path = Path.createPath(string);
-  }
-
-  public void saveState(IMemento memento)
-  {
-    memento.putString("path", path.toString());
-  }
-
-  public void update()
-  {
-    // TODO (cs) not sure what needs to be done here
-  }
-  static class PathSegment
-  {
-    final static int ELEMENT = 1;
-    final static int TYPE = 2;
-    int kind;
-    String name;
-
-    PathSegment()
-    {
-    }
-
-    PathSegment(int kind, String name)
-    {
-      this.kind = kind;
-      this.name = name;
-    }
-  }
-  static class Path
-  {
-    List segments = new ArrayList();
-
-    static XSDConcreteComponent computeComponent(XSDSchema schema, Path path)
-    {
-      PathResolvingXSDVisitor visitor = new PathResolvingXSDVisitor(path);
-      visitor.visitSchema(schema);
-      if (visitor.isDone())
-      {
-        return visitor.result;
-      }
-      return null;
-    }
-
-    static Path createPath(String string)
-    {
-      Path path = new Path();
-      PathSegment segment = null;
-      for (StringTokenizer st = new StringTokenizer(string, "/"); st.hasMoreTokens();)
-      {
-        String token = st.nextToken();
-        int kind = -1;
-        if (token.equals("element"))
-        {
-          kind = PathSegment.ELEMENT;
-        }
-        else if (token.equals("type"))
-        {
-          kind = PathSegment.TYPE;
-        }
-        if (kind != -1)
-        {
-          segment = new PathSegment();
-          segment.kind = kind;
-          path.segments.add(segment);
-          String namePattern = "[@name='";
-          int startIndex = token.indexOf(namePattern);
-          if (startIndex != -1)
-          {
-            startIndex += namePattern.length();
-            int endIndex = token.indexOf("']");
-            if (endIndex != -1)
-            {
-              segment.name = token.substring(startIndex, endIndex);
-            }
-          }
-        }
-      }
-      return path;
-    }
-
-    static Path computePath(XSDConcreteComponent component)
-    {
-      Path path = new Path();
-      for (EObject c = component; c != null; c = c.eContainer())
-      {
-        if (c instanceof XSDConcreteComponent)
-        {
-          PathSegment segment = computePathSegment((XSDConcreteComponent) c);
-          if (segment != null)
-          {
-            path.segments.add(0, segment);
-          }
-        }
-      }
-      return path;
-    }
-
-    static PathSegment computePathSegment(XSDConcreteComponent c)
-    {
-      if (c instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration ed = (XSDElementDeclaration) c;
-        return new PathSegment(PathSegment.ELEMENT, ed.getResolvedElementDeclaration().getName());
-      }
-      else if (c instanceof XSDTypeDefinition)
-      {
-        XSDTypeDefinition td = (XSDTypeDefinition) c;
-        return new PathSegment(PathSegment.TYPE, td.getName());
-      }
-      return null;
-    }
-
-    public String toString()
-    {
-      StringBuffer b = new StringBuffer();
-      for (Iterator i = segments.iterator(); i.hasNext();)
-      {
-        PathSegment segment = (PathSegment) i.next();
-        String kind = "";
-        if (segment.kind == PathSegment.ELEMENT)
-        {
-          kind = "element";
-        }
-        else if (segment.kind == PathSegment.TYPE)
-        {
-          kind = "type";
-        }
-        b.append(kind);
-        if (segment.name != null)
-        {
-          b.append("[@name='" + segment.name + "']");
-        }
-        if (i.hasNext())
-        {
-          b.append("/");
-        }
-      }
-      return b.toString();
-    }
-  }
-  
-  
-  static class PathResolvingXSDVisitor extends XSDVisitor
-  {
-    Path path;
-    int index = -1;
-    PathSegment segment;
-    XSDConcreteComponent result = null;
-
-    PathResolvingXSDVisitor(Path path)
-    {
-      this.path = path;
-      incrementSegment();
-    }
-
-    boolean isDone()
-    {
-      return index >= path.segments.size();
-    }
-
-    void incrementSegment()
-    {
-      index++;
-      if (index < path.segments.size())
-      {
-        segment = (PathSegment) path.segments.get(index);
-      }
-      else
-      {
-        segment = null;
-      }
-    }
-
-    public void visitSchema(XSDSchema schema)
-    {
-      if (segment != null)
-      {
-        if (segment.kind == PathSegment.ELEMENT)
-        {
-          XSDElementDeclaration ed = schema.resolveElementDeclaration(segment.name);
-          if (ed != null)
-          {
-            visitElementDeclaration(ed);
-          }
-        }
-        else if (segment.kind == PathSegment.TYPE)
-        {
-          XSDTypeDefinition td = schema.resolveTypeDefinition(segment.name);
-          if (td != null)
-          {
-            visitTypeDefinition(td);
-          }
-        }
-      }
-    }
-
-    public void visitElementDeclaration(XSDElementDeclaration element)
-    {
-      if (segment != null)
-      {
-        String name = element.getResolvedElementDeclaration().getName();
-        if (segment.kind == PathSegment.ELEMENT && isMatch(segment.name, name))
-        {
-          result = element;
-          incrementSegment();
-          if (!isDone())
-          {
-            super.visitElementDeclaration(element);
-          }
-        }
-      }
-    }
-
-    public void visitTypeDefinition(XSDTypeDefinition type)
-    {
-      if (segment != null)
-      {
-        String name = type.getName();
-        if (segment.kind == PathSegment.TYPE && isMatch(segment.name, name))
-        {
-          result = type;
-          incrementSegment();
-          if (!isDone())
-          {
-            super.visitTypeDefinition(type);
-          }
-        }
-      }
-    }
-
-    protected boolean isMatch(String name1, String name2)
-    {
-      return name1 != null ? name1.equals(name2) : name1 == name2;
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java
deleted file mode 100644
index f3e2d6d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.navigation;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextSelectionNavigationLocation;
-
-/**
- * The platform's navigation history plumbing doesn't like multipage text
- * editors very much and tends to ignore text locations.  To fix this
- * problem we need to override the getEditPart() method of the super class
- * in order to return the actual TextEditor of our multi-page editor
- */
-public class MultiPageEditorTextSelectionNavigationLocation extends TextSelectionNavigationLocation
-{
-  public MultiPageEditorTextSelectionNavigationLocation(ITextEditor part, boolean initialize)
-  {
-    super(part, initialize);
-  }
-
-  protected IEditorPart getEditorPart()
-  {
-    IEditorPart part = super.getEditorPart();
-    if (part != null)
-      return (ITextEditor) part.getAdapter(ITextEditor.class);
-    return null;
-  }
-
-  public String getText()
-  {
-    // ISSUE: how to get title?
-    // IEditorPart part = getEditorPart();
-    // if (part instanceof WSDLTextEditor) {
-    // return ((WSDLTextEditor) part).getWSDLEditor().getTitle();
-    // }
-    // else {
-    // return super.getText();
-    // }
-    return super.getText();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/preferences/XSDPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/preferences/XSDPreferencePage.java
deleted file mode 100644
index 7e4ecd2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/preferences/XSDPreferencePage.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.editor.XSDEditorContextIds;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-public class XSDPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener 
-{
-  Text indentTextField;
-  String indentString;
-  Text schemaNsPrefixField;
-  Text defaultTargetNamespaceText;
-  Button qualifyXSDLanguage;
-
-  /**
-   * Creates preference page controls on demand.
-   *   @param parent  the parent for the preference page
-   */
-  protected Control createContents(Composite parent)
-  {
-    WorkbenchHelp.setHelp(parent, XSDEditorContextIds.XSDP_PREFERENCE_PAGE);
-
-    Group group = createGroup(parent, 2);   
-    group.setText(XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_NAMESPACE_PREFIX"));
-
-    qualifyXSDLanguage = ViewUtility.createCheckBox(group, XSDEditorPlugin.getXSDString("_UI_QUALIFY_XSD"));
-    ViewUtility.createLabel(group, " ");
-
-    createLabel(group, XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_DEFAULT_PREFIX"));
-    schemaNsPrefixField = createTextField(group);
-    schemaNsPrefixField.addKeyListener(new KeyAdapter()
-    {
-      public void keyPressed(KeyEvent e)
-      {
-        setValid(true);
-      }      
-    });
-    
-    createLabel(group, XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE"));
-    defaultTargetNamespaceText = createTextField(group);
-
-    initializeValues();
-
-    return new Composite(parent, SWT.NULL);
-  }
-
-  private Group createGroup(Composite parent, int numColumns) 
-  {
-    Group group = new Group(parent, SWT.NULL);
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    group.setLayout(layout);
-
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    group.setLayoutData(data);
-    
-    return group;
-  }
-
-  private Text createTextField(Composite parent) 
-  {
-     Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-     GridData data = new GridData();
-     data.verticalAlignment = GridData.FILL;
-     data.horizontalAlignment = GridData.FILL;
-     data.grabExcessHorizontalSpace = true;
-     text.setLayoutData(data);
-
-     return text;
-  }
-
-  private Label createLabel(Composite parent, String text) 
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    label.setText(text);
-    
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.CENTER;
-    data.horizontalAlignment = GridData.FILL;
-    label.setLayoutData(data);
-    
-    return label;
-  }
-  
-  /**
-   * Does anything necessary because the default button has been pressed.
-   */
-  protected void performDefaults() 
-  {
-    super.performDefaults();
-    initializeDefaults();
-    checkValues();
-  }
-
-  /**
-   * Do anything necessary because the OK button has been pressed.
-   *  @return whether it is okay to close the preference page
-   */
-  public boolean performOk() 
-  {
-    if (checkValues())
-    {
-      storeValues();    
-      return true;
-    }
-    return false;
-  }
-
-  protected void performApply()
-  {
-    if (checkValues())
-    {
-      storeValues();    
-    }
-  }
-
-  /**
-   * Handles events generated by controls on this page.
-   *   @param e  the event to handle
-   */
-  public void handleEvent(Event e) 
-  {
-  }
-
-  /**
-   * @see IWorkbenchPreferencePage
-   */
-  public void init(IWorkbench workbench)
-  { 
-  }
-
-  /** 
-   * The indent is stored in the preference store associated with the XML Schema Model
-   */
-  public IPreferenceStore getPreferenceStore()
-  {
-    return XSDEditorPlugin.getPlugin().getPreferenceStore();
-  }
-
-  /**
-   * Initializes states of the controls using default values
-   * in the preference store.
-   */
-  private void initializeDefaults() 
-  {
-    schemaNsPrefixField.setText(getPreferenceStore().getDefaultString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
-    qualifyXSDLanguage.setSelection(getPreferenceStore().getDefaultBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
-    defaultTargetNamespaceText.setText(getPreferenceStore().getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
-  }
-
-  /**
-   * Initializes states of the controls from the preference store.
-   */
-  private void initializeValues() 
-  {
-    IPreferenceStore store = getPreferenceStore();
-    schemaNsPrefixField.setText(store.getString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
-    qualifyXSDLanguage.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
-    defaultTargetNamespaceText.setText(store.getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
-  }
-
-  /**
-   * Stores the values of the controls back to the preference store.
-   */
-  private void storeValues() 
-  {
-    IPreferenceStore store = getPreferenceStore();
-
-    store.setValue(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT, getXMLSchemaPrefix());
-    store.setValue(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY, getQualify());
-    store.setValue(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE, getXMLSchemaTargetNamespace());
-
-    XSDEditorPlugin.getPlugin().savePluginPreferences();
-  }
-
-  public String getXMLSchemaPrefix()
-  {
-    String prefix = schemaNsPrefixField.getText();
-    if (prefix == null || prefix.equals("")) 
-    {
-      return "xsd";
-    }
-    return prefix;
-  }
-
-  public boolean getQualify()
-  {
-    return qualifyXSDLanguage.getSelection();
-  }
-  
-  /**
-   * Get the xml schema default target namespace
-   */
-  public String getXMLSchemaTargetNamespace()
-  {
-  	String targetNamespace = defaultTargetNamespaceText.getText();
-    if (targetNamespace == null || targetNamespace.equals("")) 
-    {
-      return XSDEditorPlugin.DEFAULT_TARGET_NAMESPACE;
-    }
-    return targetNamespace;
-  }
-  
-  public boolean checkValues()
-  {
-// KCPort TODO    String errorMessage = ValidateHelper.checkXMLName(schemaNsPrefixField.getText());
-	 String errorMessage = null;
-
-    if (errorMessage == null || errorMessage.length() == 0)
-    {
-      setErrorMessage(null);
-      setValid(true);
-      return true;
-    }
-    else
-    {
-      setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_INVALID_PREFIX"));
-      setValid(false);
-      return false;
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/IXSDTypesFilter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/IXSDTypesFilter.java
deleted file mode 100644
index 204066c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/IXSDTypesFilter.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.search;
-
-public interface IXSDTypesFilter {	
-	/**
-	 * Give me an Object o, if I know it and it should be filtered out, I will 
-	 * return true. Otherwise I'll return false, even if I don't know the object 
-	 * @param o
-	 * @return
-	 */
-	public boolean shouldFilterOut(Object o);
-	
-	public void turnOn();
-	public void turnOff();
-	public boolean isOn();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDComponentDescriptionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDComponentDescriptionProvider.java
deleted file mode 100644
index 25bb6b3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDComponentDescriptionProvider.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDComponentDescriptionProvider extends LabelProvider implements IComponentDescriptionProvider
-{
-  public boolean isApplicable(Object component)
-  {
-    // TODO (cs) if this provider is used in a multi language context
-    // we'll need to provide some logic here
-    return true;
-  }
-
-  private static final Image SIMPLE_TYPE_IMAGE =  XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-  private static final Image COMPLEX_TYPE_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif");
-  private static final Image ELEMENT_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
-  //private final static Image BUILT_IN_TYPE)IMAGE = 
-    
-  public String getQualifier(Object component)
-  {
-    String result = null;
-    if (component instanceof ComponentSpecification)
-    {
-      result = ((ComponentSpecification)component).getQualifier();
-    }  
-    else if (component instanceof XSDNamedComponent)
-    {
-      result = ((XSDNamedComponent)component).getTargetNamespace(); 
-    }  
-    else if (component instanceof SearchMatch)
-    {
-      QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component);
-      if (qualifiedName != null)
-      {  
-        result = qualifiedName.getNamespace();
-      }    
-    }  
-    return result;
-  }
-  
-  // TODO... this will be much easier with Hiroshi's proposed SearchMatch changes
-  //
-  private QualifiedName getQualifiedNameForSearchMatch(SearchMatch match)
-  {
-    QualifiedName qualifiedName = null;
-    Object o = match.map.get("name");
-    if (o != null && o instanceof QualifiedName)
-    {  
-      qualifiedName = (QualifiedName)o;
-    }      
-    return qualifiedName;
-  }
-
-  public String getName(Object component)
-  {
-    String result = null;
-    if (component instanceof ComponentSpecification)
-    {
-      result = ((ComponentSpecification)component).getName();
-    }  
-    else if (component instanceof XSDNamedComponent)
-    {
-      result = ((XSDNamedComponent)component).getName(); 
-    }  
-    else if (component instanceof SearchMatch)
-    {
-      QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component);
-      if (qualifiedName != null)
-      {  
-        result = qualifiedName.getLocalName();
-      }    
-    }      
-    return result;
-  }
-
-  public IFile getFile(Object component)
-  {
-    IFile result = null;
-    if (component instanceof ComponentSpecification)
-    {
-      result = ((ComponentSpecification)component).getFile();
-    }  
-    else if (component instanceof SearchMatch)
-    {
-      result = ((SearchMatch)component).getFile();
-    }  
-    else if (component instanceof XSDConcreteComponent)
-    {
-      XSDConcreteComponent concreteComponent = (XSDConcreteComponent)component;
-      XSDSchema schema = concreteComponent.getSchema();
-      if (schema != null)
-      {
-        // TODO (cs) revisit and test more
-        //
-        String location = schema.getSchemaLocation();
-        String platformResource = "platform:/resource";
-        if (location != null && location.startsWith(platformResource))
-        {
-          Path path = new Path(location.substring(platformResource.length()));
-          result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-        }  
-      }  
-    }
-    return result;
-  }
-
-  public ILabelProvider getLabelProvider()
-  {
-    return this;
-  }
-  
-  public String getText(Object element)
-  {
-    String result = "";
-    String name = getName(element);
-    if (name != null)
-    {
-      result += name;
-      /*
-      String qualifier = getQualifier(element);
-      if (qualifier != null)
-      {
-        result += " - " + qualifier;
-      }  
-      IFile file = getFile(element);
-      if (file != null)
-      {
-        result += "  (" + file.getProject().getName() + ")";
-      }*/ 
-    }
-    return result;
-  } 
-  
-  public Image getImage(Object component)
-  {
-    Image result = null; 
-    if (component instanceof SearchMatch)
-    {
-      SearchMatch searchMatch = (SearchMatch)component;
-      QualifiedName qualifiedName = (QualifiedName)searchMatch.map.get("metaName");
-      if ( qualifiedName != null ){
-    	  if ( qualifiedName.equals(IXSDSearchConstants.SIMPLE_TYPE_META_NAME))
-    		  result = SIMPLE_TYPE_IMAGE;
-    	  else if ( qualifiedName.equals(IXSDSearchConstants.COMPLEX_TYPE_META_NAME))
-    		  result = COMPLEX_TYPE_IMAGE;
-    	  else if ( qualifiedName.equals(IXSDSearchConstants.ELEMENT_META_NAME))
-    		  result = ELEMENT_IMAGE;
-      }
-    }      
-    else if (component instanceof XSDComplexTypeDefinition)
-      result = COMPLEX_TYPE_IMAGE;      
-    else if (component instanceof XSDSimpleTypeDefinition)
-      result = SIMPLE_TYPE_IMAGE;
-    else if (component instanceof XSDElementDeclaration)
-      result = ELEMENT_IMAGE;
-    return result;
-  }
-
-  public Image getFileIcon(Object component) {
-	return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif");
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDElementsSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDElementsSearchListProvider.java
deleted file mode 100644
index 288609b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDElementsSearchListProvider.java
+++ /dev/null
@@ -1,170 +0,0 @@
-package org.eclipse.wst.xsd.editor.internal.search;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchPlugin;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentSearchListProvider;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSchemaDirective;
-
-public class XSDElementsSearchListProvider implements
-		IComponentSearchListProvider {
-	protected XSDSchema[] schemas;
-
-	protected IFile currentFile;
-
-	// TODO (cs) remove these and use proper search scopes!
-	//
-	public static final int ENCLOSING_PROJECT_SCOPE = 0;
-
-	public static final int ENTIRE_WORKSPACE_SCOPE = 1;
-
-	public XSDElementsSearchListProvider(IFile currentFile,
-			XSDSchema[] schemas) {
-		this.schemas = schemas;
-		this.currentFile = currentFile;
-	}
-
-	public void populateComponentList(IComponentList list, SearchScope scope,
-			IProgressMonitor pm) {
-		// we traverse the elements already defined within the visible
-		// schemas
-		// we do this in addition to the component search since this should
-		// execute
-		// very quickly and there's a good chance the user wants to select an
-		// element that's
-		// already imported/included
-		// TODO (cs) ensure we don't add duplicates when we proceed to use the
-		// search list
-		//
-		for (int i = 0; i < schemas.length; i++) {
-			XSDSchema schema = schemas[i];
-			ComponentCollectingXSDVisitor visitor = 
-				new ComponentCollectingXSDVisitor(list);
-			visitor.visitSchema(schema, true);
-		}
-
-		// finally we call the search API's to do a potentially slow search
-		if (scope != null) {
-			populateComponentListUsingSearch(list, scope, pm);
-		}
-	}
-
-	class ComponentCollectingXSDVisitor {
-		protected List visitedSchemas = new ArrayList();
-
-		IComponentList list;
-
-		ComponentCollectingXSDVisitor(IComponentList list) {
-			this.list = list;
-		}
-
-		public void visitSchema(XSDSchema schema, boolean visitImportedSchema) {
-			
-			visitedSchemas.add(schema);
-			for (Iterator contents = schema.getContents().iterator(); contents.hasNext();) {
-				XSDSchemaContent content = (XSDSchemaContent) contents.next();
-				if (content instanceof XSDSchemaDirective) {
-					XSDSchemaDirective schemaDirective = (XSDSchemaDirective) content;
-					XSDSchema extSchema = schemaDirective.getResolvedSchema();
-					if (extSchema != null && !visitedSchemas.contains(extSchema)){
-						if ( schemaDirective instanceof XSDImport && visitImportedSchema){
-							visitSchema(extSchema, false);
-						}
-						else if ( extSchema instanceof XSDInclude || extSchema instanceof XSDImport){
-							visitSchema(extSchema, false);
-						}
-					}
-				} else if (content instanceof XSDElementDeclaration) {
-					list.add(content);
-				}
-			}
-		}
-	}
-
-	private void populateComponentListUsingSearch(IComponentList list,
-			SearchScope scope, IProgressMonitor pm) {
-		SearchEngine searchEngine = new SearchEngine();
-		InternalSearchRequestor requestor = new InternalSearchRequestor(list);
-		findTypes(searchEngine, requestor, scope,
-				IXSDSearchConstants.ELEMENT_META_NAME);
-	}
-
-	class InternalSearchRequestor extends SearchRequestor {
-		IComponentList componentList;
-
-		InternalSearchRequestor(IComponentList componentList) {
-			this.componentList = componentList;
-		}
-
-		public void acceptSearchMatch(SearchMatch match) throws CoreException {
-			// we filter out the matches from the current file since we assume
-			// the
-			// info derived from our schema models is more update to date
-			// (in the event that we haven't saved our latest modifications)
-			//
-			if (match.getFile() != currentFile) {
-				// TODO... this ugly qualified name stashing will go away soon
-				//
-				QualifiedName qualifiedName = null;
-				Object o = match.map.get("name");
-				if (o != null && o instanceof QualifiedName) {
-					qualifiedName = (QualifiedName) o;
-				}
-				if (qualifiedName != null
-						&& qualifiedName.getLocalName() != null) {
-					componentList.add(match);
-				}
-			}
-		}
-	}
-
-	protected void findTypes(SearchEngine searchEngine,
-			SearchRequestor requestor, SearchScope scope, QualifiedName metaName) {
-		try {
-			XMLComponentDeclarationPattern pattern = new XMLComponentDeclarationPattern(
-					new QualifiedName("*", "*"), metaName,
-					SearchPattern.R_PATTERN_MATCH);
-
-			// TODO (cs) revist this... we shouldn't be needing to hard-code
-			// partipant id's
-			// All we're really doing here is trying to avoid finding matches in
-			// wsdl's since we don't
-			// ever want to import/include a wsdl from a schema! Maybe we should
-			// just scope out any file
-			// types that aren't xsd's using a custom SearchScope?
-			//
-			SearchParticipant particpant = SearchPlugin.getDefault()
-					.getSearchParticipant(
-							"org.eclipse.wst.xsd.search.XSDSearchParticipant");
-
-			Assert.isNotNull(particpant);
-			SearchParticipant[] participants = { particpant };
-			searchEngine.search(pattern, requestor, participants, scope, null,
-					new NullProgressMonitor());
-		} catch (CoreException e) {
-			e.printStackTrace();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDSearchListDialogDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDSearchListDialogDelegate.java
deleted file mode 100644
index 1c719ac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDSearchListDialogDelegate.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialog;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialogConfiguration;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ScopedComponentSearchListDialog;
-import org.eclipse.wst.xsd.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.dialogs.NewElementButtonHandler;
-import org.eclipse.wst.xsd.editor.internal.dialogs.NewTypeButtonHandler;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSearchListDialogDelegate implements IComponentDialog
-{
-  public final static QualifiedName TYPE_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "type");
-  public final static QualifiedName ELEMENT_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "element");
-  // protected Object setObject;
-  protected ComponentSpecification selection;
-  protected IFile currentFile;
-  protected XSDSchema[] schemas;
-  protected QualifiedName metaName;
-
-  public XSDSearchListDialogDelegate(QualifiedName metaName, IFile currentFile, XSDSchema[] schemas)
-  {
-    super();
-    this.metaName = metaName;
-    this.currentFile = currentFile;
-    this.schemas = schemas;
-  }
-
-  public ComponentSpecification getSelectedComponent()
-  {
-    return selection;
-  }
-
-  public void setInitialSelection(ComponentSpecification componentSpecification)
-  {
-    // TODO Auto-generated method stub   
-  }
-  
-  public int createAndOpen()
-  {
-    Shell shell = XSDEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
-    int returnValue = Window.CANCEL;
-    ComponentSearchListDialog dialog = null;
-    if ( metaName == ELEMENT_META_NAME)
-    {
-    	XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider();
-    	final XSDElementsSearchListProvider searchListProvider = new XSDElementsSearchListProvider(currentFile, schemas);
-    	ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
-    	
-        configuration.setDescriptionProvider(descriptionProvider);
-        configuration.setSearchListProvider(searchListProvider);
-        configuration.setFilterLabelText("Name (? = any character, * = any string):");
-        configuration.setListLabelText("Elements:");
-        configuration.setNewComponentHandler(new NewElementButtonHandler());
-        //TODO externalize string
-        dialog = new ScopedComponentSearchListDialog(shell, "Set element reference", configuration);
-    }
-    else if (metaName == TYPE_META_NAME)
-    {
-      XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider();
-      final XSDTypesSearchListProvider searchListProvider = new XSDTypesSearchListProvider(currentFile, schemas);
-     
-      ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
-      configuration.setDescriptionProvider(descriptionProvider);
-      configuration.setSearchListProvider(searchListProvider);
-      configuration.setNewComponentHandler(new NewTypeButtonHandler());
-      configuration.setFilterLabelText("Name (? = any character, * = any string):");
-      configuration.setListLabelText("Types:");
-      dialog = new ScopedComponentSearchListDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), configuration);
-    }
-    
-    if (dialog != null)
-    {
-      dialog.setBlockOnOpen(true);
-      dialog.create();
-      returnValue = dialog.open();
-      if (returnValue == Window.OK)
-      {
-        selection = dialog.getSelectedComponent();
-      }
-    }
-    return returnValue;
-  }
-
-  private IEditorPart getActiveEditor()
-  {
-    IWorkbench workbench = PlatformUI.getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-    return editorPart;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDTypesSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDTypesSearchListProvider.java
deleted file mode 100644
index e201cba..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/search/XSDTypesSearchListProvider.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.search;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchPlugin;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentSearchListProvider;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDTypesSearchListProvider implements IComponentSearchListProvider
-{
-  protected XSDSchema[] schemas;
-  protected IFile currentFile;
-  // TODO (cs) remove these and use proper search scopes!
-  //
-  public static final int ENCLOSING_PROJECT_SCOPE = 0;
-  public static final int ENTIRE_WORKSPACE_SCOPE = 1;
-  
-  protected IXSDTypesFilter builtInFilter;
-  
-  /**
-   * Determines if we should use the filter
-   * This us used to turn the filter on and off 
-   */
-  protected boolean supportFilter = true;
-  private boolean showComplexTypes = true;
-
-  public XSDTypesSearchListProvider(IFile currentFile, XSDSchema[] schemas)
-  {
-    this.schemas = schemas;
-    this.currentFile = currentFile;
-  }
-
-  public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm)
-  {	  
-    // first we add the 'built in' types
-    //
-    XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
-    for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
-    {
-    	XSDTypeDefinition td = (XSDTypeDefinition) i.next();
-    	if ( builtInFilter == null || !builtInFilter.shouldFilterOut(td) ) {
-    		list.add(td);
-    	}
-    }    
-  
-    // now we traverse the types already defined within the visible schemas
-    // we do this in addition to the component search since this should execute
-    // very quickly and there's a good chance the user wants to select a time that's 
-    // already imported/included
-    // TODO (cs) ensure we don't add duplicates when we proceed to use the search list
-    //
-    for (int i = 0; i < schemas.length; i++)
-    {
-      XSDSchema schema = schemas[i];
-      ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list);
-      visitor.visitSchema(schema, true);
-    }
-    
-    // finally we call the search API's to do a potentially slow search
-    //
-    if (scope != null)
-    {  
-      populateComponentListUsingSearch(list, scope, pm);
-    }  
-  }
-  class ComponentCollectingXSDVisitor
-  {
-    protected List visitedSchemas = new ArrayList();
-    IComponentList list;
-    
-    ComponentCollectingXSDVisitor(IComponentList list)
-    {
-      this.list = list;  
-    }
-
-    public void visitSchema(XSDSchema schema, boolean visitImportedSchema)
-    {
-      visitedSchemas.add(schema);
-      for (Iterator contents = schema.getContents().iterator(); contents.hasNext();)
-      {
-        XSDSchemaContent content = (XSDSchemaContent) contents.next();
-        if (content instanceof XSDSchemaDirective)
-        {
-          XSDSchemaDirective schemaDirective = (XSDSchemaDirective) content;
-          XSDSchema extSchema = schemaDirective.getResolvedSchema();
-          if (extSchema != null && !visitedSchemas.contains(extSchema))
-          {
-            if ( schemaDirective instanceof XSDImport && visitImportedSchema){
-            	visitSchema(extSchema, false);
-            }
-            else if ( schemaDirective instanceof XSDInclude ||
-            		schemaDirective instanceof XSDRedefine){
-            	visitSchema(extSchema, false);
-            }
-          }
-        }
-        else if (content instanceof XSDTypeDefinition)
-        {
-          if ( showComplexTypes || ! (content instanceof XSDComplexTypeDefinition) )
-        	  list.add(content);
-        }
-      }
-    }
-  }
-
-  private void populateComponentListUsingSearch(IComponentList list, SearchScope scope, IProgressMonitor pm)
-  {
-    SearchEngine searchEngine = new SearchEngine();
-    InternalSearchRequestor requestor = new InternalSearchRequestor(list);
-    if (showComplexTypes)
-    	findTypes(searchEngine, requestor, scope, IXSDSearchConstants.COMPLEX_TYPE_META_NAME);
-    findTypes(searchEngine, requestor, scope, IXSDSearchConstants.SIMPLE_TYPE_META_NAME);
-  }
-  
-  class InternalSearchRequestor extends SearchRequestor
-  {
-    IComponentList componentList;
-
-    InternalSearchRequestor(IComponentList componentList)
-    {
-      this.componentList = componentList;
-    }
-
-    public void acceptSearchMatch(SearchMatch match) throws CoreException
-    {
-      // we filter out the matches from the current file since we assume the
-      // info derived from our schema models is more update to date
-      // (in the event that we haven't saved our latest modifications)
-      //
-      if (match.getFile() != currentFile)
-      {  
-        // TODO... this ugly qualified name stashing will go away soon
-        //
-        QualifiedName qualifiedName = null;
-        Object o = match.map.get("name");
-        if (o != null && o instanceof QualifiedName)
-        {  
-          qualifiedName = (QualifiedName)o;
-        } 
-        if (qualifiedName != null && qualifiedName.getLocalName() != null)
-        {  
-          componentList.add(match);
-        }
-      }  
-    }
-  }
-
-  protected void findTypes(SearchEngine searchEngine, SearchRequestor requestor, SearchScope scope, QualifiedName metaName)
-  {
-    try
-    {
-      XMLComponentDeclarationPattern pattern = new XMLComponentDeclarationPattern(new QualifiedName("*", "*"), metaName, SearchPattern.R_PATTERN_MATCH);
-      
-      // TODO (cs) revist this... we shouldn't be needing to hard-code partipant id's
-      // All we're really doing here is trying to avoid finding matches in wsdl's since we don't
-      // ever want to import/include a wsdl from a schema! Maybe we should just scope out any file 
-      // types that aren't xsd's using a custom SearchScope?
-      //
-      SearchParticipant particpant = SearchPlugin.getDefault().getSearchParticipant("org.eclipse.wst.xsd.search.XSDSearchParticipant");
-      Assert.isNotNull(particpant);
-      SearchParticipant[] participants = {particpant};
-      searchEngine.search(pattern, requestor, participants, scope, null, new NullProgressMonitor());
-    }
-    catch (CoreException e)
-    {
-      e.printStackTrace();
-    }
-  }
-
-  public void _populateComponentListQuick(IComponentList list, IProgressMonitor pm)
-  {    
-  }
-
-  public void turnBuiltInFilterOn(boolean option){
-	  supportFilter = option;
-  }
-  
-  public void setBuiltInFilter(IXSDTypesFilter filter) {
- 	this.builtInFilter = filter;
-  }
-  
-  public void showComplexTypes(boolean show){
-	  showComplexTypes = show;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/utils/OpenOnSelectionHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/utils/OpenOnSelectionHelper.java
deleted file mode 100644
index 5789cc6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/utils/OpenOnSelectionHelper.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.editor.internal.utils;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xsd.editor.InternalXSDMultiPageEditor;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-
-// issue (cs) can we remove this?
-//
-public class OpenOnSelectionHelper
-{
-  
-  protected StructuredTextEditor textEditor;
-  protected XSDSchema xsdSchema;
-
- 
-  public OpenOnSelectionHelper(StructuredTextEditor textEditor, XSDSchema xsdSchema)
-  {
-  	this.textEditor = textEditor;
-  	this.xsdSchema = xsdSchema;
-  }
-  
-
-  boolean lastResult;
-  
-  public static void openXSDEditor(String schemaLocation)
-  {
-		IPath schemaPath = new Path(schemaLocation);
-		
-		final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-	
-		Display.getDefault().syncExec(new Runnable()
-		{
-			/**
-			 * @see java.lang.Runnable#run()
-			 */
-			public void run()
-			{
-				final IWorkbenchWindow workbenchWindow = XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
-				if (workbenchWindow != null)
-				{
-					try
-					{
-					  workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.PLUGIN_ID);
-					}
-					catch (PartInitException initEx)
-					{
-					  initEx.printStackTrace();
-					}
-					catch(Exception e)
-					{
-					  e.printStackTrace();
-					}
-				}          
-			}
-		});
-  }
-  
-  protected boolean revealObject(final XSDConcreteComponent component)
-  {
-    if (component.getRootContainer().equals(xsdSchema))
-    {
-      Node element = component.getElement();
-      if (element instanceof IndexedRegion)
-      {
-        IndexedRegion indexNode = (IndexedRegion) element;
-        textEditor.getTextViewer().setRangeIndication(indexNode.getStartOffset(), indexNode.getEndOffset() - indexNode.getStartOffset(), true);
-        return true;
-      }
-      return false;
-    }
-    else
-    {
-      lastResult = false;
-      if (component.getSchema() != null)
-      {
-				String schemaLocation = URIHelper.removePlatformResourceProtocol(component.getSchema().getSchemaLocation());
-        IPath schemaPath = new Path(schemaLocation);
-				final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-        Display.getDefault().syncExec(new Runnable()
-        {
-	        /**
-	         * @see java.lang.Runnable#run()
-	         */
-	        public void run()
-	        {
-		        final IWorkbenchWindow workbenchWindow = XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
-		        if (workbenchWindow != null)
-		        {
-							try
-							{
-								IEditorPart editorPart = workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.getPlugin().PLUGIN_ID);
-								if (editorPart instanceof InternalXSDMultiPageEditor)
-								{
-									((InternalXSDMultiPageEditor)editorPart).openOnGlobalReference(component);
-									lastResult = true;
-								}
-							}
-							catch (PartInitException initEx)
-							{
-							}
-						}          
-					}
-				});
-      }
-      return lastResult;
-    }
-  }
-  
-  public XSDNamedComponent openOnGlobalReference(XSDConcreteComponent comp)
-  {
-    XSDSchema schema = xsdSchema;
-    String name = null;
-    if (comp instanceof XSDNamedComponent)
-    {
-      name = ((XSDNamedComponent) comp).getName();
-    }
-    
-    if (schema == null || name == null)
-    {
-      return null;
-    }
-
-    List objects = null;    
-    if (comp instanceof XSDElementDeclaration)
-    {
-      objects = schema.getElementDeclarations();
-    }
-    else if (comp instanceof XSDTypeDefinition)
-    {
-      objects = schema.getTypeDefinitions();
-    }
-
-    if (objects != null)
-    {
-      for (Iterator iter = objects.iterator(); iter.hasNext();)
-      {
-        XSDNamedComponent namedComp = (XSDNamedComponent) iter.next();
-        
-        if (namedComp.getName().equals(name))
-        {
-          revealObject(namedComp);
-          return namedComp;
-        }
-      }
-    }
-    return null;
-  }
-  
-  public boolean openOnSelection()
-  {
-    List selectedNodes = null;
-    ISelection selection = textEditor.getSelectionProvider().getSelection();
-    if (selection instanceof IStructuredSelection) {
-      selectedNodes = ((IStructuredSelection) selection).toList();
-    }
-
-    if (selectedNodes != null && !selectedNodes.isEmpty())
-    {
-      for (Iterator i = selectedNodes.iterator(); i.hasNext();)
-      {
-        Object obj = i.next();
-        if (xsdSchema != null)
-        {
-          XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent((Node)obj);
-          XSDConcreteComponent objectToReveal = null;
-
-          if (xsdComp instanceof XSDElementDeclaration)
-          {
-            XSDElementDeclaration elementDecl = (XSDElementDeclaration) xsdComp;
-            if (elementDecl.isElementDeclarationReference())
-            {
-              objectToReveal = elementDecl.getResolvedElementDeclaration();
-            }
-            else
-            {
-              XSDConcreteComponent typeDef = null;
-              if (elementDecl.getAnonymousTypeDefinition() == null)
-              {
-                typeDef = elementDecl.getTypeDefinition();
-              }
-              
-              XSDConcreteComponent subGroupAffiliation = elementDecl.getSubstitutionGroupAffiliation();
-              
-              if (typeDef != null && subGroupAffiliation != null)
-              {
-                // we have 2 things we can navigate to, if the cursor is anywhere on the substitution attribute
-                // then jump to that, otherwise just go to the typeDef.
-                if (obj instanceof Attr && ((Attr)obj).getLocalName().equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
-                {
-                  objectToReveal = subGroupAffiliation;
-                }
-                else
-                {
-                  // try to reveal the type now.  On success, then we return true.
-                  // if we fail, set the substitution group as the object to reveal as a backup plan.
-                  if (revealObject(typeDef))
-                  {
-                    return true;
-                  }
-                  else
-                  {
-                    objectToReveal = subGroupAffiliation;
-                  }
-                }
-              }
-              else
-              {
-                // one or more of these is null.  If the typeDef is non-null, use it.  Otherwise
-                // try and use the substitution group
-                objectToReveal = typeDef != null ? typeDef : subGroupAffiliation;
-              }
-            }
-          }
-          else if (xsdComp instanceof XSDModelGroupDefinition)
-          {
-            XSDModelGroupDefinition elementDecl = (XSDModelGroupDefinition) xsdComp;
-            if (elementDecl.isModelGroupDefinitionReference())
-            {
-              objectToReveal = elementDecl.getResolvedModelGroupDefinition();
-            }
-          }
-          else if (xsdComp instanceof XSDAttributeDeclaration)
-          {
-            XSDAttributeDeclaration attrDecl = (XSDAttributeDeclaration) xsdComp;
-            if (attrDecl.isAttributeDeclarationReference())
-            {
-              objectToReveal = attrDecl.getResolvedAttributeDeclaration();
-            }
-            else if (attrDecl.getAnonymousTypeDefinition() == null)
-            {
-              objectToReveal = attrDecl.getTypeDefinition();
-            }              
-          }
-          else if (xsdComp instanceof XSDAttributeGroupDefinition)
-          {
-            XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) xsdComp;
-            if (attrGroupDef.isAttributeGroupDefinitionReference())
-            {
-              objectToReveal = attrGroupDef.getResolvedAttributeGroupDefinition();
-            }
-          }
-          else if (xsdComp instanceof XSDIdentityConstraintDefinition)
-          {
-            XSDIdentityConstraintDefinition idConstraintDef = (XSDIdentityConstraintDefinition) xsdComp;
-            if (idConstraintDef.getReferencedKey() != null)
-            {
-              objectToReveal = idConstraintDef.getReferencedKey();
-            }
-          }
-          else if (xsdComp instanceof XSDSimpleTypeDefinition)
-          {
-            XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComp;
-            objectToReveal = typeDef.getItemTypeDefinition();
-            if (objectToReveal == null)
-            {
-              // if itemType attribute is not set, then check for memberType
-              List memberTypes = typeDef.getMemberTypeDefinitions();
-              if (memberTypes != null && memberTypes.size() > 0)
-              {
-                objectToReveal = (XSDConcreteComponent)memberTypes.get(0);
-              }              
-            }
-          }
-          else if (xsdComp instanceof XSDTypeDefinition)
-          {
-            XSDTypeDefinition typeDef = (XSDTypeDefinition) xsdComp;
-            objectToReveal = typeDef.getBaseType();
-          }
-          else if (xsdComp instanceof XSDSchemaDirective)
-          {
-          	XSDSchemaDirective directive = (XSDSchemaDirective) xsdComp;
-//						String schemaLocation = URIHelper.removePlatformResourceProtocol(directive.getResolvedSchema().getSchemaLocation());
-//						openXSDEditor(schemaLocation);
-//						return false;
-            objectToReveal = directive.getResolvedSchema();						          	          	
-          }
-
-          // now reveal the object if this isn't null
-          if (objectToReveal != null)
-          {
-            return revealObject(objectToReveal);
-          }
-        }
-      }
-    }
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
deleted file mode 100644
index 90b2baa..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-import java.util.List;
-
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-// issue (cs) can we remove this?
-//
-public class CreateElementAction extends Action
-{
-  protected String description;
-  protected Element parentNode;
-
-  protected ISelectionProvider selectionProvider;
-  protected XSDSchema xsdSchema;
-
-  protected Object sourceContext;
-
-  /**
-   * Constructor for CreateElementAction.
-   */
-  public CreateElementAction()
-  {
-    super();
-  }
-  /**
-   * Constructor for CreateElementAction.
-   * @param text
-   */
-  public CreateElementAction(String text)
-  {
-    super(text);
-  }
-  /**
-   * Constructor for CreateElementAction.
-   * @param text
-   * @param image
-   */
-  public CreateElementAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public void setXSDSchema(XSDSchema xsdSchema)
-  {
-    this.xsdSchema = xsdSchema;
-  }
-  
-  public void setSelectionProvider(ISelectionProvider selectionProvider)
-  {
-    this.selectionProvider = selectionProvider;
-  }
-
-  public void setSourceContext(Object sourceContext)
-  {
-    this.sourceContext = sourceContext;
-  }
-  
-  /**
-   * Gets the parentNode.
-   * @return Returns a Element
-   */
-  public Element getParentNode()
-  {
-    return parentNode;
-  }
-
-  /**
-   * Sets the parentNode.
-   * @param parentNode The parentNode to set
-   */
-  public void setParentNode(Element parentNode)
-  {
-    this.parentNode = parentNode;
-  }
-
-  boolean isGlobal = false;
-  
-  public void setIsGlobal(boolean isGlobal)
-  {
-    this.isGlobal = isGlobal;
-  }
-  
-  public boolean getIsGlobal()
-  {
-    return isGlobal;
-  }
-
-  protected Node relativeNode;
-  protected String elementTag;
-  public void setElementTag(String elementTag)
-  {
-    this.elementTag = elementTag;
-  }
-  
-  public DocumentImpl getDocument()
-  {
-    return (DocumentImpl) getParentNode().getOwnerDocument();
-  }
-    
-  public void beginRecording(String description)
-  {
-    getDocument().getModel().beginRecording(this, description);
-  }
-  
-  public void endRecording()
-  {
-    DocumentImpl doc = (DocumentImpl) getDocument();
-    
-    doc.getModel().endRecording(this);    
-  }
-  
-  public Element createAndAddNewChildElement()
-  {
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    Element childNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + elementTag);
-    if (getAttributes() != null)
-    {
-      List attributes = getAttributes();
-      for (int i = 0; i < attributes.size(); i++)
-      {
-        DOMAttribute attr = (DOMAttribute) attributes.get(i);
-        childNode.setAttribute(attr.getName(), attr.getValue());
-      }
-    }
-    if (getRelativeNode() == null)
-    {
-      parentNode.appendChild(childNode);
-    }
-    else
-    {
-      ((Element)parentNode).insertBefore(childNode,getRelativeNode());
-    }
-    
-    if (isGlobal && getRelativeNode() == null)
-    {
-      Text textNode = getDocument().createTextNode("\n\n");
-      parentNode.appendChild(textNode);
-    }
-    else if (isGlobal && getRelativeNode() != null)
-    {
-      Text textNode = getDocument().createTextNode("\n\n");
-      parentNode.insertBefore(textNode, getRelativeNode());
-    }
-
-    formatChild(childNode);
-    
-    return childNode;
-  }    
-    
-  protected void formatChild(Element child)
-  {
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode)child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-        
-	      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-		    formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel(); 
-      }
-    }
-  }
-  /*
-   * @see IAction#run()
-   */
-  public void run()
-  {
-    beginRecording(getDescription());
-    final Element child = createAndAddNewChildElement();
-    endRecording();
-
-    if (selectionProvider != null)
-    {
-      final XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(child);
-//      selectionProvider.setSelection(new StructuredSelection(comp));
-      
-    Runnable runnable = new Runnable()
-    {
-      public void run()
-      {
-        if (comp instanceof XSDAttributeDeclaration)
-        {
-          if (((XSDAttributeDeclaration)comp).getContainer() instanceof XSDAttributeUse)
-          {
-            if (comp.getContainer().getContainer() instanceof XSDAttributeGroupDefinition)
-            {
-              selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
-            }
-            else if (comp.getContainer().getContainer() instanceof XSDComplexTypeDefinition)
-            {
-              if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
-              {
-                selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
-              }
-              else
-              {
-                selectionProvider.setSelection(new StructuredSelection(comp));
-              }
-            }
-            else
-            {
-              selectionProvider.setSelection(new StructuredSelection(comp));
-            }
-          }
-          else
-          {
-            selectionProvider.setSelection(new StructuredSelection(comp));
-          }
-        }
-        else
-        {
-          selectionProvider.setSelection(new StructuredSelection(comp));
-        }
-        if (comp instanceof XSDNamedComponent)
-        {
-          if (sourceContext instanceof AbstractEditPartViewer)
-          {
-            AbstractEditPartViewer viewer = (AbstractEditPartViewer)sourceContext;
-          
-            Object obj = viewer.getSelectedEditParts().get(0);
-            
-//            if (obj instanceof GraphicalEditPart)
-//            {
-//              if (obj instanceof ElementDeclarationEditPart)
-//              {
-//                XSDElementDeclaration elem = ((ElementDeclarationEditPart)obj).getXSDElementDeclaration();
-//                if (!elem.isElementDeclarationReference())
-//                {
-//                  ((ElementDeclarationEditPart)obj).doEditName();
-//                }
-//              }
-//              else if (obj instanceof ModelGroupDefinitionEditPart)
-//              {
-//                XSDModelGroupDefinition group = ((ModelGroupDefinitionEditPart)obj).getXSDModelGroupDefinition();
-//                if (!group.isModelGroupDefinitionReference())
-//                {
-//                  ((ModelGroupDefinitionEditPart)obj).doEditName();
-//                }
-//              }
-//              else if (obj instanceof ComplexTypeDefinitionEditPart)
-//              {
-//                XSDComplexTypeDefinition ct = ((ComplexTypeDefinitionEditPart)obj).getXSDComplexTypeDefinition();
-//                if (ct.getName() != null)
-//                {
-//                  ((ComplexTypeDefinitionEditPart)obj).doEditName();
-//                }
-//              }
-//              else if (obj instanceof TopLevelComponentEditPart)
-//              {
-//                ((TopLevelComponentEditPart)obj).doEditName();
-//              }
-//            }
-
-          }
-        }
-      }
-    };
-    Display.getDefault().timerExec(50,runnable);
-    }
-  }
-
-  /**
-   * Gets the relativeNode.
-   * @return Returns a Element
-   */
-  public Node getRelativeNode()
-  {
-    return relativeNode;
-  }
-
-  /**
-   * Sets the relativeNode.
-   * @param relativeNode The relativeNode to set
-   */
-  public void setRelativeNode(Node relativeNode)
-  {
-    this.relativeNode = relativeNode;
-  }
-
-  /**
-   * Gets the description.
-   * @return Returns a String
-   */
-  public String getDescription()
-  {
-    if (description == null)
-    {
-      return getText();
-    }
-    return description;
-  }
-
-  /**
-   * Sets the description.
-   * @param description The description to set
-   */
-  public void setDescription(String description)
-  {
-    this.description = description;
-  }
-
-  protected List attributes;
-  /**
-   * Gets the nameAttribute.
-   * @return Returns a String
-   */
-  public List getAttributes()
-  {
-    return attributes;
-  }
-
-  /**
-   * Sets the attributes.
-   * @param attributes The attributes to set
-   */
-  public void setAttributes(List attributes)
-  {
-    this.attributes = attributes;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
deleted file mode 100644
index 6e6c7e5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-// issue (cs) remove this
-/**
- * @version 	1.0
- * @author
- */
-public class DOMAttribute
-{
-  /**
-   * Constructor for DOMAttribute.
-   */
-  public DOMAttribute()
-  {
-    super();
-  }
-  
-  /**
-   * Constructor for DOMAttribute.
-   */
-  public DOMAttribute(String name, String value)
-  {
-    super();
-    this.name = name;
-    this.value = value;
-  }
-  
-  protected String name, value;
-  /**
-   * Gets the value.
-   * @return Returns a String
-   */
-  public String getValue()
-  {
-    return value;
-  }
-
-  /**
-   * Sets the value.
-   * @param value The value to set
-   */
-  public void setValue(String value)
-  {
-    this.value = value;
-  }
-
-  /**
-   * Gets the name.
-   * @return Returns a String
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-  /**
-   * Sets the name.
-   * @param name The name to set
-   */
-  public void setName(String name)
-  {
-    this.name = name;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
deleted file mode 100644
index 3e0dad4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.ui.internal.actions.ReplacePrefixAction;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonResources;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.nsedit.SchemaPrefixChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.nsedit.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.widgets.XSDEditSchemaInfoDialog;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XSDEditNamespacesAction extends Action {
-	private Element element;
-	private String resourceLocation;
-	private XSDSchema xsdSchema;
-    private DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
-	
-	public XSDEditNamespacesAction(String label, Element element, Node node) {
-		super();
-		setText(label);
-		
-		this.element = element;
-		///////////////////// This needs to be changed....
-		this.resourceLocation = "dummy";		
-	}
-	
-	public XSDEditNamespacesAction(String label, Element element, Node node, XSDSchema schema) {
-		this (label, element, node);
-		xsdSchema = schema;
-	}
-	
-	public void run() {
-		if (element != null)
-		{   
-		      Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		      String targetNamespace = null;
-		      if (xsdSchema != null) {
-		      	targetNamespace = xsdSchema.getTargetNamespace();
-		      }
-		      XSDEditSchemaInfoDialog dialog = new XSDEditSchemaInfoDialog(shell, new Path(resourceLocation), targetNamespace); 
-
-		      List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
-		      List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
-		      // here we store a copy of the old info for each NamespaceInfo
-		      // this info will be used in createPrefixMapping() to figure out how to update the document 
-		      // in response to these changes
-		      for (Iterator i = namespaceInfoList.iterator(); i.hasNext(); )
-		      {
-		        NamespaceInfo info = (NamespaceInfo)i.next();
-		        NamespaceInfo oldCopy = new NamespaceInfo(info);
-		        info.setProperty("oldCopy", oldCopy);
-		      }
-		                              
-		      dialog.setNamespaceInfoList(namespaceInfoList);   
-		      dialog.create();      
-		      //dialog.getShell().setSize(500, 300);
-		      dialog.getShell().setText(XMLCommonResources.getInstance().getString("_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE"));
-		      dialog.setBlockOnOpen(true);                                 
-		      dialog.open();
-          String xsdPrefix = "";    
-
-		      if (dialog.getReturnCode() == Window.OK)
-		      {
-            Element xsdSchemaElement = xsdSchema.getElement();
-            DocumentImpl doc = (DocumentImpl) xsdSchemaElement.getOwnerDocument();
-            
-            List newInfoList = dialog.getNamespaceInfoList();
-
-		        // see if we need to rename any prefixes
-		        Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
-            
-            Map map2 = new Hashtable();
-            for (Iterator iter = newInfoList.iterator(); iter.hasNext(); )
-            {
-              NamespaceInfo ni = (NamespaceInfo)iter.next();
-              String pref = ni.prefix;
-              String uri = ni.uri;
-              if (pref == null) pref = "";
-              if (uri == null) uri = "";
-              if (XSDConstants.isSchemaForSchemaNamespace(uri))
-              {
-                xsdPrefix = pref;
-              }
-              map2.put(pref, uri);
-            }
-           
-		        if (map2.size() > 0)
-		        {
-		        	try {
-                
-                doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"));
-
-                if (xsdPrefix != null && xsdPrefix.length() == 0)
-                {
-                  xsdSchema.setSchemaForSchemaQNamePrefix(null);
-                }
-                else
-                {
-                  xsdSchema.setSchemaForSchemaQNamePrefix(xsdPrefix);
-                }
-
-                xsdSchema.setTargetNamespace(dialog.getTargetNamespace());
-                xsdSchema.update();
-                
-                SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, xsdPrefix);
-                spch.resolve();
-                xsdSchema.update();
-                
-                xsdSchema.setIncrementalUpdate(false);
-                namespaceInfoManager.removeNamespaceInfo(element);
-                namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
-                xsdSchema.setIncrementalUpdate(true);
-
-                // don't need these any more?
-			          ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(null, element, prefixMapping);
-			          replacePrefixAction.run();
-                
-                TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, targetNamespace, dialog.getTargetNamespace());
-                targetNamespaceChangeHandler.resolve();
-				    	}
-              catch (Exception e)
-              { 
-//                e.printStackTrace();
-              }
-              finally
-              {
-                xsdSchema.update();
-                doc.getModel().endRecording(this);
-			     		}
-		        }
-		   }      
-          
-		}
-	}
-	
-	 protected Map createPrefixMapping(List oldList, List newList)
-	  {          
-	    Map map = new Hashtable();
-
-	    Hashtable oldURIToPrefixTable = new Hashtable();
-	    for (Iterator i = oldList.iterator(); i.hasNext(); )
-	    {    
-	      NamespaceInfo oldInfo = (NamespaceInfo)i.next();                    
-	      oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
-	    }
-	    
-	    for (Iterator i = newList.iterator(); i.hasNext(); )
-	    {
-	      NamespaceInfo newInfo = (NamespaceInfo)i.next();
-	      NamespaceInfo oldInfo = (NamespaceInfo)oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); 
-
-
-	      // if oldInfo is non null ... there's a matching URI in the old set
-	      // we can use its prefix to detemine out mapping
-	      //
-	      // if oldInfo is null ...  we use the 'oldCopy' we stashed away 
-	      // assuming that the user changed the URI and the prefix
-	      if (oldInfo == null)                                            
-	      {
-	        oldInfo = (NamespaceInfo)newInfo.getProperty("oldCopy");           
-	      } 
-
-	      if (oldInfo != null)
-	      {
-	        String newPrefix = newInfo.prefix != null ? newInfo.prefix : "";
-	        String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : "";
-	        if (!oldPrefix.equals(newPrefix))
-	        {
-	          map.put(oldPrefix, newPrefix);    
-	        }
-	      }      
-	    }        
-	    return map;
-	  }
-   
-//    private void updateAllNodes(Element element, String prefix)
-//    {
-//      element.setPrefix(prefix);
-//      NodeList list = element.getChildNodes();
-//      if (list != null)
-//      {
-//        for (int i=0; i < list.getLength(); i++)
-//        {
-//          Node child = list.item(i);
-//          if (child != null && child instanceof Element)
-//          {
-//            child.setPrefix(prefix);
-//            if (child.hasChildNodes())
-//            {
-//              updateAllNodes((Element)child, prefix);
-//            }
-//          }
-//        }
-//      }   
-//    }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
deleted file mode 100644
index 2df620c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class SchemaPrefixChangeHandler
-{
-  String newPrefix;
-  XSDSchema xsdSchema;
-
-  public SchemaPrefixChangeHandler(XSDSchema xsdSchema, String newPrefix)
-  {
-    this.xsdSchema = xsdSchema;
-    this.newPrefix= newPrefix;
-  }
-  
-  public void resolve()
-  {
-    XSDSchemaPrefixRenamer xsdSchemaPrefixRenamer = new XSDSchemaPrefixRenamer();
-    xsdSchemaPrefixRenamer.visitSchema(xsdSchema);
-  }
-
-  public String getNewQName(XSDTypeDefinition comp, String value, String newXSDPrefix)
-  {
-    String qName = null;
-    if (value != null)
-    {
-      qName = newXSDPrefix;
-      if (qName != null && qName.length() > 0)
-      {
-        qName += ":" + value;
-      }
-      else
-      {
-        qName = value; 
-      }
-    }
-    else
-    {
-      qName = value;
-    }
-    
-    return qName;
-  }
-
-  
-  class XSDSchemaPrefixRenamer extends XSDVisitor
-  {
-    public XSDSchemaPrefixRenamer()
-    {
-      super();
-    }
-    
-    public void visitElementDeclaration(XSDElementDeclaration element)
-    {
-      super.visitElementDeclaration(element);
-      XSDTypeDefinition type = element.getType();
-      if (type != null)
-      {
-        String ns = type.getTargetNamespace();
-        if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))        
-        {
-          Element domElement = element.getElement();
-          if (domElement != null && domElement instanceof IDOMNode)
-          {
-            Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
-            if (typeAttr != null)
-            {
-              element.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));            
-            }
-          }
-        }
-      }
-    }
-    
-    public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition simpleType)
-    {
-      super.visitSimpleTypeDefinition(simpleType);
-      XSDTypeDefinition baseType = simpleType.getBaseTypeDefinition();
-      
-      if (baseType != null)
-      {
-        String ns = baseType.getTargetNamespace();
-        if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-//        System.out.println(xsdSchema.getSchemaForSchemaNamespace());
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-        {
-          XSDDOMHelper domHelper = new XSDDOMHelper();
-          Element derivedBy = domHelper.getDerivedByElement(simpleType.getElement());
-          if (derivedBy != null && derivedBy instanceof IDOMNode)
-          {
-            Attr typeAttr = derivedBy.getAttributeNode(XSDConstants.BASE_ATTRIBUTE);
-            if (typeAttr != null)
-            {
-              derivedBy.setAttribute(XSDConstants.BASE_ATTRIBUTE, getNewQName(baseType, baseType.getName(), newPrefix));
-            }
-          }
-        }
-      }
-      
-      XSDSimpleTypeDefinition itemType = simpleType.getItemTypeDefinition();
-      if (itemType != null)
-      {
-        String ns = itemType.getTargetNamespace();
-        if (ns == null) ns = "";
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-        {
-          XSDDOMHelper domHelper = new XSDDOMHelper();
-          Node listNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.LIST_ELEMENT_TAG);
-          if (listNode != null && listNode instanceof Element)
-          {
-            Element listElement = (Element)listNode;          
-            if (listElement instanceof IDOMNode)
-            {
-              Attr typeAttr = listElement.getAttributeNode(XSDConstants.ITEMTYPE_ATTRIBUTE);
-              if (typeAttr != null)
-              {
-                listElement.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, getNewQName(itemType, itemType.getName(), newPrefix));
-              }
-            }
-          }
-        }
-      }
-      
-      List memberTypes = simpleType.getMemberTypeDefinitions();
-      if (memberTypes.size() > 0)
-      {
-        XSDDOMHelper domHelper = new XSDDOMHelper();
-        Node unionNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.UNION_ELEMENT_TAG);
-        if (unionNode != null && unionNode instanceof Element)
-        {
-          Element unionElement = (Element)unionNode;          
-          if (unionElement instanceof IDOMNode)
-          {
-            StringBuffer sb = new StringBuffer("");
-            for (Iterator i = memberTypes.iterator(); i.hasNext(); )
-            {
-              XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)i.next();
-              String ns = st.getTargetNamespace();
-              if (ns == null) ns = "";
-              if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-              {
-                sb.append(getNewQName(st, st.getName(), newPrefix));                
-              }
-              else
-              {
-                sb.append(st.getQName(xsdSchema));
-              }
-              if (i.hasNext())
-              {
-                sb.append(" ");
-              }
-            }
-            unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, sb.toString());
-          }
-        }
-      }
-    }
-
-    public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
-    {
-      super.visitAttributeDeclaration(attr);
-      XSDTypeDefinition type = attr.getType();
-      if (type != null)
-      {
-        String ns = type.getTargetNamespace();
-        if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-        {
-          Element domElement = attr.getElement();
-          if (domElement != null && domElement instanceof IDOMNode)
-          {
-            Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
-            if (typeAttr != null)
-            {
-              attr.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));            
-            }
-          }
-        }
-      }
-    }
-  }    
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java
deleted file mode 100644
index 9e745dd..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class TargetNamespaceChangeHandler
-{
-  String newNS;
-  String oldNS;
-  XSDSchema xsdSchema;
-
-  public TargetNamespaceChangeHandler(XSDSchema xsdSchema, String oldNS, String newNS)
-  {
-    this.xsdSchema = xsdSchema;
-    this.oldNS= oldNS;
-    this.newNS= newNS;
-  }
-  
-  public void resolve()
-  {
-    ElementReferenceRenamer elementReferenceRenamer = new ElementReferenceRenamer();
-    elementReferenceRenamer.visitSchema(xsdSchema);
-    AttributeReferenceRenamer attributeReferenceRenamer = new AttributeReferenceRenamer();
-    attributeReferenceRenamer.visitSchema(xsdSchema);
-  }
-
-  class ElementReferenceRenamer extends XSDVisitor
-  {
-    public ElementReferenceRenamer()
-    {
-      super();
-    }
-    
-    public void visitElementDeclaration(XSDElementDeclaration element)
-    {
-      super.visitElementDeclaration(element);
-      if (element.isElementDeclarationReference())
-      {
-      	if (element.getResolvedElementDeclaration().getTargetNamespace() != null)
-      	{
-      	  if (element.getResolvedElementDeclaration().getTargetNamespace().equals(oldNS))
-          {
-            // set the resolved element's declaration to new ns
-            // this is defect 237518 - target namespace rename creates a new namespace
-            element.getResolvedElementDeclaration().setTargetNamespace(newNS);
-          }
-        }
-        else
-        {
-        	if (oldNS == null || (oldNS != null && oldNS.equals("")))
-        	{
-						element.getResolvedElementDeclaration().setTargetNamespace(newNS);
-        	}
-        }
-      }
-    }
-  }
-  
-  // Similar to defect 237518 but for attributes
-  class AttributeReferenceRenamer extends XSDVisitor
-  {
-    public AttributeReferenceRenamer()
-    {
-      super();
-    }
-    
-    public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-    {
-      super.visitComplexTypeDefinition(type);
-      if (type.getAttributeContents() != null)
-      {
-        for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-        {
-          XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-          if (attrGroupContent instanceof XSDAttributeUse)
-          {
-            XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
-            XSDAttributeDeclaration attrDecl = attrUse.getContent();
-            
-            if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
-            {
-							if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
-							{
-                if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
-                {
-                  attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
-                }
-              }
-              else
-              {
-								if (oldNS == null || (oldNS != null && oldNS.equals("")))
-								{
-									attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
-								}
-              }
-            }
-          }
-        }
-      }
-    }
-  
-    public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-    {
-      super.visitAttributeGroupDefinition(attributeGroup);
-      EList list = attributeGroup.getAttributeUses();
-      if (list != null)
-      {
-        for (Iterator iter = list.iterator(); iter.hasNext(); )
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
-          XSDAttributeDeclaration attrDecl = attrUse.getContent();
-
-          if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
-          {
-						if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
-						{
-              if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
-              {
-                attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
-              }
-            }
-            else
-            {
-							if (oldNS == null || (oldNS != null && oldNS.equals("")))
-							{
-								attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
-							}
-            }
-          }
-        }
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
deleted file mode 100644
index c9bfbaf..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
-  public XSDVisitor()
-  {
-  }
-  
-  protected XSDSchema schema;
-  
-  public void visitSchema(XSDSchema schema)
-  {
-    this.schema = schema;
-    for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
-      visitAttributeDeclaration(attr);
-    }
-    for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
-      visitTypeDefinition(type);
-    }
-    for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
-      visitElementDeclaration(element);
-    }
-    for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
-      visitIdentityConstraintDefinition(identityConstraint);
-    }
-    for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
-      visitModelGroupDefinition(modelGroup);
-    }
-    for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
-      visitAttributeGroupDefinition(attributeGroup);
-    }
-    for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
-      visitNotationDeclaration(element);
-    }
-    
-  }
-  
-  public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
-  {
-  }
-  
-  public void visitTypeDefinition(XSDTypeDefinition type)
-  {
-    if (type instanceof XSDSimpleTypeDefinition)
-    {
-      visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
-    }
-    else if (type instanceof XSDComplexTypeDefinition)
-    {
-      visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
-    }
-  }
-  
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (element.isElementDeclarationReference())
-    {
-    }
-    else if (element.getAnonymousTypeDefinition() != null)
-    {
-      visitTypeDefinition(element.getAnonymousTypeDefinition());
-    }
-  }
-  
-  public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
-  {
-  }
-  
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
-  {
-    if (!modelGroupDef.isModelGroupDefinitionReference())
-    {
-      if (modelGroupDef.getModelGroup() != null)
-      {
-        visitModelGroup(modelGroupDef.getModelGroup());
-      }
-    }
-  }
-  
-  public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-  {
-    if (attributeGroup.getAttributeUses() != null)
-    {
-      for (Iterator iter = attributeGroup.getAttributeUses().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
-        visitAttributeDeclaration(attrUse.getContent());
-      }
-    }
-  }
-  
-  public void visitNotationDeclaration(XSDNotationDeclaration notation)
-  {
-  }
-  
-  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-  {
-  }
-  
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    if (type.getContentType() != null)
-    {
-      XSDComplexTypeContent complexContent = (XSDComplexTypeContent) type.getContentType();
-      if (complexContent instanceof XSDSimpleTypeDefinition)
-      {
-        visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
-      }
-      else if (complexContent instanceof XSDParticle)
-      {
-        visitParticle((XSDParticle) complexContent);
-      }
-    }
-    
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
-          visitAttributeDeclaration(attrUse.getContent());
-        }
-        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          visitAttributeGroupDefinition((XSDAttributeGroupDefinition)attrGroupContent);
-        }
-      }
-    }
-  }
-  
-  public void visitParticle(XSDParticle particle)
-  {
-    visitParticleContent(particle.getContent());
-  }
-  
-  public void visitParticleContent(XSDParticleContent particleContent)
-  {
-    if (particleContent instanceof XSDModelGroupDefinition)
-    {
-      visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
-    }
-    else if (particleContent instanceof XSDModelGroup)
-    {
-      visitModelGroup((XSDModelGroup)particleContent);
-    }
-    else if (particleContent instanceof XSDElementDeclaration)
-    {
-      visitElementDeclaration((XSDElementDeclaration)particleContent);
-    }
-    else if (particleContent instanceof XSDWildcard)
-    {
-      visitWildcard((XSDWildcard)particleContent);
-    }
-  }
-  
-  public void visitModelGroup(XSDModelGroup modelGroup)
-  {
-    if (modelGroup.getContents() != null)
-    {
-      for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
-      {
-        XSDParticle particle = (XSDParticle) iterator.next();
-        visitParticle(particle);
-      }
-    }
-  }
-  
-  public void visitWildcard(XSDWildcard wildcard)
-  {
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
deleted file mode 100644
index ae933cc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class TypesHelper
-{
-  XSDSchema xsdSchema;
-  Vector list = new Vector();
-
-  public TypesHelper(XSDSchema xsdSchema)
-  {
-    this.xsdSchema = xsdSchema;
-  }
-
-  private void updateExternalImportGlobals()
-  {
-    if (xsdSchema != null)
-    {
-      Iterator contents = xsdSchema.getContents().iterator();
-      while (contents.hasNext())
-      {
-        XSDSchemaContent content = (XSDSchemaContent) contents.next();
-        if (content instanceof XSDImportImpl)
-        {
-          XSDImportImpl anImport = (XSDImportImpl) content;
-          try
-          {
-            if (anImport.getSchemaLocation() != null)
-            {
-              anImport.importSchema();
-            }
-          }
-          catch (Exception e)
-          {
-            
-          }
-        }
-      }
-    }
-  }
-
-
-  public java.util.List getBuiltInTypeNamesList()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      String prefix = xsdSchema.getSchemaForSchemaQNamePrefix();
-      if (prefix != null && prefix.length() > 0)
-      {
-        prefix = prefix + ":";
-      }
-      else
-      {
-        prefix = "";
-      }
-      List result = new ArrayList();
-      if (xsdSchema != null)
-      {
-        XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
-        for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
-        {
-          XSDTypeDefinition td = (XSDTypeDefinition) i.next();  
-          String localName = td.getName(); 
-          String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName; 
-          result.add(prefixedName);        
-        }
-      }
-    }
-    return items;
-  }
-
-  // issue (cs) do we still need this?  it can likely be remove now
-  // was used for content assist but I don't think we really need it
-  public java.util.List getBuiltInTypeNamesList2()
-  {
-    List result = new ArrayList();
-    if (xsdSchema != null)
-    {
-      List prefixes = getPrefixesForNamespace(xsdSchema.getSchemaForSchemaNamespace());
-      XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
-      for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
-      {
-        XSDTypeDefinition td = (XSDTypeDefinition) i.next();  
-        String localName = td.getName();
-        String prefix = prefixes.size() > 0 ? (String)prefixes.get(0) : null;
-        String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName; 
-        result.add(prefixedName);        
-      }
-    }
-    return result;
-  }
-
-  public java.util.List getUserSimpleTypeNamesList()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      Iterator i = xsdSchema.getTypeDefinitions().iterator();
-      while (i.hasNext())
-      {
-        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
-        if (typeDefinition instanceof XSDSimpleTypeDefinition)
-        {
-          items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));
-          //System.out.println(typeDefinition.getQName(xsdSchema));
-          //items.add(typeDefinition.getQName(xsdSchema));
-        }
-      }
-      items.add(getPrefix(xsdSchema.getSchemaForSchemaNamespace(), true) + "anyType");
-      
-      //      items = addExternalImportedUserSimpleTypes(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public java.util.List getUserComplexTypeNamesList()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      Iterator i = xsdSchema.getTypeDefinitions().iterator();
-      while (i.hasNext())
-      {
-        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
-        if (typeDefinition instanceof XSDComplexTypeDefinition)
-        {
-			    items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));         
-        }
-      }
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-  
-  public java.util.List getUserSimpleTypes()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      Iterator i = xsdSchema.getTypeDefinitions().iterator();
-      while (i.hasNext())
-      {
-        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
-        if (typeDefinition instanceof XSDSimpleTypeDefinition)
-        {
-          items.add(typeDefinition);
-          //System.out.println(typeDefinition.getQName(xsdSchema));
-          //items.add(typeDefinition.getQName(xsdSchema));
-        }
-      }
-      // We need to add the anyType
-//      items.add(getPrefix(xsdSchema.getSchemaForSchemaNamespace(), true) + "anyType");
-      
-      //      items = addExternalImportedUserSimpleTypes(items);
-      //items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public String getPrefix(String ns, boolean withColon)
-  {
-    String key = "";
-
-    if (xsdSchema != null)
-    {
-      Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-      Iterator iter = map.keySet().iterator();
-      while (iter.hasNext())
-      {
-        Object keyObj = iter.next();
-        Object value = map.get(keyObj);
-        if (value != null && value.toString().equals(ns))
-        {
-          if (keyObj != null)
-          {
-            key = keyObj.toString();
-          }
-          else
-          {
-            key = "";
-          }
-          break;
-        }
-      }
-      if (!key.equals(""))
-      {
-        if (withColon)
-        {
-          key = key + ":";
-        }
-      }
-    }
-    return key;
-  }
-
-  public java.util.List getGlobalElements()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getElementDeclarations() != null)
-      {
-        Iterator i = xsdSchema.getElementDeclarations().iterator();
-        while (i.hasNext())
-        {
-          XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) i.next();
-          String name = elementDeclaration.getQName(xsdSchema);
-          if (name != null)
-          {
-            items.add(name);
-          }
-        }
-      }
-      //      items = addExternalImportedGlobalElements(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public java.util.List getGlobalAttributes()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getAttributeDeclarations() != null)
-      {
-        Iterator i = xsdSchema.getAttributeDeclarations().iterator();
-        while (i.hasNext())
-        {
-          XSDAttributeDeclaration attributeDeclaration = (XSDAttributeDeclaration) i.next();
-          if (attributeDeclaration.getTargetNamespace() == null || (attributeDeclaration.getTargetNamespace() != null && !attributeDeclaration.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
-          {
-            String name = attributeDeclaration.getQName(xsdSchema);
-            if (name != null)
-            {
-              items.add(name);
-            }
-          }
-        }
-      }
-      //      items = addExternalImportedAttributes(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public java.util.List getGlobalAttributeGroups()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getAttributeGroupDefinitions() != null)
-      {
-        Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator();
-        while (i.hasNext())
-        {
-          XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) i.next();
-          String name = attributeGroupDefinition.getQName(xsdSchema);
-          if (name != null)
-          {
-            items.add(name);
-          }
-        }
-      }
-      //      items = addExternalImportedAttributeGroups(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public java.util.List getModelGroups()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getModelGroupDefinitions() != null)
-      {
-        Iterator i = xsdSchema.getModelGroupDefinitions().iterator();
-        while (i.hasNext())
-        {
-          XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) i.next();
-          String name = modelGroupDefinition.getQName(xsdSchema);
-          if (name != null)
-          {
-            items.add(name);
-          }
-        }
-      }
-      //      items = addExternalImportedGroups(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  // issue (cs) ssems like a rather goofy util method?
-  public static java.util.List sortList(java.util.List types)
-  {
-    try
-    {
-      java.util.Collections.sort(types); // performance?  n*log(n)
-    }
-    catch (Exception e)
-    {
-//      XSDEditorPlugin.getPlugin().getMsgLogger().write("Sort failed");
-    }
-    return types;
-  }
-
-  // issue (cs) do we still need this?
-  public void updateMapAfterDelete(XSDImport deletedNode)
-  {
-    String ns = deletedNode.getNamespace();
-    if (ns != null)
-    {
-      String prefix = getPrefix(ns, false);
-      if (prefix != null)
-      {
-        prefix = prefix.trim();
-      }
-      String xmlnsAttr = (prefix == "") ? "xmlns" : "xmlns:" + prefix;
-
-      if (prefix == "")
-      {
-        prefix = null;
-      }
-
-      if (xsdSchema != null)
-      {
-        Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-        map.remove(prefix);
-        Element schemaElement = xsdSchema.getElement();
-        schemaElement.removeAttribute(xmlnsAttr);
-      }
-    }
-  }
-
-  public List getPrefixedNames(String namespace, String localName)
-  {
-    List list = new ArrayList();
-    if (namespace == null)
-    {
-      namespace = "";    			
-    }
-    if (xsdSchema != null && localName != null)
-    {
-      List prefixes = getPrefixesForNamespace(namespace);
-      for (Iterator i = prefixes.iterator(); i.hasNext(); )
-      {
-      	String prefix = (String)i.next();
-      	if (prefix == null) prefix = "";
-        String prefixedName = prefix.length() > 0 ? prefix + ":" + localName : localName;
-        list.add(prefixedName);               
-      }
-      if (prefixes.size() == 0)
-      {
-        list.add(localName);
-      }
-    }
-    return list;
-  }
-  
-  protected List getPrefixesForNamespace(String namespace)
-  {
-    List list = new ArrayList();
-    Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-    for (Iterator iter = map.keySet().iterator(); iter.hasNext();)
-    {
-      String prefix = (String) iter.next();
-      Object value = map.get(prefix);
-      if (value != null && value.toString().equals(namespace))
-      {
-       list.add(prefix);
-      }
-    }
-    return list;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
deleted file mode 100644
index 9c95ee7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-// issue (cs) can we get rid of this class?
-// I've stripped it down a whole lot... but it'd be great to get rid of it
-//
-public class ViewUtility
-{
-  private static Font font;
-
-  private static Font getFont()
-  {
-    if (font == null)
-    {              
-      font = new Font(Display.getCurrent(), "ms sans serif", 8, SWT.NORMAL);  
-    }
-    return font;
-  }
-
-  public static void setComposite(Composite comp)
-  {
-    // deprecated.  Remove later
-  }
-  public static Composite createComposite(Composite parent, int numColumns)
-  {
-    Composite composite = new Composite(parent, SWT.NONE);
-
-    composite.setFont(getFont());
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    composite.setLayout(layout);
-
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-    composite.setLayoutData(data);
-    return composite;
-  }
-
-  public static Composite createComposite(Composite parent, int numColumns, boolean horizontalFill)
-  {
-    if (!horizontalFill)
-    {
-      createComposite(parent, numColumns);
-    }
-
-    Composite composite = new Composite(parent, SWT.NONE);
-
-    composite.setFont(getFont());
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    composite.setLayout(layout);
-
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    composite.setLayoutData(data);
-
-    return composite;
-  }
-
-  public static Label createHorizontalFiller(Composite parent, int horizontalSpan) 
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.horizontalSpan = horizontalSpan;
-    label.setLayoutData(data);
-    return label;
-  }
-
-  /**
-   * Helper method for creating labels.
-   */
-  public static Label createLabel(Composite parent, String text) 
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    label.setText(text);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    label.setLayoutData(data);
-    return label;
-  }
-
-	public Label createLabel(Composite parent, int style, String text)
-	{
-		Label label = new Label(parent, style);
-//		setColor(label);
-		label.setText(text);
-
-		GridData data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		label.setLayoutData(data);
-		return label;
-	}
-  
-  public static Label createLabel(Composite parent, String text, int alignment)
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    label.setText(text);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = alignment;
-    label.setLayoutData(data);
-    return label;
-  }
-
- 
-
-
-  /**
-   * Create radio button
-   */
-  public static Button createRadioButton(Composite parent, String label)
-  {
-    Button button = new Button(parent, SWT.RADIO);
-    button.setText(label);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    button.setLayoutData(data);
-
-    return button;
-  }
-
-  /**
-   * Helper method for creating check box
-   */
-  public static Button createCheckBox(Composite parent, String label) 
-  {
-    Button button = new Button(parent, SWT.CHECK);
-    button.setText(label);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    button.setLayoutData(data);
-    return button;
-  }
-
-  public static Combo createComboBox(Composite parent)
-  {
-    return createComboBox(parent, true);
-  }
-
-  public static Combo createComboBox(Composite parent, boolean isReadOnly)
-  {
-    int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
-
-    Combo combo = new Combo(parent, style);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    combo.setLayoutData(data);
-    return combo;
-  }
-
-
-  public static Text createTextField(Composite parent, int width)
-  {
-    Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    data.widthHint = width;
-    text.setLayoutData(data);
-
-    return text;
-  }
-
-  /**
-   * <code>createWrappedMultiTextField</code> creates a wrapped multitext field
-   *
-   * @param parent a <code>Composite</code> value
-   * @param width an <code>int</code> value
-   * @param numLines an <code>int</code> value representing number of characters in height
-   * @param verticalFill a <code>boolean</code> value
-   * @return a <code>Text</code> value
-   */
-  public static Text createWrappedMultiTextField(Composite parent, int width, int numLines, boolean verticalFill)
-  {
-    Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    if (verticalFill)
-    {
-      data.verticalAlignment = GridData.FILL;
-      data.grabExcessVerticalSpace = true;
-    }      
-    data.widthHint = width;
-    FontData[] fontData = getFont().getFontData();
-    // hack for now where on Windows, only 1 fontdata exists
-    data.heightHint = numLines * fontData[0].getHeight();
-    text.setLayoutData(data);
-
-    return text;
-  }
-
-  public static Text createMultiTextField(Composite parent, int width, int height, boolean verticalFill)
-  {
-    Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    if (verticalFill)
-    {
-      data.verticalAlignment = GridData.FILL;
-      data.grabExcessVerticalSpace = true;
-    }      
-    data.widthHint = width;
-    data.heightHint = height;
-    text.setLayoutData(data);
-
-    return text;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
deleted file mode 100644
index 6e705b8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-// issue (cs) remove this class!!
-public class XSDDOMHelper
-{
-
-  private static String XMLSchemaURI = "http://www.w3.org/2001/XMLSchema";
-
-  /**
-   * Constructor for XSDDOMHelper.
-   */
-  public XSDDOMHelper()
-  {
-    super();
-  }
-
-  public Node getChildNode(Element parent, String childName)
-  {
-/*    NodeList nodeList = parent.getElementsByTagNameNS(XMLSchemaURI, childName);
-    if (nodeList.getLength() > 0)
-      return nodeList.item(0);
-    return null;
-*/
-    NodeList list = null;
-    if (parent != null)
-    {
-      list = parent.getChildNodes();
-    }
-
-    if (list != null)
-    {
-      // Performance issue perhaps?
-      for (int i = 0; i < list.getLength(); i++)
-      {
-        if (list.item(i) instanceof Element)
-        {
-          if (list.item(i).getLocalName().equals(childName))
-          {
-            return list.item(i);
-          }
-        }
-      }
-    }
-    return null;
-  }
-
-
-
-
-  public void changeDerivedByType(Element element, String derivedByType, String type)
-  {
-    Document doc = element.getOwnerDocument();
-
-    String prefix = element.getPrefix();
-    prefix = prefix == null ? "" : prefix + ":";
-
-    Element derivedByElement = getDerivedByElement(element);
-    
-    if (derivedByElement != null && derivedByElement.getLocalName().equals(derivedByType))
-    {
-    	return; // it's already the derived by type
-    }
-    Element newNode;
-  	if (derivedByType.equals("restriction"))
-  	{
-    	newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
-    }
-    else
-    {
-    	newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.EXTENSION_ELEMENT_TAG);
-    }
-	
-    newNode.setAttribute("base", type);
-
-    if (derivedByElement != null)
-    {
-      if (derivedByElement.hasChildNodes())
-      {        
-        NodeList nodes = derivedByElement.getChildNodes();
-        // use clones so we don't have a refresh problem
-        for (int i = 0; i < nodes.getLength(); i++)
-        {
-          Node node = nodes.item(i);       
-          newNode.appendChild(node.cloneNode(true));
-        }
-      }
-	  element.replaceChild(newNode, derivedByElement);
-    }
-    else 
-	{
-		Element parent = (Element) element.getParentNode();				// get back to complexType
-        NodeList nodes = parent.getChildNodes();
-		ArrayList nodeSaveList = new ArrayList();
-		
-		// save children. (nodes turns out to be the same object as parent;
-		// deleting them from parent will delete them from nodes.)
-        for (int i = 0; i < nodes.getLength(); i++)			
-        {
-          Node node = nodes.item(i);      
-		  nodeSaveList.add(node);
-        }
-
-        // remove children so we can surround them by complexContent
-        for (int i = 0; i < nodeSaveList.size(); i++)			
-        {
-          Node node = (Node) nodeSaveList.get(i);      
-          parent.removeChild(node);
-        }
-		
-		// build a complexContent element
-		Element complexContent = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.COMPLEXCONTENT_ELEMENT_TAG);
-		parent.appendChild(complexContent);					// insert into complexType
-		complexContent.appendChild(newNode);				// insert derivation type
-        for (int i = 0; i < nodeSaveList.size(); i++)			// insert children previously of complexType
-        {
-          Node node = (Node) nodeSaveList.get(i);       
-          newNode.appendChild(node.cloneNode(true));
-        }
-		
-		parent.appendChild(complexContent);
-		formatChild(complexContent);
-    }
-  }
-
-  
-  /**
-   * Get the derived by node given the complexContent or simpleContent node
-   */
-  public Element getDerivedByElement(Element element)
-  {
-    Node restrictionChild = getChildNode(element, "restriction");
-    Node extensionChild = getChildNode(element, "extension");
-    if (restrictionChild != null)
-    {
-      if (restrictionChild instanceof Element)
-      {
-        return (Element)restrictionChild;
-      }
-    }
-    
-    if (extensionChild != null)
-    {
-      if (extensionChild instanceof Element)
-      {
-        return (Element)extensionChild;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Get the derived by node given the ComplexType node
-   * Returns the first one, if say, the INVALID schema has more than one
-   */
-  public Element getDerivedByElementFromComplexType(Element element)
-  {
-    NodeList nl = element.getChildNodes();
-    int j = 0;
-    for (j = 0; j < nl.getLength(); j++)
-    {
-      Node aNode = nl.item(j);
-      if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-      {
-        break; 
-      }
-      else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        break;
-      }
-    }
-    Element derivedByNode = getDerivedByElement((Element)nl.item(j));
-    return derivedByNode;
-  }
-
-  /**
-   * Get the content model given the ComplexType node
-   * Returns the first one, if say, the INVALID schema has more than one
-   */
-  public Element getContentModelFromParent(Element element)
-  {
-    NodeList nl = element.getChildNodes();
-    int j = 0;
-    boolean modelExists = false;
-    int length = nl.getLength();
-    for (j = 0; j < length; j++)
-    {
-      Node aNode = nl.item(j);
-      if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break; 
-      }
-      else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break;
-      }
-      else if (inputEquals(aNode, XSDConstants.SEQUENCE_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break;
-      }
-      else if (inputEquals(aNode, XSDConstants.CHOICE_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break;
-      }
-      else if (inputEquals(aNode, XSDConstants.ALL_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break;
-      }
-    }
-    if (!modelExists)
-    {
-      return null;
-    }
-
-    Element derivedByNode = (Element)nl.item(j);
-    return derivedByNode;
-  }
-
-  /**
-   * 
-   */
-  public void changeContentModel(Element complexTypeElement, String contentModel, Element sequenceChoiceOrAllElement)
-  {
-    Document doc = complexTypeElement.getOwnerDocument();
-
-    String prefix = complexTypeElement.getPrefix();
-    prefix = prefix == null ? "" : prefix + ":";
-    
-    Element contentModelElement = getContentModelFromParent(complexTypeElement);
-
-    if (contentModelElement.getLocalName().equals(contentModel))
-    {
-      return; // it's already the content model 
-    }
-    Element newNode;
-    newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
-
-    if (contentModelElement.hasChildNodes())
-    {        
-      NodeList nodes = contentModelElement.getChildNodes();
-      // use clones so we don't have a refresh problem
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-        Node node = nodes.item(i);
-        if (node instanceof Element)
-        {
-          if (node.getLocalName().equals(XSDConstants.ANNOTATION_ELEMENT_TAG))
-          {
-            if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
-                XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
-                XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.ALL_ELEMENT_TAG, false)))
-            {
-              newNode.appendChild(node.cloneNode(true));
-            }
-          }
-          else if (node.getLocalName().equals(XSDConstants.RESTRICTION_ELEMENT_TAG) ||
-                    node.getLocalName().equals(XSDConstants.EXTENSION_ELEMENT_TAG))
-          {
-            newNode.appendChild(node.cloneNode(true));
-            if (sequenceChoiceOrAllElement != null)
-            {
-              node.appendChild(sequenceChoiceOrAllElement);
-            }
-          }
-          else
-          {
-            removeNodeAndWhitespace(node);
-          }
-        }
-        else
-        {
-          newNode.appendChild(node.cloneNode(true)); 
-        }
-      }
-    }
-    complexTypeElement.replaceChild(newNode, contentModelElement);
-  }
-
-  public Element cloneElement(Element parent, Element sourceNode)
-  {
-    Document doc = parent.getOwnerDocument();
-    String prefix = parent.getPrefix();
-    prefix = prefix == null ? "" : prefix + ":";
-    
-    Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + sourceNode.getLocalName());
-
-    if (sourceNode.hasChildNodes())
-    {        
-      NodeList nodes = sourceNode.getChildNodes();
-      // use clones so we don't have a refresh problem
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-        Node node = nodes.item(i);
-        newNode.appendChild(node.cloneNode(true));
-      }
-    }
-    return newNode;
-//    parent.replaceChild(newNode, sourceNode);
-  }
-
- 
-
-  public static void removeNodeAndWhitespace(Node node)
-  {
-    Node parentNode = node.getParentNode();
-    
-    Node nextElement = getNextElementNode(node);
-    Node previousElement = getPreviousElementNode(node);
-
-    Node nextSibling = node.getNextSibling();
-    if (nextSibling instanceof Text)
-    {
-      parentNode.removeChild(nextSibling);
-    }
-
-    if (parentNode != null)
-    {
-		  parentNode.removeChild(node);
-    }
-
-    if (nextElement != null)
-    {
-			formatChild(nextElement);
-    }
-
-		if (previousElement != null)
-		{
-			formatChild(previousElement);
-		}
-  }
-
-	public static void formatChild(Node child)
-	{
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode)child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-        
-	      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-		    formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel(); 
-      }
-    }
-  }
-  
-
-  private static Node getNextElementNode(Node node)
-  {
-    Node next = node.getNextSibling();
-    
-    while (!(next instanceof Element) && next != null)
-    {
-      next = next.getNextSibling();
-    }
-    if (next instanceof Text)
-    {
-    	return null;
-    }
-    return next;
-  }
-
-	private static Node getPreviousElementNode(Node node)
-	{
-		Node previous = node.getPreviousSibling();
-    
-		while (!(previous instanceof Element) && previous != null)
-		{
-			previous = previous.getPreviousSibling();
-		}
-    if (previous instanceof Text)
-    {
-      return null;
-    }
-    return previous;
-	}
-
- 
-
-  // issue (cs) what's this method supposed to do?
-  // bizzare name
-  public static boolean inputEquals(Object input, String tagname, boolean isRef)
-  {
-    if (input instanceof Element)
-    {
-      Element element = (Element) input;
-      if (element.getLocalName().equals(tagname))
-      {
-        boolean refPresent = element.hasAttribute("ref");
-
-        return refPresent == isRef;
-      }
-    }
-    return false;
-  }
-
- 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
deleted file mode 100644
index d84ba1a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.validation;
-
-import org.eclipse.wst.validation.internal.provisional.ValidationFactory;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator;
-
-/**
- * This performs the as-you-type validation
- * @author Mark Hutchinson
- *
- */
-public class DelegatingSourceValidatorForXSD extends DelegatingSourceValidator
-{                                                
-  final private static String VALIDATOR_CLASS = "org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator"; 
-
-  public DelegatingSourceValidatorForXSD()
-  { super();
-  }
-  
-  protected IValidator getDelegateValidator()
-  {
-    try
-    { return ValidationFactory.instance.getValidator(VALIDATOR_CLASS);
-    }
-    catch (Exception e)
-    { //
-    }
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java
deleted file mode 100644
index 5db6c11..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.widgets;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-/**
- * Dialog to help define a list of enumerations
- * for a join. This might be replaced once we know how to
- * initiate a drag tracker
- */
-
-public class EnumerationsDialog extends org.eclipse.jface.dialogs.Dialog
-{
-  public EnumerationsDialog(Shell shell)
-  {
-    super(shell);
-  }
-
-  protected void configureShell(Shell shell)
-  {
-    super.configureShell(shell);
-    shell.setText(XSDEditorPlugin.getXSDString("_UI_ENUMERATIONS_DIALOG_TITLE"));
-  }
-
-  protected void buttonPressed(int buttonId)
-  {
-    if (buttonId == Dialog.OK)
-    {
-      text = textField.getText();
-      delimiter = delimiterField.getText();
-      isPreserve = preserveWhitespace.getSelection();
-    }
-    super.buttonPressed(buttonId);
-  }
-
-  private String text, delimiter;
-  private boolean isPreserve;
-  public String getText() { return text; }
-  public String getDelimiter() { return delimiter; }
-  public boolean isPreserveWhitespace() { return isPreserve; }
-
-  private Text textField;
-  private Button preserveWhitespace;
-  private Combo delimiterField;
-  //
-  // Create the controls
-  //
-  public Control createDialogArea(Composite parent)
-  {
-    Control[] tabOrder = new Control[3];
-  	int tabIndex = 0;
-    Composite client = (Composite)super.createDialogArea(parent);
-    GridLayout layout = (GridLayout)client.getLayout();
-    layout.numColumns = 2;
-    client.setLayout(layout); 
-
-    textField = ViewUtility.createWrappedMultiTextField(client, 400, 20, true);
-    GridData gd = (GridData) textField.getLayoutData();
-    gd.horizontalSpan = 2;
-    tabOrder[tabIndex++] = textField;
-
-    ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_DELIMITER_CHAR"));
-    delimiterField = ViewUtility.createComboBox(client, false);
-    gd = (GridData) delimiterField.getLayoutData();
-    gd.grabExcessHorizontalSpace = false;
-    gd.horizontalAlignment = GridData.BEGINNING;
-    gd.widthHint = 30;
-    tabOrder[tabIndex++] = delimiterField;
-
-    // add default delimiters
-    delimiterField.add(":");
-    delimiterField.add(",");
-    delimiterField.add(" ");
-    // set the current one to be ','
-    delimiterField.setText(",");
-
-    preserveWhitespace = ViewUtility.createCheckBox(client, XSDEditorPlugin.getXSDString("_UI_LABEL_PRESERVE_WHITESPACE"));
-    gd = (GridData) preserveWhitespace.getLayoutData();
-    gd.horizontalSpan = 2;
-    tabOrder[tabIndex++] = preserveWhitespace;
-    
-    client.setTabList(tabOrder);
-
-    return client;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
deleted file mode 100644
index ec97e3f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.widgets;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.editor.XSDEditorContextIds;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-
-public class TypeSection
-{
-  /**
-   * Constructor for TypeSection.
-   * @param parent
-   */
-  public TypeSection(Composite parent)
-  {
-  }
-
-  protected Button  simpleType;
-  protected Button  userSimpleType;
-  protected Button  userComplexType;
-  protected Button  noneRadio;
-  protected Combo   typeList;
-  protected Combo   derivedByCombo;
-  protected boolean showUserComplexType = true;
-  protected boolean showUserSimpleType  = true;
-  protected boolean showNone            = false;
-  protected boolean showDerivedBy       = false;
-  protected String  derivedByChoices[]  = { "restriction", "extension" };
-  public final int  NONE                = 1;
-  public final int  BUILT_IN            = 2;
-  public final int  SIMPLE              = 3;
-  public final int  COMPLEX             = 4;
-
-  String            sectionTitle        = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
-  String            currentObjectUuid   = "";
-
-  /*
-   * @see FlatPageSection#createClient(Composite, WidgetFactory)
-   */
-  public Composite createClient(Composite parent)
-  {
-    Composite client = new Composite(parent, SWT.NONE);
-    GridLayout gl = new GridLayout(1, true);
-    gl.verticalSpacing = 0;
-    client.setLayout(gl);
-
-    if (showNone)
-    {
-      noneRadio = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_NONE"));
-      WorkbenchHelp.setHelp(noneRadio, XSDEditorContextIds.XSDE_TYPE_HELPER_NONE);
-    }
-
-    simpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_BUILT_IN_SIMPLE_TYPE"));
-    WorkbenchHelp.setHelp(simpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_BUILT_IN);
-
-    if (showUserSimpleType)
-    {
-      userSimpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_SIMPLE_TYPE"));
-      WorkbenchHelp.setHelp(userSimpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE);
-    }
-
-    if (showUserComplexType)
-    {
-      userComplexType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_COMPLEX_TYPE"));
-      WorkbenchHelp.setHelp(userComplexType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX);
-    }
-
-    //	  typeList = utility.createComboBox(client);
-    //	  WorkbenchHelp.setHelp(typeList, XSDEditorContextIds.XSDE_TYPE_HELPER_TYPE);
-    //    utility.createHeadingLabel(client, "Type",null);
-
-    if (showDerivedBy)
-    {
-      Composite derivedByComposite = ViewUtility.createComposite(client, 2);
-      ViewUtility.createLabel(derivedByComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY"));
-      derivedByCombo = ViewUtility.createComboBox(derivedByComposite);
-      populateDerivedByCombo();
-      WorkbenchHelp.setHelp(derivedByCombo, XSDEditorContextIds.XSDE_SIMPLE_CONTENT_DERIVED);
-      derivedByCombo.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_DERIVED_BY"));
-    }
-    // Set the default selection
-    if (showNone)
-    {
-      //		noneRadio.setSelection(true);
-      //		typeList.setEnabled(false);
-    }
-    else
-    {
-      simpleType.setSelection(true);
-    }
-    return client;
-  }
-
-  public void setIsDerivedBy(boolean derive)
-  {
-    if (derive)
-    {
-      sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE");
-    }
-    else
-    {
-      sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
-    }
-    //	setHeaderText(sectionTitle);
-  }
-
-  /**
-   * Set to true if called by Complex Type & Simple Type
-   */
-  public void setShowDerivedBy(boolean derive)
-  {
-    showDerivedBy = derive;
-  }
-
-  /**
-   * Gets the derivedByField
-   * @return Returns a Button
-   */
-  public Combo getDerivedByCombo()
-  {
-    return derivedByCombo;
-  }
-
-  /**
-   * Gets the noneRadio.
-   * @return Returns a Button
-   */
-  public Button getNoneRadio()
-  {
-    return noneRadio;
-  }
-
-  /**
-   * Gets the simpleType.
-   * @return Returns a Button
-   */
-  public Button getSimpleType()
-  {
-    return simpleType;
-  }
-
-  /**
-   * Gets the userComplexType.
-   * @return Returns a Button
-   */
-  public Button getUserComplexType()
-  {
-    return userComplexType;
-  }
-
-  /**
-   * Gets the userSimpleType.
-   * @return Returns a Button
-   */
-  public Button getUserSimpleType()
-  {
-    return userSimpleType;
-  }
-
-  /**
-   * Gets the typeList.
-   * @return Returns a CCombo
-   */
-  public Combo getTypeList()
-  {
-    return typeList;
-  }
-
-  /**
-   * Populate combo box with built-in simple types
-   */
-  public void populateBuiltInType(XSDSchema xsdSchema)
-  {
-    getTypeList().removeAll();
-    List items = getBuiltInTypeNamesList(xsdSchema);
-    for (int i = 0; i < items.size(); i++)
-    {
-      getTypeList().add(items.get(i).toString());
-    }
-  }
-
-  public java.util.List getBuiltInTypeNamesList(XSDSchema xsdSchema)
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getBuiltInTypeNamesList();
-  }
-
-  /**
-   * Populate combo box with user defined complex types
-   */
-  public void populateUserComplexType(XSDSchema xsdSchema, boolean showAnonymous)
-  {
-    getTypeList().removeAll();
-    if (showAnonymous)
-    {
-      getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
-    }
-
-    List items = getUserComplexTypeNamesList(xsdSchema);
-    for (int i = 0; i < items.size(); i++)
-    {
-      getTypeList().add(items.get(i).toString());
-    }
-  }
-
-  public java.util.List getUserComplexTypeNamesList(XSDSchema xsdSchema)
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getUserComplexTypeNamesList();
-  }
-
-  public void populateUserSimpleType(XSDSchema xsdSchema, boolean showAnonymous)
-  {
-    getTypeList().removeAll();
-    if (showAnonymous)
-    {
-      getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
-    }
-    List items = getUserSimpleTypeNamesList(xsdSchema);
-    for (int i = 0; i < items.size(); i++)
-    {
-      getTypeList().add(items.get(i).toString());
-    }
-  }
-
-  /**
-   * Populate combo box with user defined simple types
-   */
-  public void populateUserSimpleType(XSDSchema xsdSchema)
-  {
-    getTypeList().removeAll();
-    List items = getUserSimpleTypeNamesList(xsdSchema);
-    for (int i = 0; i < items.size(); i++)
-    {
-      getTypeList().add(items.get(i).toString());
-    }
-  }
-
-  public java.util.List getUserSimpleTypeNamesList(XSDSchema xsdSchema)
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getUserSimpleTypeNamesList();
-  }
-
-  public String getPrefix(String ns, XSDSchema xsdSchema)
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    String key = helper.getPrefix(ns, true);
-    return key;
-  }
-
-  /**
-   * Populate combo box with derived by choices
-   */
-  protected void populateDerivedByCombo()
-  {
-    for (int i = 0; i < derivedByChoices.length; i++)
-    {
-      getDerivedByCombo().add(derivedByChoices[i]);
-    }
-  }
-
-  /**
-   * Gets the showUserComplexType.
-   * @return Returns a boolean
-   */
-  public boolean getShowUserComplexType()
-  {
-    return showUserComplexType;
-  }
-
-  /**
-   * Gets the showUserSimpleType.
-   * @return Returns a boolean
-   */
-  public boolean getShowUserSimpleType()
-  {
-    return showUserSimpleType;
-  }
-
-  /**
-   * Gets the showNone.
-   * @return Returns a boolean
-   */
-  public boolean getShowNone()
-  {
-    return showNone;
-  }
-
-  /**
-   * Sets the showUserComplexType.
-   * @param showUserComplexType The showUserComplexType to set
-   */
-  public void setShowUserComplexType(boolean showUserComplexType)
-  {
-    this.showUserComplexType = showUserComplexType;
-  }
-
-  /**
-   * Sets the showUserSimpleType.
-   * @param showUserSimpleType The showUserSimpleType to set
-   */
-  public void setShowUserSimpleType(boolean showUserSimpleType)
-  {
-    this.showUserSimpleType = showUserSimpleType;
-  }
-
-  /**
-   * Sets the showNone
-   * @param showUserSimpleType The showNone to set
-   */
-  public void setShowNone(boolean showNone)
-  {
-    this.showNone = showNone;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java
deleted file mode 100644
index f240140..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-
-public class NewXSDWizard extends Wizard implements INewWizard {
-	private XSDNewFilePage newFilePage;
-	private IStructuredSelection selection;
-	private IWorkbench workbench;
-
-	public NewXSDWizard() {
-	}
-
-	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
-		this.selection = aSelection;
-		this.workbench = aWorkbench;
-
-		this.setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "internal/icons/NewXSD.gif"));
-		this.setWindowTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_CREATE_XSD_MODEL_TITLE"));
-	}
-
-	public void addPages() {
-		newFilePage = new XSDNewFilePage(selection);
-		addPage(newFilePage);
-	}
-
-	public boolean performFinish() {
-		IFile file = newFilePage.createNewFile();
-
-		//
-		// Get the xsd schema name from the full path name
-		// e.g. f:/b2b/po.xsd => schema name = po
-		//
-		IPath iPath = file.getFullPath().removeFileExtension();
-		// String schemaName = iPath.lastSegment();
-		String schemaName = iPath.lastSegment();
-		String schemaPrefix = "tns";
-		String prefixForSchemaNamespace = "";
-		String schemaNamespaceAttribute = "xmlns";
-		if (XSDEditorPlugin.getPlugin().isQualifyXMLSchemaLanguage()) {
-			// Added this if check before disallowing blank prefixes in the
-			// preferences...
-			// Can take this out. See also XSDEditor
-			if (XSDEditorPlugin.getPlugin().getXMLSchemaPrefix().trim().length() > 0) {
-				prefixForSchemaNamespace = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix() + ":";
-				schemaNamespaceAttribute += ":" + XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
-			}
-		}
-
-		Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
-		String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-		if (charSet == null || charSet.trim().equals("")) {
-			charSet = "UTF-8";
-		}
-
-		String newContents = "<?xml version=\"1.0\" encoding=\"" + charSet + "\"?>\n";
-
-		String defaultTargetURI = XSDEditorPlugin.getPlugin().getXMLSchemaTargetNamespace();
-		newContents += "<" + prefixForSchemaNamespace + "schema " + schemaNamespaceAttribute + "=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"" + defaultTargetURI + schemaName + "\" xmlns:" + schemaPrefix + "=\"" + defaultTargetURI + schemaName + "\">\n</" + prefixForSchemaNamespace + "schema>";
-
-		try {
-			byte[] bytes = newContents.getBytes(charSet);
-			ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
-
-			file.setContents(inputStream, true, false, null);
-			inputStream.close();
-		}
-		catch (Exception e) {
-			// XSDEditorPlugin.getPlugin().getMsgLogger().write("Error writing
-			// default content:\n" + newContents);
-			// XSDEditorPlugin.getPlugin().getMsgLogger().write(e);
-		}
-
-		if (file != null) {
-			revealSelection(new StructuredSelection(file));
-		}
-
-		openEditor(file);
-
-		return true;
-	}
-
-	private void revealSelection(final ISelection selection) {
-		if (selection != null) {
-			IWorkbench workbench2;
-			if (workbench == null)
-			{
-			  workbench2 = XSDEditorPlugin.getPlugin().getWorkbench();
-			}
-			else
-			{
-			  workbench2 = workbench;
-			}
-			final IWorkbenchWindow workbenchWindow = workbench2.getActiveWorkbenchWindow();
-			final IWorkbenchPart focusPart = workbenchWindow.getActivePage().getActivePart();
-			if (focusPart instanceof ISetSelectionTarget) {
-				Display.getCurrent().asyncExec(new Runnable() {
-					public void run() {
-						((ISetSelectionTarget) focusPart).selectReveal(selection);
-					}
-				});
-			}
-		}
-	}
-
-	public void openEditor(final IFile iFile) {
-		if (iFile != null) {
-			IWorkbench workbench2;
-			if (workbench == null)
-			{
-			  workbench2 = XSDEditorPlugin.getPlugin().getWorkbench();
-			}
-			else
-			{
-			  workbench2 = workbench;
-			}
-			final IWorkbenchWindow workbenchWindow = workbench2.getActiveWorkbenchWindow();
-
-			Display.getDefault().asyncExec(new Runnable() {
-				public void run() {
-					try {
-						String editorId = null;
-						IEditorDescriptor editor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(iFile.getLocation().toOSString(), iFile.getContentDescription().getContentType());
-						if (editor != null) {
-							editorId = editor.getId();
-						}
-						workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), editorId);
-						
-					}
-					catch (PartInitException ex) {
-					}
-					catch (CoreException ex) {
-					}
-				}
-			});
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java
deleted file mode 100644
index 2e2859b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java
+++ /dev/null
@@ -1,958 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-// Based on version 1.12 of original xsdeditor
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.editor.XSDEditorContextIds;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDPatternFacet;
-
-
-
-/*
--other regex features (eg case sensitivity, ^ or $, |, etc etc)
--smarter model
--better keyboard navigation
--update list of tokens 
-*/
-
-public class RegexCompositionPage extends WizardPage
-{
-  private static final boolean debug = false;
-
-  /* The text representation of our pattern. */
-  private StyledText value; 
-
-  /* The StyleRange used to color code the current parse error. */
-  private StyleRange currentError;
-
-  /* The regex terms we can form tokens from. */
-  private Combo terms;
-
-  /* The checkbox for activating auto-escape mode. */  
-  private Button escapeCheckbox;
-  
-  /* On/off status of auto-escape mode. */ 
-  private boolean autoEscapeStatus;
-
-  /* The Add Token button. */
-  private Button add;
-
-
-  // The following controls are used in the occurrence selection group
-
-  private Text repeatValue;
-
-  private Text rangeMinValue;
-  private Text rangeMaxValue;
-  private Label rangeToLabel;  
-
-  private Button singleRadio;
-  private Button starRadio;
-  private Button plusRadio;
-  private Button optionalRadio; 
-  private Button repeatRadio;
-  private Button rangeRadio;
-
-  
-  // The following variables used as part of the model. 
-
-  /* Our pattern. */
-  private XSDPatternFacet pattern;
-
-  /* Model used to store the current token. */
-  private RegexNode node;    
-
-  /* The flags passed to the new RegularExpression object.  Default value includes:
-      X = XMLSchema mode    */
-  private String regexFlags = "X";
-      
-
-  /* Is the current regex token valid? */
-  private boolean isValidToken;
-
-  /* The label used to indicate the value's caret position when it looses focus. */
-  private Label caretLabel;
-
-  /* The pixel offsets needed to align the label icon with the caret location.
-     These are dependent on the icon used. */
-  private static final int CARET_LABEL_X_OFFSET = -3;
-  private static final int CARET_LABEL_Y_OFFSET = 19;
-
-  
-  /* Enumerated constants for specifying the type of an error message. */
-  private static final int TOKEN = 0;
-  private static final int SELECTION = 1;
-  private static final int PARSE = 2;
-  
-  private static final int NUM_ERROR_MESSAGE_TYPES = 3;
-  
-  /* The current error message for each type of error.  A value of null indicates no message. 
-     The array is indexed according to the above constants.
-  */
-  private String[] currentErrorMessages;
-
-
-  public RegexCompositionPage(XSDPatternFacet pattern)
-  {
-    super(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE"));
-    this.pattern = pattern;
-
-    setTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE"));
-    setDescription(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_DESCRIPTION"));
-  }
-
-  public void createControl(Composite parent)
-  {
-    // Set up our model and validator
-    node = new RegexNode();
-        
-    isValidToken = true;
-
-    currentErrorMessages = new String[NUM_ERROR_MESSAGE_TYPES];
-
-    // The main composite
-    Composite composite= new Composite(parent, SWT.NONE);
-    WorkbenchHelp.setHelp(composite, XSDEditorContextIds.XSDR_COMPOSITION_PAGE);
-    composite.setLayout(new GridLayout());
-
-
-    // The composite for the token combo box, label, and auto-escape checkbox
-    Composite tokenComposite = new Composite (composite, SWT.NONE);
-    GridLayout tokenCompositeLayout = new GridLayout();
-    tokenCompositeLayout.numColumns = 3;
-    tokenCompositeLayout.marginWidth = 0;
-    tokenComposite.setLayout(tokenCompositeLayout);
-
-
-    new Label(tokenComposite, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TOKEN_LABEL"));
-    
-    terms = new Combo(tokenComposite, SWT.DROP_DOWN);
-    WorkbenchHelp.setHelp(terms, XSDEditorContextIds.XSDR_COMPOSITION_TOKEN);
-    for (int i = 0; i < RegexNode.getNumRegexTerms(); i++)
-    {
-      terms.add(RegexNode.getRegexTermText(i));
-    }
-    terms.addListener(SWT.Modify, new ComboListener());
-    terms.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_TERMS"));
-
-    escapeCheckbox = new Button(tokenComposite, SWT.CHECK);
-    escapeCheckbox.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL"));
-    escapeCheckbox.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX")); 
-    escapeCheckbox.addSelectionListener(new CheckboxListener());
-    autoEscapeStatus = false;
-    
-    tokenComposite.pack();
-
-
-    // Set up the composites pertaining to the selection of occurrence quantifiers
-
-    Group occurrenceSelectionArea = new Group(composite, SWT.NONE);
-    occurrenceSelectionArea.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_OCCURENCE_LABEL"));
-    WorkbenchHelp.setHelp(occurrenceSelectionArea, XSDEditorContextIds.XSDR_COMPOSITION_OCCURRENCE_GROUP);
-    GridLayout selectionAreaLayout = new GridLayout();
-    selectionAreaLayout.numColumns = 2;
-    occurrenceSelectionArea.setLayout(selectionAreaLayout);
-
-    // Listener used for all of the text fields
-    TextListener textListener = new TextListener();
-    
-
-    // Add the radio buttons
-    RadioSelectListener radioSelectListener = new RadioSelectListener();
-
-    singleRadio = addOccurenceRadioButton(RegexNode.SINGLE, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(singleRadio, XSDEditorContextIds.XSDR_COMPOSITION_JUST_ONCE);
-    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
-    starRadio = addOccurenceRadioButton(RegexNode.STAR, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(starRadio, XSDEditorContextIds.XSDR_COMPOSITION_ZERO_OR_MORE);
-    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
-    plusRadio = addOccurenceRadioButton(RegexNode.PLUS, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(plusRadio, XSDEditorContextIds.XSDR_COMPOSITION_ONE_OR_MORE);
-    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
-    optionalRadio = addOccurenceRadioButton(RegexNode.OPTIONAL, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(optionalRadio, XSDEditorContextIds.XSDR_COMPOSITION_OPTIONAL);
-    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
-    repeatRadio = addOccurenceRadioButton(RegexNode.REPEAT, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(repeatRadio, XSDEditorContextIds.XSDR_COMPOSITION_REPEAT);
-
-    // Add text field for specifying number of repeats
-    Composite repeatWidgets = new Composite(occurrenceSelectionArea, SWT.NONE);
-    RowLayout repeatWidgetsLayout = new RowLayout();
-    repeatWidgetsLayout.marginTop = 0;
-    repeatWidgetsLayout.marginBottom = 0;
-    repeatWidgetsLayout.marginLeft = 0;
-    repeatWidgetsLayout.marginRight = 0;
-    repeatWidgets.setLayout(repeatWidgetsLayout);        
-    
-    repeatValue = new Text(repeatWidgets, SWT.SINGLE | SWT.BORDER);
-    repeatValue.addListener(SWT.Modify, textListener);
-    WorkbenchHelp.setHelp(repeatValue, XSDEditorContextIds.XSDR_COMPOSITION_REPEAT_TEXT);
-    repeatValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_REPEAT"));
-    setEnabledStatus(RegexNode.REPEAT, false);
-    
-    repeatWidgets.pack();
-    
-    rangeRadio = addOccurenceRadioButton(RegexNode.RANGE, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(rangeRadio, XSDEditorContextIds.XSDR_COMPOSITION_RANGE);
-
-    // Add text fields and labels for specifying the range    
-    Composite rangeWidgets = new Composite(occurrenceSelectionArea, SWT.NONE);
-    RowLayout rangeWidgetsLayout = new RowLayout();
-    rangeWidgetsLayout.marginTop = 0;
-    rangeWidgetsLayout.marginBottom = 0;
-    rangeWidgetsLayout.marginLeft = 0;
-    rangeWidgetsLayout.marginRight = 0;
-    rangeWidgets.setLayout(rangeWidgetsLayout);
-    
-    rangeMinValue = new Text(rangeWidgets, SWT.SINGLE | SWT.BORDER);
-    rangeMinValue.addListener(SWT.Modify, textListener);
-    WorkbenchHelp.setHelp(rangeMinValue, XSDEditorContextIds.XSDR_COMPOSITION_RANGE_MIN);
-    rangeMinValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_MIN"));
-    
-    rangeToLabel = new Label(rangeWidgets, SWT.NONE);
-    rangeToLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TO_LABEL"));
-    
-    rangeMaxValue = new Text(rangeWidgets, SWT.SINGLE | SWT.BORDER);
-    rangeMaxValue.addListener(SWT.Modify, textListener);
-    rangeMaxValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_MAX"));
-    WorkbenchHelp.setHelp(rangeMaxValue, XSDEditorContextIds.XSDR_COMPOSITION_RANGE_MAX);
-
-    setEnabledStatus(RegexNode.RANGE, false);
-    rangeWidgets.pack();
-    
-    singleRadio.setSelection(true);
-    
-    occurrenceSelectionArea.pack();
-
-    // The add button
-    add = new Button(composite, SWT.PUSH);
-    add.addSelectionListener(new ButtonSelectListener());
-    add.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"));
-    WorkbenchHelp.setHelp(add, XSDEditorContextIds.XSDR_COMPOSITION_ADD);
-    add.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_ADD_BUTTON"));
-
-    
-    Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
-    separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    
-    // Our main text box
-
-    Label valueLabel= new Label(composite, SWT.LEFT);
-    valueLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL"));
-    
-    value = new StyledText(composite, SWT.SINGLE | SWT.BORDER);
-    value.addListener(SWT.Modify, textListener);
-    value.addListener(SWT.Selection, textListener);
-    WorkbenchHelp.setHelp(value, XSDEditorContextIds.XSDR_COMPOSITION_CURRENT);
-    value.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_CURRENT_REGEX"));
-    value.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    value.setFocus();
-
-    // StyleRange used for highlighting parse errors
-    currentError = new StyleRange();
-    currentError.length = 1;
-    currentError.foreground = parent.getDisplay().getSystemColor(SWT.COLOR_RED);
-
-    // The caret label
-    caretLabel = new Label(composite, SWT.LEFT);
-    caretLabel.setImage(XSDEditorPlugin.getXSDImage("icons/RegexWizardArrow.gif"));
-    caretLabel.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_CARET_LABEL"));
-    setShowCaretLabel(true);
-
-    value.addFocusListener(new TextFocusListener());
-
-    terms.select(0);
-
-
-    setControl(composite);
-  }
-
-
-  public void setVisible(boolean visible)
-  {
-    super.setVisible(visible);
-
-    value.setText(pattern.getLexicalValue());
-    value.setCaretOffset(value.getCharCount());
-  }
-
-  public void dispose()
-  {
-    super.dispose();
-  }
-
-
-  /**
-   * Sets the visible status of caretLabel to status.  If status is true, then we also update the position
-   * of caretLabel in one of two ways.  If there is no active selection in value, we set caretLabel's
-   * position to correspond with the position of the actual caret.  Alternatively, if there is an active selection
-   * in value, we set caretLabel's position to the beginning of the selection.
-   *
-   * @param The new visibility status of caretLabel.
-   */
-  private void setShowCaretLabel(boolean status)
-  {
-    if (status)
-    {
-  
-      int offset;
-      
-      if (value.getSelectionText().equals(""))
-      {
-        offset = value.getCaretOffset();
-      }
-      else
-      {
-        offset = value.getSelection().x;
-      }
-  
-      Point p = value.getLocationAtOffset(offset);
-      
-      p.x += value.getLocation().x;
-      p.y = value.getLocation().y;
-      
-      // Place the label under value, and make sure it is aligned with the caret.
-      // The offsets are dependent on the icon used.
-      p.x += CARET_LABEL_X_OFFSET;
-      p.y += CARET_LABEL_Y_OFFSET;
-  
-      if (debug)
-      {
-        System.out.println("POINT: " + p);
-      }
-      
-      caretLabel.setLocation(p);
-      caretLabel.setVisible(true);
-    }
-    else
-    {
-      caretLabel.setVisible(false);
-    }
-  }
-
-
-  /**
-   * Adds a new radio button to Composite c with SelectionListener l.  The text of the button is the String associated with
-   * quantifier.
-   *
-   * @param quantifier The desired quantifier, as enumerated in RegexNode.
-   * @param c The Composite to add the buttons to (normally occurrenceRadioButtons).
-   * @param l The SelectionListener (normally radioSelectionListener).
-   * @return The newly created button.
-   */
-  private Button addOccurenceRadioButton(int quantifier, Composite c, SelectionListener l)
-  {
-    Button result = new Button(c, SWT.RADIO);
-    result.setText(RegexNode.getQuantifierText(quantifier));
-    result.addSelectionListener(l);
-    return result;
-  }
-
-
-  /**
-   * Validates the regex in value.  If the regex is valid, clears the Wizard's error message.  If it's not valid,
-   *  sets the Wizard's error message accordingly.
-   *
-   * @return Whether the regex is valid.
-   */
-  private boolean validateRegex()
-  {
-
-    boolean isValid;
-    try
-    {
-      // We validate the regex by checking whether we get a ParseException.
-      // By default, we assume that it's valid unless we determine otherwise.
-      isValid = true;
-      displayRegexErrorMessage(null);
-      value.setStyleRange(null);
-
-      Pattern.compile(value.getText());
-    }
-    catch (PatternSyntaxException pe)
-    {
-      isValid = false;
-      displayRegexErrorMessage(pe.getMessage());
-
-      // An off-by-one bug in the xerces regex parser will sometimes return a location for the parseError that
-      //  is off the end of the string.  If this is the case, then we want to highlight the last character.
-      if (pe.getIndex() >= value.getText().length())
-      {
-        currentError.start = value.getText().length() - 1;
-      }
-      else
-      {
-        currentError.start = pe.getIndex();
-      }
-
-      if (debug)
-      {
-        System.out.println("Parse Error location: " + pe.getIndex());
-        System.out.println("currentError.start: " + currentError.start);
-      }
-
-      value.setStyleRange(currentError);
-
-    }
-
-    // Another bug in the xerces parser will sometimes throw a RuntimeException instead of a ParseException.
-    //  When we get a RuntimeException, we aren't provided with the additional information we need to highlight
-    //  the parse error.  So, we merely report that there is an error.
-    catch (RuntimeException re)
-    {
-      displayRegexErrorMessage("");
-      value.setStyleRange(null);
-      isValid = false;
-    }
-    
-    setPageComplete(isValid);    
-    return isValid;
-  }
-
-  
-  /**
-   * Manages the display of error messages.
-   * Sets the error message for type to errorMessage.  If errorMessage != null, then we set the Wizard's error message
-   * to errorMessage.  If errorMessage == null, then we check whether we have a pending message of another type.
-   * If we do, then it is displayed as the Wizard's error message.  If we don't, then the Wizard's error message field
-   * is cleared.
-   *
-   * @param errorMessage The text of the new error message.  A value of null indicates that the error message should
-   *  be cleared.
-   * @param type The error type, one of PARSE, TOKEN, or SELECTION.
-   */ 
-  private void displayErrorMessage(String errorMessage, int type)
-  {
-    String messageToDisplay = null;
-
-
-    currentErrorMessages[type] = errorMessage;
-
-    messageToDisplay = errorMessage;
-
-    for (int i = 0; i < NUM_ERROR_MESSAGE_TYPES; i++)
-    {
-      if (messageToDisplay != null)
-      {
-        break;
-      }
-      messageToDisplay = currentErrorMessages[i];
-    }
-
-    setErrorMessage(messageToDisplay);
-  }
-
-
-  /**
-   * Sets the Wizard's error message to message, preceded by a standard prefix.
-   *
-   * @param message The new error message (or null to clear it).
-   */
-  private void displayRegexErrorMessage (String errorMessage)
-  {
-    if (errorMessage == null)
-    {
-      displayErrorMessage(null, PARSE);
-    }
-    else
-    {
-    	if (errorMessage.trim().equals("")) // when there is no error message available.
-    	{
-        displayErrorMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REGEX_ERROR"),
-                           PARSE);
-      }
-      else
-      {
-        displayErrorMessage(errorMessage, PARSE);
-      }
-    }
-  }
-
-
-  /**
-   * Updates the token status.  Sets isValidToken to status && the status of the other error type.
-   * If status is true, we clear the wizard's error message for this type; if it is false, we set it to errorMessage.
-   *
-   * @param status The new isValidToken value.
-   * @param errorMessage The new error message.
-   * @param type The type of the error (either TOKEN or SELECTION).
-   */
-  private void setTokenStatus (boolean status, String errorMessage, int type)
-  {
-    boolean otherTypeStatus =     (type == TOKEN) ? 
-                                  currentErrorMessages[SELECTION] == null :
-                                  currentErrorMessages[TOKEN] == null;
-    
-    isValidToken = status && otherTypeStatus;
-    add.setEnabled(isValidToken);
-
-    if (status)
-    {
-      displayErrorMessage(null, type);
-    }
-    else
-    {
-    	if (errorMessage != null && errorMessage.trim().equals("")) // when there is no error message available.
-    	{
-        displayErrorMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR"),
-                           type);
-      }
-      else
-      {
-        displayErrorMessage(errorMessage, type);
-      }
-    }
-  }
-
-  
-  /**
-   * Updates the token status.  Sets isValidToken to status && the status of the other error type.
-   * Also clears the wizard's error message for this type.
-   * Usually used to set isValidToken to true.
-   *
-   * @param status The new isValidToken value.
-   * @param type The type of the error (either TOKEN or SELECTION).
-   */
-  private void setTokenStatus(boolean status, int type)
-  {
-    setTokenStatus(status, null, type);
-  }
-
-
-
-  /**
-   * Sets the enabled status of the text fields and labels associated with the specified quantifier.
-   * If status is true, then fields and labels associated with other quantifiers are disabled.
-   * @param quantifier The quantifier whose elements' enabled status we wish to change
-   *   (as enumerated in RegexNode).
-   * @param status The new status of the elements.  If true, then all elements associated with other buttons
-   *               are disabled.
-   */    
-  private void setEnabledStatus(int quantifier, boolean status)
-  {
-    switch (quantifier)
-    {
-    
-    case RegexNode.REPEAT:
-      repeatValue.setEnabled(status);
-      if (status)
-      {
-        rangeMinValue.setEnabled(false);
-        rangeMaxValue.setEnabled(false);
-        rangeToLabel.setEnabled(false);
-      }
-      break;
-
-    case RegexNode.RANGE:
-      rangeMinValue.setEnabled(status);
-      rangeMaxValue.setEnabled(status);
-      rangeToLabel.setEnabled(status);
-      if (status)
-      {
-        repeatValue.setEnabled(false);
-      }
-      break;
-
-    }
-  }
-
-  /**
-   * Checks to see if there is a selection in value.  If there is not, we set the Wizard's error message accordingly.
-   * If there is, we update the contents of node.  If "Current Selection" is not the current token, then
-   * we clear the Selection error message.
-   */
-  private void updateCurrentSelectionStatus()
-  {
-    if (terms.getSelectionIndex() == RegexNode.SELECTION)
-    {
-      String selection = value.getSelectionText();
-      if (selection.equals(""))
-      {
-        setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_SELECTION_ERROR"), SELECTION);
-      }
-      else
-      {
-        setTokenStatus(true, SELECTION);
-        node.setContents(selection);
-        node.setHasParens(true);
-      }
-    }
-    else
-    {
-      setTokenStatus(true, SELECTION);
-    }
-  }
-
-  /**
-   * Updates the enabled status of the auto-escape checkbox.  If status is true, we enable the checkbox, and
-   * set its selection status and node's auto-escape status to the value of autoEscapeStatus.  If status is
-   * false, then we disable and deselect the checkbox, and set node's status to false.
-   *
-   * @param status The new enabled status.
-   */
-  private void setEscapeCheckboxEnabledStatus(boolean status)
-  {
-    if (status)
-    {
-      escapeCheckbox.setEnabled(true);
-      escapeCheckbox.setSelection(autoEscapeStatus);
-      node.setAutoEscapeStatus(autoEscapeStatus);
-    }
-    else
-    {
-      escapeCheckbox.setEnabled(false);
-      escapeCheckbox.setSelection(false);
-      node.setAutoEscapeStatus(false);
-    }
-  }
-
-
-  /**
-   * Returns the current regex flags.
-   */
-  String getFlags()
-  {
-    return regexFlags;
-  }
-
-  /**
-   * Returns the current XSDPattern model.
-   */
-  XSDPatternFacet getPattern()
-  {
-    return pattern;
-  }
-
-
-  /**
-   * Returns a string consisting of the values of min, max, and repeat stored in node.
-   * Used for debugging purposes only.
-   */  
-  private String getAllFieldValues()
-  {
-      String result = "";
-      result += "Min: " + node.getMin() + "\n";
-      result += "Max: " + node.getMax() + "\n";
-      result += "Repeat: " + node.getRepeat() + "\n";
-      result += "\n";
-      return result;
-  }
-  
-
-  /* Listener for the add button. */
-  class ButtonSelectListener implements SelectionListener
-  {
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-
-    // Precondition: isValidToken == true  
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (!isValidToken) // should never happen
-      {
-        System.out.println("Attempted to add an invalid token.");
-        System.out.println(node.toString());
-        System.out.println(getAllFieldValues());
-        return;
-      }
-
-      // Whether there is anything selected in value.
-      boolean isActiveSelection = value.getSelectionCount() != 0;
-      
-      value.insert(node.toString());
-
-      if (terms.getSelectionIndex() == RegexNode.SELECTION)
-      {
-        updateCurrentSelectionStatus();
-      }
-
-      // If nothing is selected, then we need to advance the caret location.
-      if (!isActiveSelection)
-      {
-        value.setCaretOffset(value.getCaretOffset() + node.toString().length());
-      }
-
-      value.setFocus();
-
-    }
-
-  }
- 
-
-  /* Listener for the terms combo box. */
-  class ComboListener implements Listener
-  {
-    public void handleEvent(Event e)
-    {
-      
-      updateCurrentSelectionStatus();
-
-      // If the user has typed in a token
-      if (terms.getSelectionIndex() == -1)
-      {
-        setEscapeCheckboxEnabledStatus(true);
-        node.setContents(terms.getText());
-        node.setHasParens(true);
-        
-
-        if (debug)
-        {
-          System.out.println(terms.getText());
-        }
-
-      }
-      else if (terms.getSelectionIndex() == RegexNode.SELECTION)
-      {
-        setEscapeCheckboxEnabledStatus(false);
-      }
-      else
-      {
-        node.setContents(RegexNode.getRegexTermValue(terms.getSelectionIndex()));
-        node.setHasParens(false);
-        setEscapeCheckboxEnabledStatus(false);
-      }
-    }
-  }
-
-
-  /* Listener for enabling/disabling caretLabel. */
-  class TextFocusListener implements FocusListener
-  {
-    public void focusGained(FocusEvent e)
-    {
-      setShowCaretLabel(false);
-    }
-    public void focusLost(FocusEvent e)
-    {
-      setShowCaretLabel(true);
-    }
-  }
-
-
-
-  /* Listener for the text fields. */
-  class TextListener implements Listener
-  {
-    public void handleEvent (Event e)
-    {
-
-      if (debug)
-      {
-        System.out.println("Inside TextListener handler");
-        System.out.println(e);
-        System.out.println(getAllFieldValues());
-      }
-
-
-      if ( (e.widget == value) && (e.type == SWT.Modify) )
-      {
-        pattern.setLexicalValue(value.getText());
-        validateRegex();
-      }
-
-      else if (e.widget == value && e.type == SWT.Selection)
-      {
-        if (terms.getSelectionIndex() == RegexNode.SELECTION)
-        {
-          updateCurrentSelectionStatus();
-        }
-      }
-
-      else if (e.widget == rangeMinValue)
-      {
-        boolean isValid = node.setMin(rangeMinValue.getText());
-
-        if (isValid)
-        {
-          setTokenStatus(true, null, TOKEN);
-        }
-        else
-        {
-          setTokenStatus(false,  XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX"), TOKEN);
-        }
-      }
-
-      else if (e.widget == rangeMaxValue)
-      {
-        boolean isValid = node.setMax(rangeMaxValue.getText());
-
-        if (node.getMin() == RegexNode.EMPTY)
-        {
-          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MISSING_MIN_ERROR_SUFFIX"), TOKEN);
-        }
-        else if (isValid)
-        {
-          setTokenStatus(true, null, TOKEN);
-        }
-        else
-        {
-          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX"), TOKEN);
-        }
-      }
-
-      else  // (e.widget == repeatValue)
-      {
-        boolean isValid = node.setRepeat(repeatValue.getText());
-        if (isValid)
-        {
-          setTokenStatus(true, null, TOKEN);
-        }
-        else
-        {
-          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX"), TOKEN);
-        }
-      }
-    }
-  }
-
-  /* Listener for the auto-escape checkbox. */
-  class CheckboxListener implements SelectionListener
-  {
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-
-    public void widgetSelected(SelectionEvent e)
-    {
-      boolean newStatus = !autoEscapeStatus;
-      node.setAutoEscapeStatus(newStatus);
-      autoEscapeStatus = newStatus;
-      
-      if (debug)
-      {
-        System.out.println("AutoEscape Status: " + node.getAutoEscapeStatus());
-      }
-    }
-
-  }
-
-
-  /* Listener for the radio buttons. */
-  class RadioSelectListener implements SelectionListener
-  {
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (debug)
-      {
-        System.out.println(getAllFieldValues());
-      }
-
-
-      int currentQuantifier = getQuantifier(e);
-
-      node.setQuantifier(currentQuantifier);
-
-      switch (currentQuantifier)
-      {
-      case RegexNode.SINGLE:                     
-      case RegexNode.STAR:
-      case RegexNode.PLUS:
-      case RegexNode.OPTIONAL:
-        setEnabledStatus(RegexNode.REPEAT, false);
-        setEnabledStatus(RegexNode.RANGE, false);
-        setTokenStatus(true, TOKEN);
-        break; 
-
-      case RegexNode.REPEAT:
-        setEnabledStatus(RegexNode.REPEAT, true);
-        setTokenStatus(node.hasValidRepeat(), XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX"), TOKEN);
-        repeatValue.setFocus();
-        break;
-
-      case RegexNode.RANGE:
-        setEnabledStatus(RegexNode.RANGE, true);
-        String error = (node.hasValidMin()) ? 
-                            XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX") : 
-                            XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX");
-
-        setTokenStatus( node.hasValidMin() && node.hasValidMax(), error, TOKEN);
-        rangeMinValue.setFocus();
-        break;
-      }
-    }
-
-    private int getQuantifier(SelectionEvent e)
-    {
-
-      if (e.widget == singleRadio)
-      {
-        return RegexNode.SINGLE;
-      }
-      
-      else if (e.widget == starRadio)
-      {
-        return RegexNode.STAR;
-      }
-      
-      else if (e.widget == plusRadio)
-      {
-        return RegexNode.PLUS;
-      }
-      
-      else if (e.widget == optionalRadio)
-      {
-        return RegexNode.OPTIONAL;
-      }
-      
-      else if (e.widget == repeatRadio)
-      {
-        return RegexNode.REPEAT;
-      }
-      
-      else if (e.widget == rangeRadio)
-      {
-        return RegexNode.RANGE;
-      }
-      
-      else // can't get here
-      { 
-        return RegexNode.EMPTY;
-      }
-    } 
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
deleted file mode 100644
index 3dd0b63..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-
-class RegexNode
-{
-  private String contents;
-  private int min;
-  private int max;
-  private int repeat;
-  private int quantifier;
-  private boolean hasParens;
-  private boolean autoEscapeStatus;
-
-  
-  /* Quantifiers. */
-  public static final int SINGLE = 0;    
-  public static final int STAR = 1;
-  public static final int PLUS = 2;
-  public static final int OPTIONAL = 3;
-  public static final int REPEAT = 4; 
-  public static final int RANGE = 5;
-
-  /* Regex quantifiers.  First column is the on-screen textual representation, second column is the 
-   on-screen regex representation.  The two are concatenated together to form the on-screen
-   representation.
-   Indexing of this array must correspond to the values of the quantifier constants above.
-  */
-  private static final String[][] regexQuantifiers =
-  { 
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_SINGLE"),   ""  },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_STAR"),     "*" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_PLUS"),     "+" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL"), "?" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_REPEAT"),   ""  },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_RANGE"),    ""  },
-  };
-
-
-  /* Regex tokens.  First column is the on-screen representation, second column is the regex representation. 
-     More tokens can be added, but it is assumed that "Current Selection" is the last element in the array.
-     If this is not the case, then the value of the SELECTION constant below will need to be changed 
-     accordingly.
-     Also note that because these are java Strings, backslashes must be escaped (this is only relevant to the
-     second column of the array).
-   */
-  private static final String[][] regexTerms =
-  { 
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ANY_CHAR"),   "."     },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ALPHANUMERIC_CHAR"),   "\\w"     },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_WHITESPACE"), "\\s"   },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_DIGIT"),      "\\d"   },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_UPPER"),      "[A-Z]" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_LOWER"),      "[a-z]" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_SELECTION"),  ""      },
-  };
-
-  /* Token enumerated constants. */
-
-  // SELECTION must correspond to the index in regexTerms of "Current Selection".  This is assumed to be
-  //  the last element.
-  public static final int SELECTION = regexTerms.length - 1;
-
-  public static final int EMPTY = -1;
-
-  /* 
-  The metacharacters recognized by XML Schema.
-  Note that the double backslash ("\\") actually represents an escaped single backslash character ("\").
-  */ 
-  private static final String metacharacters = ".\\?*+{}()[]";
-
-
-  public static String getRegexTermText(int i)
-  {
-    if (i == SELECTION)
-    {
-      return regexTerms[i][0];
-    }
-    else
-    {
-      return regexTerms[i][0] + " ( " + regexTerms[i][1] + " )";
-    }
-  }
-
-  public static String getRegexTermValue(int i)
-  {
-    if (i == SELECTION) // shouldn't happen
-    {
-      return "";
-    }
-    else
-    {
-      return regexTerms[i][1];
-    }
-  }
-
-  public static int getNumRegexTerms()
-  {
-    return regexTerms.length;
-  }
-
-  public static String getQuantifierText(int i)
-  {
-    String result = regexQuantifiers[i][0];
-    
-    if (!regexQuantifiers[i][1].equals(""))
-    {
-      result += " ( ";
-      result += regexQuantifiers[i][1];
-      result += " )";
-    }
-
-    return result;
-  }
-
-  public RegexNode()
-  {
-    this.contents = "";
-    this.quantifier = SINGLE;
-    this.min = EMPTY;
-    this.max = EMPTY;
-    this.repeat = EMPTY;
-    this.hasParens = false;
-
-  }
-
-  
-  public String getContents()
-  {
-    return contents;
-  }
-  
-  public void setContents(String contents)
-  {
-    this.contents = contents;
-  }
-
-
-  public int getQuantifier()
-  {
-    return quantifier;
-  }
-
-  public void setQuantifier(int quantifier)
-  {
-    this.quantifier = quantifier;
-  }
-
-
-  public int getMin()
-  {
-    return min;
-  }
-
-  public void setMin(int min)
-  {
-    this.min = min;
-  }
-
-  /**
-   * Sets this.min to the integer representation of min iff min is a valid value (i.e. greater than 0).
-   * Sets this.min to EMPTY if it is not.
-   *
-   * @param min The new min value
-   * @returns Whether min was a valid value
-   */  
-  public boolean setMin(String min)
-  {
-    this.min = convertToInt(min);
-
-    // min > max is an invalid case, unless max is EMPTY (since EMPTY == -1).
-    if ( (this.max != EMPTY) && (this.min > this.max) )
-    {
-      return false;
-    }
-    
-    return (this.min >= 0);
-  }
-
-  
-  public int getMax()
-  {
-    return max;
-  }
-  
-  public void setMax(int max)
-  {
-    this.max = max;
-  }
-
-  /**
-   * Sets this.max to the integer representation of max iff max is a valid value (i.e. greater than 0).
-   * Sets this.max to EMPTY if it is not.
-   *
-   * @param max The new max value
-   * @returns Whether max was a valid value, or (whether max == the empty string && min has a valid value)
-   */ 
-  public boolean setMax(String max)
-  {
-    this.max = convertToInt(max);
-
-    // The empty string is a valid max value iff min has a valid value.
-    // This is due to the fact that {n,} means "at least n times" in regex parlance.
-    if (max.equals("") && this.min != EMPTY)
-    {
-      return true;
-    }
-    
-    else if (this.max < this.min)
-    {
-      return false;
-    }
-    
-    else
-    {
-      return (this.max >= 0);
-    }
-  }
-
-
- 
-  public int getRepeat()
-  {
-    return repeat;
-  }
-
-  public void setRepeat(int repeat)
-  {
-    this.repeat = repeat;
-  }
-
-  /**
-   * Sets this.repeat to the integer representation of repeat iff repeat is a valid value (i.e. greater than 0).
-   * Sets this.repeat to EMPTY if it is not.
-   *
-   * @param repeat The new repeat value
-   * @returns Whether repeat was a valid value
-   */
-  public boolean setRepeat(String repeat)
-  {
-    this.repeat = convertToInt(repeat);
-    return (this.repeat >= 0);
-  }
-
-
-
-  /**
-   * Returns the integer representation of s.  If s is less than zero, or if s is not an int
-   * (i.e. if Integer.parseInt would throw a NumberFormatException), then returns EMPTY.
-   *
-   * @param s The String to convert.
-   * @returns The integer representation of s.
-   */
-  private int convertToInt(String s)
-  {
-    int result;
-    try
-    {
-      result = Integer.parseInt(s);
-      if (result < 0)
-      {
-        result = EMPTY;
-      }
-    }
-    catch (NumberFormatException e)
-    {
-      result = EMPTY;
-    }
-
-    return result;
-  }
-
-
-  public boolean getHasParens()
-  {
-    return hasParens;
-  }
-
-  public void setHasParens(boolean status)
-  {
-    this.hasParens = status;
-  }
-
-  public boolean getAutoEscapeStatus()
-  {
-    return autoEscapeStatus;
-  }
-
-  public void setAutoEscapeStatus(boolean status)
-  {
-    this.autoEscapeStatus = status;
-  }
-
-  /**
-   * Returns an escaped version of s.  In other words, each occurrence of a metacharacter ( .\?*+{}()[] )
-   * is replaced by that character preceded by a backslash.
-   *
-   * @param s The String to escape.
-   * @returns An escaped version of s.
-   */
-  private String addEscapeCharacters(String s)
-  {
-    StringBuffer result = new StringBuffer("");
-
-    for (int i = 0; i < s.length(); i++)
-    {
-      char currentChar = s.charAt(i);
-
-      if (isMetachar(currentChar))
-      {
-        result.append("\\"); // Note that this is an escaped backslash, not a double backslash.
-      }
-      result.append(currentChar);
-
-    }
-
-    return result.toString();
-  }
-
-  /**
-   * Checks whether c is a metacharacter as defined in the static variable metacharacters.
-   *
-   * @param c The character to check.
-   * @returns Whether c is a metacharacter.
-   */
-  private boolean isMetachar(char c)
-  {
-    return metacharacters.indexOf(c) != -1;
-  }
-  
-
-  public boolean hasValidMin()
-  {
-    return (min != EMPTY);
-  }
-
-  public boolean hasValidMax()
-  {
-    return(max != EMPTY);
-  }
-
-  public boolean hasValidRepeat()
-  {
-    return(repeat != EMPTY);
-  }
-
-  public String toString()
-  {
-    String result = "";
-    
-    if (hasParens)
-    {
-      result += "(";
-    }
-    
-    if (autoEscapeStatus)
-    {
-       result += addEscapeCharacters(contents);
-    }
-    else 
-    {
-      result += contents;
-    }
-
-
-    if (hasParens)
-    {
-      result += ")";
-    }
-    
-    switch (quantifier)
-    {
-      case STAR:
-        result += "*";
-        break;
-      
-      case PLUS:
-        result += "+";
-        break;
-      
-      case OPTIONAL:
-        result += "?";
-        break;
-      
-      case REPEAT:
-        result += "{" + repeat + "}";
-        break;
-      
-      case RANGE:
-        result += "{" + min + ",";
-        if (max == EMPTY)
-        {
-          result += "";
-        }
-        else
-        {
-          result += max;
-        }       
-        result += "}";
-        break;
-      
-      // SINGLE is a fall through           
-
-    }
-    return result;
-
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
deleted file mode 100644
index 6421e12..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-// Based on version 1.6 of original xsdeditor
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.util.regex.Pattern;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.editor.XSDEditorContextIds;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-public class RegexTestingPage extends WizardPage
-{
-  /* Validator from xerces package. */
-//  private RegularExpression validator;
-  
-  /* Displays the status of the match. */
-  private Label matchLabel;
-
-
-  /* The regex. */
-  private Text value;
-  
-  /* The string the user is trying to match against the regex. */
-  private StyledText testString;
-
-  public RegexTestingPage()
-  {
-    super(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_TITLE"));
-
-    setTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_TITLE"));
-    setDescription(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
-  }
-
-
-  public void createControl(Composite parent)
-  {
-    Composite composite = ViewUtility.createComposite(parent, 1);
-    WorkbenchHelp.setHelp(composite, XSDEditorContextIds.XSDR_TEST_PAGE);
-
-    matchLabel = new Label(composite, SWT.WRAP);
-    matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
-    FontData[] fontData = matchLabel.getFont().getFontData();
-    GridData dataF = new GridData();
-    dataF.widthHint = 400;
-    dataF.heightHint = 6 * fontData[0].getHeight();
-    matchLabel.setLayoutData(dataF);
-    
-    Composite controls = new Composite(composite, SWT.NONE);
-    GridLayout controlsLayout = new GridLayout();
-    controlsLayout.numColumns = 2;
-    controls.setLayout(controlsLayout);
-    controls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    new Label(controls, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_REGEX_LABEL"));
-    value = new Text(controls, SWT.BORDER | SWT.READ_ONLY);
-    value.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-
-    new Label(controls, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_SAMPLE_TEXT"));
-    testString = new StyledText(controls, SWT.SINGLE | SWT.BORDER);
-    WorkbenchHelp.setHelp(testString, XSDEditorContextIds.XSDR_TEST_SAMPLE);
-    testString.addListener(SWT.Modify, new TestStringListener());
-    testString.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    
-    controls.pack();
-    
-    Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
-    GC gc = new GC(separator);
-    Point pointSize = gc.stringExtent(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
-    GridData gd = new GridData();
-    gd.widthHint = (int)(pointSize.x / 2 + gc.getAdvanceWidth('M')*11);
-    gd.horizontalAlignment= GridData.FILL;
-    separator.setLayoutData(gd);
-    
-    composite.pack();
-
-    setControl(composite);
-  }
-
-
-  private String getPatternValue()
-  {
-    return ( (RegexCompositionPage)getPreviousPage() ).getPattern().getLexicalValue();
-  }
-
-  private String getFlags()
-  {
-    return ( (RegexCompositionPage)getPreviousPage() ).getFlags();
-  }
-
-  public void setVisible(boolean visible)
-  {
-    super.setVisible(visible);
-
-    String pattern = getPatternValue();
-    getFlags();
-
-    value.setText(pattern);
-    
-    updateMatchStatus();
-
-    testString.setFocus();
-  }
-
-  class TestStringListener implements Listener
-  {
-    public void handleEvent(Event e)
-    {
-      updateMatchStatus();
-    }
-  }
-
-  private void updateMatchStatus()
-  {
-    if (Pattern.matches(getPatternValue(), testString.getText()))
-    {
-//      matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MATCHES"));
-      setMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MATCHES"), 1);
-    }
-    else
-    {
-      setMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_DOES_NOT_MATCH"), 2);
-//      matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_DOES_NOT_MATCH"));
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
deleted file mode 100644
index 62e393e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.impl.XSDFactoryImpl;
-
-
-public class RegexWizard extends Wizard 
-{
-  private RegexCompositionPage compositionPage;
-  private RegexTestingPage testingPage;
-
-  /* The original, unchanged pattern. */  
-  private XSDPatternFacet originalPattern;
-  
-  /* A copy of the original pattern that is passed into the wizard. */
-  private XSDPatternFacet modifiedPattern;
-
-  String pattern;
-
-  public RegexWizard(String expr)
-  {
-    super();
-    setWindowTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TITLE"));
-    setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/regx_wiz.gif"));
-
-    XSDFactoryImpl factory = new XSDFactoryImpl();
-    modifiedPattern = factory.createXSDPatternFacet();
-    modifiedPattern.setLexicalValue(expr);
-
-    originalPattern = factory.createXSDPatternFacet();
-    originalPattern.setLexicalValue(expr);
-
-    compositionPage = new RegexCompositionPage(modifiedPattern);
-    addPage(compositionPage);
-
-    testingPage = new RegexTestingPage();
-    addPage(testingPage);
-  }
-
-  public String getPattern()
-  {
-    return pattern;
-  }
-
-  public boolean performFinish()
-  {
-    pattern = modifiedPattern.getLexicalValue();
-    return true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
deleted file mode 100644
index d824efb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-public class XSDLocationChoicePage extends WizardPage 
-{
-  protected Button radioButton1;
-  protected Button radioButton2;
-    
-  public XSDLocationChoicePage()
-  {
-    super("XSDLocationChoicePage");
-
-    this.setTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_TITLE"));
-    this.setDescription(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_DESC"));
-  }
-    
-  public boolean isPageComplete()
-  {
-    return true;
-  }
-    
-  public void createControl(Composite parent)
-  {
-    Composite base = new Composite(parent, SWT.NONE);
-    base.setLayout(new GridLayout());
-      
-    ViewUtility.createLabel(base, XSDEditorPlugin.getXSDString("_UI_LABEL_INCLUDE_URL_FILE"));
-    Composite radioButtonsGroup = ViewUtility.createComposite(base, 1, true);
-
-    radioButton1 = ViewUtility.createRadioButton(radioButtonsGroup, 
-                                                 XSDEditorPlugin.getXSDString("_UI_RADIO_FILE"));
-      
-    radioButton2 = ViewUtility.createRadioButton(radioButtonsGroup,
-                                                 XSDEditorPlugin.getXSDString("_UI_RADIO_URL"));
-
-    radioButton1.setSelection(true);
-
-    setControl(base);
-  }
-
-  // actions on finish
-  public boolean performFinish()
-  {
-    return true;
-  }
-
-  public boolean isURL()
-  {
-    return radioButton2.getSelection();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
deleted file mode 100644
index 98c8d23..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
- 
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-
-public class XSDNewFilePage extends WizardNewFileCreationPage
-{
-  public XSDNewFilePage(IStructuredSelection selection) 
-  {
-    super(XSDEditorPlugin.getXSDString("_UI_CREATEXSD"), selection);
-    setTitle(XSDEditorPlugin.getXSDString("_UI_NEW_XML_SCHEMA_TITLE"));
-    setDescription(XSDEditorPlugin.getXSDString("_UI_CREATE_A_NEW_XML_SCHEMA_DESC"));
-  }
-
-  public void createControl(Composite parent) 
-  {
-    // inherit default container and name specification widgets
-    super.createControl(parent);
-
-    this.setFileName(computeDefaultFileName());
-
-    setPageComplete(validatePage());
-  }
-
-  protected boolean validatePage()
-  {
-    Path newName = new Path(getFileName());
-    String fullFileName = getFileName();
-    String extension = newName.getFileExtension();
-    if (extension == null || !extension.equalsIgnoreCase("xsd")) 
-    {
-      setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_FILENAME_MUST_END_XSD"));
-      return false;
-    }
-    else 
-    {
-      setErrorMessage(null);
-    }
-
-    // check for file should be case insensitive
-    String sameName = existsFileAnyCase(fullFileName);
-    if (sameName != null) 
-    {
-      setErrorMessage(XSDEditorPlugin.getPlugin().getString("_ERROR_FILE_ALREADY_EXISTS", sameName)); //$NON-NLS-1$
-      return false;
-    }
-
-    return super.validatePage();
-  }
-
-  public String defaultName = "NewXMLSchema"; //$NON-NLS-1$
-  public String defaultFileExtension = ".xsd"; //$NON-NLS-1$
-  public String[] filterExtensions = { "*.xsd"}; //$NON-NLS-1$
-
-  protected String computeDefaultFileName()
-  {
-    int count = 0;
-    String fileName = defaultName + defaultFileExtension;
-    IPath containerFullPath = getContainerFullPath();
-    if (containerFullPath != null)
-    {
-      while (true)
-      {
-        IPath path = containerFullPath.append(fileName);
-        if (ResourcesPlugin.getWorkspace().getRoot().exists(path))
-        {
-          count++;
-          fileName = defaultName + count + defaultFileExtension;
-        }
-        else
-        {
-          break;
-        }
-      }
-    }
-    return fileName;
-  }
-
-  // returns true if file of specified name exists in any case for selected container
-  protected String existsFileAnyCase(String fileName)
-  {
-    if ( (getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false)
-        && (fileName.compareTo("") != 0))
-    {
-      //look through all resources at the specified container - compare in upper case
-      IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
-      if (parent instanceof IContainer)
-      {
-        IContainer container = (IContainer) parent;
-        try
-        {
-          IResource[] members = container.members();
-          String enteredFileUpper = fileName.toUpperCase();
-          for (int i=0; i<members.length; i++)
-          {
-            String resourceUpperName = members[i].getName().toUpperCase();
-            if (resourceUpperName.equals(enteredFileUpper))
-            {  
-              return members[i].getName();    
-            }
-          }
-        }
-        catch (CoreException e)
-        {
-        }
-      }
-    }
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
deleted file mode 100644
index 83b3810..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFilePage;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDParser;
-
-
-/**
- * Extend the base wizard to select a file from the project or outside the workbench
- * and add error handling
- */
-public class XSDSelectIncludeFileWizard extends Wizard implements INewWizard
-{
-  boolean isInclude;
-  XSDSchema mainSchema;
-  XSDSchema externalSchema;
-
-  XSDLocationChoicePage choicePage;
-  XSDSelectSingleFilePage filePage;
-  XSDURLPage urlPage;
-
-  IFile resultFile;
-  String resultURL;
-  String namespace = "";
-
-  public XSDSelectIncludeFileWizard(XSDSchema mainSchema, boolean isInclude,
-                                    String title, String desc, 
-                                    ViewerFilter filter,
-                                    IStructuredSelection selection)
-  {
-    super();
-    setWindowTitle(title);
-    setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/NewXSD.gif"));
-
-    setNeedsProgressMonitor(true);
-
-    // Choice Page
-    choicePage = new XSDLocationChoicePage();
-
-    // Select File Page
-    filePage = new XSDSelectSingleFilePage(PlatformUI.getWorkbench(),  selection, true);
-    filePage.setTitle(title);
-    filePage.setDescription(desc);
-    filePage.addFilter(filter);
-
-    // URL Page
-    urlPage = new XSDURLPage();
-    urlPage.setTitle(title);
-    urlPage.setDescription(XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_URL"));
-    
-    this.mainSchema = mainSchema;
-    this.isInclude = isInclude;
-  }
-
-  public void init(IWorkbench aWorkbench, IStructuredSelection aSelection)
-  { 
-  }
-
-  public void addPages()
-  {
-    addPage(choicePage);
-    addPage(filePage);
-    addPage(urlPage);
-  }
-
-  public IWizardPage getNextPage(IWizardPage currentPage)
-  {
-    WizardPage nextPage = null;
-
-    if (currentPage == choicePage)
-    {
-      if (choicePage.isURL()) 
-      {
-        nextPage = urlPage;
-      }
-      else
-      {
-        nextPage = filePage;
-      }
-    }
-    return nextPage;
-  }
-
-  public boolean canFinish()
-  {
-    if (!choicePage.isURL())
-    {
-      return filePage.isPageComplete(); 
-    }
-    return true;
-  }
-
-  public boolean performFinish()
-  { 
-    if (choicePage.isURL())
-    {
-      try 
-      {
-        getContainer().run(false, true, urlPage.getRunnable());
-        resultURL = urlPage.getURL();
-      }
-      catch (Exception e)
-      {
-        return false;
-      }
-      return true;
-    }
-    else
-    {  
-      resultFile = filePage.getFile();
-    }
-    return true;
-  }
-
-  /**
-   * Get the MOF object that represents the external file
-   */
-  public XSDSchema getExternalSchema()
-  {
-    return externalSchema;
-  }
-
-  public IFile getResultFile()
-  {
-    return resultFile;
-  }
-
-  public String getURL()
-  {
-    return resultURL;
-  }
-  
-  public String getNamespace()
-  {
-  	return namespace;
-  }
-
-  /**
-   * Create a MOF model for the imported file
-   */
-  protected String doLoadExternalModel(IProgressMonitor monitor, String xsdModelFile, String xsdFileName)
-  { 
-    String errorMessage = null;
-    String currentNameSpace = mainSchema.getTargetNamespace();
-
-    monitor.beginTask("Loading XML Schema", 100);
-    monitor.worked(50);
-
-    XSDParser parser = new XSDParser();
-    parser.parse(xsdModelFile);
-
-    externalSchema = parser.getSchema();
-    if (externalSchema != null)
-    {
-      String extNamespace = externalSchema.getTargetNamespace();
-      namespace = extNamespace;
-     
-      if (externalSchema.getDiagnostics() != null &&
-          externalSchema.getDiagnostics().size() > 0)
-      {
-        errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
-      }  
-      else
-      {
-        if (isInclude) 
-        {  
-          // Check the namespace to make sure they are the same as current file
-          if (extNamespace != null)
-          {
-            if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
-            {
-              errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_DIFFERENT_NAME_SPACE", xsdFileName);
-            }
-          }
-        }
-        else
-        {  
-          // Check the namespace to make sure they are different from the current file
-          if (extNamespace != null)
-          {
-            if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
-            {
-              errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_SAME_NAME_SPACE", xsdFileName);
-            }
-          }
-        }
-      }
-    }
-    else
-    {
-      errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
-    }
-
-    monitor.subTask("Finish Loading");
-    monitor.worked(80);
-
-    return errorMessage;
-  }
-
- 
-  /**
-   * URL page
-   */
-  class XSDURLPage extends WizardPage
-  { 
-    Text urlField;
-    String saveString;
-
-    public XSDURLPage()
-    {
-      super("URLPage");
-    }
-
-    public void createControl(Composite parent)
-    {
-      Composite client = ViewUtility.createComposite(parent,2);
-      ViewUtility.setComposite(client);
-
-      ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_URL"));
-      ViewUtility.createLabel(client, "");
-
-      urlField = ViewUtility.createTextField(client, 50);
-      saveString = "http://";
-      urlField.setText(saveString);
-
-      setControl(client);
-    }
-
-    public String getURL()
-    {
-      return urlField.getText();
-    }
-
-    private boolean openExternalSchema(IProgressMonitor monitor)
-    {
-      String text = urlField.getText();
-//      if (text.equals(saveString)) 
-//      {
-//        return false;
-//      }
-//      saveString = text;
-
-      if (text.equals(""))
-      {
-        setErrorMessage(XSDEditorPlugin.getXSDString("_UI_SPECIFY_URL"));
-        return false;
-      }
-
-      if ( !text.startsWith("http://") )
-      {
-        setErrorMessage(XSDEditorPlugin.getXSDString("_UI_URL_START_WITH"));
-        return false;
-      }
-
-      setErrorMessage(null);
-      String errorMessage = doLoadExternalModel(monitor, text, text);
-      if (errorMessage != null) 
-      {
-        setErrorMessage(errorMessage); 
-        return false;
-      }
-      else
-      {
-        return true;
-      }
-    }
-
-    public IRunnableWithProgress getRunnable()
-    {
-      return new IRunnableWithProgress()
-      {
-        public void run(IProgressMonitor monitor)   
-          throws InvocationTargetException, InterruptedException
-        {
-          if (monitor == null)
-          {
-            monitor= new NullProgressMonitor();
-          }
-          monitor.beginTask("", 6);
-        
-          boolean ok = openExternalSchema(monitor);
-
-          if (!ok) 
-          { 
-            throw new InvocationTargetException(new java.lang.Error());
-          }
-
-          monitor.done();
-        }
-      };
-    }
-  }
-
-  /**
-   * Select XML Schema File
-   */
-  class XSDSelectSingleFilePage extends SelectSingleFilePage
-  {
-    public XSDSelectSingleFilePage(IWorkbench workbench, IStructuredSelection selection, boolean isFileMandatory)
-    {          
-      super(workbench,selection,isFileMandatory);
-    }
-
-    private boolean openExternalSchema()
-    {
-      // Get the fully-qualified file name
-      IFile iFile = getFile();
-      if (iFile == null) 
-        return false;
-
-      setErrorMessage(null);
-
-      String xsdModelFile = iFile.getLocation().toOSString();
-      String xsdFileName = iFile.getName();
-      String errorMessage = doLoadExternalModel(new NullProgressMonitor(), xsdModelFile, xsdFileName);
-
-      if (errorMessage != null) 
-      {
-        setErrorMessage(errorMessage);
-        return false;
-      }
-      else
-      {
-        return true;
-      }
-    }
-
-    public boolean isPageComplete()
-    {  
-      if (choicePage.isURL()) 
-      {
-        return true;
-      }
-
-      if (super.isPageComplete()) 
-      {
-        return openExternalSchema();
-      }
-      return super.isPageComplete();
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/AddFieldAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/AddFieldAction.java
deleted file mode 100644
index 42ee0b4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/AddFieldAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.common.commands.BaseCommand;
-
-
-public class AddFieldAction extends BaseSelectionAction
-{   
-  public static String ID = "AddFieldAction"; 
-  
-  public AddFieldAction(IWorkbenchPart part)
-  {
-    super(part);
-    setId(ID);
-    setText("Add Field");  
-  }
-  
-  public void run()
-  {
-    if (getSelectedObjects().size() > 0)
-    {
-      Object o = getSelectedObjects().get(0);
-      IComplexType type = null;
-      
-      if (o instanceof IComplexType)
-      {  
-        type = (IComplexType)o; 
-      }
-      else if (o instanceof IField)
-      {
-        IField field = (IField)o;
-        type = field.getContainerType();
-      }
-      if (type != null)
-      {
-        Command command = ((IComplexType)type).getAddNewFieldCommand("");
-        if (command != null)
-        {  
-          getCommandStack().execute(command);
-          Adapter adapter = XSDAdapterFactory.getInstance().adapt(((BaseCommand)command).getAddedComponent());
-          if (adapter != null)
-            provider.setSelection(new StructuredSelection(adapter));
-        }
-        else
-        {
-           //TODO ... pop up a command not implemented message
-        }
-      }
-    }  
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/BaseSelectionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/BaseSelectionAction.java
deleted file mode 100644
index ee5c85f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/BaseSelectionAction.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.actions;
-
-import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IField;
-
-public abstract class BaseSelectionAction extends SelectionAction
-{
-  public static final String SEPARATOR_ID = "org.eclipse.jface.action.Separator";
-  public static final String SUBMENU_START_ID = "SUBMENU_START_ID: ";
-  public static final String SUBMENU_END_ID = "SUBMENU_END_ID: ";
-
-  protected ISelectionProvider provider;
-  
-  public BaseSelectionAction(IWorkbenchPart part)
-  {
-    super(part);
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.gef.ui.actions.SelectionAction#getSelection()
-   */
-  protected ISelection getSelection()
-  {
-    // always get selection from selection provider first
-    if (provider!=null)
-      return provider.getSelection();
-    
-    return super.getSelection();
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.gef.ui.actions.SelectionAction#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
-   */
-  public void setSelectionProvider(ISelectionProvider provider)
-  {
-    super.setSelectionProvider(provider);
-    this.provider = provider;
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xsd.adt.actions.BaseSelectionAction#calculateEnabled()
-   */
-  protected boolean calculateEnabled()
-  {
-    if (getSelectedObjects().size() > 0)
-    {
-      Object o = getSelectedObjects().get(0);
-      if (o instanceof IComplexType)
-      {
-        return !((IComplexType)o).isReadOnly();
-      }
-      else if (o instanceof IField)
-      {
-        return !((IField)o).isReadOnly();
-      }
-    }
-    return true;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/DeleteAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/DeleteAction.java
deleted file mode 100644
index 74bd725..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/DeleteAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-public class DeleteAction extends BaseSelectionAction
-{
-  public final static String ID = "org.eclipse.wst.xsd.editor.DeleteAction"; 
-  public DeleteAction(IWorkbenchPart part)
-  {
-    super(part);
-    setText("Delete");
-    setId(ID);
-    setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/delete_obj.gif") );
-  }
-  
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-    Command command = null;
-    boolean doReselect = false;
-    IModel model = null;
-    if (selection instanceof IComplexType)
-    {
-      command = ((IComplexType)selection).getDeleteCommand();
-      model = ((IComplexType)selection).getModel();
-      doReselect = true;
-    }
-    else if (selection instanceof IField)
-    {
-      model = ((IField)selection).getModel();
-      if ( ((IField)selection).isGlobal())
-      {
-        doReselect = true;
-      }
-      command = ((IField)selection).getDeleteCommand();
-    }  
-    if (command != null)
-    {
-      command.execute();
-      if (model != null && doReselect)
-        provider.setSelection(new StructuredSelection(model));
-    }  
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/SetInputToGraphView.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/SetInputToGraphView.java
deleted file mode 100644
index 573f5ae..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/SetInputToGraphView.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.actions;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.RootEditPart;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-
-public class SetInputToGraphView extends BaseSelectionAction
-{
-  public static String ID = "SetAsFocus";
-  IEditorPart editorPart;
-
-  public SetInputToGraphView(IWorkbenchPart part)
-  {
-    super(part);
-    setId(ID);
-    setText("Set As Focus");
-    if (part instanceof IEditorPart)
-    {
-      editorPart = (IEditorPart)part;
-    }  
-  }
-
-  protected boolean calculateEnabled()
-  {
-    return true;
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-    Object adapter = getWorkbenchPart().getAdapter(GraphicalViewer.class);
-
-    if (selection instanceof IComplexType)
-    {
-      IComplexType type = (IComplexType) selection;
-
-      if (adapter instanceof DesignViewGraphicalViewer)
-      {
-        DesignViewGraphicalViewer graphicalViewer = (DesignViewGraphicalViewer) adapter;
-        RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
-        EditPart editPart = rootEditPart.getContents();
-        if (editPart instanceof RootContentEditPart)
-        {
-          if (editorPart != null)
-          {          
-            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getNavigationHistory().markLocation(editorPart);
-          }  
-          ((RootContentEditPart) editPart).setInput(type);
-          ((RootContentEditPart) editPart).refresh();          
-          if (editorPart != null)
-          {
-            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getNavigationHistory().markLocation(editorPart);
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/ShowPropertiesViewAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/ShowPropertiesViewAction.java
deleted file mode 100644
index 7752efc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/actions/ShowPropertiesViewAction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-
-/**
- * Show the properties view in the current perspective.
- */
-public class ShowPropertiesViewAction extends BaseSelectionAction
-{
-	public static final String ID = "org.eclipse.wst.xsd.adt.actions.ShowPropertiesViewAction"; //$NON-NLS-1$
-	public static final String PROPERTIES_VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
-	
-  protected static ImageDescriptor enabledImage, disabledImage;
-
-	public ShowPropertiesViewAction(IWorkbenchPart part)
-  {
-		super(part);
-		setId(ID);
-		setText("Show properties");
-		setToolTipText(getText());
-    setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/elcl16/showproperties_obj.gif") );
-	  setDisabledImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/dlcl16/showproperties_obj.gif") );
-	}
-  
-  protected boolean calculateEnabled()
-  {
-    return true;
-  }
-  
-  public void run()
-  {
-    try
-    {
-      getWorkbenchPart().getSite().getPage().showView(PROPERTIES_VIEW_ID);
-    }
-    catch (PartInitException pie)
-    {
-
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/DesignViewContextMenuProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/DesignViewContextMenuProvider.java
deleted file mode 100644
index 67d6529..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/DesignViewContextMenuProvider.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design;
-
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-
-
-public class DesignViewContextMenuProvider extends ContextMenuProvider
-{
-  IEditorPart editor;  
-  ISelectionProvider selectionProvider;
-
-  /**
-   * Constructor for GraphContextMenuProvider.
-   * 
-   * @param selectionProvider
-   * @param editor
-   */
-  public DesignViewContextMenuProvider(IEditorPart editor, EditPartViewer viewer, ISelectionProvider selectionProvider)
-  {
-    super(viewer);
-    this.editor = editor;
-    this.selectionProvider = selectionProvider;
-  }
-
-  /**
-   * @see org.eclipse.gef.ui.parts.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager,
-   *      org.eclipse.gef.EditPartViewer)
-   */
-  public void buildContextMenu(IMenuManager menu)
-  {
-    IMenuManager currentMenu = menu;
-    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
-    ActionRegistry registry = getEditorActionRegistry();
-    ISelection selection = selectionProvider.getSelection();
-    
-    if (selection != null)
-    {
-      Object selectedObject = ((StructuredSelection) selection).getFirstElement();
-      
-      // Convert editparts to model objects as selections 
-      if (selectedObject instanceof EditPart)
-      {
-        selectedObject = ((EditPart)selectedObject).getModel();
-      }
-
-      if (selectedObject instanceof IActionProvider)
-      {
-        IActionProvider actionProvider = (IActionProvider) selectedObject;
-
-        String[] actions = actionProvider.getActions(null);
-        for (int i = 0; i < actions.length; i++)
-        {
-          String id = actions[i];
-          if (id.startsWith(BaseSelectionAction.SUBMENU_START_ID))
-          {
-            String text = id.substring(BaseSelectionAction.SUBMENU_START_ID.length());
-            IMenuManager subMenu = new MenuManager(text);
-            currentMenu.add(subMenu);
-            currentMenu = subMenu;
-          }
-          else if (id.startsWith(BaseSelectionAction.SUBMENU_END_ID))
-          {
-            currentMenu = getParentMenu(menu, currentMenu);
-          }
-          else if (id.equals(BaseSelectionAction.SEPARATOR_ID))
-          {
-            currentMenu.add(new Separator());
-          }
-          else
-          {
-            IAction action = registry.getAction(id);
-            if (action != null)
-            { 
-              action.isEnabled();
-              currentMenu.add(action);
-            }
-          }
-        }
-        menu.add(new Separator());       
-        menu.add(new Separator("refactoring-slot")); 
-        menu.add(new Separator());       
-        menu.add(new Separator("search-slot"));       
-        menu.add(new Separator());
-      }
-    }    
-    menu.add(new Separator());
-    //menu.add(registry.getAction("org.eclipse.wst.xsd.DeleteAction"));
-    //menu.add(new Separator());
-    //ShowPropertiesViewAction showPropertiesAction = (ShowPropertiesViewAction) registry.getAction(ShowPropertiesViewAction.ACTION_ID);
-    //showPropertiesAction.setPage(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage());
-    //menu.add(showPropertiesAction);
-  }
-
-  protected IMenuManager getParentMenu(IMenuManager root, IMenuManager child) {
-    IMenuManager parent = null;
-    
-    IContributionItem[] kids = root.getItems();
-    int index = 0;
-    while (index < kids.length && parent == null) {
-      IContributionItem item = kids[index];
-      if (item.equals(child)) {
-        parent = root;
-      }
-      else {
-        if (item instanceof IMenuManager) {
-          parent = getParentMenu((IMenuManager) item, child);
-        }
-      }
-      index++;
-    }
-    
-    return parent;
-  }
-
-  protected ActionRegistry getEditorActionRegistry()
-  {
-    return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
-  }
-  protected CommandStack commandStack;
-
-  protected CommandStack getCommandStack()
-  {
-    if (commandStack == null)
-      commandStack = getViewer().getEditDomain().getCommandStack();
-    return commandStack;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/DesignViewGraphicalViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/DesignViewGraphicalViewer.java
deleted file mode 100644
index 2716912..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/DesignViewGraphicalViewer.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.adt.editor.ADTSelectionManager;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-
-public class DesignViewGraphicalViewer extends ScrollingGraphicalViewer implements ISelectionChangedListener
-{
-  protected ADTSelectionChangedListener internalSelectionProvider = new ADTSelectionChangedListener();
-
-  public DesignViewGraphicalViewer(IEditorPart editor, ADTSelectionManager manager)
-  {
-    super();
-    setContextMenu(new DesignViewContextMenuProvider(editor, this, this));
-    editor.getEditorSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.graph", getContextMenu(), internalSelectionProvider, false);
-    
-    // make the internalSelectionProvider listen to graph view selection changes
-    addSelectionChangedListener(internalSelectionProvider);    
-    internalSelectionProvider.addSelectionChangedListener(manager);
-  }
-  
-
-  // this method is called when something changes in the selection manager
-  // (e.g. a selection occured from another view)
-  public void selectionChanged(SelectionChangedEvent event)
-  {
-    Object selectedObject = ((StructuredSelection) event.getSelection()).getFirstElement();
-    
-    // TODO (cs) It seems like there's way more selection going on than there should
-    // be!!  There's at least 2 selections getting fired when something is selected in the
-    // outline view.  Are we listening to too many things?
-    //
-    //if (event.getSource() instanceof ADTContentOutlinePage)
-    if (event.getSource() != internalSelectionProvider)
-    {
-      if (selectedObject instanceof IStructure)
-      {
-        ((RootContentEditPart) getContents()).setInput(selectedObject);
-      }
-      else if (selectedObject instanceof IField)
-      {
-        IField field = (IField)selectedObject;
-        if (field.isGlobal())
-        {  
-          ((RootContentEditPart) getContents()).setInput(selectedObject);
-        }
-      }
-      else if (selectedObject instanceof IModel)
-      {
-        IModel model = (IModel)selectedObject;
-        if (model.getTypes().size() > 0)
-        {  
-          selectedObject = model.getTypes().get(0);
-          ((RootContentEditPart) getContents()).setInput(selectedObject);
-        }  
-        EditPart editPart = getEditPart(getRootEditPart(), selectedObject);
-        if (editPart != null)
-          setSelection(new StructuredSelection(editPart));
-        else
-          setInput(null);
-        return;
-      }
-      
-      EditPart editPart = getEditPart(getRootEditPart(), selectedObject);
-      if (editPart != null)
-        setSelection(new StructuredSelection(editPart));
-    }
-  }
-  
-  /*
-   * We need to convert from edit part selections to model object selections
-   */
-  class ADTSelectionChangedListener implements ISelectionProvider, ISelectionChangedListener
-  {
-    protected List listenerList = new ArrayList();
-    protected ISelection selection = new StructuredSelection();
-
-    public void addSelectionChangedListener(ISelectionChangedListener listener)
-    {
-      listenerList.add(listener);
-    }
-
-    public void removeSelectionChangedListener(ISelectionChangedListener listener)
-    {
-      listenerList.remove(listener);
-    }
-
-    public ISelection getSelection()
-    {
-      return selection;
-    }
-
-    protected void notifyListeners(SelectionChangedEvent event)
-    {
-      for (Iterator i = listenerList.iterator(); i.hasNext();)
-      {
-        ISelectionChangedListener listener = (ISelectionChangedListener) i.next();
-        listener.selectionChanged(event);
-      }
-    }
-
-    public StructuredSelection convertSelectionFromEditPartToModel(ISelection editPartSelection)
-    {
-      List selectedModelObjectList = new ArrayList();
-      if (editPartSelection instanceof IStructuredSelection)
-      {
-        for (Iterator i = ((IStructuredSelection) editPartSelection).iterator(); i.hasNext();)
-        {
-          Object obj = i.next();
-          Object model = null;
-          if (obj instanceof EditPart)
-          {
-            EditPart editPart = (EditPart) obj;
-            model = editPart.getModel();
-          }
-          if (model != null)
-          {
-            selectedModelObjectList.add(model);
-          }
-        }
-      }
-      return new StructuredSelection(selectedModelObjectList);
-    }
-
-    public void setSelection(ISelection selection)
-    {
-      this.selection = selection;
-    }
-
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      ISelection newSelection = convertSelectionFromEditPartToModel(event.getSelection());
-      this.selection = newSelection;
-      SelectionChangedEvent newEvent = new SelectionChangedEvent(this, newSelection);
-      notifyListeners(newEvent);
-    }
-  }
-  
-  protected EditPart getEditPart(EditPart parent, Object object)
-  {
-    EditPart result = null;
-    for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
-    {
-      EditPart editPart = (EditPart)i.next();
-      if (editPart.getModel() == object)
-      {  
-        result = editPart;
-        break;
-      }
-    }             
-  
-    if (result == null)
-    { 
-      for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
-      {
-        EditPart editPart = getEditPart((EditPart)i.next(), object);
-        if (editPart != null)
-        {
-          result = editPart;
-          break;
-        }
-      }            
-    }
-  
-    return result;
-  }
-  
-  public void setInput(IADTObject object)
-  {
-    ((RootContentEditPart)getRootEditPart().getContents()).setInput(object);
-  }
-  
-  public IADTObject getInput()
-  {
-    return (IADTObject)((RootContentEditPart)getRootEditPart().getContents()).getInput();    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/IAnnotationProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/IAnnotationProvider.java
deleted file mode 100644
index e11e149..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/IAnnotationProvider.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design;
-
-public interface IAnnotationProvider
-{
-  String getNameAnnotationString();
-  String getNameAnnotationToolTipString();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ADTComboBoxCellEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ADTComboBoxCellEditor.java
deleted file mode 100644
index 2bad965..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ADTComboBoxCellEditor.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.directedit;
-
-import java.text.MessageFormat;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.wst.xsd.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-/*
- * This is a copy of ComboBoxCellEditor.
- * We need to apply and deactivate the combo on a single click (not on a double click like
- * the ComboBoxCellEditor).
- */
-public class ADTComboBoxCellEditor extends CellEditor
-{
-
-  /**
-   * The list of items to present in the combo box.
-   */
-  private String[] items;
-
-  /**
-   * The zero-based index of the selected item.
-   */
-  int selection;
-
-  /**
-   * The custom combo box control.
-   */
-  CCombo comboBox;
-
-  /**
-   * Used to determine if the value should be applied to the cell.
-   */
-  private boolean continueApply;
-
-  private Object selectedValue;
-  //private Object setObject;
-  private ComponentReferenceEditManager componentReferenceEditManager;
-
-  /**
-   * Default ComboBoxCellEditor style
-   */
-  private static final int defaultStyle = SWT.NONE;
-
-
-  /**
-   * Creates a new cell editor with a combo containing the given list of choices
-   * and parented under the given control. The cell editor value is the
-   * zero-based index of the selected item. Initially, the cell editor has no
-   * cell validator and the first item in the list is selected.
-   * 
-   * @param parent
-   *          the parent control
-   * @param items
-   *          the list of strings for the combo box
-   */
-  public ADTComboBoxCellEditor(Composite parent, String[] items, ComponentReferenceEditManager editManager)
-  {
-    super(parent, defaultStyle);
-    setItems(items);
-    componentReferenceEditManager = editManager;
-  }
-
-  /**
-   * Returns the list of choices for the combo box
-   * 
-   * @return the list of choices for the combo box
-   */
-  public String[] getItems()
-  {
-    return this.items;
-  }
-
-  /**
-   * Sets the list of choices for the combo box
-   * 
-   * @param items
-   *          the list of choices for the combo box
-   */
-  public void setItems(String[] items)
-  {
-    Assert.isNotNull(items);
-    this.items = items;
-    populateComboBoxItems();
-  }
-
-  /*
-   * (non-Javadoc) Method declared on CellEditor.
-   */
-  protected Control createControl(Composite parent)
-  {
-
-    comboBox = new CCombo(parent, getStyle() | SWT.READ_ONLY);
-    comboBox.setFont(parent.getFont());
-
-    comboBox.addKeyListener(new KeyAdapter()
-    {
-      // hook key pressed - see PR 14201
-      public void keyPressed(KeyEvent e)
-      {
-        keyReleaseOccured(e);
-      }
-    });
-
-    comboBox.addSelectionListener(new SelectionAdapter()
-    {
-      public void widgetDefaultSelected(SelectionEvent event)
-      {
-        applyEditorValueAndDeactivate();
-      }
-
-      public void widgetSelected(SelectionEvent event)
-      {
-        Object newValue = null;
-        continueApply = true;
-        selection = comboBox.getSelectionIndex();
-        String stringSelection = items[selection];
-
-        if (stringSelection.equals("Browse..."))
-        {
-           newValue = invokeDialog(componentReferenceEditManager.getBrowseDialog());
-        }
-        else if (stringSelection.equals("New..."))
-        {
-           newValue = invokeDialog(componentReferenceEditManager.getNewDialog());
-        }
-
-        if (continueApply)
-        {
-          if (newValue == null)
-          {
-            int index = comboBox.getSelectionIndex();
-            if (index != -1)
-            {
-              selectedValue = comboBox.getItem(index);
-            }
-          }
-          else
-          {
-            selectedValue = newValue;
-          }
-
-          applyEditorValueAndDeactivate();
-        }
-      }
-    });
-
-    comboBox.addTraverseListener(new TraverseListener()
-    {
-      public void keyTraversed(TraverseEvent e)
-      {
-        if (e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN)
-        {
-          e.doit = false;
-        }
-      }
-    });
-
-    comboBox.addFocusListener(new FocusAdapter()
-    {
-      public void focusLost(FocusEvent e)
-      {
-        ADTComboBoxCellEditor.this.focusLost();
-      }
-    });
-    return comboBox;
-  }
-
-  private Object invokeDialog(IComponentDialog dialog)
-  {
-    Object newValue = null;
-
-    if (dialog == null)
-    {
-      return null;
-    }
-
-    //dialog.setInitialComponent(setObject);
-    if (dialog.createAndOpen() == Window.OK)
-    {
-      newValue = dialog.getSelectedComponent();
-    }
-    else
-    {
-      continueApply = false;
-    }
-
-    return newValue;
-  }
-
-  /**
-   * The <code>ComboBoxCellEditor</code> implementation of this
-   * <code>CellEditor</code> framework method returns the zero-based index of
-   * the current selection.
-   * 
-   * @return the zero-based index of the current selection wrapped as an
-   *         <code>Integer</code>
-   */
-  protected Object doGetValue()
-  {
-    return new Integer(selection);
-  }
-
-  /*
-   * (non-Javadoc) Method declared on CellEditor.
-   */
-  protected void doSetFocus()
-  {
-    comboBox.setFocus();
-  }
-
-  /**
-   * The <code>ComboBoxCellEditor</code> implementation of this
-   * <code>CellEditor</code> framework method sets the minimum width of the
-   * cell. The minimum width is 10 characters if <code>comboBox</code> is not
-   * <code>null</code> or <code>disposed</code> eles it is 60 pixels to make
-   * sure the arrow button and some text is visible. The list of CCombo will be
-   * wide enough to show its longest item.
-   */
-  public LayoutData getLayoutData()
-  {
-    LayoutData layoutData = super.getLayoutData();
-    if ((comboBox == null) || comboBox.isDisposed())
-      layoutData.minimumWidth = 60;
-    else
-    {
-      // make the comboBox 10 characters wide
-      GC gc = new GC(comboBox);
-      layoutData.minimumWidth = (gc.getFontMetrics().getAverageCharWidth() * 10) + 10;
-      gc.dispose();
-    }
-    return layoutData;
-  }
-
-  /**
-   * The <code>ComboBoxCellEditor</code> implementation of this
-   * <code>CellEditor</code> framework method accepts a zero-based index of a
-   * selection.
-   * 
-   * @param value
-   *          the zero-based index of the selection wrapped as an
-   *          <code>Integer</code>
-   */
-  protected void doSetValue(Object value)
-  {
-    Assert.isTrue(comboBox != null && (value instanceof Integer));
-    selection = ((Integer) value).intValue();
-    comboBox.select(selection);
-  }
-
-  /**
-   * Updates the list of choices for the combo box for the current control.
-   */
-  private void populateComboBoxItems()
-  {
-    if (comboBox != null && items != null)
-    {
-      comboBox.removeAll();
-      for (int i = 0; i < items.length; i++)
-        comboBox.add(items[i], i);
-
-      setValueValid(true);
-      selection = 0;
-    }
-  }
-
-  /**
-   * Applies the currently selected value and deactiavates the cell editor
-   */
-  void applyEditorValueAndDeactivate()
-  {
-    // must set the selection before getting value
-    selection = comboBox.getSelectionIndex();
-    Object newValue = doGetValue();
-    markDirty();
-    boolean isValid = isCorrect(newValue);
-    setValueValid(isValid);
-    if (!isValid)
-    {
-      // try to insert the current value into the error message.
-      setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] { items[selection] }));
-    }
-    fireApplyEditorValue();
-    deactivate();
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.jface.viewers.CellEditor#focusLost()
-   */
-  protected void focusLost()
-  {
-    if (isActivated())
-    {
-      applyEditorValueAndDeactivate();
-    }
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.jface.viewers.CellEditor#keyReleaseOccured(org.eclipse.swt.events.KeyEvent)
-   */
-  protected void keyReleaseOccured(KeyEvent keyEvent)
-  {
-    if (keyEvent.character == '\u001b')
-    { // Escape character
-      fireCancelEditor();
-    }
-    else if (keyEvent.character == '\t')
-    { // tab key
-      applyEditorValueAndDeactivate();
-    }
-  }
-
-  //public void setSetObject(Object object)
-  //{
-  //  setObject = object;
-  //}
-
-  public Object getSelectedValue()
-  {
-    return selectedValue;
-  }
-
-  /*
-   * TODO: rmah: This should be moved to WSDLEditorPlugin.java
-   */
-  private IEditorPart getActiveEditor()
-  {
-    IWorkbench workbench = XSDEditorPlugin.getDefault().getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-
-    return editorPart;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ComboBoxCellEditorManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ComboBoxCellEditorManager.java
deleted file mode 100644
index c919aec..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ComboBoxCellEditorManager.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.directedit;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-public abstract class ComboBoxCellEditorManager extends DirectEditManager// implements
-                                                                          // DirectEditPolicyDelegate
-{
-  protected Label label;
-
-  public ComboBoxCellEditorManager(GraphicalEditPart source, Label label)
-  {
-    super(source, ComboBoxCellEditor.class, new InternalCellEditorLocator(label));
-    this.label = label;
-  }
-
-  protected void initCellEditor()
-  {
-    String initialLabelText = label.getText();
-
-    CCombo combo = (CCombo) getCellEditor().getControl();
-    combo.setFont(label.getFont());
-    combo.setForeground(label.getForegroundColor());
-    combo.setBackground(label.getBackgroundColor());
-    combo.setVisibleItemCount(20);
-
-    /*
-     * combo.addKeyListener(new KeyAdapter() { // hook key pressed - see PR
-     * 14201 public void keyPressed(KeyEvent keyEvent) { if (keyEvent.character ==
-     * 'z') { getCellEditor().applyEditorValue(); } } });
-     */
-    ICellEditorListener cellEditorListener = new ICellEditorListener()
-    {
-      public void cancelEditor()
-      {
-      }
-
-      public void applyEditorValue()
-      {
-      }
-
-      public void editorValueChanged(boolean old, boolean newState)
-      {
-      }
-    };
-    getCellEditor().addListener(cellEditorListener);
-
-    String[] item = combo.getItems();
-    for (int i = 0; i < item.length; i++)
-    {
-      if (item[i].equals(initialLabelText))
-      {
-        getCellEditor().setValue(new Integer(i));
-        break;
-      }
-    }
-  }
-
-  // hack... for some reason the ComboBoxCellEditor does't fire an
-  // editorValueChanged to set the dirty flag
-  // unless we overide this method to return true, the manager is not notified
-  // of changes made in the cell editor
-  protected boolean isDirty()
-  {
-    return true;
-  }
-
-  protected CellEditor createCellEditorOn(Composite composite)
-  {
-    boolean isLabelTextInList = false;
-    List list = computeComboContent();
-    for (Iterator i = list.iterator(); i.hasNext();)
-    {
-      String string = (String) i.next();
-      if (string.equals(label.getText()))
-      {
-        isLabelTextInList = true;
-        break;
-      }
-    }
-
-    if (!isLabelTextInList)
-    {
-      list.add(label.getText());
-    }
-
-    List sortedList = computeSortedList(list);
-    String[] stringArray = new String[sortedList.size()];
-    for (int i = 0; i < stringArray.length; i++)
-    {
-      stringArray[i] = (String) sortedList.get(i);
-    }
-    return createCellEditor(composite, stringArray);
-  }
-  
-  protected CellEditor createCellEditor(Composite composite, String[] stringArray)
-  {
-    return new ComboBoxCellEditor(composite, stringArray);    
-  }
-
-  protected List computeSortedList(List list)
-  {
-    return list;
-  }
-
-  protected abstract List computeComboContent();
-
-  protected abstract void performModify(Object value);
-
-  public static class InternalCellEditorLocator implements CellEditorLocator
-  {
-    protected Label label;
-
-    public InternalCellEditorLocator(Label label)
-    {
-      this.label = label;
-    }
-
-    public void relocate(CellEditor celleditor)
-    {
-      CCombo combo = (CCombo) celleditor.getControl();
-
-      // TODO: We're pulling a fast one here..... This is assuming we're using a
-      // CCombo as our widget
-      // Our eventual 'Combo' may not even use CCombo so this will most likely
-      // get replaced.
-      // int dropDownButtonSizeX = 16;
-
-      Rectangle labelParentBounds = label.getBounds().getCopy();
-      label.translateToAbsolute(labelParentBounds);
-
-      int x = labelParentBounds.x;
-      int y = labelParentBounds.y;
-      int widthK = labelParentBounds.width;
-      int height = labelParentBounds.height;
-      combo.setBounds(x, y + 1, widthK, height - 2);
-    }
-  }
-
-  // implements DirectEditPolicyDelegate
-  // 
-  public void performEdit(CellEditor cellEditor)
-  {
-    ADTComboBoxCellEditor comboCellEditor = (ADTComboBoxCellEditor) cellEditor;
-    CCombo combo = (CCombo) getCellEditor().getControl();
-    int index = combo.getSelectionIndex();
-    if (index != -1)
-    {
-      Object value = combo.getItem(index);
-      if (comboCellEditor.getSelectedValue() != null)
-      {
-        value = comboCellEditor.getSelectedValue();
-      }
-
-      performModify(value);
-    }
-    else
-    {
-      String typedValue = combo.getText();
-      if (combo.indexOf(typedValue) != -1)
-      {
-        performModify(typedValue);
-      }
-      else
-      {
-        String closeMatch = getCloseMatch(typedValue, combo.getItems());
-        if (closeMatch != null)
-        {
-          performModify(closeMatch);
-        }
-        else
-        {
-          Display.getCurrent().beep();
-        }
-      }
-    }
-  }
-
-  protected String getCloseMatch(String value, String[] items)
-  {
-    int matchIndex = -1;
-
-    for (int i = 0; i < items.length; i++)
-    {
-      String item = items[i];
-      String a = getLocalName(value);
-      String b = getLocalName(item);
-      if (a.equalsIgnoreCase(b))
-      {
-        matchIndex = i;
-        break;
-      }
-    }
-    return matchIndex != -1 ? items[matchIndex] : null;
-  }
-
-  protected String getLocalName(String string)
-  {
-    int index = string.indexOf(":");
-    return (index != -1) ? string.substring(index + 1) : string;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ElementReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ElementReferenceDirectEditManager.java
deleted file mode 100644
index 1054a7c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/ElementReferenceDirectEditManager.java
+++ /dev/null
@@ -1,178 +0,0 @@
-package org.eclipse.wst.xsd.adt.design.directedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.editor.XSDElementReferenceEditManager;
-
-public class ElementReferenceDirectEditManager extends ComboBoxCellEditorManager
-{
-  protected AbstractGraphicalEditPart editPart;
-  protected IField setObject;
-
-  public ElementReferenceDirectEditManager(IField parameter, AbstractGraphicalEditPart source, Label label)
-  {
-    super(source, label);
-    editPart = source;
-    setObject = parameter;
-  }
-
-  protected CellEditor createCellEditorOn(Composite composite)
-  {
-    return super.createCellEditorOn(composite);
-  }
-
-  protected List computeComboContent()
-  {
-    List list = new ArrayList();
-    ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
-    if (editManager != null)
-    {
-       list.add("Browse...");
-       list.add("New...");
-       ComponentSpecification[] quickPicks = editManager.getQuickPicks();
-       if (quickPicks != null)
-       {
-         for (int i=0; i < quickPicks.length; i++)
-         {
-           ComponentSpecification componentSpecification = quickPicks[i];
-           list.add(componentSpecification.getName());
-         }  
-       }
-       ComponentSpecification[] history = editManager.getHistory();
-       if (history != null)
-       {
-         for (int i=0; i < history.length; i++)
-         {
-           ComponentSpecification componentSpecification = history[i];
-           list.add(componentSpecification.getName());
-         }  
-       }
-    } 
-    return list; 
-  }
-
-  protected ComponentSpecification getComponentSpecificationForValue(String value)
-  {
-    ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
-    if (editManager != null)
-    {  
-      ComponentSpecification[] quickPicks = editManager.getQuickPicks();
-      if (quickPicks != null)
-      {
-        for (int i=0; i < quickPicks.length; i++)
-        {
-          ComponentSpecification componentSpecification = quickPicks[i];
-          if (value.equals(componentSpecification.getName()))
-          {
-            return componentSpecification;
-          }                
-        }  
-      }
-      ComponentSpecification[] history = editManager.getHistory();
-      if (history != null)
-      {
-        for (int i=0; i < history.length; i++)
-        {
-          ComponentSpecification componentSpecification = history[i];
-          if (value.equals(componentSpecification.getName()))
-          {  
-            return componentSpecification;
-          }
-        }  
-      }
-    }
-    return null;
-  }
-  
-  public void performModify(Object value)
-  {
-    ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
-    if (editManager == null)
-    {
-      return;
-    }
-    
-    // our crude combo box can only work with 'String' objects
-    // if we get a String back we need to do some clever mapping to get the ComponentSpecification 
-    //    
-    if (value instanceof String)
-    {
-      value = getComponentSpecificationForValue((String)value);     
-    }  
-    // we assume the selected value is always of the form of a ComponentSpecification
-    // 
-    if (value instanceof ComponentSpecification)      
-    {
-      // we need to perform an asyncExec here since the 'host' editpart may be
-      // removed as a side effect of performing the action           
-      DelayedSetElementReferenceRunnable runnable = new DelayedSetElementReferenceRunnable(editManager, setObject, (ComponentSpecification)value);
-      //runnable.run();
-      Display.getCurrent().asyncExec(runnable);
-    }
-  }
-
-  protected List computeSortedList(List list)
-  {
-    // return TypesHelper.sortList(list);
-    return list;
-  }
-  
-  protected CellEditor createCellEditor(Composite composite, String[] stringArray)
-  {
-    ADTComboBoxCellEditor cellEditor = new ADTComboBoxCellEditor(composite, stringArray, getComponentReferenceEditManager());
-    //((ADTComboBoxCellEditor) cellEditor).setObjectToModify(setObject);
-    return cellEditor;
-  }
-
-  protected ComponentReferenceEditManager getComponentReferenceEditManager()
-  {
-    ComponentReferenceEditManager result = null;
-    IEditorPart editor = getActiveEditor();
-    if (editor != null)
-    {
-      result = (ComponentReferenceEditManager)editor.getAdapter(XSDElementReferenceEditManager.class);
-    }  
-    return result;
-  }
-  
-  private IEditorPart getActiveEditor()
-  {
-    IWorkbench workbench = PlatformUI.getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-    return editorPart;
-  }    
-  
-  protected static class DelayedSetElementReferenceRunnable implements Runnable
-  {
-    protected ComponentReferenceEditManager componentReferenceEditManager;
-    protected ComponentSpecification newValue;
-    protected IField field;
-
-    public DelayedSetElementReferenceRunnable(ComponentReferenceEditManager componentReferenceEditManager,
-    		IField setObject, ComponentSpecification selectedValue)
-    {
-      this.componentReferenceEditManager = componentReferenceEditManager;
-      newValue = selectedValue;
-      field = setObject;
-    }
-
-    public void run()
-    {
-      componentReferenceEditManager.modifyComponentReference(field, newValue);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/LabelCellEditorLocator.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/LabelCellEditorLocator.java
deleted file mode 100644
index 2e187eb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/LabelCellEditorLocator.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.INamedEditPart;
-import org.eclipse.wst.xsd.adt.design.figures.IFieldFigure;
-
-public class LabelCellEditorLocator implements CellEditorLocator
-{
-  private INamedEditPart namedEditPart;
-  private Point cursorLocation;
-
-  public LabelCellEditorLocator(INamedEditPart namedEditPart, Point cursorLocation)
-  {
-    this.namedEditPart = namedEditPart;
-    this.cursorLocation = cursorLocation;
-  }
-
-  public void relocate(CellEditor celleditor)
-  {
-    Text text = (Text) celleditor.getControl();
-    
-    if (text.getBounds().x <= 0)
-    {
-      Label label = namedEditPart.getNameLabelFigure();
-      
-      int widthToRemove = 0;
-      // HACK 
-      if (namedEditPart instanceof BaseFieldEditPart)
-      {
-        BaseFieldEditPart field = (BaseFieldEditPart)namedEditPart;
-        IFieldFigure fieldFigure = field.getFieldFigure();     
-        widthToRemove = fieldFigure.getTypeLabel().getBounds().width;       
-        //TODO: !! perhaps the IFieldFigure should just have a method to compute this?
-        //Label typeAnnotationLabel = ((FieldFigure) field.getFigure()).getTypeAnnotationLabel();
-        //Label nameAnnotationLabel = ((FieldFigure) field.getFigure()).getNameAnnotationLabel();
-        //widthToRemove = typeLabel.getBounds().width + typeAnnotationLabel.getBounds().width + nameAnnotationLabel.getBounds().width;
-      }
-      
-      Rectangle boundingRect = label.getTextBounds();
-
-      // Reduce the width by the amount we shifted along the x-axis
-      int delta = Math.abs(boundingRect.x - label.getParent().getBounds().x);
-
-      label.getParent().translateToAbsolute(boundingRect);
-      org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0);
-      boundingRect.translate(trim.x, trim.y);
-      boundingRect.height = boundingRect.height - trim.y;
-
-      boundingRect.width = label.getParent().getBounds().width - delta - widthToRemove;
-      text.setBounds(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);
-
-      // Translate point
-      Point translatedPoint = new Point(cursorLocation.x - boundingRect.x, cursorLocation.y - boundingRect.y);
-
-      // Calculate text offset corresponding to the translated point
-      text.setSelection(0, 0);
-      int xCaret = text.getCaretLocation().x;
-      int offset = text.getCaretPosition();
-      while (xCaret < translatedPoint.x)
-      {
-        text.setSelection(offset + 1, offset + 1);
-        xCaret = text.getCaretLocation().x;
-        int newOffset = text.getCaretPosition();
-        if (newOffset == offset)
-        {
-          break;
-        }
-        offset++;
-      }
-      text.setSelection(offset, offset);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/LabelEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/LabelEditManager.java
deleted file mode 100644
index 1b621eb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/LabelEditManager.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.wst.xsd.adt.design.editparts.INamedEditPart;
-
-public class LabelEditManager extends DirectEditManager {
-
-	private IActionBars actionBars;
-	private CellEditorActionHandler actionHandler;
-	private IAction copy, cut, paste, undo, redo, find, selectAll, delete;
-	private Font scaledFont;
-
-	public LabelEditManager(GraphicalEditPart source, CellEditorLocator locator) {
-		super(source, null, locator);
-	}
-
-	/**
-	 * @see org.eclipse.gef.tools.DirectEditManager#bringDown()
-	 */
-	protected void bringDown() {
-		if (actionHandler != null) {
-			actionHandler.dispose();
-			actionHandler = null;
-		}
-		if (actionBars != null) {
-			restoreSavedActions(actionBars);
-			actionBars.updateActionBars();
-			actionBars = null;
-		}
-
-		Font disposeFont = scaledFont;
-		scaledFont = null;
-		super.bringDown();
-		if (disposeFont != null)
-			disposeFont.dispose();
-	}
-	
-	public void showFeedback() {
-//    super.showFeedback();
-		getEditPart().showSourceFeedback(getDirectEditRequest());
-	}
-
-	protected CellEditor createCellEditorOn(Composite composite) {
-		return new TextCellEditor(composite, SWT.SINGLE | SWT.WRAP);
-	}
-
-	protected void initCellEditor() {
-		Text text = (Text)getCellEditor().getControl();
-		Label label = ((INamedEditPart) getEditPart()).getNameLabelFigure();
-    
-		if (label != null) {
-			scaledFont = label.getFont();
-			
-			Color color = label.getBackgroundColor();
-			text.setBackground(color);
-			
-			String initialLabelText = label.getText();
-			getCellEditor().setValue(initialLabelText);
-		}
-		else {
-			scaledFont = label.getParent().getFont();
-			text.setBackground(label.getParent().getBackgroundColor());
-		}
-		
-		FontData data = scaledFont.getFontData()[0];
-		Dimension fontSize = new Dimension(0, data.getHeight());
-		label.getParent().translateToAbsolute(fontSize);
-		data.setHeight(fontSize.height);
-		scaledFont = new Font(null, data);
-		
-		text.setFont(scaledFont);
-//		text.selectAll();
-
-		// Hook the cell editor's copy/paste actions to the actionBars so that they can
-		// be invoked via keyboard shortcuts.
-		actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
-				.getActiveEditor().getEditorSite().getActionBars();
-		saveCurrentActions(actionBars);
-		actionHandler = new CellEditorActionHandler(actionBars);
-		actionHandler.addCellEditor(getCellEditor());
-		actionBars.updateActionBars();
-	}
-
-	private void restoreSavedActions(IActionBars actionBars){
-		actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
-		actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
-		actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
-		actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
-		actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
-		actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
-		actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
-		actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
-	}
-
-	private void saveCurrentActions(IActionBars actionBars) {
-		copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
-		paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
-		delete = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
-		selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
-		cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
-		find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
-		undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
-		redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/TypeReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/TypeReferenceDirectEditManager.java
deleted file mode 100644
index 61daa07..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/directedit/TypeReferenceDirectEditManager.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.directedit;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.editor.XSDTypeReferenceEditManager;
-
-public class TypeReferenceDirectEditManager extends ComboBoxCellEditorManager
-{
-  protected AbstractGraphicalEditPart editPart;
-  protected IField setObject;
-
-  public TypeReferenceDirectEditManager(IField parameter, AbstractGraphicalEditPart source, Label label)
-  {
-    super(source, label);
-    editPart = source;
-    setObject = parameter;
-  }
-
-  protected CellEditor createCellEditorOn(Composite composite)
-  {
-    return super.createCellEditorOn(composite);
-  }
-
-  protected List computeComboContent()
-  {
-    List list = new ArrayList();
-    ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
-    if (editManager != null)
-    {
-       list.add("Browse...");
-       list.add("New...");
-       ComponentSpecification[] quickPicks = editManager.getQuickPicks();
-       if (quickPicks != null)
-       {
-         for (int i=0; i < quickPicks.length; i++)
-         {
-           ComponentSpecification componentSpecification = quickPicks[i];
-           list.add(componentSpecification.getName());
-         }  
-       }
-       ComponentSpecification[] history = editManager.getHistory();
-       if (history != null)
-       {
-         for (int i=0; i < history.length; i++)
-         {
-           ComponentSpecification componentSpecification = history[i];
-           list.add(componentSpecification.getName());
-         }  
-       }
-    } 
-    return list; 
-  }
-
-  protected ComponentSpecification getComponentSpecificationForValue(String value)
-  {
-    ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
-    if (editManager != null)
-    {  
-      ComponentSpecification[] quickPicks = editManager.getQuickPicks();
-      if (quickPicks != null)
-      {
-        for (int i=0; i < quickPicks.length; i++)
-        {
-          ComponentSpecification componentSpecification = quickPicks[i];
-          if (value.equals(componentSpecification.getName()))
-          {
-            return componentSpecification;
-          }                
-        }  
-      }
-      ComponentSpecification[] history = editManager.getHistory();
-      if (history != null)
-      {
-        for (int i=0; i < history.length; i++)
-        {
-          ComponentSpecification componentSpecification = history[i];
-          if (value.equals(componentSpecification.getName()))
-          {  
-            return componentSpecification;
-          }
-        }  
-      }
-    }
-    return null;
-  }
-  
-  public void performModify(Object value)
-  {
-    ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
-    if (editManager == null)
-    {
-      return;
-    }
-    
-    // our crude combo box can only work with 'String' objects
-    // if we get a String back we need to do some clever mapping to get the ComponentSpecification 
-    //    
-    if (value instanceof String)
-    {
-      value = getComponentSpecificationForValue((String)value);     
-    }  
-    // we assume the selected value is always of the form of a ComponentSpecification
-    // 
-    if (value instanceof ComponentSpecification)      
-    {
-      // we need to perform an asyncExec here since the 'host' editpart may be
-      // removed as a side effect of performing the action           
-      DelayedSetTypeRunnable runnable = new DelayedSetTypeRunnable(editManager, setObject, (ComponentSpecification)value);
-      //runnable.run();
-      Display.getCurrent().asyncExec(runnable);
-    }
-  }
-
-  protected List computeSortedList(List list)
-  {
-    // return TypesHelper.sortList(list);
-    return list;
-  }
-  
-  protected CellEditor createCellEditor(Composite composite, String[] stringArray)
-  {
-    ADTComboBoxCellEditor cellEditor = new ADTComboBoxCellEditor(composite, stringArray, getComponentReferenceEditManager());
-    //((ADTComboBoxCellEditor) cellEditor).setObjectToModify(setObject);
-    return cellEditor;
-  }
-
-  protected ComponentReferenceEditManager getComponentReferenceEditManager()
-  {
-    ComponentReferenceEditManager result = null;
-    IEditorPart editor = getActiveEditor();
-    if (editor != null)
-    {
-        result = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
-    }  
-    return result;
-  }
-  
-  private IEditorPart getActiveEditor()
-  {
-    IWorkbench workbench = PlatformUI.getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-    return editorPart;
-  }    
-  
-  protected static class DelayedSetTypeRunnable implements Runnable
-  {
-    protected ComponentReferenceEditManager componentReferenceEditManager;
-    protected ComponentSpecification newValue;
-    protected IField field;
-
-    public DelayedSetTypeRunnable(ComponentReferenceEditManager componentReferenceEditManager, IField setObject, ComponentSpecification selectedValue)
-    {
-      this.componentReferenceEditManager = componentReferenceEditManager;
-      newValue = selectedValue;
-      field = setObject;
-    }
-
-    public void run()
-    {
-      componentReferenceEditManager.modifyComponentReference(field, newValue);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ADTEditPartFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ADTEditPartFactory.java
deleted file mode 100644
index b7b5f53..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ADTEditPartFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.wst.xsd.adt.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.xsd.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-
-public class ADTEditPartFactory implements EditPartFactory
-{
-  public EditPart createEditPart(EditPart context, Object model)
-  {
-    EditPart child = null;
-    if (model instanceof Compartment)
-    {
-      child = new CompartmentEditPart();
-    }      
-    else if (model instanceof AbstractModelCollection)
-    {
-      child = new ColumnEditPart();
-      if (model instanceof FocusTypeColumn)
-      {
-        ColumnEditPart columnEditPart = (ColumnEditPart)child;
-        columnEditPart.setSpacing(60);
-        columnEditPart.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
-      }  
-    }
-    else if (model instanceof IComplexType)
-    {
-      child = new ComplexTypeEditPart();
-    }
-    else if (model instanceof IStructure)
-    {
-      child = new StructureEditPart();
-    }  
-    else if (model instanceof IField)
-    {
-      if (context instanceof CompartmentEditPart)
-      {  
-        child = new FieldEditPart();
-      }
-      else
-      {
-        child = new TopLevelFieldEditPart();
-      }  
-    }
-    else if (model instanceof IModel)
-    {
-      child = new RootContentEditPart();
-    }
-
-    checkChild(child, model);
-
-    return child;
-  }
-
-  /**
-   * Subclasses can override and not check for null
-   * 
-   * @param child
-   * @param model
-   */
-  protected void checkChild(EditPart child, Object model)
-  {
-    if (child == null)
-    {
-      Thread.dumpStack();
-    }
-    Assert.isNotNull(child);
-    child.setModel(model);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseEditPart.java
deleted file mode 100644
index 86d4c10..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseEditPart.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.gef.editparts.ZoomListener;
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IFeedbackHandler;
-import org.eclipse.wst.xsd.adt.design.figures.IFigureFactory;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-
-public abstract class BaseEditPart extends AbstractGraphicalEditPart implements IActionProvider, IADTObjectListener, IFeedbackHandler
-{
-  protected static final String[] EMPTY_ACTION_ARRAY = {};
- 
-  public IFigureFactory getFigureFactory()
-  {
-    EditPartFactory factory = getViewer().getEditPartFactory();
-    Assert.isTrue(factory instanceof IFigureFactory, "EditPartFactory must be an instanceof of IFigureFactory");    
-    return (IFigureFactory)factory; 
-  }
-  
-  public String[] getActions(Object object)
-  {
-    Object model = getModel();
-    if (model instanceof IActionProvider)
-    {
-      return ((IActionProvider)model).getActions(object);
-    }  
-    return EMPTY_ACTION_ARRAY;
-  }
-  
-  protected void addActionsToList(List list, IAction[] actions)
-  {
-    for (int i = 0; i < actions.length; i++)
-    {
-      list.add(actions[i]);
-    }  
-  }
-  
-  public void activate()
-  {
-    super.activate();
-    Object model = getModel();
-    if (model instanceof IADTObject)
-    {
-      IADTObject object = (IADTObject)model;
-      object.registerListener(this);
-    }
-    
-    if (getZoomManager() != null)
-      getZoomManager().addZoomListener(zoomListener);
-
-  }
-  
-  public void deactivate()
-  {
-    try
-    {
-    Object model = getModel();
-    if (model instanceof IADTObject)
-    {
-      IADTObject object = (IADTObject)model;
-      object.unregisterListener(this);
-    }   
-    
-    if (getZoomManager() != null)
-      getZoomManager().removeZoomListener(zoomListener);    
-    }
-    finally
-    {
-      super.deactivate();
-    }  
-  }  
-  
-  public void propertyChanged(Object object, String property)
-  {
-    refresh();
-  }
-  
-  public void refresh() {
-    super.refresh();
-
-    // Tell our children to refresh (note, this is NOT the function of 
-    // refreshChildren(), strangely enough)
-    for(Iterator i = getChildren().iterator(); i.hasNext(); )
-    {
-      Object obj = i.next();
-      if (obj instanceof BaseEditPart)
-      {
-        ((BaseEditPart)obj).refresh();
-      }
-      else if (obj instanceof AbstractGraphicalEditPart)
-      {
-        ((AbstractGraphicalEditPart)obj).refresh();
-      }
-      
-    }
-  }
-
-  public void addFeedback()
-  {
-  }
-
-  public void removeFeedback()
-  {
-  }
-  
-  public ZoomManager getZoomManager()
-  {
-    return ((ScalableRootEditPart)getRoot()).getZoomManager();
-  }
-  
-  public Rectangle getZoomedBounds(Rectangle r)
-  {
-    double factor = getZoomManager().getZoom();
-    int x = (int)Math.round(r.x * factor);
-    int y = (int)Math.round(r.y * factor);
-    int width = (int)Math.round(r.width * factor);
-    int height = (int)Math.round(r.height * factor);
-
-    return new Rectangle(x, y, width, height);
-  }
-  
-  private ZoomListener zoomListener = new ZoomListener()
-  {
-    public void zoomChanged(double zoom)
-    {
-      handleZoomChanged();
-    }
-  };
-
-  protected void handleZoomChanged()
-  {
-    refreshVisuals();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseFieldEditPart.java
deleted file mode 100644
index 05d422e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseFieldEditPart.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.wst.xsd.adt.design.directedit.ComboBoxCellEditorManager;
-import org.eclipse.wst.xsd.adt.design.directedit.ElementReferenceDirectEditManager;
-import org.eclipse.wst.xsd.adt.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.xsd.adt.design.directedit.LabelEditManager;
-import org.eclipse.wst.xsd.adt.design.directedit.TypeReferenceDirectEditManager;
-import org.eclipse.wst.xsd.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.adt.design.editpolicies.IADTUpdateCommand;
-import org.eclipse.wst.xsd.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.editor.internal.design.editpolicies.GraphNodeDragTracker;
-
-public class BaseFieldEditPart extends BaseTypeConnectingEditPart implements INamedEditPart
-{
-  protected TypeReferenceConnection connectionFigure;
-  protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
-  TypeUpdateCommand typeUpdateCommand = new TypeUpdateCommand();
-  ElementReferenceUpdateCommand elementUpdateCommand = new ElementReferenceUpdateCommand();
-  
-  protected IFigure createFigure()
-  {          
-    IFieldFigure figure = getFigureFactory().createFieldFigure(getModel());    
-    figure.setForegroundColor(ColorConstants.black);
-    return figure;
-  }
-  
-  public IFieldFigure getFieldFigure()
-  {
-    return (IFieldFigure)figure;
-  }
-  
-
-  public void activate()
-  {
-    super.activate();
-    activateConnection();
-  }
-  
-  public void deactivate()
-  {
-    deactivateConnection();
-    super.deactivate();
-  }
-
-  protected boolean shouldDrawConnection()
-  {
-    boolean result = false;
-    
-    // For now we only want to produce outbound lines from a Field to a Type
-    // when the field in contained in the 'focus' edit part    
-    for (EditPart parent = getParent(); parent != null; parent = parent.getParent())
-    {  
-      if (parent.getModel() instanceof FocusTypeColumn)
-      {        
-        result = true;
-        break;
-      }  
-    }    
-    return result;
-  }
-  
-  public TypeReferenceConnection createConnectionFigure()
-  {
-    connectionFigure = null;
-    IField field = (IField)getModel();
-    IType type = field.getType();
-    if (type != null) // && type.isComplexType())
-    {      
-      AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart)getViewer().getEditPartRegistry().get(type);
-      if (referenceTypePart != null)
-      {
-        connectionFigure = new TypeReferenceConnection();
-
-        if (getFigure().getParent() == referenceTypePart.getFigure())
-        {
-          connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.LEFT, 1)); 
-        }
-        else
-        {
-          connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.RIGHT, 5));
-        }
-        int targetAnchorYOffset = 8;
-
-        connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.HEADER_LEFT, 0, targetAnchorYOffset)); 
-        connectionFigure.setHighlight(false);
-      }
-    }    
-    return connectionFigure;
-  }
-
-  protected void createEditPolicies()
-  {
-    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
-  }
- 
-  public void refresh()
-  {
-    super.refresh();
-    
-    // todo... perhaps this is aggressive?
-    // really we only need to update the connection when the IType changes
-    
-    deactivateConnection();
-    activateConnection();      
-  }
-
-  protected void refreshVisuals()
-  {
-    super.refreshVisuals();
-    IFieldFigure figure = getFieldFigure();
-    IField field = (IField) getModel();
-    
-    figure.getNameLabel().setText(field.getName());
-    figure.getTypeLabel().setText(field.getTypeName());
-    figure.refreshVisuals(getModel());
-
-    figure.recomputeLayout();
-
-    ((GraphicalEditPart)getRoot()).getFigure().invalidateTree();
-  }
-
-  public DragTracker getDragTracker(Request request)
-  {
-    return new GraphNodeDragTracker((EditPart)this);
-  }
-  
-  /*
-  public IAction[] getActions(Object object)
-  {
-    // when a FieldEditPart is selected it provides it's own actions
-    // as well as those of it's parent 'type' edit part
-    List list = new ArrayList();
-    EditPart compartment = getParent();
-    if (compartment != null)
-    {  
-      EditPart type = compartment.getParent();
-      if (type != null && type instanceof IActionProvider)
-      {
-        IActionProvider provider = (IActionProvider)type;
-        addActionsToList(list, provider.getActions(object));
-      }
-    }
-    addActionsToList(list, super.getActions(object));
-    IAction[] result = new IAction[list.size()];
-    list.toArray(result);
-    return result;
-  }*/
-  
-  public Label getNameLabelFigure()
-  {
-    return getFieldFigure().getNameLabel();
-  }
-
-  public void performDirectEdit(Point cursorLocation)
-  {
-    
-  }
-  
-  public void performRequest(Request request)
-  {  
-    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT||
-        request.getType() == RequestConstants.REQ_OPEN)
-    {
-      IFieldFigure fieldFigure = getFieldFigure();
-      Object model = getModel();
-      if (request instanceof LocationRequest)
-      {
-        LocationRequest locationRequest = (LocationRequest)request;
-        Point p = locationRequest.getLocation();
-       
-        if (hitTest(fieldFigure.getTypeLabel(), p))
-        {
-          TypeReferenceDirectEditManager manager = new TypeReferenceDirectEditManager((IField)model, this, fieldFigure.getTypeLabel());
-          typeUpdateCommand.setDelegate(manager);
-          adtDirectEditPolicy.setUpdateCommand(typeUpdateCommand);
-          manager.show();
-        }
-        else if (hitTest(fieldFigure.getNameLabel(), p))
-        {
-        	if ( model instanceof XSDElementDeclarationAdapter ){
-        		XSDElementDeclarationAdapter elementDecAdapter = ((XSDElementDeclarationAdapter) model);
-        		if ( elementDecAdapter.isElementDeclarationReference() ){
-        			ElementReferenceDirectEditManager manager =
-        				new ElementReferenceDirectEditManager((IField)model, this, fieldFigure.getNameLabel());
-        			elementUpdateCommand.setDelegate(manager);
-        			adtDirectEditPolicy.setUpdateCommand(elementUpdateCommand);
-        			manager.show();
-        		}
-        		else {
-        			LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, p));
-        			NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
-        			adtDirectEditPolicy.setUpdateCommand(wrapper);
-        			manager.show();
-        		}
-        	}
-        }
-      }
-    }
-  }
-  
-  
-  class NameUpdateCommandWrapper extends Command implements IADTUpdateCommand
-  {
-    Command command;
-    protected DirectEditRequest request;
-    
-    public NameUpdateCommandWrapper()
-    {
-      super("Update Name");
-    }
-
-    public void setRequest(DirectEditRequest request)
-    {
-      this.request = request;
-    }
-    
-    public void execute()
-    {
-      IField field = (IField)getModel();
-      Object newValue = request.getCellEditor().getValue();
-      if (newValue instanceof String)
-      {
-        command = field.getUpdateNameCommand((String)newValue);
-      }
-      if (command != null)
-        command.execute();
-    }
-  }
-  
-  class TypeUpdateCommand extends Command implements IADTUpdateCommand
-  {
-    protected ComboBoxCellEditorManager delegate;
-    protected DirectEditRequest request;
-    
-    public TypeUpdateCommand()
-    {
-      super("Update type");
-    }
-
-    public void setDelegate(ComboBoxCellEditorManager delegate)
-    {                                           
-      this.delegate = delegate;
-    }
-    
-    public void setRequest(DirectEditRequest request)
-    {
-      this.request = request;
-    }
-    
-    public void execute()
-    {
-      if (delegate != null)
-      {
-        delegate.performEdit(request.getCellEditor());
-      }
-    }
-
-    public boolean canExecute()
-    {
-      return true;
-    }
-  }
-  
-  class ElementReferenceUpdateCommand extends Command implements IADTUpdateCommand
-  {
-	    protected ComboBoxCellEditorManager delegate;
-	    protected DirectEditRequest request;
-	    
-	    public ElementReferenceUpdateCommand()
-	    {
-	      super("Update element reference");
-	    }
-
-	    public void setDelegate(ComboBoxCellEditorManager delegate)
-	    {
-	      this.delegate = delegate;
-	    }
-
-	    public void setRequest(DirectEditRequest request)
-	    {
-	      this.request = request;
-	    }
-
-	    public void execute()
-	    {
-	      if (delegate != null)
-	      {
-	        delegate.performEdit(request.getCellEditor());
-	      }
-	    }
-
-	    public boolean canExecute()
-	    {
-	      return true;
-	    }
-  }
-
-
-  TypeReferenceConnection connectionFeedbackFigure;
-
-  public void addFeedback()
-  {
-    // Put back connection figure so it won't get overlayed by other non highlighted connections
-    if (connectionFigure != null)
-    {
-      connectionFeedbackFigure = new TypeReferenceConnection();
-      connectionFeedbackFigure.setSourceAnchor(connectionFigure.getSourceAnchor());
-      connectionFeedbackFigure.setTargetAnchor(connectionFigure.getTargetAnchor());
-      connectionFeedbackFigure.setHighlight(true);
-      getLayer(LayerConstants.FEEDBACK_LAYER).add(connectionFeedbackFigure);
-    }
-     super.addFeedback();
-     getFieldFigure().addSelectionFeedback();
-  }
-  
-  public void removeFeedback()
-  {
-    if (connectionFeedbackFigure != null)
-    {
-      connectionFeedbackFigure.setHighlight(false);
-      getLayer(LayerConstants.FEEDBACK_LAYER).remove(connectionFeedbackFigure);
-    }
-    connectionFeedbackFigure = null;
-    super.removeFeedback();
-    getFieldFigure().removeSelectionFeedback();
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseTypeConnectingEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseTypeConnectingEditPart.java
deleted file mode 100644
index bc74d6d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BaseTypeConnectingEditPart.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IFeedbackHandler;
-import org.eclipse.wst.xsd.adt.design.editpolicies.IADTUpdateCommand;
-import org.eclipse.wst.xsd.adt.facade.IType;
-
-/**
- * This class provides some base function to enable drawing connections to a referenced type
- *
- */
-public abstract class BaseTypeConnectingEditPart extends BaseEditPart implements IFeedbackHandler
-{
-  private TypeReferenceConnection connectionFigure;  
-  
-  public void activate()
-  {
-    super.activate();
-    // TODO (cs) revisit this, perhaps has Randy for his advice
-    // it seems that the edit parts required for the target end of the connections
-    // are not always layed available when active is called.  So we need to delay
-    // the activateConnection() until a short time later.  For now the only way I can think
-    // of doing this is via an asyncExec.
-    //
-    Display.getCurrent().asyncExec(new Runnable()
-    {
-      public void run()
-      {
-        if (isActive())
-        {  
-          activateConnection();
-        }  
-      }
-    });   
-  }
-  
-  public void deactivate()
-  {
-    deactivateConnection();
-    super.deactivate();
-  }
-
-  protected void activateConnection()
-  {
-    // If appropriate, create our connectionFigure and add it to the appropriate layer
-    if (connectionFigure == null && shouldDrawConnection())
-    {
-      connectionFigure = createConnectionFigure();
-      if (connectionFigure != null)
-      {  
-        // Add our editpolicy as a listener on the connection, so it can stay in synch
-        //connectionFigure.addPropertyChangeListener((AttributeSelectionFeedbackPolicy) getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE));
-        //connectionFigure.addMouseListener(this);
-        getLayer(LayerConstants.CONNECTION_LAYER).add(connectionFigure);
-      }  
-    }
-  }
-  
-  protected void deactivateConnection()
-  {
-    // if we have a connection, remove it
-    if (connectionFigure != null)
-    {
-      getLayer(LayerConstants.CONNECTION_LAYER).remove(connectionFigure);
-      // Remove our editpolicy listener(s)
-      //connectionFigure.removePropertyChangeListener((AttributeSelectionFeedbackPolicy) getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE));
-      //connectionFigure.removeMouseListener(this);
-      connectionFigure = null;
-    }
-  }  
-  
-  protected boolean shouldDrawConnection()
-  {
-    return true;
-  }
-  
-  public abstract TypeReferenceConnection createConnectionFigure();
-  
-  public void addFeedback()
-  {
-    if (connectionFigure != null)
-    {
-      connectionFigure.setHighlight(true);
-    }
-  }
-  
-  public void removeFeedback()
-  {
-    if (connectionFigure != null)
-    {
-      connectionFigure.setHighlight(false);
-    }
-  }
-  
-  protected class NameUpdateCommandWrapper extends Command implements IADTUpdateCommand
-  {
-    Command command;
-    protected DirectEditRequest request;
-    
-    public NameUpdateCommandWrapper()
-    {
-      super("Update Name");
-    }
-
-    public void setRequest(DirectEditRequest request)
-    {
-      this.request = request;
-    }
-    
-    public void execute()
-    {
-      IType iType = (IType)getModel();
-      Object newValue = request.getCellEditor().getValue();
-      if (newValue instanceof String)
-      {
-        command = iType.getUpdateNameCommand((String)newValue);
-      }
-      if (command != null)
-        command.execute();
-    }
-  }
-
-  public boolean hitTest(IFigure target, Point location)
-  {
-    Rectangle b = target.getBounds().getCopy();
-    target.translateToAbsolute(b);  
-    return b.contains(location);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BoxEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BoxEditPart.java
deleted file mode 100644
index 60815cf..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/BoxEditPart.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import java.util.List;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.adt.typeviz.design.figures.BoxFigure;
-import org.eclipse.wst.xsd.adt.design.editpolicies.SimpleDirectEditPolicy;
-
-public abstract class BoxEditPart extends BaseTypeConnectingEditPart //IFeedbackHandler
-{  
-  protected List compartmentList = null;
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-
-  protected Compartment[] getCompartments()
-  {
-    return null;
-  }
-  
-  protected IFigure createFigure()
-  {
-    BoxFigure figure = new BoxFigure();
-    LineBorder boxLineBorder = new LineBorder(1);
-    figure.setBorder(boxLineBorder);    
-    ToolbarLayout toolbarLayout = new ToolbarLayout();
-    toolbarLayout.setStretchMinorAxis(true);
-    figure.setLayoutManager(toolbarLayout);
-    // we should organize ITreeElement and integrate it with the facade
-    if (getModel() instanceof ITreeElement)
-    {
-      figure.getNameLabel().setIcon(((ITreeElement)getModel()).getImage());
-    }
-    return figure;
-  }
-  
-  public IFigure getContentPane()
-  {
-    return ((BoxFigure)getFigure()).getContentPane();
-  }
-    
-  protected void createEditPolicies()
-  {
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
-    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
-  }
-  
-   
-  public void addFeedback()
-  {
-    BoxFigure boxFigure = (BoxFigure)figure;
-    LineBorder boxFigureLineBorder = (LineBorder)boxFigure.getBorder();
-    boxFigureLineBorder.setWidth(2);
-    boxFigureLineBorder.setColor(ColorConstants.darkBlue);  
-    boxFigure.getHeadingFigure().setSelected(true);
-    figure.repaint();
-    super.addFeedback();
-  }
-  
-  public void removeFeedback()
-  {
-    BoxFigure boxFigure = (BoxFigure)figure;
-    LineBorder boxFigureLineBorder = (LineBorder)boxFigure.getBorder();
-    boxFigureLineBorder.setWidth(1);
-    boxFigureLineBorder.setColor(ColorConstants.black);
-    boxFigure.getHeadingFigure().setSelected(false);
-    figure.repaint();
-    super.removeFeedback();    
-  }
-  
-  protected ActionRegistry getEditorActionRegistry(IEditorPart editor)
-  {
-    return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
-  }
-}  
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/CenteredConnectionAnchor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/CenteredConnectionAnchor.java
deleted file mode 100644
index 3e19c6f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/CenteredConnectionAnchor.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.draw2d.AbstractConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.editor.internal.design.figures.CenteredIconFigure;
-
-public class CenteredConnectionAnchor extends AbstractConnectionAnchor
-{
-  public static final int TOP = 0;
-  public static final int BOTTOM = 1;
-  public static final int LEFT = 2;
-  public static final int RIGHT = 3;
-
-  public static final int HEADER_LEFT = 4;
-  public static final int HEADER_RIGHT = 5;
-
-  private int location;
-  private int inset;
-  private int offset = 0;
-
-  public CenteredConnectionAnchor(IFigure owner, int location, int inset)
-  {
-    super(owner);
-    this.location = location;
-    this.inset = inset;
-  }
-
-  public CenteredConnectionAnchor(IFigure owner, int location, int inset, int offset)
-  {
-    this(owner, location, inset);
-    this.offset = offset;
-  }
-
-  public Point getLocation(Point reference)
-  {
-    Rectangle r = getOwner().getBounds();
-    int x, y;
-    switch (location)
-    {
-    case TOP:
-      x = r.right() - r.width / 2 + offset;
-      y = r.y + inset;
-      break;
-    case BOTTOM:
-      x = r.right() - r.width / 2 + offset;
-      y = r.bottom() - inset;
-      break;
-    case LEFT:
-      x = r.x + inset;
-      y = r.bottom() - r.height / 2 + offset;
-      break;
-    case RIGHT:
-      x = r.right() - inset;
-      y = r.bottom() - r.height / 2 + offset;
-      break;
-    case HEADER_LEFT:
-      x = r.x + inset;
-      y = r.y + offset;
-      break;
-    case HEADER_RIGHT:
-      x = r.right() - inset;
-      y = r.y + offset;
-      break;
-
-    default:
-      x = r.right() - r.width / 2;
-      y = r.bottom() - r.height / 2;
-    }
-    Point p = new Point(x, y);
-
-    if (!(getOwner() instanceof CenteredIconFigure))
-    {
-      getOwner().translateToAbsolute(p);
-    }
-    else
-    {
-      getOwner().translateToAbsolute(p);
-    }
-    return p;
-  }
-
-  public Point getReferencePoint()
-  {
-    return getLocation(null);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ColumnEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ColumnEditPart.java
deleted file mode 100644
index f6352ae..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ColumnEditPart.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.adt.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-
-public class ColumnEditPart extends BaseEditPart
-{         
-  protected int spacing = 20;  
-  protected int minorAlignment = -1;
-  
-  protected IFigure createFigure()
-  {
-    Figure figure = new Figure();
-    ToolbarLayout layout = new ToolbarLayout(false);
-    if (minorAlignment != -1)
-    {  
-      layout.setMinorAlignment(minorAlignment);
-    }  
-    layout.setStretchMinorAxis(false);
-    layout.setSpacing(spacing);
-    figure.setLayoutManager(layout);
-    return figure;
-  }
-  
-  public void setSpacing(int spacing)
-  {
-    this.spacing = spacing;
-    if (figure != null)
-    {  
-      ((ToolbarLayout)figure.getLayoutManager()).setSpacing(spacing);
-    }  
-  }
-  
-  public IComplexType getComplexType()
-  {
-    return (IComplexType)getModel();   
-  }
-
-  protected void createEditPolicies()
-  {
-    // TODO Auto-generated method stub
-  }
-  
-  protected List getModelChildren()
-  { 
-    AbstractModelCollection collection = (AbstractModelCollection)getModel();
-    return collection.getChildren();
-  }
-
-  public int getMinorAlignment()
-  {
-    return minorAlignment;
-  }
-
-  public void setMinorAlignment(int minorAlignment)
-  {
-    this.minorAlignment = minorAlignment;
-  }
-}
-
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/CompartmentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/CompartmentEditPart.java
deleted file mode 100644
index b5724e0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/CompartmentEditPart.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import java.util.List;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.adt.facade.IField;
-
-// TODO (cs) common-up with BoxEditPart (?)
-public class CompartmentEditPart extends BaseEditPart // implements
-                                                      // IFeedbackHandler
-{
-  Annotation annotation = new Annotation();
-
-  protected IFigure createFigure()
-  {
-    ICompartmentFigure figure = getFigureFactory().createCompartmentFigure(getModel());
-    return figure;
-  }
-
-  public IFigure getContentPane()
-  {
-    return getCompartmentFigure().getContentPane();
-  }
-
-  protected void createEditPolicies()
-  {
-    // installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new
-    // SelectionFeedbackEditPolicy(this));
-  }
-
-  protected void addChildVisual(EditPart childEditPart, int index)
-  {
-    Object model = childEditPart.getModel();
-
-    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
-
-    if (model instanceof IField)
-    {
-      getCompartmentFigure().getContentPane().add(child, index);
-      return;
-    }
-    else if (model instanceof Annotation)
-    {
-      getCompartmentFigure().getAnnotationPane().add(child);
-      return;
-    }
-    super.addChildVisual(childEditPart, index);
-  }
-
-  protected void removeChildVisual(EditPart childEditPart)
-  {
-    Object model = childEditPart.getModel();
-    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
-
-    if (model instanceof IField)
-    {
-      getCompartmentFigure().getContentPane().remove(child);
-      return;
-    }
-    else if (model instanceof Annotation)
-    {
-      getCompartmentFigure().getAnnotationPane().remove(child);
-      return;
-    }
-    super.removeChildVisual(childEditPart);
-  }
-
-  protected Compartment getCompartment()
-  {
-    return (Compartment) getModel();
-  }
-
-  protected List getModelChildren()
-  {
-    List children = getCompartment().getChildren();
-    children.add(annotation);
-    return children;
-  }
-  
-  public void setModel(Object model)
-  {
-    super.setModel(model);
-    annotation.setCompartment(getCompartment());
-  }
-
-  protected void refreshChildren()
-  {
-    super.refreshChildren();
-    // ((AbstractGraphicalEditPart)getParent()).getContentPane().invalidate();
-  }
-
-  protected void refreshVisuals()
-  {
-    super.refreshVisuals();
-  }
-
-  public void addFeedback()
-  {
-    // getFigure().setBackgroundColor(ColorConstants.blue);
-    // ((CompartmentFigure)getFigure()).setBorderColor(ColorConstants.black);
-    getFigure().repaint();
-  }
-
-  public void removeFeedback()
-  {
-    // getFigure().setBackgroundColor(ColorConstants.lightBlue);
-    // ((CompartmentFigure)getFigure()).setBorderColor(ColorConstants.lightGray);
-    getFigure().repaint();
-  }
-  
-  public ICompartmentFigure getCompartmentFigure()
-  {
-    return (ICompartmentFigure)figure;
-  }
-
-  public void addNotify()
-  {  
-    super.addNotify();
-    getCompartmentFigure().editPartAttached(this);   
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ComplexTypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ComplexTypeEditPart.java
deleted file mode 100644
index 6445ee8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/ComplexTypeEditPart.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IType;
-
-public class ComplexTypeEditPart extends StructureEditPart
-{   
-  protected boolean shouldDrawConnection()
-  {
-    if (getParent().getModel() instanceof FocusTypeColumn)
-    {  
-      IComplexType complexType = (IComplexType)getModel();
-      return complexType.getSuperType() != null;
-    } 
-    return false;
-  }
-  
-  public TypeReferenceConnection createConnectionFigure()
-  {
-    TypeReferenceConnection connectionFigure = null;
-    IComplexType complexType = (IComplexType)getModel();
-    IType type = complexType.getSuperType();
-    if (type != null && type.isComplexType())
-    {      
-      AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart)getViewer().getEditPartRegistry().get(type);
-      if (referenceTypePart != null)
-      {
-        connectionFigure = new TypeReferenceConnection();
-        // draw a line out from the top         
-        connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.TOP, 1));
-        
-        // TODO (cs) need to draw the target anchor to look like a UML inheritance relationship
-        // adding a label to the connection would help to
-        connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.BOTTOM, 0, 0)); 
-        connectionFigure.setHighlight(false);
-      }
-    }    
-    return connectionFigure;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/FieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/FieldEditPart.java
deleted file mode 100644
index 20d4377..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/FieldEditPart.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-
-public class FieldEditPart extends BaseFieldEditPart
-{
-  public void addNotify()
-  {
-    super.addNotify();
-    getFieldFigure().editPartAttached(this);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/INamedEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/INamedEditPart.java
deleted file mode 100644
index 089b8b6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/INamedEditPart.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-
-public interface INamedEditPart
-{
-  public Label getNameLabelFigure();
-
-  public void performDirectEdit(Point cursorLocation);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/RootContentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/RootContentEditPart.java
deleted file mode 100644
index a046556..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/RootContentEditPart.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.adt.design.editparts.model.ReferencedTypeColumn;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.wst.xsd.editor.internal.design.layouts.ContainerLayout;
-
-public class RootContentEditPart extends AbstractGraphicalEditPart
-{
-  List collections = null;
-  Figure contentPane;
-  
-  protected IFigure createFigure()
-  {    
-    Panel panel = new Panel();    
-    // why do we need to use a container layout? can we just set a
-    // margin border and get the same effect?
-    ContainerLayout clayout = new ContainerLayout();
-    clayout.setBorder(60);
-    panel.setLayoutManager(clayout);
-    
-    contentPane = new Figure();
-    panel.add(contentPane);
-        
-    ToolbarLayout layout = new ToolbarLayout(true);
-    layout.setStretchMinorAxis(false);
-    layout.setSpacing(100);
-    contentPane.setLayoutManager(layout);
-    return panel;
-  }
-  
-  public IFigure getContentPane()
-  {
-    return contentPane;
-  }
-  
-  
-  public IComplexType getSelectedComplexType()
-  {
-    IComplexType result = null;
-    IModel model = (IModel)getModel();
-    List types = model.getTypes();
-    if (types.size() > 0)
-    {
-      if (types.get(0) instanceof IComplexType) 
-        result = (IComplexType)types.get(0);
-    }  
-    return result;
-  }
-
-  protected void createEditPolicies()
-  {
-    // TODO Auto-generated method stub
-  }
-  
-  protected List getModelChildren()
-  { 
-    collections = new ArrayList();
-    if (getModel() != null)
-    {
-      Object obj = getModel();
-      IADTObject focusObject = null;
-      if (obj instanceof IStructure)
-      {
-        focusObject = (IStructure)obj;
-      }
-      else if (obj instanceof IField)
-      {
-        focusObject = (IField)obj;
-      }  
-      else if (obj instanceof IModel)
-      {
-        focusObject = getSelectedComplexType();
-      }
-      else if (obj instanceof IType)
-      {
-        if (((IType)obj).isFocusAllowed())
-        {
-          focusObject = (IType)obj;
-        }
-      }
-      if (focusObject != null)
-      {
-        collections.add(new FocusTypeColumn(focusObject));
-        collections.add(new ReferencedTypeColumn(focusObject));
-      }
-    }
-    return collections;
-  }
-  
-  public void setInput(Object component)
-  {
-    setModel(component);
-    refresh();
-  }
-  
-  public Object getInput()
-  {
-    return getModel();
-  }
-  
-  public void refresh()
-  {
-    super.refresh();
-    // the connections are not refreshed
-    for(Iterator i = getChildren().iterator(); i.hasNext(); )
-    {
-      Object obj = i.next();
-      if (obj instanceof AbstractGraphicalEditPart)
-      {
-        ((AbstractGraphicalEditPart)obj).refresh();
-      }
-    }
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/RootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/RootEditPart.java
deleted file mode 100644
index ba0fcbb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/RootEditPart.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.draw2d.BendpointConnectionRouter;
-import org.eclipse.draw2d.ConnectionLayer;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-
-public class RootEditPart extends ScalableRootEditPart implements org.eclipse.gef.RootEditPart
-{  
-  public void activate()
-  {
-    super.activate();
-    // Set up Connection layer with a router, if it doesn't already have one
-    ConnectionLayer connectionLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
-    if (connectionLayer != null)
-    {  
-      connectionLayer.setConnectionRouter(new BendpointConnectionRouter());
-    }
-    refresh();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/StructureEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/StructureEditPart.java
deleted file mode 100644
index 0189d58..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/StructureEditPart.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.common.actions.OpenInNewEditor;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-public class StructureEditPart extends BaseTypeConnectingEditPart implements INamedEditPart
-{  
-  protected List compartmentList = null;
-  protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
-
-  /**
-   * TODO cs... I'm sure this has something to do with the way we wanted to rework compartment creation
-   * I suppose we could have subclasses override this method instead of getModelChildren()
-   * 
-   * @deprecated
-   */
-  protected Compartment[] getCompartments()
-  {
-    return null;
-  }
-  
-  protected IFigure createFigure()
-  {
-    IStructureFigure figure = getFigureFactory().createStructureFigure(getModel());
-    return figure;
-  }
-  
-  public IStructureFigure getStructureFigure()
-  {
-    return (IStructureFigure)getFigure();
-  }
-  
-  public IFigure getContentPane()
-  {
-    return getStructureFigure().getContentPane();
-  }
-  
-  
-  protected void createEditPolicies()
-  {
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
-    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
-  }
-  
-  protected IStructure getStructure()
-  {
-    return (IStructure)getModel();
-  }
-  
-  protected List getModelChildren()
-  {
-    if (compartmentList == null)
-    {
-      compartmentList = new ArrayList();
-      
-      // TODO.. this needs to be moved to the xsd specific version of this class 
-      compartmentList.add(new Compartment(getStructure(), "attribute"));
-      compartmentList.add(new Compartment(getStructure(), "element"));   
-    }  
-    return compartmentList;
-  }
-  
-  protected void refreshChildren()
-  {   
-    super.refreshChildren();
-    //getFigure().invalidateTree();    
-  }
-  
-  protected void refreshVisuals()
-  {
-    super.refreshVisuals();
-    getStructureFigure().refreshVisuals(getModel());
-  }
-  
-  public void addFeedback()
-  {
-    getStructureFigure().addSelectionFeedback();
-    super.addFeedback();
-  }
-  
-  public void removeFeedback()
-  {
-    getStructureFigure().removeSelectionFeedback();
-    super.removeFeedback();    
-  }
-
-  public Label getNameLabelFigure()
-  {
-    return getStructureFigure().getNameLabel();
-  }
-
-  public void performDirectEdit(Point cursorLocation)
-  {
-    
-  }
-
-  public void performRequest(Request request)
-  {  
-    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
-        request.getType() == RequestConstants.REQ_OPEN)
-    {
-      
-      Object model = getModel();
-      if (request instanceof LocationRequest)
-      {
-        LocationRequest locationRequest = (LocationRequest)request;
-        Point p = locationRequest.getLocation();
-// uncomment for direct edit of name (add else)
-//        if (hitTest(getNameLabelFigure(), p))
-//        {
-//          LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, p));
-//          NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
-//          adtDirectEditPolicy.setUpdateCommand(wrapper);
-//          manager.show();
-//        }
-       
-         
-        if (getStructureFigure().hitTestHeader(p))
-        {          
-          // TODO: !!! This should be moved to the adt-xsd package
-          // 
-          if (model instanceof XSDComplexTypeDefinitionAdapter)     
-          {
-            XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter)model;
-            XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)adapter.getTarget();
-            IWorkbench workbench = PlatformUI.getWorkbench();
-            IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-            IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-            Object schema = editorPart.getAdapter(XSDSchema.class);
-            ActionRegistry registry = getEditorActionRegistry(editorPart);
-            if (registry != null)
-            {
-              if (schema == ct.getSchema())
-              {
-                IAction action = registry.getAction(SetInputToGraphView.ID);
-                action.run();
-              }
-              else
-              {
-                IAction action = registry.getAction(OpenInNewEditor.ID);
-                action.run();
-              }
-            }
-          }          
-        }
-      }
-    }
-  }
-  
-  protected ActionRegistry getEditorActionRegistry(IEditorPart editor)
-  {
-    return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
-  }
-  
-  protected boolean shouldDrawConnection()
-  {
-    return false;
-  }
-  
-  public TypeReferenceConnection createConnectionFigure()
-  {
-    return null;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/TopLevelFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/TopLevelFieldEditPart.java
deleted file mode 100644
index 901f420..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/TopLevelFieldEditPart.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.wst.xsd.adt.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.xsd.adt.design.directedit.LabelEditManager;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IType;
-import org.eclipse.wst.xsd.adt.typeviz.design.figures.BoxFigure;
-
-public class TopLevelFieldEditPart extends BoxEditPart implements INamedEditPart
-{
-  protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
-  
-  protected boolean shouldDrawConnection()
-  {
-    IField field = (IField)getModel();
-    IType type = field.getType();
-    return (type != null && type.isComplexType());
-  }
-  
-  public TypeReferenceConnection createConnectionFigure()
-  {
-    TypeReferenceConnection connectionFigure = null;
-    IField field = (IField)getModel();
-    IType type = field.getType();
-    if (type != null && type.isComplexType())
-    {      
-      AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart)getViewer().getEditPartRegistry().get(type);
-      if (referenceTypePart != null)
-      {
-        connectionFigure = new TypeReferenceConnection();   
-        connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.RIGHT, 5));
-        int targetAnchorYOffset = 16;        
-        connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.HEADER_LEFT, 0, targetAnchorYOffset)); 
-        connectionFigure.setHighlight(false);
-      }
-    }    
-    return connectionFigure;
-  }  
-  
-  protected void createEditPolicies()
-  {
-    super.createEditPolicies();
-    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
-  }
-
-  protected void refreshVisuals()
-  {
-    IField field = (IField)getModel();
-    BoxFigure boxFigure = (BoxFigure)getFigure();
-    boxFigure.getNameLabel().setText(field.getName());
-    super.refreshVisuals();
-  }
-  
-  public Label getNameLabelFigure()
-  {
-    BoxFigure boxFigure = (BoxFigure)getFigure();
-    return boxFigure.getNameLabel();
-  }
-
-  public void performDirectEdit(Point cursorLocation)
-  {
-   
-  }
-  
-  public void performRequest(Request request)
-  {  
-    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT||
-        request.getType() == RequestConstants.REQ_OPEN)
-    {
-      if (request instanceof LocationRequest)
-      {
-        LocationRequest locationRequest = (LocationRequest)request;
-        Point p = locationRequest.getLocation();
-       
-        if (hitTest(getNameLabelFigure(), p))
-        {
-          LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, p));
-          NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
-          adtDirectEditPolicy.setUpdateCommand(wrapper);
-          manager.show();
-        }
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/TypeReferenceConnection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/TypeReferenceConnection.java
deleted file mode 100644
index d4eef12..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/TypeReferenceConnection.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.ManhattanConnectionRouter;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.swt.graphics.Color;
-
-public class TypeReferenceConnection extends PolylineConnection
-{
-  protected boolean highlight = false;
-  protected static final Color activeConnection = ColorConstants.black;
-  protected static final Color inactiveConnection = new Color(null, 198, 195, 198);
-
-  /**
-   * Default constructor
-   */
-  public TypeReferenceConnection()
-  {
-    super();
-    setTargetDecoration(new PolygonDecoration());
-  }
-  
-  
-
-  public void setConnectionRouter(ConnectionRouter cr)
-  {
-    if (cr != null && getConnectionRouter() != null && !(getConnectionRouter() instanceof ManhattanConnectionRouter))
-      super.setConnectionRouter(cr);
-  }
-
-  /**
-   * @return Returns the current highlight status.
-   */
-  public boolean isHighlighted()
-  {
-    return highlight;
-  }
-
-  /**
-   * @param highlight
-   *          The highlight to set.
-   */
-  public void setHighlight(boolean highlight)
-  {
-    this.highlight = highlight;
-    // Update our connection to use the correct colouring
-    setForegroundColor(highlight ? activeConnection : inactiveConnection);
-    setOpaque(highlight);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/AbstractModelCollection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/AbstractModelCollection.java
deleted file mode 100644
index 37d1e33..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/AbstractModelCollection.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts.model;
-
-import java.util.List;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-
-public abstract class AbstractModelCollection implements IADTObject
-{
-  IADTObject model;
-  String kind;
-  
-  public AbstractModelCollection(IADTObject model, String kind)
-  {
-    this.model = model;
-    this.kind = kind;
-  }
-
-  public Object getModel()
-  {
-    return model;
-  }
-
-  public void setModel(IADTObject model)
-  {
-    this.model = model;
-  }
-
-  public String getKind()
-  {
-    return kind;
-  }
-
-  public void setKind(String kind)
-  {
-    this.kind = kind;
-  }
-  
-  public abstract List getChildren();
-
-  public void registerListener(IADTObjectListener listener)
-  {
-    model.registerListener(listener);
-  }
-
-  public void unregisterListener(IADTObjectListener listener)
-  {
-    model.unregisterListener(listener);
-  }   
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/Annotation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/Annotation.java
deleted file mode 100644
index fee40af..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/Annotation.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts.model;
-
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-
-public class Annotation
-{
-  Compartment compartment;
-  public Annotation()
-  {
-    super();
-  }
-  
-  public void setCompartment(Compartment compartment)
-  {
-    this.compartment = compartment;
-  }
-  
-  public Compartment getCompartment()
-  {
-    return compartment;
-  }
-  
-  public IStructure getOwner()
-  {
-    return compartment.getOwner();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/Compartment.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/Compartment.java
deleted file mode 100644
index 6de4ff2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/Compartment.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-
-public class Compartment implements IADTObject
-{
-  String kind;
-  IStructure owner;
-
-  public Compartment(IStructure owner, String kind)
-  {
-    this.kind = kind;
-    this.owner = owner;
-  }
-
-  public List getChildren()
-  {
-    List list = new ArrayList();
-    for (Iterator i = owner.getFields().iterator(); i.hasNext();)
-    {
-      IField field = (IField) i.next();
-      if (kind == null || kind.equals(field.getKind()))
-      {
-        list.add(field);
-      }
-    }
-    return list;
-  }
-
-  public String getKind()
-  {
-    return kind;
-  }
-  
-  public IStructure getOwner()
-  {
-    return owner;
-  }
-
-  public void registerListener(IADTObjectListener listener)
-  {
-    // really we want to listen to the owner
-    owner.registerListener(listener);
-  }
-
-  public void unregisterListener(IADTObjectListener listener)
-  {
-    // really we want to listen to the owner
-    owner.unregisterListener(listener);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/FocusTypeColumn.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/FocusTypeColumn.java
deleted file mode 100644
index 81272c3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/FocusTypeColumn.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-import org.eclipse.wst.xsd.adt.facade.IType;
-
-public class FocusTypeColumn extends AbstractModelCollection
-{  
-  public FocusTypeColumn(IADTObject model)
-  {
-    super(model, "FocusTypeColumn");
-  }
-
-  public List getChildren()
-  {
-    List result = new ArrayList();  
-    if (model instanceof IType)
-    {
-      IType type = (IType)model;
-      if (type.getSuperType() != null)
-      {  
-        result.add(type.getSuperType());
-      }
-      result.add(type);
-    }  
-    else if (model instanceof IField ||
-             model instanceof IStructure)
-    {   
-      result.add(model);
-    }       
-    return result;       
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/IActionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/IActionProvider.java
deleted file mode 100644
index 46d812c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/IActionProvider.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts.model;
-
-
-
-public interface IActionProvider
-{
-  public String[] getActions(Object object);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/IFeedbackHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/IFeedbackHandler.java
deleted file mode 100644
index a8f6ca3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/IFeedbackHandler.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts.model;
-
-public interface IFeedbackHandler
-{
-  public void addFeedback();
-  public void removeFeedback();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/ReferencedTypeColumn.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/ReferencedTypeColumn.java
deleted file mode 100644
index 761a59a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editparts/model/ReferencedTypeColumn.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.adt.facade.IField;
-import org.eclipse.wst.xsd.adt.facade.IStructure;
-import org.eclipse.wst.xsd.adt.facade.IType;
-
-public class ReferencedTypeColumn extends AbstractModelCollection
-{
-  List listenerList = new ArrayList();
-  InternalListener internalListener = new InternalListener();
-  
-  // todo... really this this model object should listen
-  // to the parent of the IType
-  //
-  public ReferencedTypeColumn(IADTObject model)
-  {
-    super(model, "ReferencedTypeColumn");
-    model.registerListener(internalListener);
-    internalListener.recomputeSubListeners();
-  }
-
-  public List getChildren()
-  {
-    List result = new ArrayList();  
-    if (model instanceof IStructure)
-    {
-      IStructure structure = (IStructure)model;
-      for (Iterator i = structure.getFields().iterator(); i.hasNext(); )
-      {
-        IField field = (IField)i.next();
-        IType type = field.getType();
-        if (type != null)  // && type.isComplexType())
-        {
-          if (!result.contains(type))
-          {
-            if (type.isFocusAllowed())
-              result.add(type);
-          }  
-        }  
-      }        
-    }  
-    else if (model instanceof IField)
-    {
-      IField field = (IField)model;
-      IType type = field.getType();
-      if (type != null) //  && type.isComplexType())
-      {
-        if (type.isFocusAllowed())
-          result.add(type);        
-      }
-    }  
-    return result;
-  }  
-  
-  public void registerListener(IADTObjectListener listener)
-  {
-    listenerList.add(listener);
-  }
-
-  public void unregisterListener(IADTObjectListener listener)
-  {
-    listenerList.remove(listener);
-  }   
-  
-  protected void notifyListeners(Object changedObject, String property)
-  {
-    List clonedListenerList = new ArrayList();
-    clonedListenerList.addAll(listenerList);
-    for (Iterator i = clonedListenerList.iterator(); i.hasNext(); )
-    {
-      IADTObjectListener listener = (IADTObjectListener)i.next();
-      listener.propertyChanged(this, null);
-    } 
-  }   
-  
-  protected class InternalListener implements IADTObjectListener
-  {
-    List fields = new ArrayList();
-
-    void recomputeSubListeners()
-    {
-      if (model instanceof IStructure)
-      {  
-        // remove old ones
-        for (Iterator i = fields.iterator(); i.hasNext();)
-        {
-          IField field = (IField) i.next();
-          field.unregisterListener(this);
-        }
-        // add new ones
-        fields.clear();
-        IStructure complexType = (IStructure) model;
-        for (Iterator i = complexType.getFields().iterator(); i.hasNext();)
-        {
-          IField field = (IField) i.next();
-          fields.add(field);
-          field.registerListener(this);
-        }
-      }
-    }
-
-    public void propertyChanged(Object object, String property)
-    {
-      if (object == model)
-      {
-        // we need to update the fields we're listening too
-        // since these may have changed
-        recomputeSubListeners();
-      }
-      else if (object instanceof IField)
-      {
-        System.out.println("field changed!!! " + fields.size() + " " + object);
-      }  
-      notifyListeners(object, property);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/ADTDirectEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/ADTDirectEditPolicy.java
deleted file mode 100644
index d06be2d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/ADTDirectEditPolicy.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editpolicies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.wst.xsd.adt.design.directedit.ComboBoxCellEditorManager;
-
-public class ADTDirectEditPolicy extends DirectEditPolicy
-{
-  protected ComboBoxCellEditorManager delegate;
-  protected IADTUpdateCommand command;
-
-  public ADTDirectEditPolicy()
-  {
-    super();
-  }
-
-  
-  public void setUpdateCommand(IADTUpdateCommand command)
-  {
-    this.command = command;
-  }
-  
-  protected void showCurrentEditValue(DirectEditRequest request) 
-  {      
-    getHostFigure().getUpdateManager().performUpdate();
-  }
-
-  protected Command getDirectEditCommand(DirectEditRequest request)
-  {
-    command.setRequest(request);
-    return (Command)command; 
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
deleted file mode 100644
index 4d391fb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editpolicies;
-
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.wst.xsd.adt.design.editparts.model.IFeedbackHandler;
-
-public class ADTSelectionFeedbackEditPolicy extends SelectionEditPolicy
-{
-
-  public ADTSelectionFeedbackEditPolicy()
-  {
-    super();
-  }
-
-  protected void hideSelection()
-  {
-    if (getHost() instanceof IFeedbackHandler)
-    {
-      ((IFeedbackHandler) getHost()).removeFeedback();
-    }
-  }
-
-  protected void showSelection()
-  {
-    if (getHost() instanceof IFeedbackHandler)
-    {
-      ((IFeedbackHandler) getHost()).addFeedback();
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/DirectEditPolicyDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/DirectEditPolicyDelegate.java
deleted file mode 100644
index d4b33a1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/DirectEditPolicyDelegate.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editpolicies;
-   
-import org.eclipse.jface.viewers.CellEditor;
-
-public interface DirectEditPolicyDelegate
-{       
-  public void performEdit(CellEditor cellEditor);  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/IADTUpdateCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/IADTUpdateCommand.java
deleted file mode 100644
index 56d9092..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/IADTUpdateCommand.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editpolicies;
-
-import org.eclipse.gef.requests.DirectEditRequest;
-
-public interface IADTUpdateCommand
-{
-  void setRequest(DirectEditRequest request);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/SimpleDirectEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/SimpleDirectEditPolicy.java
deleted file mode 100644
index 9363426..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/editpolicies/SimpleDirectEditPolicy.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.editpolicies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-                                   
-public class SimpleDirectEditPolicy extends DirectEditPolicy 
-{
-  protected DirectEditPolicyDelegate delegate;
-
-  public void setDelegate(DirectEditPolicyDelegate delegate)
-  {                                           
-    this.delegate = delegate;
-  }
-
-  protected org.eclipse.gef.commands.Command getDirectEditCommand(final DirectEditRequest request) 
-  { 
-  	return new Command() //AbstractCommand()
-    {
-      public void execute()
-      {                       
-        if (delegate != null)
-        {
-          delegate.performEdit(request.getCellEditor());
-        }  
-      }     
-  
-      public void redo()
-      {
-      }  
-  
-      public void undo()
-      {
-      }     
-  
-      public boolean canExecute()
-      {
-        return true;
-      }
-    };
-  }
-  
-  protected void showCurrentEditValue(DirectEditRequest request) 
-  {      
-  	//hack to prevent async layout from placing the cell editor twice.
-  	getHostFigure().getUpdateManager().performUpdate();
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IADTFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IADTFigure.java
deleted file mode 100644
index ce7b14b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IADTFigure.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-
-public interface IADTFigure extends IFigure
-{
-  void editPartAttached(EditPart owner); 
-  void addSelectionFeedback();
-  void removeSelectionFeedback();
-  void refreshVisuals(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/ICompartmentFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/ICompartmentFigure.java
deleted file mode 100644
index 9eff72f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/ICompartmentFigure.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface ICompartmentFigure extends IADTFigure
-{
-  IFigure getContentPane();
-  IFigure getAnnotationPane();  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IFieldFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IFieldFigure.java
deleted file mode 100644
index d310271..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IFieldFigure.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.figures;
-
-import org.eclipse.draw2d.Label;
-
-
-public interface IFieldFigure extends IADTFigure
-{
-  Label getTypeLabel();
-  Label getNameLabel();
-  Label getNameAnnotationLabel();
-  Label getTypeAnnotationLabel();
-  void recomputeLayout();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IFigureFactory.java
deleted file mode 100644
index 893222b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IFigureFactory.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.figures;
-
-public interface IFigureFactory
-{
-  IFieldFigure createFieldFigure(Object model);
-  IStructureFigure createStructureFigure(Object model);
-  ICompartmentFigure createCompartmentFigure(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IStructureFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IStructureFigure.java
deleted file mode 100644
index 7e7cbc5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/design/figures/IStructureFigure.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-
-public interface IStructureFigure extends IADTFigure
-{
-  IFigure getContentPane();
-  Label getNameLabel();
-  boolean hitTestHeader(Point point);  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/edit/ComponentReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/edit/ComponentReferenceEditManager.java
deleted file mode 100644
index 21b9ded..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/edit/ComponentReferenceEditManager.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.edit;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-
-public interface ComponentReferenceEditManager
-{
-  public IComponentDialog getBrowseDialog();
-  public IComponentDialog getNewDialog();
-  public void modifyComponentReference(Object referencingObject, ComponentSpecification referencedComponent);
-  public IComponentDescriptionProvider getComponentDescriptionProvider();
-  
-  public ComponentSpecification[] getQuickPicks();
-  public ComponentSpecification[] getHistory();
-  public void addToHistory(ComponentSpecification component);  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/edit/IComponentDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/edit/IComponentDialog.java
deleted file mode 100644
index f18e8f0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/edit/IComponentDialog.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.edit;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-
-public interface IComponentDialog  {
-  
-	/*
-	 * Set the Object being set
-	 */
-	public void setInitialSelection(ComponentSpecification componentSpecification);
-	
-	/*
-	 * Return the Object which should be used as the type.
-	 */
-	public ComponentSpecification getSelectedComponent();
-	
-	/*
-	 * Used to open the Dialog
-	 */
-	public int createAndOpen();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/editor/ADTMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/editor/ADTMultiPageEditor.java
deleted file mode 100644
index 80e75d9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/editor/ADTMultiPageEditor.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.editor;
-
-import java.util.ArrayList;
-import java.util.EventObject;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.MouseWheelHandler;
-import org.eclipse.gef.MouseWheelZoomHandler;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.commands.CommandStackListener;
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.UpdateAction;
-import org.eclipse.gef.ui.actions.ZoomInAction;
-import org.eclipse.gef.ui.actions.ZoomOutAction;
-import org.eclipse.gef.ui.parts.SelectionSynchronizer;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.adt.design.editparts.ADTEditPartFactory;
-import org.eclipse.wst.xsd.adt.design.editparts.RootEditPart;
-import org.eclipse.wst.xsd.adt.facade.IModel;
-import org.eclipse.wst.xsd.adt.outline.ADTContentOutlinePage;
-import org.eclipse.wst.xsd.adt.outline.ADTContentOutlineProvider;
-import org.eclipse.wst.xsd.adt.outline.ADTLabelProvider;
-
-/**
- * </ul>
- * <li>page 0 graph
- * <li>page 1 source
- * </ul>
- */
-public abstract class ADTMultiPageEditor extends MultiPageEditorPart implements IResourceChangeListener, CommandStackListener, ITabbedPropertySheetPageContributor
-{
-  protected IContentOutlinePage fOutlinePage;
-  protected long lastModificationStamp;
-  protected DesignViewGraphicalViewer graphicalViewer;
-  
-  protected IModel model;
-  private DefaultEditDomain editDomain;
-  private SelectionSynchronizer synchronizer;
-  private ActionRegistry actionRegistry;
-  private List selectionActions = new ArrayList();
-  private List stackActions = new ArrayList();
-  private List propertyActions = new ArrayList();
-  protected ADTSelectionManager selectionManager;
-
-  /**
-   * Creates a multi-page editor example.
-   */
-  public ADTMultiPageEditor()
-  {
-    super();
-    DefaultEditDomain defaultGEFEditDomain = new DefaultEditDomain(this);
-    setEditDomain(defaultGEFEditDomain);
-  }
-
-  public String getContributorId()
-  {
-    return "org.eclipse.wst.xsd.editor";
-  }
-  
-  
-  public ADTSelectionManager getSelectionManager()
-  {
-    if (selectionManager == null)
-    {
-      selectionManager = new ADTSelectionManager(this);
-    }
-    return selectionManager;
-  }
-
-  protected void createGraphPage()
-  {
-    Composite parent = new Composite(getContainer(), SWT.NONE);
-    parent.setLayout(new FillLayout());
-
-    graphicalViewer = new DesignViewGraphicalViewer(this, getSelectionProvider());//getSelectionManager(), xsdModelAdapterFactory);
-    graphicalViewer.createControl(parent);
-    getEditDomain().addViewer(graphicalViewer);
-    
-    configureGraphicalViewer();
-    hookGraphicalViewer();
-    initializeGraphicalViewer();
-    int index = addPage(parent);
-    setPageText(index, "Design");
-  }
-
-  protected ADTSelectionManager selectionProvider;
-  public ADTSelectionManager getSelectionProvider()
-  {
-    return selectionProvider;
-  }
-  
-  /**
-   * Creates the pages of the multi-page editor.
-   */
-  protected void createPages()
-  {
-    model = buildModel((IFileEditorInput)getEditorInput());
-    
-    selectionProvider = getSelectionManager();
-    getEditorSite().setSelectionProvider(selectionProvider);
-    
-    createGraphPage();
-  }
-
-  /**
-   * The <code>MultiPageEditorPart</code> implementation of this
-   * <code>IWorkbenchPart</code> method disposes all nested editors.
-   * Subclasses may extend.
-   */
-  public void dispose()
-  {
-    getCommandStack().removeCommandStackListener(this);
-    ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
-    getActionRegistry().dispose();
-    super.dispose();
-  }
-
-  /**
-   * Saves the multi-page editor's document.
-   */
-  public void doSave(IProgressMonitor monitor)
-  {
-    getEditor(1).doSave(monitor); 
-    getCommandStack().markSaveLocation();
-  }
-
-  /**
-   * Saves the multi-page editor's document as another file. Also updates the
-   * text for page 0's tab, and updates this multi-page editor's input to
-   * correspond to the nested editor's.
-   */
-  public void doSaveAs()
-  {
-    IEditorPart editor = getEditor(0);
-    editor.doSaveAs();
-    setPageText(0, editor.getTitle());
-    setInput(editor.getEditorInput());
-  }
-
-  /*
-   * (non-Javadoc) Method declared on IEditorPart
-   */
-  public void gotoMarker(IMarker marker)
-  {
-    setActivePage(0);
-    IDE.gotoMarker(getEditor(0), marker);
-  }
-
-  /**
-   * The <code>MultiPageEditorExample</code> implementation of this method
-   * checks that the input is an instance of <code>IFileEditorInput</code>.
-   */
-  public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException
-  {
-    if (!(editorInput instanceof IFileEditorInput))
-      throw new PartInitException("Invalid Input: Must be IFileEditorInput");
-    super.init(site, editorInput);
-    
-    getCommandStack().addCommandStackListener(this);
-    initializeActionRegistry();
-    
-    String title = null;
-    if (getEditorInput() != null) {
-      title = getEditorInput().getName();
-    }
-    setPartName(title);
-  }
-
-  /*
-   * (non-Javadoc) Method declared on IEditorPart.
-   */
-  public boolean isSaveAsAllowed()
-  {
-    return true;
-  }
-
-  /**
-   * Calculates the contents of page 2 when the it is activated.
-   */
-  protected void pageChange(int newPageIndex)
-  {
-    super.pageChange(newPageIndex);
-    if (newPageIndex == 1)
-    {
-    }
-  }
-
-  abstract public IModel buildModel(IFileEditorInput editorInput);
-  
-  protected void initializeActionRegistry()
-  {
-    createActions();
-  }
-
-  protected void createActions()
-  {
-    ActionRegistry registry = getActionRegistry();
-    
-    BaseSelectionAction action = new SetInputToGraphView(this);
-    action.setSelectionProvider(getSelectionManager());
-    registry.registerAction(action);
-  }
-
-
-  public IModel getModel()
-  {
-    return model;
-  }
-
-  //protected XSDModelAdapterFactoryImpl xsdModelAdapterFactory;
-  //protected XSDAdapterFactoryLabelProvider adapterFactoryLabelProvider;
-
-  public Object getAdapter(Class type)
-  {
-    Object result = null;
-    if (type == ZoomManager.class)
-      return graphicalViewer.getProperty(ZoomManager.class.toString());
-    
-    if (type == ISelectionProvider.class)
-    {
-      result = getSelectionManager();
-    }    
-    /*
-    if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class)
-    {
-      // PropertySheetPage page = new PropertySheetPage();
-      // page.setRootEntry(new UndoablePropertySheetEntry(getCommandStack()));
-      XSDTabbedPropertiesPage page = new XSDTabbedPropertiesPage(this);
-      return page;
-    }*/
-    if (type == GraphicalViewer.class)
-      return graphicalViewer;
-    if (type == CommandStack.class)
-      return getCommandStack();
-    if (type == ActionRegistry.class)
-      return getActionRegistry();
-    if (type == EditPart.class && graphicalViewer != null)
-      return graphicalViewer.getRootEditPart();
-    if (type == IFigure.class && graphicalViewer != null)
-      return ((GraphicalEditPart) graphicalViewer.getRootEditPart()).getFigure();
-
-    if (type == IContentOutlinePage.class)
-    {
-      if (fOutlinePage == null || fOutlinePage.getControl() == null || fOutlinePage.getControl().isDisposed())
-      {
-        ADTContentOutlinePage outlinePage = new ADTContentOutlinePage(this);
-        ADTContentOutlineProvider adtContentProvider = new ADTContentOutlineProvider();
-        outlinePage.setContentProvider(adtContentProvider);
-        ADTLabelProvider adtLabelProvider = new ADTLabelProvider();
-        outlinePage.setLabelProvider(adtLabelProvider);
-        outlinePage.setModel(getModel());
-        
-        fOutlinePage = outlinePage;
-      }
-      return fOutlinePage;
-    }
-
-    return super.getAdapter(type);
-  }
-
-  protected DefaultEditDomain getEditDomain()
-  {
-    return editDomain;
-  }
-
-
-  protected void configureGraphicalViewer()
-  {
-    graphicalViewer.getControl().setBackground(ColorConstants.listBackground);
-
-    // Set the root edit part
-    // ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
-    RootEditPart root = new RootEditPart();
-
-    List zoomLevels = new ArrayList(3);
-    zoomLevels.add(ZoomManager.FIT_ALL);
-    zoomLevels.add(ZoomManager.FIT_WIDTH);
-    zoomLevels.add(ZoomManager.FIT_HEIGHT);
-    root.getZoomManager().setZoomLevelContributions(zoomLevels);
-
-    IAction zoomIn = new ZoomInAction(root.getZoomManager());
-    IAction zoomOut = new ZoomOutAction(root.getZoomManager());
-    getActionRegistry().registerAction(zoomIn);
-    getActionRegistry().registerAction(zoomOut);
-
-    getSite().getKeyBindingService().registerAction(zoomIn);
-    getSite().getKeyBindingService().registerAction(zoomOut);
-
-    //ConnectionLayer connectionLayer = (ConnectionLayer) root.getLayer(LayerConstants.CONNECTION_LAYER);
-    //connectionLayer.setConnectionRouter(new BendpointConnectionRouter());
-    IFigure feedbackLayer = root.getLayer(LayerConstants.FEEDBACK_LAYER);
-
-    //connectionLayer.setConnectionRouter(new ShortestPathConnectionRouter(connectionLayer));
-    // connectionLayer.setVisible(false);
-
-    // Zoom
-    ZoomManager manager = (ZoomManager) graphicalViewer.getProperty(ZoomManager.class.toString());
-    if (manager != null)
-      manager.setZoom(1.0);
-    // Scroll-wheel Zoom
-    graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);
-
-    
-    
-    graphicalViewer.setRootEditPart(root);
-    graphicalViewer.setEditPartFactory(new ADTEditPartFactory());
-  }
-
-  protected void hookGraphicalViewer()
-  {
-    getSelectionSynchronizer().addViewer(graphicalViewer);
-    getSelectionManager().addSelectionChangedListener(graphicalViewer);
-  }
-
-  protected SelectionSynchronizer getSelectionSynchronizer()
-  {
-    if (synchronizer == null)
-      synchronizer = new SelectionSynchronizer();
-    return synchronizer;
-  }
-
-  protected void initializeGraphicalViewer()
-  {
-    graphicalViewer.setContents(model);
-  }
-
-  protected void setEditDomain(DefaultEditDomain ed)
-  {
-    this.editDomain = ed;
-  }
-
-  protected CommandStack getCommandStack()
-  {
-    return getEditDomain().getCommandStack();
-  }
-
-  protected ActionRegistry getActionRegistry()
-  {
-    if (actionRegistry == null)
-      actionRegistry = new ActionRegistry();
-    return actionRegistry;
-  }
-
-  public void commandStackChanged(EventObject event)
-  {
-    updateActions(stackActions);
-    firePropertyChange(PROP_DIRTY);
-  }
-
-  /**
-   * From GEF GraphicalEditor A convenience method for updating a set of actions
-   * defined by the given List of action IDs. The actions are found by looking
-   * up the ID in the {@link #getActionRegistry() action registry}. If the
-   * corresponding action is an {@link UpdateAction}, it will have its
-   * <code>update()</code> method called.
-   * 
-   * @param actionIds
-   *          the list of IDs to update
-   */
-  protected void updateActions(List actionIds)
-  {
-    ActionRegistry registry = getActionRegistry();
-    Iterator iter = actionIds.iterator();
-    while (iter.hasNext())
-    {
-      IAction action = registry.getAction(iter.next());
-      if (action instanceof UpdateAction)
-        ((UpdateAction) action).update();
-    }
-  }
-
-  /**
-   * Returns <code>true</code> if the command stack is dirty
-   * 
-   * @see org.eclipse.ui.ISaveablePart#isDirty()
-   */
-  public boolean isDirty()
-  {
-    super.isDirty();
-    return getCommandStack().isDirty();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/editor/ADTSelectionManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/editor/ADTSelectionManager.java
deleted file mode 100644
index 5b67d6d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/editor/ADTSelectionManager.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-
-public class ADTSelectionManager extends MultiPageSelectionProvider implements ISelectionProvider, ISelectionChangedListener
-{
-
-  public ADTSelectionManager(MultiPageEditorPart multiPageEditor)
-  {
-    super(multiPageEditor);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
-   */
-  public void addSelectionChangedListener(ISelectionChangedListener listener)
-  {
-    listenerList.add(listener);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
-   */
-  public ISelection getSelection()
-  {
-//    System.out.println("getSelection() = " + currentSelection);
-    return currentSelection;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
-   */
-  public void removeSelectionChangedListener(ISelectionChangedListener listener)
-  {
-    listenerList.remove(listener);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
-   */
-  public void setSelection(ISelection selection)
-  {
-    setSelection(selection, this);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
-   */
-  public void selectionChanged(SelectionChangedEvent event)
-  {
-    if (enableNotify)
-    {
-      setSelection(event.getSelection(), event.getSelectionProvider());
-    }
-  }
-
-  
-  protected List listenerList = new ArrayList();
-  protected ISelection currentSelection;
-  protected boolean enableNotify = true;
-
-  public boolean getEnableNotify()
-  {
-    return enableNotify;
-  }
-  
-  public void setSelection(ISelection selection, ISelectionProvider source)
-  {  
-    //System.out.println("ADTSelectionManager.setSelection(" + selection + ")");
-    if (enableNotify)
-    {
-      currentSelection = selection;
-      enableNotify = false;
-      try
-      {
-        SelectionChangedEvent event = new SelectionChangedEvent(source, selection);
-        List copyOfListenerList = new ArrayList(listenerList);
-        for (Iterator i = copyOfListenerList.iterator(); i.hasNext(); )
-        {
-          ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
-          listener.selectionChanged(event);
-        }
-      }
-      catch (Exception e)
-      {
-        e.printStackTrace();
-      }
-      finally
-      {
-        enableNotify = true;
-      }
-    }
-  }      
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IADTObject.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IADTObject.java
deleted file mode 100644
index 77d6b5f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IADTObject.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.facade;
-
-public interface IADTObject
-{
-    public void registerListener(IADTObjectListener listener);
-    public void unregisterListener(IADTObjectListener listener);  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IADTObjectListener.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IADTObjectListener.java
deleted file mode 100644
index 5fafdbf..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IADTObjectListener.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.facade;
-
-public interface IADTObjectListener
-{
-  public void propertyChanged(Object object, String property);  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IComplexType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IComplexType.java
deleted file mode 100644
index 3f3c4ea..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IComplexType.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.facade;
-
-
-
-public interface IComplexType extends IType, IStructure
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IField.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IField.java
deleted file mode 100644
index a0c85d2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IField.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IField extends IADTObject
-{
-  String getKind();
-  String getName();
-  String getTypeName();
-  String getTypeNameQualifier();
-  IModel getModel();
-  IType getType();
-  IComplexType getContainerType();
-  int getMinOccurs();
-  int getMaxOccurs();
-  boolean isGlobal();
-  boolean isReadOnly();
-  
-  Command getUpdateMinOccursCommand(int minOccurs);
-  Command getUpdateMaxOccursCommand(int maxOccurs);
-  Command getUpdateTypeNameCommand(String typeName, String quailifier);
-  Command getUpdateNameCommand(String name); 
-  Command getDeleteCommand();  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IModel.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IModel.java
deleted file mode 100644
index 7e904b2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IModel.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.facade;
-
-import java.util.List;
-
-public interface IModel extends IADTObject
-{
-  List getTypes();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IStructure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IStructure.java
deleted file mode 100644
index 3e0e012..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IStructure.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.facade;
-
-import java.util.List;
-import org.eclipse.gef.commands.Command;
-
-public interface IStructure extends IADTObject
-{
-  String getName();
-  List getFields();
-  IModel getModel();
-  Command getAddNewFieldCommand(String fieldKind);
-  Command getDeleteCommand();  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IType.java
deleted file mode 100644
index 1cbe3aa..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/facade/IType.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IType extends IADTObject
-{ 
-  IType getSuperType();
-  String getName();
-  String getQualifier();
-  boolean isComplexType();
-  boolean isReadOnly();
-  boolean isFocusAllowed();
-  
-  Command getUpdateNameCommand(String newName);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTContentOutlinePage.java
deleted file mode 100644
index 0765069..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTContentOutlinePage.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.outline;
-
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.wst.xsd.adt.design.DesignViewContextMenuProvider;
-import org.eclipse.wst.xsd.adt.editor.ADTMultiPageEditor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class ADTContentOutlinePage extends ContentOutlinePage
-{
-  protected ADTMultiPageEditor editor;
-  protected int level = 0;
-  protected Object model;
-  protected ITreeContentProvider contentProvider;
-  protected ILabelProvider labelProvider;
-  protected MultiPageSelectionProvider selectionManager;
-  protected SelectionManagerSelectionChangeListener selectionManagerSelectionChangeListener = new SelectionManagerSelectionChangeListener();
-  protected TreeSelectionChangeListener treeSelectionChangeListener = new TreeSelectionChangeListener();
-
-  /**
-   * 
-   */
-  public ADTContentOutlinePage(ADTMultiPageEditor editor)
-  {
-    super();
-    this.editor = editor;
-  }
-
-  public void setModel(Object newModel)
-  {
-    model = newModel;
-  }
-
-  public void setContentProvider(ITreeContentProvider contentProvider)
-  {
-    this.contentProvider = contentProvider;
-  }
-
-  public void setLabelProvider(ILabelProvider labelProvider)
-  {
-    this.labelProvider = labelProvider;
-  }
-
-  // expose
-  public TreeViewer getTreeViewer()
-  {
-    return super.getTreeViewer();
-  }
-
-  public void createControl(Composite parent)
-  {
-    super.createControl(parent);
-    getTreeViewer().setContentProvider(contentProvider);
-    getTreeViewer().setLabelProvider(labelProvider);
-    getTreeViewer().setInput(model);
-    getTreeViewer().addSelectionChangedListener(this);
-    MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
-    menuManager.setRemoveAllWhenShown(true);
-    Menu menu = menuManager.createContextMenu(getTreeViewer().getControl());
-    getTreeViewer().getControl().setMenu(menu);
-    setSelectionManager(editor.getSelectionManager());
-    
-    // Create menu...for now reuse graph's.  Note edit part viewer = null
-    DesignViewContextMenuProvider menuProvider = new DesignViewContextMenuProvider(editor, null, (ISelectionProvider)editor.getSelectionManager());
-    menuManager.addMenuListener(menuProvider);
-    getSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.outline", menuManager, editor.getSelectionManager());
-
-    // enable popupMenus extension
-    // getSite().registerContextMenu("org.eclipse.wst.xsdeditor.ui.popup.outline",
-    // menuManager, xsdEditor.getSelectionManager());
-
-    // cs... why are we doing this from the outline view?
-    //
-    // xsdTextEditor.getXSDEditor().getSelectionManager().setSelection(new
-    // StructuredSelection(xsdTextEditor.getXSDSchema()));
-    // drill down from outline view
-    getTreeViewer().getControl().addMouseListener(new MouseAdapter()
-    {
-      public void mouseDoubleClick(MouseEvent e)
-      {
-        ISelection iSelection = getTreeViewer().getSelection();
-        if (iSelection instanceof StructuredSelection)
-        {
-          StructuredSelection selection = (StructuredSelection) iSelection;
-          Object obj = selection.getFirstElement();
-          if (obj instanceof XSDConcreteComponent)
-          {
-            XSDConcreteComponent comp = (XSDConcreteComponent) obj;
-            if (comp.getContainer() instanceof XSDSchema)
-            {
-              // getXSDEditor().getGraphViewer().setInput(obj);
-            }
-          }
-        }
-
-      }
-    });
-  }
-
-  class XSDKeyListener extends KeyAdapter
-  {
-  }
-
-  public void dispose()
-  {
-    contentProvider.dispose();
-    super.dispose();
-  }
-
-  public void setExpandToLevel(int i)
-  {
-    level = i;
-  }
-
-  public void setInput(Object value)
-  {
-    getTreeViewer().setInput(value);
-    getTreeViewer().expandToLevel(level);
-  }
-
-  // public ISelection getSelection()
-  // {
-  // if (getTreeViewer() == null)
-  // return StructuredSelection.EMPTY;
-  // return getTreeViewer().getSelection();
-  // }
-  public void setSelectionManager(MultiPageSelectionProvider newSelectionManager)
-  {
-    TreeViewer treeViewer = getTreeViewer();
-    // disconnect from old one
-    if (selectionManager != null)
-    {
-      selectionManager.removeSelectionChangedListener(selectionManagerSelectionChangeListener);
-      treeViewer.removeSelectionChangedListener(treeSelectionChangeListener);
-    }
-    selectionManager = newSelectionManager;
-    // connect to new one
-    if (selectionManager != null)
-    {
-      selectionManager.addSelectionChangedListener(selectionManagerSelectionChangeListener);
-      treeViewer.addSelectionChangedListener(treeSelectionChangeListener);
-    }
-  }
-
-  class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
-  {
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      if (event.getSelectionProvider() != getTreeViewer())
-      {
-        getTreeViewer().setSelection(event.getSelection(), true);
-      }
-    }
-  }
-
-  class TreeSelectionChangeListener implements ISelectionChangedListener
-  {
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      if (selectionManager != null)
-      {
-        ISelection selection = event.getSelection();
-        if (selection instanceof IStructuredSelection)
-        {
-          IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-          Object o = structuredSelection.getFirstElement();
-          if (o != null)
-          {
-            selectionManager.setSelection(structuredSelection);
-          }
-        }
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTContentOutlineProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTContentOutlineProvider.java
deleted file mode 100644
index 0264e9c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTContentOutlineProvider.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.outline;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.xsd.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.adt.facade.IADTObjectListener;
-
-public class ADTContentOutlineProvider implements ITreeContentProvider, IADTObjectListener
-{
-  protected Viewer viewer = null;
-  protected Object oldInput, newInput;
-
-  public ADTContentOutlineProvider()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
-   */
-  public Object[] getChildren(Object parentElement)
-  {
-    if (parentElement instanceof ITreeElement)
-    {
-      Object[] children = ((ITreeElement) parentElement).getChildren();
-      if (children != null)
-      {
-        int length = children.length;
-        for (int i = 0; i < length; i++)
-        {
-          Object child = children[i];
-          if (child instanceof IADTObject)
-          {
-            ((IADTObject) child).registerListener(this);
-          }
-        }
-      }
-      return children;
-    }
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
-   */
-  public Object getParent(Object element)
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
-   */
-  public boolean hasChildren(Object element)
-  {
-    if (element instanceof ITreeElement)
-    {
-      return ((ITreeElement) element).hasChildren();
-    }
-    return false;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
-   */
-  public Object[] getElements(Object inputElement)
-  {
-    return getChildren(inputElement);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IContentProvider#dispose()
-   */
-  public void dispose()
-  {
-    Object input = viewer.getInput();
-    if (input instanceof IADTObject)
-    {
-      removeListener((IADTObject) input);
-    }
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
-   */
-  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-  {
-    this.viewer = viewer;
-    this.oldInput = oldInput;
-    this.newInput = newInput;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xsd.adt.facade.IADTObjectListener#propertyChanged(java.lang.Object, java.lang.String)
-   */
-  public void propertyChanged(Object object, String property)
-  {
-    if (viewer instanceof TreeViewer)
-    {
-      TreeViewer treeViewer = (TreeViewer) viewer;
-      treeViewer.refresh(object);
-      treeViewer.reveal(object);
-    }
-  }
-
-  /**
-   * @param model
-   */
-  private void removeListener(IADTObject model)
-  {
-    model.unregisterListener(this);
-    Object[] children = getChildren(model);
-    if (children != null)
-    {
-      int length = children.length;
-      for (int i = 0; i < length; i++)
-      {
-        Object child = children[i];
-        if (child instanceof IADTObject)
-        {
-          removeListener((IADTObject) child);
-        }
-      }
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTLabelProvider.java
deleted file mode 100644
index d662507..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ADTLabelProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.outline;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-
-public class ADTLabelProvider implements ILabelProvider
-{
-
-  public ADTLabelProvider()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-   */
-  public Image getImage(Object element)
-  {
-    if (element instanceof ITreeElement)
-    {
-      return ((ITreeElement)element).getImage();
-    }
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-   */
-  public String getText(Object element)
-  {
-    if (element instanceof ITreeElement)
-    {
-      return ((ITreeElement)element).getText();
-    }
-    return "";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
-   */
-  public void addListener(ILabelProviderListener listener)
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
-   */
-  public void dispose()
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
-   */
-  public boolean isLabelProperty(Object element, String property)
-  {
-    return false;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
-   */
-  public void removeListener(ILabelProviderListener listener)
-  {
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ITreeElement.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ITreeElement.java
deleted file mode 100644
index 49304a7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/outline/ITreeElement.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.outline;
-
-import org.eclipse.swt.graphics.Image;
-
-public interface ITreeElement
-{
-  public final static ITreeElement[] EMPTY_LIST = {};
-  ITreeElement[] getChildren();
-  ITreeElement getParent();
-  boolean hasChildren();
-  String getText();
-  Image getImage();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/properties/ADTTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/properties/ADTTabbedPropertySheetPage.java
deleted file mode 100644
index d31d2ee..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/adt/properties/ADTTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.adt.properties;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-
-public class ADTTabbedPropertySheetPage extends TabbedPropertySheetPage
-{
-  public ADTTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
-  {
-    super(tabbedPropertySheetPageContributor);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
-      Object selected = ((StructuredSelection)selection).getFirstElement();
-//      if (selected instanceof EditPart)
-//      {
-//        Object model = ((EditPart)selected).getModel();
-//        selection = new StructuredSelection(model);
-//      }
-      super.selectionChanged(part, selection);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDAttributeDeclarationAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDAttributeDeclarationAction.java
deleted file mode 100644
index f5b054e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDAttributeDeclarationAction.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDAttributeDeclarationCommand;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDAttributeDeclarationAction extends XSDBaseAction
-{
-  public static String ID = "AddXSDAttributeAction";
-
-  public AddXSDAttributeDeclarationAction(IWorkbenchPart part)
-  {
-    super(part);
-    setText("Add Attribute");
-    setId(ID);
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    if (selection instanceof XSDBaseAdapter)
-    {
-      selection = ((XSDBaseAdapter) selection).getTarget();
-    }
-    AddXSDAttributeDeclarationCommand command = null;
-    if (selection instanceof XSDComplexTypeDefinition)
-    {
-      command = new AddXSDAttributeDeclarationCommand("Add Attribute", (XSDComplexTypeDefinition) selection);
-      getCommandStack().execute(command);
-    }
-    else if (selection instanceof XSDAttributeUse)
-    {
-      XSDAttributeUse xsdAttributeUse = (XSDAttributeUse) selection;
-      XSDConcreteComponent parent = null;
-      XSDComplexTypeDefinition ct = null;
-      for (parent = xsdAttributeUse.getContainer(); parent != null;)
-      {
-        if (parent instanceof XSDComplexTypeDefinition)
-        {
-          ct = (XSDComplexTypeDefinition) parent;
-          break;
-        }
-        parent = parent.getContainer();
-      }
-      if (ct != null)
-      {
-        command = new AddXSDAttributeDeclarationCommand("Add Attribute", ct);
-        getCommandStack().execute(command);
-      }
-    }
-    else if (selection instanceof XSDAttributeGroupDefinition)
-    {
-      command = new AddXSDAttributeDeclarationCommand("Add Attribute", (XSDAttributeGroupDefinition)selection);
-      getCommandStack().execute(command);
-    }
-    else if (selection instanceof XSDSchema)
-    {
-      command = new AddXSDAttributeDeclarationCommand("Add Attribute", (XSDSchema)selection);
-      getCommandStack().execute(command);
-    }
-    
-    if (command != null)
-    {
-      Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
-      if (adapter != null)
-        provider.setSelection(new StructuredSelection(adapter));
-    }
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDAttributeGroupDefinitionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDAttributeGroupDefinitionAction.java
deleted file mode 100644
index 29daef2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDAttributeGroupDefinitionAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDAttributeGroupDefinitionCommand;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDAttributeGroupDefinitionAction extends XSDBaseAction
-{
-  public static String ID = "AddXSDAttributeGroupDefinitionAction";
-
-  public AddXSDAttributeGroupDefinitionAction(IWorkbenchPart part)
-  {
-    super(part);
-    setText("Add Attribute Group");
-    setId(ID);
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    if (selection instanceof XSDBaseAdapter)
-    {
-      selection = ((XSDBaseAdapter) selection).getTarget();
-    }
-
-    AddXSDAttributeGroupDefinitionCommand command = null;
-    if (selection instanceof XSDComplexTypeDefinition)
-    {
-      command = new AddXSDAttributeGroupDefinitionCommand("Add Attribute Group Ref", (XSDComplexTypeDefinition) selection);
-      getCommandStack().execute(command);
-    }
-    else if (selection instanceof XSDSchema)
-    {
-      command = new AddXSDAttributeGroupDefinitionCommand("Add Attribute Group Definition", (XSDSchema) selection);
-      getCommandStack().execute(command);
-    }
-
-    if (command != null)
-    {
-      Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
-      if (adapter != null)
-        provider.setSelection(new StructuredSelection(adapter));
-    }
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDComplexTypeDefinitionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDComplexTypeDefinitionAction.java
deleted file mode 100644
index 2c9cb5e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDComplexTypeDefinitionAction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDComplexTypeDefinitionCommand;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDComplexTypeDefinitionAction extends XSDBaseAction
-{
-  public static final String ID = "org.eclipse.wst.xsd.editor.AddXSDComplexTypeDefinitionAction";
-
-  public AddXSDComplexTypeDefinitionAction(IWorkbenchPart part)
-  {
-    super(part);
-    setText("Add Complex Type");
-    setId(ID);
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    if (selection instanceof XSDBaseAdapter)
-    {
-      selection = ((XSDBaseAdapter) selection).getTarget();
-    }
-
-    if (selection instanceof XSDSchema)
-    {
-      AddXSDComplexTypeDefinitionCommand command = new AddXSDComplexTypeDefinitionCommand("Add Complex Type", (XSDSchema) selection);
-      getCommandStack().execute(command);
-      Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
-      if (adapter != null)
-        provider.setSelection(new StructuredSelection(adapter));
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDElementAction.java
deleted file mode 100644
index cb0482d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDElementAction.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDElementCommand;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-//revisit this and see if we can reuse AddFieldAction??
-
-public class AddXSDElementAction extends XSDBaseAction
-{
-  public static String ID = "org.eclipse.wst.xsd.ui.common.actions.AddXSDElementAction";
-  public static String REF_ID = "org.eclipse.wst.xsd.ui.common.actions.AddXSDElementReferenceAction";
-  boolean isReference;
-  
-  public AddXSDElementAction(IWorkbenchPart part, String id, String label, boolean isReference)
-  {
-    super(part);
-    setText(label);
-    setId(id);
-    this.isReference = isReference;
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    if (selection instanceof XSDBaseAdapter)
-    {
-      selection = ((XSDBaseAdapter) selection).getTarget();
-    }
-    AddXSDElementCommand command = null;
-    if (selection instanceof XSDComplexTypeDefinition)
-    {
-      command = new AddXSDElementCommand(getText(), (XSDComplexTypeDefinition) selection);
-      command.setReference(isReference);
-      getCommandStack().execute(command);
-    }
-    else if (selection instanceof XSDModelGroupDefinition)
-    {
-      command = new AddXSDElementCommand(getText(), (XSDModelGroupDefinition) selection);
-      command.setReference(isReference);
-      getCommandStack().execute(command);
-    }
-    else if (selection instanceof XSDSchema)
-    {
-      command = new AddXSDElementCommand(getText(), (XSDSchema) selection);
-      getCommandStack().execute(command);
-    }
-    else if (selection instanceof XSDModelGroup)
-    {
-      XSDModelGroup modelGroup = (XSDModelGroup) selection;
-      XSDConcreteComponent component = modelGroup.getContainer();
-      XSDComplexTypeDefinition ct = null;
-      while (component != null)
-      {
-        if (component instanceof XSDComplexTypeDefinition)
-        {
-          ct = (XSDComplexTypeDefinition) component;
-          break;
-        }
-        component = component.getContainer();
-      }
-
-      if (ct != null)
-      {
-        command = new AddXSDElementCommand(getText(), (XSDModelGroup) selection, ct);
-      }
-      else
-      {
-        command = new AddXSDElementCommand(getText(), (XSDModelGroup) selection);
-      }
-      command.setReference(isReference);
-      getCommandStack().execute(command);
-    }
-    else if (selection instanceof XSDElementDeclaration || selection instanceof XSDAttributeUse)
-    {
-      XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent) selection;
-      XSDConcreteComponent parent = null;
-      XSDComplexTypeDefinition ct = null;
-      for (parent = xsdConcreteComponent.getContainer(); parent != null; )
-      {
-        if (parent instanceof XSDComplexTypeDefinition)
-        {
-          ct = (XSDComplexTypeDefinition)parent;
-          break;
-        }
-        parent = parent.getContainer();
-      }
-      if (ct != null)
-      {
-        command = new AddXSDElementCommand(getText(), ct);
-        command.setReference(isReference);
-        getCommandStack().execute(command);
-      }
-    }
-    
-    if (command != null)
-    {
-      Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
-      if (adapter != null)
-        provider.setSelection(new StructuredSelection(adapter));
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDModelGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDModelGroupAction.java
deleted file mode 100644
index 4fc6840..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDModelGroupAction.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDModelGroupCommand;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-
-public class AddXSDModelGroupAction extends XSDBaseAction
-{
-  public static String SEQUENCE_ID = "AddXSDSequenceModelGroupAction";
-  public static String CHOICE_ID = "AddXSDChoiceModelGroupAction";
-  public static String ALL_ID = "AddXSDAllModelGroupAction";
-  XSDCompositor xsdCompositor;
-
-  public AddXSDModelGroupAction(IWorkbenchPart part, XSDCompositor compositor, String ID)
-  {
-    super(part);
-    setText(getLabel(compositor));
-    setId(ID);
-    this.xsdCompositor = compositor;
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-    if (selection instanceof XSDBaseAdapter)
-    {
-      XSDConcreteComponent xsdComponent = (XSDConcreteComponent) ((XSDBaseAdapter) selection).getTarget();
-      AddXSDModelGroupCommand command = null;
-      if (xsdComponent instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) xsdComponent;
-
-        command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdElementDeclaration, xsdCompositor);
-        getCommandStack().execute(command);
-      }
-      else if (xsdComponent instanceof XSDModelGroup)
-      {
-        XSDModelGroup xsdModelGroup = (XSDModelGroup) xsdComponent;
-
-        command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdModelGroup, xsdCompositor);
-        getCommandStack().execute(command);
-      }
-      else if (xsdComponent instanceof XSDComplexTypeDefinition)
-      {
-        command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdComponent, xsdCompositor);
-        getCommandStack().execute(command);
-      }
-     
-      if (command != null)
-      {
-        Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
-        if (adapter != null)
-          provider.setSelection(new StructuredSelection(adapter));
-      }
-
-    }
-  }
-
-  private String getLabel(XSDCompositor compositor)
-  {
-    String result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SEQUENCE"); //$NON-NLS-1$
-    if (compositor != null)
-    {
-      if (compositor == XSDCompositor.CHOICE_LITERAL)
-      {
-        result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CHOICE"); //$NON-NLS-1$
-      }
-      else if (compositor == XSDCompositor.ALL_LITERAL)
-      {
-        result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ALL");//$NON-NLS-1$
-      }
-    }
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDModelGroupDefinitionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDModelGroupDefinitionAction.java
deleted file mode 100644
index 2f2a542..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDModelGroupDefinitionAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDModelGroupDefinitionCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class AddXSDModelGroupDefinitionAction extends XSDBaseAction
-{
-  public static final String MODELGROUPDEFINITION_ID = "AddXSDModelGroupDefinitionAction";
-  public static final String MODELGROUPDEFINITIONREF_ID = "AddXSDModelGroupDefinitionRefAction";
-  boolean isReference;
-
-  public AddXSDModelGroupDefinitionAction(IWorkbenchPart part, boolean isReference)
-  {
-    super(part);
-    this.isReference = isReference;
-    if (isReference)
-    {
-      setText("Add Group Ref");
-      setId(MODELGROUPDEFINITION_ID);
-    }
-    else
-    {
-      setText("Add Group");
-      setId(MODELGROUPDEFINITIONREF_ID);
-    }
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-    XSDConcreteComponent xsdConcreteComponent = null;
-    if (selection instanceof XSDBaseAdapter)
-    {
-      xsdConcreteComponent = (XSDConcreteComponent) ((XSDBaseAdapter) selection).getTarget();
-    }
-    if (xsdConcreteComponent != null)
-    {
-      AddXSDModelGroupDefinitionCommand command = new AddXSDModelGroupDefinitionCommand(getText(), xsdConcreteComponent, isReference);
-      getCommandStack().execute(command);
-      Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
-      if (adapter != null)
-        provider.setSelection(new StructuredSelection(adapter));
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDSimpleTypeDefinitionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDSimpleTypeDefinitionAction.java
deleted file mode 100644
index 14ee444..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/AddXSDSimpleTypeDefinitionAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.AddXSDSimpleTypeDefinitionCommand;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDSimpleTypeDefinitionAction extends XSDBaseAction
-{
-  public static final String ID = "org.eclipse.wst.xsd.editor.AddXSDSimpleTypeDefinitionAction";
-
-  public AddXSDSimpleTypeDefinitionAction(IWorkbenchPart part)
-  {
-    super(part);
-    setText("Add Simple Type");
-    setId(ID);
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    if (selection instanceof XSDBaseAdapter)
-    {
-      selection = ((XSDBaseAdapter) selection).getTarget();
-    }
-
-    if (selection instanceof XSDSchema)
-    {
-      AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand("Add Simple Type", (XSDSchema) selection);
-      getCommandStack().execute(command);
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/DeleteXSDConcreteComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/DeleteXSDConcreteComponentAction.java
deleted file mode 100644
index ff9b772..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/DeleteXSDConcreteComponentAction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.DeleteCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class DeleteXSDConcreteComponentAction extends XSDBaseAction
-{
-  public static final String DELETE_XSD_COMPONENT_ID = "org.eclipse.wst.xsd.ui.common.actions.DeleteXSDConcreteComponentAction";   //$NON-NLS-1$
-
-  public DeleteXSDConcreteComponentAction(IWorkbenchPart part)
-  {
-    super(part);
-    setText("Delete");
-    setId(DELETE_XSD_COMPONENT_ID);
-    setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/delete_obj.gif") );
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    if (selection instanceof XSDBaseAdapter)
-    {
-      selection = ((XSDBaseAdapter) selection).getTarget();
-    }
-
-    if (selection instanceof XSDConcreteComponent)
-    {
-      DeleteCommand command = new DeleteCommand(getText(), (XSDConcreteComponent) selection);
-      getCommandStack().execute(command);
-    }
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/OpenInNewEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/OpenInNewEditor.java
deleted file mode 100644
index 1e781a7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/OpenInNewEditor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.editor.InternalXSDMultiPageEditor;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-
-public class OpenInNewEditor extends BaseSelectionAction
-{
-  public static final String ID = "OpenInNewEditor";
-
-  public OpenInNewEditor(IWorkbenchPart part)
-  {
-    super(part);
-    setText("Open In New Editor");
-    setId(ID);
-  }
-
-  protected boolean calculateEnabled()
-  {
-    return true;
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    if (selection instanceof XSDComplexTypeDefinitionAdapter)
-    {
-      XSDComplexTypeDefinitionAdapter xsdAdapter = (XSDComplexTypeDefinitionAdapter) selection;
-      XSDComplexTypeDefinition fComponent = (XSDComplexTypeDefinition) xsdAdapter.getTarget();
-
-      if (fComponent.getSchema() != null)
-      {
-        String schemaLocation = URIHelper.removePlatformResourceProtocol(fComponent.getSchema().getSchemaLocation());
-        IPath schemaPath = new Path(schemaLocation);
-        IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-        if (schemaFile != null && schemaFile.exists())
-        {
-          IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-          if (workbenchWindow != null)
-          {
-            IWorkbenchPage page = workbenchWindow.getActivePage();
-            try
-            {
-              // TODO: Should use this to open in default editor
-              // IEditorPart editorPart = IDE.openEditor(page, schemaFile, true);
-              IEditorPart editorPart = page.openEditor(new FileEditorInput(schemaFile), "org.eclipse.wst.xsd.editor.InternalXSDMultiPageEditor", true);
-
-              if (editorPart instanceof InternalXSDMultiPageEditor)
-              {
-                InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor) editorPart;
-
-                xsdEditor.openOnGlobalReference(fComponent);
-              }
-
-            }
-            catch (PartInitException pie)
-            {
-            }
-          }
-        }
-      }
-
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/SetMultiplicityAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/SetMultiplicityAction.java
deleted file mode 100644
index ad92a70..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/SetMultiplicityAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.SetMultiplicityCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class SetMultiplicityAction extends XSDBaseAction
-{
-  public static String REQUIRED_ID = "org.eclipse.wst.xsd.ui.common.actions.SetMultiplicity.REQUIRED_ID";
-  public static String ZERO_OR_ONE_ID = "org.eclipse.wst.xsd.ui.common.actions.SetMultiplicity.ZERO_OR_ONE_ID";
-  public static String ZERO_OR_MORE_ID = "org.eclipse.wst.xsd.ui.common.actions.SetMultiplicity.ZERO_OR_MORE_ID";
-  public static String ONE_OR_MORE_ID = "org.eclipse.wst.xsd.ui.common.actions.SetMultiplicity.ONE_OR_MORE_ID";
-  
-  SetMultiplicityCommand command;
-  
-  public SetMultiplicityAction(IWorkbenchPart part, String label, String ID)
-  {
-    super(part);
-    setText(label);
-    setId(ID);
-    command = new SetMultiplicityCommand(label);
-  }
-  
-  public void setMaxOccurs(int i)
-  {
-    command.setMaxOccurs(i);
-  }
-
-  public void setMinOccurs(int i)
-  {
-    command.setMinOccurs(i);
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    XSDConcreteComponent xsdConcreteComponent = null;
-    if (selection instanceof XSDBaseAdapter)
-    {
-      xsdConcreteComponent = (XSDConcreteComponent)((XSDBaseAdapter) selection).getTarget();
-    }
-    if (xsdConcreteComponent != null)
-    {
-      command.setXSDConcreteComponent(xsdConcreteComponent);
-      getCommandStack().execute(command);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/SetTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/SetTypeAction.java
deleted file mode 100644
index 1040e95..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/SetTypeAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.commands.SetTypeCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class SetTypeAction extends XSDBaseAction
-{
-  public static final String SET_NEW_TYPE_ID = "SetTypeAction_AddType";
-  public static final String SELECT_EXISTING_TYPE_ID = "SetTypeAction_ExistingType";
-
-  SetTypeCommand command;
-
-  public SetTypeAction(String label, String ID, IWorkbenchPart part)
-  {
-    super(part);
-    setText(label);
-    setId(ID);
-  }
-
-  public void run()
-  {
-    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
-    if (selection instanceof XSDBaseAdapter)
-    {
-      Object target = ((XSDBaseAdapter) selection).getTarget();
-
-      if (target instanceof XSDConcreteComponent)
-      {
-        command = new SetTypeCommand(getText(), getId(), (XSDConcreteComponent) target);
-        command.setAdapter((XSDBaseAdapter) selection);
-        getCommandStack().execute(command);
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/XSDBaseAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/XSDBaseAction.java
deleted file mode 100644
index 7374229..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/actions/XSDBaseAction.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDBaseAction extends BaseSelectionAction
-{
-
-  public XSDBaseAction(IWorkbenchPart part)
-  {
-    super(part);
-  }
-
-  protected boolean calculateEnabled()
-  {
-    if (getWorkbenchPart() instanceof IEditorPart)
-    {
-      IEditorPart owningEditor = (IEditorPart)getWorkbenchPart();
-      
-      Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-      if (selection instanceof XSDBaseAdapter)
-      {
-        selection = ((XSDBaseAdapter) selection).getTarget();
-      }
-      XSDSchema xsdSchema = null;
-      if (selection instanceof XSDConcreteComponent)
-      {
-        xsdSchema = ((XSDConcreteComponent)selection).getSchema();
-      }
-      
-      if (xsdSchema != null && xsdSchema == owningEditor.getAdapter(XSDSchema.class))
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoAttributeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoAttributeCommand.java
deleted file mode 100644
index 7d4117d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoAttributeCommand.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class AddAppInfoAttributeCommand extends AddAppInfoCommand
-{
-  private static DOMNamespaceInfoManager manager = new DOMNamespaceInfoManager();
-  private XSDAttributeDeclaration attribute;
-  private boolean appInfoAttributeAdded = false;
-  private boolean prefixAdded = false;
-  private String attributeQName;
-  private String namespacePrefix;
-  
-  XSDConcreteComponent component;
-
-
-  public AddAppInfoAttributeCommand(String label, XSDConcreteComponent component,
-      XSDAttributeDeclaration attribute)
-  {
-    super(label);
-    this.component = component;
-    this.attribute = attribute;
-  }
-
-  public void execute()
-  {
-    namespacePrefix = handleNamespacePrefices();
-    
-    attributeQName = namespacePrefix + ":" + attribute.getName();
-    String value = component.getElement().getAttribute(attributeQName);
-    if ( value == null) {
-      appInfoAttributeAdded = true;
-      component.getElement().setAttribute(attributeQName, "");
-    }
-  }
-
-  public void undo()
-  {
-    super.undo();
-    // TODO (allison) remove the namespace prefix when applicable as well
-    if (appInfoAttributeAdded){
-      component.getElement().removeAttribute(attributeQName);
-    }
-  }
-
-  /** Create a namespace prefix if needed, other wise retrieve 
-   * a predefined namespace prefix
-   * @return   */
-  private String handleNamespacePrefices()
-  {
-    Element schemaElement = component.getSchema().getElement();
-    String prefix = null;
-    
-    // If target namespace of the attribute already exists
-    List namespacePrefices = manager.getNamespaceInfoList(schemaElement);
-    for (int i = 0; i < namespacePrefices.size(); i++){
-      NamespaceInfo info = (NamespaceInfo) namespacePrefices.get(i);
-      if ( info.uri.equals(attribute.getTargetNamespace())) {
-        prefix = info.prefix;
-      }
-    }
-    
-    // Create unquie namespace prefix
-    if ( prefix == null){
-      prefixAdded = true;
-      prefix = createUniquePrefix(component);
-    }
-
-    NamespaceInfo info = new NamespaceInfo(attribute.getTargetNamespace(), prefix, "");
-    List infoList = new ArrayList(1);
-    infoList.add(info);
-    manager.addNamespaceInfo(schemaElement, infoList, false);
-    return prefix;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoCommand.java
deleted file mode 100644
index 133cd8e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoCommand.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.Map;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.ui.common.properties.sections.appinfo.SpecificationForAppinfoSchema;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class AddAppInfoCommand extends Command
-{
-  protected SpecificationForAppinfoSchema appInfoSchemaSpec;
-
-  protected AddAppInfoCommand(String label)
-  {
-    super(label);
-  }
-
-  public void setSchemaProperties(SpecificationForAppinfoSchema appInfoSchemaSpec)
-  {
-    this.appInfoSchemaSpec = appInfoSchemaSpec;
-  }
-  
-  protected String createUniquePrefix(XSDConcreteComponent component)
-  {
-    String prefix = "sdo";
-    Map prefMapper = component.getSchema().getQNamePrefixToNamespaceMap();
-    if ( prefMapper.get(prefix) != null){
-      int i = 1;
-      while ( prefMapper.get(prefix + i) != null)
-        i++;
-      prefix += i;
-    }
-    return prefix;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoElementCommand.java
deleted file mode 100644
index a0cbe17..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddAppInfoElementCommand.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.common.properties.sections.appinfo.SpecificationForAppinfoSchema;
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AddAppInfoElementCommand extends AddAppInfoCommand
-{
-  XSDConcreteComponent input;
-  XSDElementDeclaration element;
-  Element appInfo;
-
-  public AddAppInfoElementCommand(String label, XSDConcreteComponent input, XSDElementDeclaration element)
-  {
-    super(label);
-    this.input = input;
-    this.element = element;
-  }
-
-  public void execute()
-  {
-    super.execute();
-    addAnnotationSet(input.getSchema(), appInfoSchemaSpec);
-  }
-
-  public void undo()
-  {
-    super.undo();
-    XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(input, false);
-    xsdAnnotation.getElement().removeChild(appInfo);
-    List appInfos = xsdAnnotation.getApplicationInformation();
-    appInfos.remove(appInfo);
-    xsdAnnotation.updateElement();
-
-  }
-
-  public void setSchemaProperties(SpecificationForAppinfoSchema appInfoSchemaSpec)
-  {
-    this.appInfoSchemaSpec = appInfoSchemaSpec;
-  }
-
-  public void addAnnotationSet(XSDSchema xsdSchema, SpecificationForAppinfoSchema asiSpec)
-  {
-    XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(input, true);
-    addAnnotationSet(asiSpec, xsdAnnotation);
-  }
-
-  private void addAnnotationSet(SpecificationForAppinfoSchema asiProperties, XSDAnnotation xsdAnnotation)
-  {
-    appInfo = xsdAnnotation.createApplicationInformation(asiProperties.getNamespaceURI());
-
-    if (appInfo != null)
-    {
-      Document doc = appInfo.getOwnerDocument();
-
-      Element rootElement = doc.createElementNS(asiProperties.getNamespaceURI(), element.getName());
-      
-      String prefix = createUniquePrefix(input);
-      rootElement.setPrefix(prefix);
-
-      Attr nsURIAttribute = doc.createAttribute("xmlns:"+prefix);
-      nsURIAttribute.setValue(asiProperties.getNamespaceURI());
-      rootElement.setAttributeNode(nsURIAttribute);
-      appInfo.appendChild(rootElement);
-
-      xsdAnnotation.getElement().appendChild(appInfo);
-      List appInfos = xsdAnnotation.getApplicationInformation();
-      appInfos.add(appInfo);
-      xsdAnnotation.updateElement();
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddDocumentationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddDocumentationCommand.java
deleted file mode 100644
index 8ed0c27..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddDocumentationCommand.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AddDocumentationCommand extends BaseCommand
-{
-  XSDAnnotation xsdAnnotation;
-  XSDConcreteComponent input;
-  String newValue, oldValue;
-  boolean documentationExists;
-  Element documentationElement;
-
-  public AddDocumentationCommand(String label, XSDAnnotation xsdAnnotation, XSDConcreteComponent input, String newValue, String oldValue)
-  {
-    super(label);
-    this.xsdAnnotation = xsdAnnotation;
-    this.input = input;
-    this.newValue = newValue;
-    this.oldValue = oldValue;
-  }
-
-  public void execute()
-  {
-    xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation((XSDConcreteComponent) input, true);
-    Element element = xsdAnnotation.getElement();
-
-    List documentationList = xsdAnnotation.getUserInformation();
-    documentationElement = null;
-    documentationExists = false;
-    if (documentationList.size() > 0)
-    {
-      documentationExists = true;
-      documentationElement = (Element) documentationList.get(0);
-    }
-
-    if (documentationElement == null)
-    {
-      documentationElement = xsdAnnotation.createUserInformation(null);
-      element.appendChild(documentationElement);
-      formatChild(documentationElement);
-      // Defect in model....I create it but the model object doesn't appear
-      // to be updated
-      xsdAnnotation.updateElement();
-      xsdAnnotation.setElement(element);
-    }
-
-    try
-    {
-      if (documentationElement.hasChildNodes())
-      {
-        if (documentationElement instanceof IDOMElement)
-        {
-          IDOMElement domElement = (IDOMElement) documentationElement;
-
-          Node firstChild = documentationElement.getFirstChild();
-          Node lastChild = documentationElement.getLastChild();
-          int start = 0;
-          int end = 0;
-
-          IDOMModel model = domElement.getModel();
-          IDOMDocument doc = model.getDocument();
-          IDOMNode first = null;
-          if (firstChild instanceof IDOMNode)
-          {
-            first = (IDOMNode) firstChild;
-            start = first.getStartOffset();
-          }
-          if (lastChild instanceof IDOMNode)
-          {
-            IDOMNode last = (IDOMNode) lastChild;
-            end = last.getEndOffset();
-          }
-
-          if (domElement != null)
-          {
-            oldValue = domElement.getModel().getStructuredDocument().get(start, end - start);
-            domElement.getModel().getStructuredDocument().replaceText(documentationElement, start, end - start, newValue);
-          }
-        }
-      }
-      else
-      {
-        if (newValue.length() > 0)
-        {
-          oldValue = "";
-          Node childNode = documentationElement.getOwnerDocument().createTextNode(newValue);
-          documentationElement.appendChild(childNode);
-        }
-      }
-    }
-    catch (Exception e)
-    {
-
-    }
-  }
-
-  public void undo()
-  {
-    super.undo();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddEnumerationsCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddEnumerationsCommand.java
deleted file mode 100644
index 90cdc4c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddEnumerationsCommand.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-
-public class AddEnumerationsCommand extends BaseCommand
-{
-  XSDSimpleTypeDefinition simpleType;
-  String value;
-  
-  public AddEnumerationsCommand(String label, XSDSimpleTypeDefinition simpleType)
-  {
-    super(label);
-    this.simpleType = simpleType;
-  }
-  
-  public void setValue(String value)
-  {
-    this.value = value; 
-  }
-
-  public void execute()
-  {
-    XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-    XSDEnumerationFacet enumerationFacet = factory.createXSDEnumerationFacet();
-    enumerationFacet.setLexicalValue(value);
-    simpleType.getFacetContents().add(enumerationFacet);
-    formatChild(simpleType.getElement());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddExtensibilityElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddExtensibilityElementCommand.java
deleted file mode 100644
index 26a2e7b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddExtensibilityElementCommand.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.ui.common.properties.sections.appinfo.SpecificationForAppinfoSchema;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AddExtensibilityElementCommand extends Command
-{
-  Element input, elementToAdd;
-  SpecificationForAppinfoSchema appInfoSchemaSpec;
-
-  public AddExtensibilityElementCommand(String label, Element input, Element elementToAdd)
-  {
-    super(label);
-    this.input = input;
-    this.elementToAdd = elementToAdd;
-  }
-
-  public void execute()
-  {
-    super.execute();
-    addElement();
-  }
-
-  public void undo()
-  {
-    super.undo();
-    // TODO
-  }
-
-  public void setSchemaProperties(SpecificationForAppinfoSchema appInfoSchemaSpec)
-  {
-    this.appInfoSchemaSpec = appInfoSchemaSpec;
-  }
-
-  private void addElement()
-  {
-    if (input != null)
-    {
-      Document doc = input.getOwnerDocument();
-      String name = elementToAdd.getAttribute("name");
-      try
-      {
-        Element rootElement = doc.createElementNS(appInfoSchemaSpec.getNamespaceURI(), name);
-        String prefix = input.getPrefix();
-        rootElement.setPrefix(prefix);
-        String xmlns = (prefix == null || prefix.equals("")) ? "xmlns" : "xmlns:" + prefix;
-        Attr nsURIAttribute = doc.createAttribute(xmlns);
-        nsURIAttribute.setValue(appInfoSchemaSpec.getNamespaceURI());
-        rootElement.setAttributeNode(nsURIAttribute);
-        input.appendChild(rootElement);
-
-      }
-      catch (Exception e)
-      {
-
-      }
-
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDAttributeDeclarationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDAttributeDeclarationCommand.java
deleted file mode 100644
index 0f0a15f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDAttributeDeclarationCommand.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Text;
-
-public class AddXSDAttributeDeclarationCommand extends BaseCommand
-{
-  XSDComplexTypeDefinition xsdComplexTypeDefinition;
-  XSDModelGroup xsdModelGroup;
-//  XSDSchema xsdSchema;
-  XSDConcreteComponent parent;
-
-  public AddXSDAttributeDeclarationCommand(String label, XSDComplexTypeDefinition xsdComplexTypeDefinition)
-  {
-    super(label);
-    this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
-  }
-  
-  public AddXSDAttributeDeclarationCommand(String label, XSDConcreteComponent parent)
-  {
-    super(label);
-    this.parent = parent;
-  }
-
-  public void execute()
-  {
-    XSDAttributeDeclaration attribute = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
-    if (parent == null)
-    {
-      attribute.setName(getNewName("Attribute")); //$NON-NLS-1$
-      attribute.setTypeDefinition(xsdComplexTypeDefinition.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$
-
-      XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
-      attributeUse.setAttributeDeclaration(attribute);
-      attributeUse.setContent(attribute);
-
-      if (xsdComplexTypeDefinition.getAttributeContents() != null)
-      {
-        xsdComplexTypeDefinition.getAttributeContents().add(attributeUse);
-        formatChild(xsdComplexTypeDefinition.getElement());
-      }
-      addedXSDConcreteComponent = attributeUse;
-    }
-    else
-    {
-      attribute.setTypeDefinition(parent.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$
-      if (parent instanceof XSDSchema)
-      {
-        attribute.setName(XSDCommonUIUtils.createUniqueElementName("NewAttribute", parent.getSchema().getAttributeDeclarations()));
-        XSDSchema xsdSchema = (XSDSchema)parent;
-        Text textNode = xsdSchema.getDocument().createTextNode("\n");
-        xsdSchema.getElement().appendChild(textNode);
-        xsdSchema.getContents().add(attribute);
-      }
-      else if (parent instanceof XSDAttributeGroupDefinition)
-      {
-        List list = new ArrayList();
-        Iterator i = ((XSDAttributeGroupDefinition)parent).getResolvedAttributeGroupDefinition().getAttributeUses().iterator();
-        while (i.hasNext())
-        {
-          XSDAttributeUse use = (XSDAttributeUse)i.next();
-          list.add(use.getAttributeDeclaration());
-        }
-        attribute.setName(XSDCommonUIUtils.createUniqueElementName("NewAttribute", list));
-        XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
-        attributeUse.setAttributeDeclaration(attribute);
-        attributeUse.setContent(attribute);
- 
-        ((XSDAttributeGroupDefinition)parent).getResolvedAttributeGroupDefinition().getContents().add(attributeUse);
-        formatChild(parent.getElement());
-      }
-      addedXSDConcreteComponent = attribute;
-    }
-  }
-
-  ArrayList names;
-
-  protected String getNewName(String description)
-  {
-    String candidateName = "New" + description; //$NON-NLS-1$
-    XSDConcreteComponent parent = xsdComplexTypeDefinition;
-    names = new ArrayList();
-    int i = 1;
-    if (parent instanceof XSDComplexTypeDefinition)
-    {
-      XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) parent;
-      walkUpInheritance(ct);
-
-      boolean ready = false;
-      while (!ready)
-      {
-        ready = true;
-        for (Iterator iter = names.iterator(); iter.hasNext();)
-        {
-          String attrName = (String) iter.next();
-          if (candidateName.equals(attrName))
-          {
-            ready = false;
-            candidateName = "New" + description + String.valueOf(i); //$NON-NLS-1$
-            i++;
-          }
-        }
-      }
-    }
-    return candidateName;
-  }
-
-  private void walkUpInheritance(XSDComplexTypeDefinition ct)
-  {
-    updateNames(ct);
-    XSDTypeDefinition typeDef = ct.getBaseTypeDefinition();
-    if (ct != ct.getRootType())
-    {
-      if (typeDef instanceof XSDComplexTypeDefinition)
-      {
-        XSDComplexTypeDefinition ct2 = (XSDComplexTypeDefinition) typeDef;
-        walkUpInheritance(ct2);
-      }
-    }
-  }
-
-  private void updateNames(XSDComplexTypeDefinition ct)
-  {
-    Iterator iter = ct.getAttributeContents().iterator();
-    while (iter.hasNext())
-    {
-      Object obj = iter.next();
-      if (obj instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse use = (XSDAttributeUse) obj;
-        XSDAttributeDeclaration attr = use.getAttributeDeclaration();
-        String attrName = attr.getName();
-        if (attrName != null)
-        {
-          names.add(attrName);
-        }
-      }
-    }
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDAttributeGroupDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDAttributeGroupDefinitionCommand.java
deleted file mode 100644
index 2bf259f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDAttributeGroupDefinitionCommand.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Text;
-
-public class AddXSDAttributeGroupDefinitionCommand extends BaseCommand
-{
-  XSDComplexTypeDefinition xsdComplexTypeDefinition;
-  XSDSchema xsdSchema;
-
-  public AddXSDAttributeGroupDefinitionCommand(String label, XSDComplexTypeDefinition xsdComplexTypeDefinition)
-  {
-    super(label);
-    this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
-  }
-
-  public AddXSDAttributeGroupDefinitionCommand(String label, XSDSchema xsdSchema)
-  {
-    super(label);
-    this.xsdSchema = xsdSchema;
-  }
-
-  public void execute()
-  {
-    XSDAttributeGroupDefinition attributeGroup = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
-    if (xsdSchema == null)
-    {
-      attributeGroup.setName(getNewName("AttributeGroup")); //$NON-NLS-1$
-
-      List list = xsdComplexTypeDefinition.getSchema().getAttributeGroupDefinitions();
-      if (list.size() > 0)
-      {
-        attributeGroup.setResolvedAttributeGroupDefinition((XSDAttributeGroupDefinition) list.get(0));
-      }
-      else
-      {
-        attributeGroup.setName(null);
-        XSDAttributeGroupDefinition attributeGroup2 = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
-        attributeGroup2.setName(XSDCommonUIUtils.createUniqueElementName("NewAttributeGroup", xsdComplexTypeDefinition.getSchema().getAttributeGroupDefinitions()));
-        xsdComplexTypeDefinition.getSchema().getContents().add(attributeGroup2);
-        attributeGroup.setResolvedAttributeGroupDefinition(attributeGroup2);
-      }
-
-      if (xsdComplexTypeDefinition.getAttributeContents() != null)
-      {
-        xsdComplexTypeDefinition.getAttributeContents().add(attributeGroup);
-      }
-      addedXSDConcreteComponent = attributeGroup;
-    }
-    else
-    {
-      attributeGroup.setName(XSDCommonUIUtils.createUniqueElementName("NewAttributeGroup", xsdSchema.getAttributeGroupDefinitions()));
-      Text textNode = xsdSchema.getDocument().createTextNode("\n");
-      xsdSchema.getElement().appendChild(textNode);
-      xsdSchema.getContents().add(attributeGroup);
-      addedXSDConcreteComponent = attributeGroup;
-    }
-  }
-
-  ArrayList names;
-
-  protected String getNewName(String description)
-  {
-    String candidateName = "New" + description; //$NON-NLS-1$
-    XSDConcreteComponent parent = xsdComplexTypeDefinition;
-    names = new ArrayList();
-    int i = 1;
-    if (parent instanceof XSDComplexTypeDefinition)
-    {
-      XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) parent;
-      walkUpInheritance(ct);
-
-      boolean ready = false;
-      while (!ready)
-      {
-        ready = true;
-        for (Iterator iter = names.iterator(); iter.hasNext();)
-        {
-          String attrName = (String) iter.next();
-          if (candidateName.equals(attrName))
-          {
-            ready = false;
-            candidateName = "New" + description + String.valueOf(i); //$NON-NLS-1$
-            i++;
-          }
-        }
-      }
-    }
-    return candidateName;
-  }
-
-  private void walkUpInheritance(XSDComplexTypeDefinition ct)
-  {
-    updateNames(ct);
-    XSDTypeDefinition typeDef = ct.getBaseTypeDefinition();
-    if (ct != ct.getRootType())
-    {
-      if (typeDef instanceof XSDComplexTypeDefinition)
-      {
-        XSDComplexTypeDefinition ct2 = (XSDComplexTypeDefinition) typeDef;
-        walkUpInheritance(ct2);
-      }
-    }
-  }
-
-  private void updateNames(XSDComplexTypeDefinition ct)
-  {
-    Iterator iter = ct.getAttributeContents().iterator();
-    while (iter.hasNext())
-    {
-      Object obj = iter.next();
-      if (obj instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse use = (XSDAttributeUse) obj;
-        XSDAttributeDeclaration attr = use.getAttributeDeclaration();
-        String attrName = attr.getName();
-        if (attrName != null)
-        {
-          names.add(attrName);
-        }
-      }
-    }
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDComplexTypeDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDComplexTypeDefinitionCommand.java
deleted file mode 100644
index 6cfe1af..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDComplexTypeDefinitionCommand.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-import org.w3c.dom.Text;
-
-public final class AddXSDComplexTypeDefinitionCommand extends BaseCommand
-{
-  protected XSDConcreteComponent parent;
-  protected XSDComplexTypeDefinition createdComplexType;
-  private String nameToAdd;
-  
-  public AddXSDComplexTypeDefinitionCommand(String label, XSDConcreteComponent parent)
-  {
-    super(label);
-    this.parent = parent;
-  }
-  
-  public void setNameToAdd(String nameToAdd)
-  {
-    this.nameToAdd = nameToAdd;
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.gef.commands.Command#execute()
-   */
-  public void execute()
-  {
-    XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-    XSDComplexTypeDefinition complexType = factory.createXSDComplexTypeDefinition();
-    addedXSDConcreteComponent = complexType;
-    String newName = getNewName(nameToAdd == null ? "NewXSDComplexType" : nameToAdd, parent.getSchema());
-    complexType.setName(newName);
-    if (parent instanceof XSDSchema)
-    {
-      try
-      {
-        XSDSchema xsdSchema = (XSDSchema)parent;
-        Text textNode = xsdSchema.getDocument().createTextNode("\n");
-        xsdSchema.getElement().appendChild(textNode);
-        xsdSchema.getContents().add(complexType);
-      }
-      catch (Exception e)
-      {
-        e.printStackTrace();
-      } 
-    }
-    else if (parent instanceof XSDElementDeclaration)
-    {
-      ((XSDElementDeclaration) parent).setAnonymousTypeDefinition((XSDComplexTypeDefinition) complexType);
-      formatChild(parent.getElement());
-    }
-    createdComplexType = complexType;
-  }
-
-  protected String getNewName(String description, XSDSchema schema)
-  {
-    String candidateName = description; //$NON-NLS-1$
-    int i = 1;
-
-    List list = schema.getTypeDefinitions();
-    List listOfNames = new ArrayList();
-    for (Iterator iter = list.iterator(); iter.hasNext();)
-    {
-      XSDTypeDefinition typeDef = (XSDTypeDefinition) iter.next();
-      String name = typeDef.getName();
-      if (name == null)
-        name = "";
-      if (typeDef.getTargetNamespace() == schema.getTargetNamespace())
-        listOfNames.add(name);
-    }
-
-    boolean flag = true;
-    while (flag)
-    {
-      if (!listOfNames.contains(candidateName))
-      {
-        flag = false;
-        break;
-      }
-      candidateName = description + String.valueOf(i); //$NON-NLS-1$
-      i++;
-    }
-
-    return candidateName;
-  }
-
-  public XSDComplexTypeDefinition getCreatedComplexType()
-  {
-    return createdComplexType;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDElementCommand.java
deleted file mode 100644
index efa2dda..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDElementCommand.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-import org.w3c.dom.Text;
-
-public class AddXSDElementCommand extends BaseCommand
-{
-  XSDComplexTypeDefinition xsdComplexTypeDefinition;
-  XSDModelGroupDefinition xsdModelGroupDefinition;
-  XSDModelGroup xsdModelGroup;
-  XSDSchema xsdSchema;
-  boolean isReference;
-private String nameToAdd;
-
-  public AddXSDElementCommand()
-  {
-    super();
-  }
-
-  public AddXSDElementCommand(String label, XSDComplexTypeDefinition xsdComplexTypeDefinition)
-  {
-    super(label);
-    this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
-    xsdModelGroup = getModelGroup(xsdComplexTypeDefinition);
-  }
-
-  public AddXSDElementCommand(String label, XSDModelGroupDefinition xsdModelGroupDefinition)
-  {
-    super(label);
-    this.xsdModelGroupDefinition = xsdModelGroupDefinition;
-    xsdModelGroup = getModelGroup(xsdModelGroupDefinition);
-  }
-  
-  public AddXSDElementCommand(String label, XSDModelGroup xsdModelGroup, XSDComplexTypeDefinition xsdComplexTypeDefinition)
-  {
-    super(label);
-    this.xsdModelGroup = xsdModelGroup;
-    this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
-  }
-
-  public AddXSDElementCommand(String label, XSDModelGroup xsdModelGroup)
-  {
-    super(label);
-    this.xsdModelGroup = xsdModelGroup;
-  }
-
-  public AddXSDElementCommand(String label, XSDSchema xsdSchema)
-  {
-    super(label);
-    this.xsdSchema = xsdSchema;
-  }
-
-  public void setReference(boolean isReference)
-  {
-    this.isReference = isReference;
-  }
-  
-  public void setNameToAdd(String name){
-	  nameToAdd = name;
-  }
-  
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.gef.commands.Command#execute()
-   */
-  public void execute()
-  {
-    if (xsdSchema != null)
-    {
-      XSDElementDeclaration element = createGlobalXSDElementDeclaration();
-      Text textNode = xsdSchema.getDocument().createTextNode("\n");
-      xsdSchema.getElement().appendChild(textNode);
-      xsdSchema.getContents().add(element);
-      addedXSDConcreteComponent = element;
-    }
-    else if (xsdModelGroupDefinition != null)
-    {
-      if (xsdModelGroup == null)
-      {
-        XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-        XSDParticle particle = factory.createXSDParticle();
-        xsdModelGroup = factory.createXSDModelGroup();
-        xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
-        particle.setContent(xsdModelGroup);
-      }
-      if (!isReference)
-      {
-        xsdModelGroup.getContents().add(createXSDElementDeclaration());
-      }
-      else
-      {
-        xsdModelGroup.getContents().add(createXSDElementReference());
-      }
-    }
-    else if (xsdComplexTypeDefinition == null && xsdModelGroup != null)
-    {
-      xsdSchema = xsdModelGroup.getSchema();
-      if (!isReference)
-      {
-        xsdModelGroup.getContents().add(createXSDElementDeclaration());
-      }
-      else
-      {
-        xsdModelGroup.getContents().add(createXSDElementReference());
-      }
-      formatChild(xsdModelGroup.getElement());
-    }
-    else
-    {
-      if (xsdModelGroup == null)
-      {
-        XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-        XSDParticle particle = factory.createXSDParticle();
-        xsdModelGroup = factory.createXSDModelGroup();
-        xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
-        particle.setContent(xsdModelGroup);
-        xsdComplexTypeDefinition.setContent(particle);
-      }
-      xsdSchema = xsdComplexTypeDefinition.getSchema();
-      
-      if (!isReference)
-      {
-        xsdModelGroup.getContents().add(createXSDElementDeclarationForComplexType());
-      }
-      else
-      {
-        xsdModelGroup.getContents().add(createXSDElementReference());
-      }
-      formatChild(xsdModelGroup.getElement());
-    }
-    
-  }
-  
-  protected XSDParticle createXSDElementDeclaration()
-  {
-    XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string");
-
-    XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
-
-    ArrayList usedAttributeNames = new ArrayList();
-    usedAttributeNames.addAll(XSDCommonUIUtils.getChildElements(xsdModelGroup));
-    element.setName(XSDCommonUIUtils.createUniqueElementName(
-    		nameToAdd == null ? "NewElement" : nameToAdd , xsdSchema.getElementDeclarations()));
-    element.setTypeDefinition(type);
-
-    XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
-    particle.setContent(element);
-    addedXSDConcreteComponent = element;
-    return particle;
-  }
-
-  protected XSDParticle createXSDElementReference()
-  {
-    List list = xsdModelGroup.getSchema().getElementDeclarations();
-    XSDElementDeclaration referencedElement = null;
-    if (list.size() > 0)
-    {
-      referencedElement = (XSDElementDeclaration)list.get(0);
-    }
-    else
-    {
-      referencedElement = createGlobalXSDElementDeclaration();
-      Text textNode = xsdSchema.getDocument().createTextNode("\n");
-      xsdSchema.getElement().appendChild(textNode);
-      xsdSchema.getContents().add(referencedElement);
-    }
-
-    XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
-    
-    element.setResolvedElementDeclaration(referencedElement);
-    XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
-    particle.setContent(element);
-    addedXSDConcreteComponent = element;
-    return particle;
-  }
-
-  protected XSDParticle createXSDElementDeclarationForComplexType()
-  {
-    XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string");
-
-    XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
-
-    ArrayList usedAttributeNames = new ArrayList();
-    usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes(xsdComplexTypeDefinition));
-    usedAttributeNames.addAll(XSDCommonUIUtils.getInheritedAttributes(xsdComplexTypeDefinition));
-    element.setName(XSDCommonUIUtils.createUniqueElementName(
-    		nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames));
-    element.setTypeDefinition(type);
-
-    XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
-    particle.setContent(element);
-    addedXSDConcreteComponent = element;
-    return particle;
-  }
-
-  protected XSDElementDeclaration createGlobalXSDElementDeclaration()
-  {
-    XSDSimpleTypeDefinition type = xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("string");
-    XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-    XSDElementDeclaration element = factory.createXSDElementDeclaration();
-
-    element.setName(XSDCommonUIUtils.createUniqueElementName(
-    		nameToAdd == null ? "NewElement" : nameToAdd , xsdSchema.getElementDeclarations()));
-    element.setTypeDefinition(type);
-
-    return element;
-  }
-  
-  public XSDModelGroup getModelGroup(XSDModelGroupDefinition modelGroupDef)
-  {
-    return modelGroupDef.getModelGroup();
-  }
-
-  //PORT
-  public XSDModelGroup getModelGroup(XSDComplexTypeDefinition cType)
-  {
-    XSDParticle particle = cType.getComplexType();
-
-    if (particle == null)
-    {
-      return null;
-    }
-    
-    Object particleContent = particle.getContent();
-    XSDModelGroup group = null;
-
-    if (particleContent instanceof XSDModelGroupDefinition)
-    {
-      group = ((XSDModelGroupDefinition) particleContent).getResolvedModelGroupDefinition().getModelGroup();
-    }
-    else if (particleContent instanceof XSDModelGroup)
-    {
-      group = (XSDModelGroup) particleContent;
-    }
-
-    if (group == null)
-    {
-      return null;
-    }
-
-    if (group.getContents().isEmpty() || group.eResource() != cType.eResource())
-    {
-      if (cType.getBaseType() != null)
-      {
-        XSDComplexTypeContent content = cType.getContent();
-        if (content instanceof XSDParticle)
-        {
-          group = (XSDModelGroup) ((XSDParticle) content).getContent();
-        }
-      }
-    }
-
-    return group;
-  }
-  
-  public XSDConcreteComponent getAddedComponent()
-  {
-    return super.getAddedComponent();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDModelGroupCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDModelGroupCommand.java
deleted file mode 100644
index 4821c85..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDModelGroupCommand.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-
-public class AddXSDModelGroupCommand extends BaseCommand
-{
-  XSDConcreteComponent parent;
-  XSDCompositor xsdCompositor;
-  XSDModelGroup newModelGroup;
-
-  public AddXSDModelGroupCommand(String label, XSDConcreteComponent parent, XSDCompositor xsdCompositor)
-  {
-    super(label);
-    this.parent = parent;
-    this.xsdCompositor = xsdCompositor;
-  }
-
-  public void execute()
-  {
-    XSDConcreteComponent owner = getOwner();
-    if (owner != null)
-    {
-      XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); 
-      newModelGroup = createModelGroup();
-      particle.setContent(newModelGroup);
-
-      XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)owner;
-      ctd.setContent(particle);
-    }
-    formatChild(parent.getElement());
-  }
-  
-  public void undo()
-  {
-    super.undo();
-    
-    if (parent instanceof XSDModelGroup)
-    {
-      XSDModelGroup model = (XSDModelGroup) parent;
-      model.getContents().remove(newModelGroup.getContainer());
-    }
-  }
-  
-  private XSDConcreteComponent getOwner()
-  {
-    XSDConcreteComponent owner = null;
-    if (parent instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration ed = (XSDElementDeclaration)parent;      
-      if (ed.getTypeDefinition() != null) 
-      {
-        if (ed.getAnonymousTypeDefinition() == null)
-        {
-          ed.setTypeDefinition(null);
-          XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-          ed.setAnonymousTypeDefinition(td);
-          owner = ed.getTypeDefinition();
-        }
-        else
-        {
-          XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-          ed.setAnonymousTypeDefinition(td);
-          owner = td;        
-        }
-      }        
-      else if (ed.getAnonymousTypeDefinition() == null)
-      {
-        XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-        ed.setAnonymousTypeDefinition(td);
-        owner = td;        
-      }
-      else if (ed.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)
-      {
-        owner = ed.getAnonymousTypeDefinition();
-      }
-      else if (ed.getAnonymousTypeDefinition() instanceof XSDSimpleTypeDefinition)
-      {
-        XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-        ed.setAnonymousTypeDefinition(td);
-        owner = td;        
-      }
-    }
-    else if (parent instanceof XSDModelGroup)
-    {
-      newModelGroup = createModelGroup();
-      ((XSDModelGroup) parent).getContents().add(newModelGroup.getContainer());
-    }
-    else if (parent instanceof XSDComplexTypeDefinition)
-    {
-      XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)parent;
-      owner = parent;
-      if (ct.getContent() instanceof XSDParticle)
-      {
-        XSDParticle particle = (XSDParticle)ct.getContent();
-        if (particle.getContent() instanceof XSDModelGroup)
-        {
-          owner = null;
-          newModelGroup = createModelGroup();
-          XSDModelGroup newParent = (XSDModelGroup)particle.getContent();
-          newParent.getContents().add(newModelGroup.getContainer());
-        }
-        
-      }
-    }
-    return owner;
-  }
-  
-
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-    return false;
-  }
-  
-  protected XSDModelGroup createModelGroup()
-  {
-    
-    XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-    XSDParticle particle = factory.createXSDParticle();
-    XSDModelGroup modelGroup = factory.createXSDModelGroup();
-    modelGroup.setCompositor(xsdCompositor);
-    particle.setContent(modelGroup);
-    addedXSDConcreteComponent = modelGroup;
-    return modelGroup;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDModelGroupDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDModelGroupDefinitionCommand.java
deleted file mode 100644
index 0947ee5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDModelGroupDefinitionCommand.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-import org.w3c.dom.Text;
-
-public class AddXSDModelGroupDefinitionCommand extends BaseCommand
-{
-  XSDConcreteComponent parent;
-  boolean isReference;
-
-  public AddXSDModelGroupDefinitionCommand(String label, XSDConcreteComponent parent, boolean isReference)
-  {
-    super(label);
-    this.parent = parent;
-    this.isReference = isReference;
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.gef.commands.Command#execute()
-   */
-  public void execute()
-  {
-    if (!isReference)
-    {
-      XSDModelGroupDefinition def= createXSDModelGroupDefinition();
-      addedXSDConcreteComponent = def;
-    }
-    else
-    {
-      XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-      XSDModelGroupDefinition def = factory.createXSDModelGroupDefinition();
-      XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
-      particle.setContent(def);
-      List list = parent.getSchema().getModelGroupDefinitions();
-      if (list.size() > 0)
-      {
-        def.setResolvedModelGroupDefinition((XSDModelGroupDefinition) list.get(0));
-      }
-      else
-      {
-        XSDModelGroupDefinition newGroupDef = createXSDModelGroupDefinition();
-        def.setResolvedModelGroupDefinition(newGroupDef);
-      }
-
-      if (parent instanceof XSDModelGroup)
-      {
-        ((XSDModelGroup) parent).getContents().add(particle);
-      }
-      formatChild(def.getElement());
-      addedXSDConcreteComponent = def;
-    }
-  }
-
-  protected XSDModelGroupDefinition createXSDModelGroupDefinition()
-  {
-    XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-    XSDModelGroupDefinition def = factory.createXSDModelGroupDefinition();
-    List list = parent.getSchema().getModelGroupDefinitions();
-    String newName = XSDCommonUIUtils.createUniqueElementName("ModelGroupDefinition", list);
-    def.setName(newName);
-
-    XSDModelGroup modelGroup = createModelGroup();
-    def.setModelGroup(modelGroup);
-    Text textNode = parent.getSchema().getDocument().createTextNode("\n");
-    parent.getSchema().getElement().appendChild(textNode);
-    parent.getSchema().getContents().add(def);
-    formatChild(def.getElement());
-    return def;
-  }
-
-  protected XSDModelGroup createModelGroup()
-  {
-    XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-    XSDParticle particle = factory.createXSDParticle();
-    XSDModelGroup modelGroup = factory.createXSDModelGroup();
-    modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
-    particle.setContent(modelGroup);
-
-    return modelGroup;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDSimpleTypeDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDSimpleTypeDefinitionCommand.java
deleted file mode 100644
index 64f7b36..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/AddXSDSimpleTypeDefinitionCommand.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Text;
-
-public final class AddXSDSimpleTypeDefinitionCommand extends BaseCommand
-{
-  XSDConcreteComponent parent;
-  XSDSimpleTypeDefinition createdSimpleType;
-  private String nameToAdd;
-  
-  public AddXSDSimpleTypeDefinitionCommand(String label, XSDConcreteComponent parent)
-  {
-    super(label);
-    this.parent = parent;
-  }
-
-  public void setNameToAdd(String nameToAdd)
-  {
-    this.nameToAdd = nameToAdd;
-  }
-  
-  public void execute()
-  {
-    XSDSimpleTypeDefinition typeDef = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-    typeDef.setBaseTypeDefinition(parent.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string"));
-
-    if (parent instanceof XSDSchema)
-    {
-      typeDef.setName(XSDCommonUIUtils.createUniqueElementName(nameToAdd == null ? "XSDSimpleType" : nameToAdd, ((XSDSchema) parent).getTypeDefinitions()));
-      createdSimpleType = typeDef;
-      try
-      {
-        XSDSchema xsdSchema = (XSDSchema)parent;
-        Text textNode = xsdSchema.getDocument().createTextNode("\n");
-        xsdSchema.getElement().appendChild(textNode);
-        xsdSchema.getContents().add(typeDef);
-      }
-      catch (Exception e)
-      {
-    
-      }
-    }
-    else if (parent instanceof XSDElementDeclaration)
-    {
-      ((XSDElementDeclaration) parent).setAnonymousTypeDefinition(typeDef);
-    }
-    else if (parent instanceof XSDAttributeDeclaration)
-    {
-      ((XSDAttributeDeclaration) parent).setAnonymousTypeDefinition(typeDef);
-    }
-    formatChild(createdSimpleType.getElement());
-  }
-
-  public XSDSimpleTypeDefinition getCreatedSimpleType()
-  {
-    return createdSimpleType;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/BaseCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/BaseCommand.java
deleted file mode 100644
index b8c4803..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/BaseCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class BaseCommand extends Command
-{
-  XSDConcreteComponent addedXSDConcreteComponent;
-
-  public BaseCommand()
-  {
-    super();
-  }
-
-  public BaseCommand(String label)
-  {
-    super(label);
-  }
-  
-  public XSDConcreteComponent getAddedComponent()
-  {
-    return addedXSDConcreteComponent;
-  }
-
-  protected void formatChild(Element child)
-  {
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode)child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-        
-        IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-        formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel(); 
-      }
-    }
-  }
- 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/ChangeToLocalSimpleTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/ChangeToLocalSimpleTypeCommand.java
deleted file mode 100644
index c17c9f3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/ChangeToLocalSimpleTypeCommand.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class ChangeToLocalSimpleTypeCommand extends BaseCommand
-{
-  XSDFeature parent;
-  XSDSimpleTypeDefinition anonymousSimpleType;
-  XSDSimpleTypeDefinition currentType;
-
-  public ChangeToLocalSimpleTypeCommand(String label, XSDFeature parent)
-  {
-    super(label);
-    this.parent = parent;
-
-//    if (parent instanceof XSDElementDeclaration)
-//    {
-//      XSDElementDeclaration element = (XSDElementDeclaration) parent;
-//      XSDTypeDefinition aType = element.getResolvedElementDeclaration().getTypeDefinition();
-//
-//      if (aType instanceof XSDSimpleTypeDefinition)
-//      {
-//        currentType = (XSDSimpleTypeDefinition) aType;
-//      }
-//    }
-  }
-
-  public void execute()
-  {
-//    anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-//    anonymousSimpleType.setBaseTypeDefinition(currentType);
-    if (parent instanceof XSDElementDeclaration)
-    {
-      ((XSDElementDeclaration)parent).setAnonymousTypeDefinition(anonymousSimpleType);
-    }
-    else if (parent instanceof XSDAttributeDeclaration)
-    {
-      ((XSDAttributeDeclaration)parent).setAnonymousTypeDefinition(anonymousSimpleType);
-    }
-    formatChild(parent.getElement());
-  }
-  
-  public void setAnonymousSimpleType(XSDSimpleTypeDefinition anonymousSimpleType)
-  {
-    this.anonymousSimpleType = anonymousSimpleType;
-  }
-
-  public XSDSimpleTypeDefinition getAnonymousType()
-  {
-    if (anonymousSimpleType == null)
-    {
-      anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-      anonymousSimpleType.setBaseTypeDefinition(currentType);
-    }
-    return anonymousSimpleType;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/DeleteCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/DeleteCommand.java
deleted file mode 100644
index eee0802..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/DeleteCommand.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDVisitor;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class DeleteCommand extends BaseCommand
-{
-  XSDConcreteComponent target;
-
-  public DeleteCommand(String label, XSDConcreteComponent target)
-  {
-    super(label);
-    this.target = target;
-  }
-
-  public void execute()
-  {
-    XSDVisitor visitor = new XSDVisitor()
-    {
-      public void visitElementDeclaration(org.eclipse.xsd.XSDElementDeclaration element)
-      {
-        if (element.getTypeDefinition() == target)
-        {
-          XSDSimpleTypeDefinition type = target.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string");
-          element.setTypeDefinition(type);
-        }
-        super.visitElementDeclaration(element);
-      }
-    };
-
-    XSDConcreteComponent parent = target.getContainer();
-
-    if (target instanceof XSDModelGroup || target instanceof XSDElementDeclaration || target instanceof XSDModelGroupDefinition)
-    {
-      if (parent instanceof XSDParticle)
-      {
-        if (parent.getContainer() instanceof XSDModelGroup)
-        {
-          XSDModelGroup modelGroup = (XSDModelGroup) ((XSDParticle) parent).getContainer();
-
-          modelGroup.getContents().remove(parent);
-        }
-      }
-      else if (parent instanceof XSDSchema)
-      {
-        visitor.visitSchema(target.getSchema());
-        ((XSDSchema) parent).getContents().remove(target);
-      }
-
-    }
-    else if (target instanceof XSDAttributeDeclaration)
-    {
-      if (parent instanceof XSDAttributeUse)
-      {
-        EObject obj = parent.eContainer();
-        XSDComplexTypeDefinition complexType = null;
-        while (obj != null)
-        {
-          if (obj instanceof XSDComplexTypeDefinition)
-          {
-            complexType = (XSDComplexTypeDefinition) obj;
-            break;
-          }
-          obj = obj.eContainer();
-        }
-        if (complexType != null)
-        {
-          complexType.getAttributeContents().remove((XSDAttributeUse) parent);
-        }
-
-        if (parent.getContainer() instanceof XSDAttributeGroupDefinition)
-        {
-          XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) parent.getContainer();
-
-          attrGroup.getContents().remove(parent);
-        }
-      }
-    }
-    else if (target instanceof XSDAttributeGroupDefinition &&
-             parent instanceof XSDComplexTypeDefinition)
-    {
-      ((XSDComplexTypeDefinition)parent).getAttributeContents().remove(target);
-    }
-    else if (target instanceof XSDEnumerationFacet)
-    {
-      XSDEnumerationFacet enumerationFacet = (XSDEnumerationFacet)target;
-      enumerationFacet.getSimpleTypeDefinition().getFacetContents().remove(enumerationFacet);
-    }
-    else
-    {
-      if (parent instanceof XSDSchema)
-      {
-        visitor.visitSchema(target.getSchema());
-        ((XSDSchema) parent).getContents().remove(target);
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/RemoveAppInfoAttrCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/RemoveAppInfoAttrCommand.java
deleted file mode 100644
index 031e975..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/RemoveAppInfoAttrCommand.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-public class RemoveAppInfoAttrCommand extends Command 
-{
-	Element hostElement;
-	Attr attr;
-	
-	public RemoveAppInfoAttrCommand(String label, Element hostElement, Attr attr)
-	{
-		super(label);
-		this.hostElement = hostElement;
-		this.attr = attr;
-	}
-	
-	public void execute()
-	{
-		super.execute();
-		hostElement.removeAttributeNode(attr);
-	}
-	
-	public void undo()
-	{
-		super.undo();
-		//TODO implement me
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/RemoveAppInfoElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/RemoveAppInfoElementCommand.java
deleted file mode 100644
index fabfe62..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/RemoveAppInfoElementCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDAnnotation;
-import org.w3c.dom.Node;
-
-public class RemoveAppInfoElementCommand extends Command
-{
-  XSDAnnotation xsdAnnotation;
-  Node appInfo;
-
-  public RemoveAppInfoElementCommand(String label, XSDAnnotation xsdAnnotation, Node appInfo)
-  {
-    super(label);
-    this.xsdAnnotation = xsdAnnotation;
-    this.appInfo = appInfo;
-  }
-
-  public void execute()
-  {
-    super.execute();
-    xsdAnnotation.getApplicationInformation().remove(appInfo);
-    xsdAnnotation.getElement().removeChild(appInfo);
-    xsdAnnotation.updateElement();
-  }
-
-  public void undo()
-  {
-    super.undo();
-    xsdAnnotation.getApplicationInformation().add(appInfo);
-    xsdAnnotation.getElement().appendChild(appInfo);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetMultiplicityCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetMultiplicityCommand.java
deleted file mode 100644
index 1810fde..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetMultiplicityCommand.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-
-public class SetMultiplicityCommand extends BaseCommand
-{
-  XSDConcreteComponent parent;
-  int maxOccurs, minOccurs;
-
-  /**
-   * @param parent
-   */
-  public SetMultiplicityCommand(String label)
-  {
-    super(label);
-  }
-  
-  public void setMaxOccurs(int i)
-  {
-    maxOccurs=i;
-  }
-
-  public void setMinOccurs(int i)
-  {
-    minOccurs=i;    
-  }
-
-  public void setXSDConcreteComponent(XSDConcreteComponent parent)
-  {
-    this.parent = parent;
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#run()
-   */
-  public void execute()
-  {
-    if (parent instanceof XSDParticleContent)
-    {
-      XSDParticleContent xsdParticleContent = (XSDParticleContent)parent;
-      XSDParticle xsdParticle = (XSDParticle)xsdParticleContent.getContainer();
-      if (maxOccurs < 0)
-      {
-        maxOccurs = XSDParticle.UNBOUNDED;
-      }
-      xsdParticle.setMaxOccurs(maxOccurs);
-      xsdParticle.setMinOccurs(minOccurs);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetTypeCommand.java
deleted file mode 100644
index 3fbafe8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetTypeCommand.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.editor.XSDTypeReferenceEditManager;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.common.actions.SetTypeAction;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-public class SetTypeCommand extends BaseCommand
-{
-  XSDConcreteComponent parent;
-  private boolean continueApply;
-  XSDBaseAdapter adapter;
-  String action;
-
-  public SetTypeCommand(String label, String ID, XSDConcreteComponent parent)
-  {
-    super(label);
-    this.parent = parent;
-    this.action = ID;
-  }
-  
-  public void setAdapter(XSDBaseAdapter adapter)
-  {
-    this.adapter = adapter;
-  }
-
-  public void execute()
-  {
-    ComponentReferenceEditManager componentReferenceEditManager = getComponentReferenceEditManager();
-    continueApply = true; 
-    if (parent instanceof XSDElementDeclaration)
-    {
-      if (action.equals(SetTypeAction.SET_NEW_TYPE_ID))
-      {
-        ComponentSpecification newValue = (ComponentSpecification)invokeDialog(componentReferenceEditManager.getNewDialog());
-        if (continueApply)
-          componentReferenceEditManager.modifyComponentReference(adapter, newValue);
-      }
-      else
-      {
-        ComponentSpecification newValue = (ComponentSpecification)invokeDialog(componentReferenceEditManager.getBrowseDialog());
-        if (continueApply)
-          componentReferenceEditManager.modifyComponentReference(adapter, newValue);
-      }
-      formatChild(parent.getElement());
-    }
-
-  }
-
-  private Object invokeDialog(IComponentDialog dialog)
-  {
-    Object newValue = null;
-
-    if (dialog == null)
-    {
-      return null;
-    }
-
-    if (dialog.createAndOpen() == Window.OK)
-    {
-      newValue = dialog.getSelectedComponent();
-    }
-    else
-    {
-      continueApply = false;
-    }
-
-    return newValue;
-  }
-
-  protected ComponentReferenceEditManager getComponentReferenceEditManager()
-  {
-    ComponentReferenceEditManager result = null;
-    IEditorPart editor = getActiveEditor();
-    if (editor != null)
-    {
-      result = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
-    }  
-    return result;
-  }
-  
-  private IEditorPart getActiveEditor()
-  {
-    IWorkbench workbench = PlatformUI.getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-    return editorPart;
-  }    
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetXSDFacetValueCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetXSDFacetValueCommand.java
deleted file mode 100644
index 33c3523..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/SetXSDFacetValueCommand.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDFacet;
-
-public class SetXSDFacetValueCommand extends BaseCommand
-{
-  protected XSDFacet facet;
-  protected String value;
-  
-  public SetXSDFacetValueCommand(String label, XSDFacet facet)
-  {
-    super(label);
-    this.facet = facet;
-  }
-  
-  public void setValue(String value)
-  {
-    this.value = value; 
-  }
-  
-  public void execute()
-  {
-    facet.setLexicalValue(value);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateComponentReferenceAndManageDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateComponentReferenceAndManageDirectivesCommand.java
deleted file mode 100644
index fddfcf3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateComponentReferenceAndManageDirectivesCommand.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public abstract class UpdateComponentReferenceAndManageDirectivesCommand extends Command{
-	  protected XSDConcreteComponent concreteComponent;
-	  protected String componentName;
-	  protected String componentNamespace;
-	  protected IFile file;
-
-	  public UpdateComponentReferenceAndManageDirectivesCommand(XSDConcreteComponent concreteComponent, String componentName, String componentNamespace, IFile file)
-	  {
-	    this.concreteComponent = concreteComponent;
-	    this.componentName = componentName;
-	    this.componentNamespace = componentNamespace;
-	    this.file = file;
-	  }  
-
-	  protected abstract XSDComponent computeComponent();
-	  
-	  public abstract void execute() ;
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateContentModelCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateContentModelCommand.java
deleted file mode 100644
index 0faa3e5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateContentModelCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDModelGroup;
-
-public class UpdateContentModelCommand extends Command
-{
-  XSDModelGroup xsdModelGroup;
-  XSDCompositor oldXSDCompositor, newXSDCompositor;
-  
-  
-  public UpdateContentModelCommand(String label, XSDModelGroup xsdModelGroup, XSDCompositor xsdCompositor)
-  {
-    super(label);
-    this.xsdModelGroup = xsdModelGroup;
-    this.newXSDCompositor = xsdCompositor;
-    this.oldXSDCompositor = xsdModelGroup.getCompositor();
-  }
-
-  
-  public void execute()
-  {
-    super.execute();
-    xsdModelGroup.setCompositor(newXSDCompositor);
-    
-  }
-    
-  public void undo()
-  {
-    xsdModelGroup.setCompositor(oldXSDCompositor);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java
deleted file mode 100644
index e07dbca..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.util.XSDResourceImpl;
-
-public class UpdateElementReferenceAndManageDirectivesCommand extends 
-UpdateComponentReferenceAndManageDirectivesCommand{
-
-	public UpdateElementReferenceAndManageDirectivesCommand(XSDConcreteComponent concreteComponent,
-			String componentName, String componentNamespace, IFile file)
-	{
-		super(concreteComponent, componentName, componentNamespace, file);
-	}
-	
-	protected XSDComponent computeComponent()
-	{
-		XSDElementDeclaration result = null;
-		XSDSchema schema = concreteComponent.getSchema();
-		XSDSchemaDirective directive = null;
-		
-		// TODO (cs) handle case where namespace==null
-		//
-		if (componentNamespace != null)
-		{  
-			
-			// lets see if the element is already visible to our schema
-			result = getDefinedComponent(schema, componentName, componentNamespace);                     
-			if (result == null)
-			{
-				// TODO (cs) we need to provide a separate command to do this part
-				//
-				// apparently the element is not yet visible, we need to add includes/imports to get to it
-				if (componentNamespace.equals(schema.getTargetNamespace()))
-				{
-					// we need to add an include
-					directive =XSDFactory.eINSTANCE.createXSDInclude();
-				}
-				else
-				{
-					// we need to add an import
-					XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport();
-					xsdImport.setNamespace(componentNamespace);
-					directive = xsdImport;              
-				}  
-				
-				// TODO (cs) we need to compute a relative URI to make this nicer!
-				//
-				String fileURI = file.getLocationURI().toString();
-				if (fileURI.startsWith("file:/") && !fileURI.startsWith("file:///"))
-				{
-					fileURI = "file:///" + fileURI.substring(6);
-				}   
-				directive.setSchemaLocation(fileURI);
-				
-				// TODO (cs) we should at the directive 'next' in the list of directives
-				// for now I'm just adding as the first thing in the schema :-(         
-				//
-				schema.getContents().add(0, directive);           
-				XSDSchema resolvedSchema = directive.getResolvedSchema();        
-				
-				if (resolvedSchema == null)
-				{
-					System.out.println("resolvedSchema is null!!!");
-					Resource resource  = concreteComponent.eResource().getResourceSet().createResource(URI.createURI(fileURI));          
-					if (resource instanceof XSDResourceImpl)
-					{
-						try
-						{
-							resource.load(null);
-							XSDResourceImpl resourceImpl = (XSDResourceImpl)resource;
-							resolvedSchema = resourceImpl.getSchema();
-							if (resolvedSchema != null)
-							{
-								System.out.println("Strange... managed to make the schema resovle myself 8-P" + resource);
-								directive.setResolvedSchema(resolvedSchema);
-							}
-						}
-						catch (Exception e)
-						{
-							
-						}
-					}  
-				}
-				if (resolvedSchema != null)
-				{  
-					result = getDefinedComponent(resolvedSchema, componentName, componentNamespace);
-				}    
-				else 
-				{
-					// TODO (cs) consider setting some error state so that the client can provide a  pop-dialog error
-					// we should also remove the import/include so save from cluttering the file with bogus directives                           
-				}
-			}   
-		}  
-		return result;
-	}
-
-	private XSDElementDeclaration getDefinedComponent(XSDSchema schema,
-			String componentName, String componentNamespace) {
-	    XSDElementDeclaration result = schema.resolveElementDeclaration(componentNamespace, componentName);
-	    if (result.eContainer() == null)
-	    {
-	      result = null;
-	    }
-	    return result;
-	}
-
-	public void execute() {
-	    try
-	    {
-	    XSDComponent elementDef = computeComponent();
-	    if (elementDef != null)
-	    {
-	      UpdateElementReferenceCommand command = new UpdateElementReferenceCommand(
-	    		  "Update Element Reference", (XSDElementDeclaration) concreteComponent,
-	    		  (XSDElementDeclaration) elementDef);
-	      command.execute();
-	    }
-	    }
-	    catch (Exception e)
-	    {
-	      e.printStackTrace();
-	    }
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateElementReferenceCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateElementReferenceCommand.java
deleted file mode 100644
index 5f05506..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateElementReferenceCommand.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDElementDeclaration;
-
-public class UpdateElementReferenceCommand extends BaseCommand
-{
-  XSDElementDeclaration element, ref;
-
-  public UpdateElementReferenceCommand(String label, XSDElementDeclaration element, XSDElementDeclaration ref)
-  {
-    super(label);
-    this.element = element;
-    this.ref = ref;
-  }
-
-  public void execute()
-  {
-    element.setResolvedElementDeclaration(ref);
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateMaxOccursCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateMaxOccursCommand.java
deleted file mode 100644
index a1f0ff4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateMaxOccursCommand.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class UpdateMaxOccursCommand extends Command
-{
-	private int oldMaxOccurs;
-	private int newMaxOccurs;
-  private boolean removeMaxOccursAttribute;
-	
-	XSDParticle particle;
-
-  public UpdateMaxOccursCommand(String label, XSDParticle particle, int MaxOccurs)
-	{
-		super(label);
-		this.newMaxOccurs = MaxOccurs;
-		this.particle = particle;
-	}
-	
-	public void execute()
-	{
-    Element element = particle.getElement();
-    String currentMax = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-    removeMaxOccursAttribute = (currentMax == null)? true: false;
-		oldMaxOccurs = particle.getMaxOccurs();
-		particle.setMaxOccurs(newMaxOccurs);
-	}
-	
-	public void redo()
-	{
-		execute();
-	}
-	
-	public void undo()
-	{
-    if (removeMaxOccursAttribute)
-    {
-      particle.unsetMaxOccurs();
-    }
-    else
-    {
-		  particle.setMaxOccurs(oldMaxOccurs);
-    }
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateMinOccursCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateMinOccursCommand.java
deleted file mode 100644
index 457e4c6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateMinOccursCommand.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDAttributeUseCategory;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class UpdateMinOccursCommand extends Command
-{
-  private int oldMinOccurs;
-  private int newMinOccurs;
-  private boolean removeMinOccursAttribute;
-
-  XSDComponent component;
-
-  public UpdateMinOccursCommand(String label, XSDComponent component, int minOccurs)
-  {
-    super(label);
-    this.newMinOccurs = minOccurs;
-    this.component = component;
-  }
-
-  public void execute()
-  {
-
-    Element element = component.getElement();
-    String currentMin = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-    removeMinOccursAttribute = (currentMin == null) ? true : false;
-
-    if (component instanceof XSDParticle)
-    {
-      oldMinOccurs = ((XSDParticle) component).getMinOccurs();
-      ((XSDParticle) component).setMinOccurs(newMinOccurs);
-    }
-    else if (component instanceof XSDAttributeUse)
-    {
-      oldMinOccurs = (((XSDAttributeUse) component).getUse() == XSDAttributeUseCategory.REQUIRED_LITERAL ? 1 : 0);
-      if (newMinOccurs == 1)
-        ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
-      else
-        ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
-    }
-  }
-
-  public void undo()
-  {
-    if (component instanceof XSDParticle)
-    {
-      if (removeMinOccursAttribute)
-      {
-        ((XSDParticle) component).unsetMinOccurs();
-      }
-      else
-      {
-        ((XSDParticle) component).setMinOccurs(oldMinOccurs);
-      }
-    }
-    else if (component instanceof XSDAttributeUse)
-    {
-      if (removeMinOccursAttribute)
-      {
-        ((XSDParticle) component).unsetMinOccurs();
-      }
-      else
-      {
-        if (oldMinOccurs == 1)
-          ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
-        else
-          ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateNameCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateNameCommand.java
deleted file mode 100644
index b2fd461..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateNameCommand.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-
-public class UpdateNameCommand extends Command
-{
-  private String oldName;
-  private String newName;
-  private XSDNamedComponent component;
-
-  public UpdateNameCommand(String label, XSDNamedComponent component, String newName)
-  {
-    super(label);
-
-    if (component instanceof XSDComplexTypeDefinition && component.getName() == null && component.eContainer() instanceof XSDNamedComponent && ((XSDNamedComponent) component.eContainer()).getName() != null)
-    {
-      component = (XSDNamedComponent) component.eContainer();
-    }
-
-    this.component = component;
-    this.newName = newName;
-    this.oldName = component.getName();
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.gef.commands.Command#execute()
-   */
-  public void execute()
-  {
-    component.setName(newName);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateNumericBoundsFacetCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateNumericBoundsFacetCommand.java
deleted file mode 100644
index 26598e1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateNumericBoundsFacetCommand.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDMaxExclusiveFacet;
-import org.eclipse.xsd.XSDMaxInclusiveFacet;
-import org.eclipse.xsd.XSDMinExclusiveFacet;
-import org.eclipse.xsd.XSDMinInclusiveFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class UpdateNumericBoundsFacetCommand extends BaseCommand
-{
-  XSDSimpleTypeDefinition xsdSimpleType;
-  String max, min;
-  boolean includeMin, includeMax;
-  private boolean doUpdateMax = false, doUpdateMin = false;
-  XSDMinInclusiveFacet minInclusiveFacet;
-  XSDMinExclusiveFacet minExclusiveFacet;
-  XSDMaxInclusiveFacet maxInclusiveFacet;
-  XSDMaxExclusiveFacet maxExclusiveFacet;
-
-
-  public UpdateNumericBoundsFacetCommand(String label, XSDSimpleTypeDefinition xsdSimpleType, boolean includeMin, boolean includeMax)
-  {
-    super(label);
-    this.xsdSimpleType = xsdSimpleType;
-    this.includeMin = includeMin;
-    this.includeMax = includeMax;
-    
-    minInclusiveFacet = xsdSimpleType.getMinInclusiveFacet();
-    minExclusiveFacet = xsdSimpleType.getMinExclusiveFacet();
-    maxInclusiveFacet = xsdSimpleType.getMaxInclusiveFacet();
-    maxExclusiveFacet = xsdSimpleType.getMaxExclusiveFacet();
-
-  }
-
-  public void setMin(String min)
-  {
-    this.min = min;
-    doUpdateMin = true;
-  }
-  
-  public void setMax(String max)
-  {
-    this.max = max;
-    doUpdateMax = true;
-  }
-
-  public void execute()
-  {    
-    if (doUpdateMin)
-    {
-      if (includeMin)
-      {
-        if (minInclusiveFacet == null && min != null)
-        {
-          minInclusiveFacet = XSDFactory.eINSTANCE.createXSDMinInclusiveFacet();
-          minInclusiveFacet.setLexicalValue(min);
-          xsdSimpleType.getFacetContents().add(minInclusiveFacet);
-          
-          if (minExclusiveFacet != null)
-          {
-            xsdSimpleType.getFacetContents().remove(minExclusiveFacet);
-          }
-        }
-        else if (minInclusiveFacet != null && min != null)
-        {
-          minInclusiveFacet.setLexicalValue(min);
-        }
-        else if (minInclusiveFacet != null && min == null)
-        {
-          xsdSimpleType.getFacetContents().remove(minInclusiveFacet);
-        }
-      }
-      else // !includeMin
-      {
-        if (minExclusiveFacet == null && min != null)
-        {
-          minExclusiveFacet = XSDFactory.eINSTANCE.createXSDMinExclusiveFacet();
-          minExclusiveFacet.setLexicalValue(min);
-          xsdSimpleType.getFacetContents().add(minExclusiveFacet);
-          
-          if (minInclusiveFacet != null)
-          {
-            xsdSimpleType.getFacetContents().remove(minInclusiveFacet);
-          }
-        }
-        else if (minExclusiveFacet != null && min != null)
-        {
-          minExclusiveFacet.setLexicalValue(min);
-        }
-        else if (minExclusiveFacet != null && min == null)
-        {
-          xsdSimpleType.getFacetContents().remove(minExclusiveFacet);
-        }
-      }
-    }
-    else if (doUpdateMax)
-    {
-      if (includeMax)
-      {
-        if (maxInclusiveFacet == null && max != null)
-        {
-          maxInclusiveFacet = XSDFactory.eINSTANCE.createXSDMaxInclusiveFacet();
-          maxInclusiveFacet.setLexicalValue(max);
-          xsdSimpleType.getFacetContents().add(maxInclusiveFacet);
-          
-          if (maxExclusiveFacet != null)
-          {
-            xsdSimpleType.getFacetContents().remove(maxExclusiveFacet);
-          }
-        }
-        else if (maxInclusiveFacet != null && max != null)
-        {
-          maxInclusiveFacet.setLexicalValue(max);
-        }
-        else if (maxInclusiveFacet != null && max == null)
-        {
-          xsdSimpleType.getFacetContents().remove(maxInclusiveFacet);
-        }
-      }
-      else // !includeMax
-      {
-        if (maxExclusiveFacet == null && max != null)
-        {
-          maxExclusiveFacet = XSDFactory.eINSTANCE.createXSDMaxExclusiveFacet();
-          maxExclusiveFacet.setLexicalValue(max);
-          xsdSimpleType.getFacetContents().add(maxExclusiveFacet);
-          
-          if (maxInclusiveFacet != null)
-          {
-            xsdSimpleType.getFacetContents().remove(maxInclusiveFacet);
-          }
-        }
-        else if (maxExclusiveFacet != null && max != null)
-        {
-          maxExclusiveFacet.setLexicalValue(max);
-        }
-        else if (maxExclusiveFacet != null && max == null)
-        {
-          xsdSimpleType.getFacetContents().remove(maxExclusiveFacet);
-        }
-      }
-    }
-
-    formatChild(xsdSimpleType.getElement());
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateStringLengthFacetCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateStringLengthFacetCommand.java
deleted file mode 100644
index 48d0f63..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateStringLengthFacetCommand.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDLengthFacet;
-import org.eclipse.xsd.XSDMaxLengthFacet;
-import org.eclipse.xsd.XSDMinLengthFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class UpdateStringLengthFacetCommand extends BaseCommand
-{
-  XSDSimpleTypeDefinition xsdSimpleType;
-  String max, min;
-  private boolean doUpdateMax = false, doUpdateMin = false;
-
-  public UpdateStringLengthFacetCommand(String label, XSDSimpleTypeDefinition xsdSimpleType)
-  {
-    super(label);
-    this.xsdSimpleType = xsdSimpleType;
-  }
-  
-  public void setMin(String min)
-  {
-    this.min = min;
-    doUpdateMin = true;
-  }
-  
-  public void setMax(String max)
-  {
-    this.max = max;
-    doUpdateMax = true;
-  }
-  
-  public void execute()
-  {
-    XSDLengthFacet lengthFacet = xsdSimpleType.getEffectiveLengthFacet();
-    XSDMinLengthFacet minLengthFacet = xsdSimpleType.getEffectiveMinLengthFacet();
-    XSDMaxLengthFacet maxLengthFacet = xsdSimpleType.getEffectiveMaxLengthFacet();
-    
-    String currentLength = null, currentMin = null, currentMax = null;
-    if (lengthFacet != null)
-    {
-      currentLength = lengthFacet.getLexicalValue();
-    }
-    if (minLengthFacet != null)
-    {
-      currentMin = minLengthFacet.getLexicalValue();
-    }
-    if (maxLengthFacet != null)
-    {
-      currentMax = maxLengthFacet.getLexicalValue();
-    }
-
-    if (doUpdateMax && !doUpdateMin)
-    {
-      if (maxLengthFacet != null)
-      {
-        if (max != null)
-        {
-          if (max.equals(currentMin))
-          {
-            lengthFacet = XSDFactory.eINSTANCE.createXSDLengthFacet();
-            lengthFacet.setLexicalValue(max);
-            xsdSimpleType.getFacetContents().add(lengthFacet);
-            xsdSimpleType.getFacetContents().remove(maxLengthFacet);
-            xsdSimpleType.getFacetContents().remove(minLengthFacet);
-          }
-          else
-          {
-            if (lengthFacet != null)
-            {
-              xsdSimpleType.getFacetContents().remove(lengthFacet);
-            }
-            if (minLengthFacet == null && currentLength != null)
-            {
-              minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
-              minLengthFacet.setLexicalValue(currentLength);
-              xsdSimpleType.getFacetContents().add(minLengthFacet);
-            }
-            maxLengthFacet.setLexicalValue(max);
-          }
-        }
-        else
-        {
-          xsdSimpleType.getFacetContents().remove(maxLengthFacet);
-        }
-      }
-      else
-      {
-        if (currentMin != null && currentMin.equals(max))
-        {
-          if (lengthFacet == null)
-          {
-            lengthFacet = XSDFactory.eINSTANCE.createXSDLengthFacet();
-            xsdSimpleType.getFacetContents().add(lengthFacet);
-          }
-          lengthFacet.setLexicalValue(max);
-          xsdSimpleType.getFacetContents().remove(minLengthFacet);
-        }
-        else if (currentLength != null && !currentLength.equals(max))
-        {
-          xsdSimpleType.getFacetContents().remove(lengthFacet);
-
-          if (max != null)
-          {
-            maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
-            maxLengthFacet.setLexicalValue(max);
-            xsdSimpleType.getFacetContents().add(maxLengthFacet);
-          }
-          
-          minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
-          minLengthFacet.setLexicalValue(currentLength);
-          xsdSimpleType.getFacetContents().add(minLengthFacet);
-        }
-        else
-        {
-          if (lengthFacet != null)
-          {
-            xsdSimpleType.getFacetContents().remove(lengthFacet);
-            
-            minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
-            minLengthFacet.setLexicalValue(currentLength);
-            xsdSimpleType.getFacetContents().add(minLengthFacet);
-
-          }
-          maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
-          maxLengthFacet.setLexicalValue(max);
-          xsdSimpleType.getFacetContents().add(maxLengthFacet);
-        }
-      }
-    }
-    else if (!doUpdateMax && doUpdateMin)
-    {
-      if (minLengthFacet != null)
-      {
-        if (min != null)
-        {
-          if (min.equals(currentMax))
-          {
-            lengthFacet = XSDFactory.eINSTANCE.createXSDLengthFacet();
-            lengthFacet.setLexicalValue(min);
-            xsdSimpleType.getFacetContents().add(lengthFacet);
-            xsdSimpleType.getFacetContents().remove(maxLengthFacet);
-            xsdSimpleType.getFacetContents().remove(minLengthFacet);
-          }
-          else
-          {
-            if (lengthFacet != null)
-            {
-              xsdSimpleType.getFacetContents().remove(lengthFacet);
-            }
-            if (maxLengthFacet == null && currentLength != null)
-            {
-              maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
-              maxLengthFacet.setLexicalValue(currentLength);
-              xsdSimpleType.getFacetContents().add(maxLengthFacet);
-            }
-            minLengthFacet.setLexicalValue(min);
-          }
-        }
-        else
-        {
-          xsdSimpleType.getFacetContents().remove(minLengthFacet);
-        }
-      }
-      else
-      {
-        if (currentMax != null && currentMax.equals(min))
-        {
-          if (lengthFacet == null)
-          {
-            lengthFacet = XSDFactory.eINSTANCE.createXSDLengthFacet();
-            xsdSimpleType.getFacetContents().add(lengthFacet);
-          }
-          lengthFacet.setLexicalValue(min);
-          xsdSimpleType.getFacetContents().remove(maxLengthFacet);
-        }
-        else if (currentLength != null && !currentLength.equals(min))
-        {
-          xsdSimpleType.getFacetContents().remove(lengthFacet);
-
-          if (min != null)
-          {
-            minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
-            minLengthFacet.setLexicalValue(min);
-            xsdSimpleType.getFacetContents().add(minLengthFacet);
-          }
-
-          maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
-          maxLengthFacet.setLexicalValue(currentLength);
-          xsdSimpleType.getFacetContents().add(maxLengthFacet);
-        }
-        else
-        {
-          minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
-          minLengthFacet.setLexicalValue(min);
-          xsdSimpleType.getFacetContents().add(minLengthFacet);
-
-          if (lengthFacet != null)
-          {
-            xsdSimpleType.getFacetContents().remove(lengthFacet);
-
-            maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
-            maxLengthFacet.setLexicalValue(currentLength);
-            xsdSimpleType.getFacetContents().add(maxLengthFacet);
-          }
-        }
-      }
-    }
-    formatChild(xsdSimpleType.getElement());
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java
deleted file mode 100644
index 157c1a9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDResourceImpl;
-
-public class UpdateTypeReferenceAndManageDirectivesCommand extends UpdateComponentReferenceAndManageDirectivesCommand
-{
-
-  public UpdateTypeReferenceAndManageDirectivesCommand(XSDConcreteComponent concreteComponent,
-		  String componentName, String componentNamespace, IFile file)
-  {
-	  super(concreteComponent, componentName, componentNamespace, file);
-  }
-
-  public XSDComponent computeComponent()
-  {
-    XSDComponent result = null;
-    XSDSchema schema = concreteComponent.getSchema();
-    XSDSchemaDirective directive = null;
-    
-    // TODO (cs) handle case where namespace==null
-    //
-    if (componentNamespace != null)
-    {  
-      if (XSDConstants.isSchemaForSchemaNamespace(componentNamespace))
-      {
-        // this is the easy case, its just a built-in type
-        //
-        result = getDefinedComponent(schema, componentName, componentNamespace);        
-      }  
-      else
-      {
-        // lets see if the type is already visible to our schema
-        result = getDefinedComponent(schema, componentName, componentNamespace);                     
-        if (result == null)
-        {
-          // TODO (cs) we need to provide a separate command to do this part
-          // TODO (trung) directives in the outline view does not get updated
-          // apparently the type is not yet visible, we need to add includes/imports to get to it
-          if (componentNamespace.equals(schema.getTargetNamespace()))
-          {
-            // we need to add an include
-            directive =XSDFactory.eINSTANCE.createXSDInclude();
-          }
-          else
-          {
-            // we need to add an import
-            XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport();
-            xsdImport.setNamespace(componentNamespace);
-            directive = xsdImport;              
-          }  
-          
-          // TODO (cs) we need to compute a relative URI to make this nicer!
-          //
-          String fileURI = file.getLocationURI().toString();
-          if (fileURI.startsWith("file:/") && !fileURI.startsWith("file:///"))
-          {
-            fileURI = "file:///" + fileURI.substring(6);
-          }   
-          directive.setSchemaLocation(fileURI);
-          
-          // TODO (cs) we should at the directive 'next' in the list of directives
-          // for now I'm just adding as the first thing in the schema :-(         
-          //
-          schema.getContents().add(0, directive);           
-          XSDSchema resolvedSchema = directive.getResolvedSchema();        
-         
-          if (resolvedSchema == null)
-          {
-            System.out.println("resolvedSchema is null!!!");
-            Resource resource  = concreteComponent.eResource().getResourceSet().createResource(URI.createURI(fileURI));          
-            if (resource instanceof XSDResourceImpl)
-            {
-              try
-              {
-              resource.load(null);
-              XSDResourceImpl resourceImpl = (XSDResourceImpl)resource;
-              resolvedSchema = resourceImpl.getSchema();
-              if (resolvedSchema != null)
-              {
-                System.out.println("Strange... managed to make the schema resovle myself 8-P" + resource);
-                directive.setResolvedSchema(resolvedSchema);
-              }
-              }
-              catch (Exception e)
-              {
-                
-              }
-            }  
-          }
-          if (resolvedSchema != null)
-          {  
-            result = getDefinedComponent(resolvedSchema, componentName, componentNamespace);
-          }    
-          else 
-          {
-            // TODO (cs) consider setting some error state so that the client can provide a  pop-dialog error
-            // we should also remove the import/include so save from cluttering the file with bogus directives                           
-          }
-        }
-      }   
-    }  
-    return result;
-  }
- 
-  
-  private XSDTypeDefinition getDefinedComponent(XSDSchema schema, String componentName, String componentNamespace)
-  {
-    XSDTypeDefinition result = schema.resolveTypeDefinition(componentNamespace, componentName);
-    if (result.eContainer() == null)
-    {
-      result = null;
-    }      
-    return result;
-  }
-  
-  
-  public void execute()
-  {
-    try
-    {
-    XSDComponent td = computeComponent();
-    if (td != null && td instanceof XSDTypeDefinition)
-    {
-      UpdateTypeReferenceCommand command = new UpdateTypeReferenceCommand(
-    		  concreteComponent, (XSDTypeDefinition) td);
-      command.execute();
-    }
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateTypeReferenceCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateTypeReferenceCommand.java
deleted file mode 100644
index b9b9a8a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateTypeReferenceCommand.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class UpdateTypeReferenceCommand extends Command
-{
-  XSDConcreteComponent concreteComponent;
-  XSDTypeDefinition newType;
-  
-  public UpdateTypeReferenceCommand(XSDConcreteComponent concreteComponent, XSDTypeDefinition newType)
-  {
-    this.concreteComponent = concreteComponent;
-    this.newType = newType;
-  }
-   
-  public void execute()
-  {
-    
-    if (concreteComponent instanceof XSDElementDeclaration)
-    {
-      setElementType((XSDElementDeclaration)concreteComponent);
-    }  
-    else if (concreteComponent instanceof XSDAttributeUse)
-    {
-      setAttributeType((XSDAttributeUse)concreteComponent);      
-    }  
-    else if (concreteComponent instanceof XSDAttributeDeclaration)
-    {
-      setAttributeType((XSDAttributeDeclaration)concreteComponent);
-    }  
-  }
- 
-  protected void setElementType(XSDElementDeclaration ed)
-  {
-    ed = ed.getResolvedElementDeclaration();
-    if (ed != null)
-    {  
-      ed.setTypeDefinition(newType);
-    }      
-  }
-  
-  protected void setAttributeType(XSDAttributeUse attributeUse)
-  {
-    setAttributeType(attributeUse.getAttributeDeclaration());
-  }
-  
-  protected void setAttributeType(XSDAttributeDeclaration ad)
-  {
-    ad = ad.getResolvedAttributeDeclaration();
-    if (ad != null && newType instanceof XSDSimpleTypeDefinition)
-    {
-      ad.setTypeDefinition((XSDSimpleTypeDefinition)newType);
-    }  
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateXSDPatternFacetCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateXSDPatternFacetCommand.java
deleted file mode 100644
index 2880469..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateXSDPatternFacetCommand.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class UpdateXSDPatternFacetCommand extends BaseCommand
-{
-  public static final int ADD = 0;
-  public static final int DELETE = 1;
-  public static final int UPDATE = 2;
-  
-  XSDSimpleTypeDefinition xsdSimpleTypeDefinition;
-  String value;
-  int actionType;
-  XSDPatternFacet patternToEdit;
-  
-  public UpdateXSDPatternFacetCommand(String label, XSDSimpleTypeDefinition xsdSimpleTypeDefinition, int actionType)
-  {
-    super(label);
-    this.xsdSimpleTypeDefinition = xsdSimpleTypeDefinition;
-    this.actionType = actionType;
-    
-  }
-  
-  public void setValue(String value)
-  {
-    this.value = value;
-  }
-  
-  public void setPatternToEdit(XSDPatternFacet patternToEdit)
-  {
-    this.patternToEdit = patternToEdit;
-  }
-
-  public void execute()
-  {
-    if (actionType == ADD)
-    {
-      XSDPatternFacet pattern = XSDFactory.eINSTANCE.createXSDPatternFacet();
-      pattern.setLexicalValue(value);
-      xsdSimpleTypeDefinition.getFacetContents().add(pattern);
-    }
-    else if (actionType == DELETE)
-    {
-      Assert.isNotNull(patternToEdit);
-      if (xsdSimpleTypeDefinition.getFacetContents().contains(patternToEdit))
-        xsdSimpleTypeDefinition.getFacetContents().remove(patternToEdit);
-    }
-    else if (actionType == UPDATE)
-    {
-      Assert.isNotNull(patternToEdit);
-      patternToEdit.setLexicalValue(value);
-    }
-    formatChild(xsdSimpleTypeDefinition.getElement());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateXSDWhiteSpaceFacetCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateXSDWhiteSpaceFacetCommand.java
deleted file mode 100644
index 05b64d6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/commands/UpdateXSDWhiteSpaceFacetCommand.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWhiteSpace;
-import org.eclipse.xsd.XSDWhiteSpaceFacet;
-
-public class UpdateXSDWhiteSpaceFacetCommand extends BaseCommand
-{
-  XSDSimpleTypeDefinition xsdSimpleTypeDefinition;
-  boolean doAddFacet;
-  
-  public UpdateXSDWhiteSpaceFacetCommand(String label, XSDSimpleTypeDefinition xsdSimpleType, boolean doAddFacet)
-  {
-    super(label);
-    this.xsdSimpleTypeDefinition = xsdSimpleType;
-    this.doAddFacet = doAddFacet;
-  }
-
-  public void execute()
-  {
-    XSDWhiteSpaceFacet whitespaceFacet = xsdSimpleTypeDefinition.getWhiteSpaceFacet();
-    
-    if (doAddFacet)
-    {
-      if (whitespaceFacet == null)
-      {
-        whitespaceFacet = XSDFactory.eINSTANCE.createXSDWhiteSpaceFacet();
-        xsdSimpleTypeDefinition.getFacetContents().add(whitespaceFacet);
-      }
-      whitespaceFacet.setLexicalValue(XSDWhiteSpace.COLLAPSE_LITERAL.getName());
-    }
-    else
-    {
-      if (whitespaceFacet != null)
-      {
-        xsdSimpleTypeDefinition.getFacetContents().remove(whitespaceFacet);
-      }
-    }
-    formatChild(xsdSimpleTypeDefinition.getElement());    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/providers/XSDSectionLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/providers/XSDSectionLabelProvider.java
deleted file mode 100644
index b633a98..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/providers/XSDSectionLabelProvider.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.providers;
-
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.editor.Messages;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.editor.internal.adapters.XSDBaseAdapter;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-public class XSDSectionLabelProvider extends LabelProvider
-{
-  /**
-   * 
-   */
-  public XSDSectionLabelProvider()
-  {
-    super();
-  }
-
-  /**
-   * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-   */
-  public Image getImage(Object object)
-  {
-    if (object == null || object.equals(StructuredSelection.EMPTY))
-    {
-      return null;
-    }
-    Image result = null;
-    if (object instanceof StructuredSelection)
-    {
-      Object selected = ((StructuredSelection) object).getFirstElement();
-
-      if (selected instanceof XSDConcreteComponent)
-      {
-        XSDBaseAdapter adapter = (XSDBaseAdapter)XSDAdapterFactory.getInstance().adapt((XSDConcreteComponent)selected);
-        if (adapter instanceof ITreeElement)
-        {
-          return ((ITreeElement)adapter).getImage();
-        }
-        
-      }
-    }
-    return result;
-  }
-
-  /**
-   * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-   */
-  public String getText(Object object)
-  {
-    if (object == null || object.equals(StructuredSelection.EMPTY))
-    {
-      return "No items selected";
-    }
-
-    String result = null;
-
-    boolean isReference = false;
-    Object selected = null;
-    if (object instanceof StructuredSelection)
-    {
-      selected = ((StructuredSelection) object).getFirstElement();
-
-      if (selected instanceof XSDConcreteComponent)
-      {
-        if (selected instanceof XSDElementDeclaration)
-        {
-          XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) selected;
-          if (xsdElementDeclaration.isElementDeclarationReference())
-          {
-            isReference = true;
-          }
-        } else if (selected instanceof XSDAttributeDeclaration)
-        {
-          if (((XSDAttributeDeclaration) selected).isAttributeDeclarationReference())
-          {
-            isReference = true;
-          }
-        } else if (selected instanceof XSDModelGroupDefinition)
-        {
-          if (((XSDModelGroupDefinition) selected).isModelGroupDefinitionReference())
-          {
-            isReference = true;
-          }
-        }
-        StringBuffer sb = new StringBuffer();
-        Element element = ((XSDConcreteComponent) selected).getElement();
-        if (element != null)
-        {
-          sb.append(((XSDConcreteComponent) selected).getElement().getLocalName());
-
-          if (isReference)
-          {
-            sb.append(" ");//$NON-NLS-1$
-            sb.append(Messages.UI_PAGE_HEADING_REFERENCE);
-          }
-
-          IWorkbench workbench = PlatformUI.getWorkbench();
-          IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-          IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-          XSDSchema xsdSchema = ((XSDConcreteComponent) selected).getSchema();
-          if (xsdSchema != editorPart.getAdapter(XSDSchema.class))
-          {
-            sb.append(" (" + Messages.UI_LABEL_READ_ONLY + ")"); //$NON-NLS-1$
-          }
-          return sb.toString();
-        }
-        else
-        {
-          return "(" + Messages.UI_LABEL_READ_ONLY + ")"; //$NON-NLS-1$
-        }
-      }
-
-      if (object instanceof Element)
-      {
-        return ((Element) object).getLocalName();
-      }
-    }
-
-    return result;
-  }
-
-  private Object getObject(Object objects, boolean multiple[])
-  {
-    Assert.isNotNull(objects);
-    Object object = null;
-    return object;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AbstractSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AbstractSection.java
deleted file mode 100644
index ba785f2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AbstractSection.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.SubContributionManager;
-import org.eclipse.jface.action.SubStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public abstract class AbstractSection extends AbstractPropertySection implements SelectionListener, Listener
-{
-  protected Composite composite;
-  protected PaintListener painter;
-  protected XSDSchema xsdSchema;
-  protected Object input;
-  protected boolean isReadOnly;
-  protected boolean listenerEnabled = true;
-  protected boolean isSimple;
-  protected CustomListener customListener = new CustomListener();
-  protected IEditorPart owningEditor;
-  private IStatusLineManager statusLine;
-  
-  public static final Image ICON_ERROR = XSDEditorPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
-  
-  public AbstractSection()
-  {
-    super();
-  }
-  
-  public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage)
-  {
-    super.createControls(parent, aTabbedPropertySheetPage);
-    isSimple = getIsSimple();
-    createContents(parent);
-  }
-  
-  protected abstract void createContents(Composite parent);
-
-    protected PaintListener createPainter() {
-        return new PaintListener() {
-
-            public void paintControl(PaintEvent e) {
-                Rectangle bounds = composite.getClientArea();
-                GC gc = e.gc;
-
-                gc.setForeground(gc.getBackground());
-                gc.setBackground(getWidgetFactory().getColors().getColor(
-                    FormColors.TB_BG));
-
-//                gc.fillGradientRectangle(4 + bounds.width / 2, 0,
-//                    bounds.width / 2 - 9, bounds.height, false);
-
-                gc.setForeground(getWidgetFactory().getColors().getColor(
-                    FormColors.TB_BORDER));
-//                gc.drawLine(bounds.width - 5, 0, bounds.width - 5,
-//                    bounds.height);
-            }
-
-        };
-
-    }
-    
-    public void dispose()
-    {
-        if (composite != null && ! composite.isDisposed() && painter != null)
-            composite.removePaintListener(painter);
-        
-        super.dispose();
-    }
-
-    public void setInput(IWorkbenchPart part, ISelection selection) {
-        super.setInput(part, selection);
-        isSimple = getIsSimple();
-        Object input = ((IStructuredSelection)selection).getFirstElement();
-        this.input = input;
-        
-        if (input instanceof XSDConcreteComponent)
-        {
-          xsdSchema = ((XSDConcreteComponent)input).getSchema();
-        }
-        
-        // set owning editor of this section
-        if (part!=null)
-        {
-            if (part instanceof IEditorPart)
-            {
-                owningEditor = (IEditorPart)part;
-            }
-            else
-            {
-                owningEditor = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
-            }
-        }
-        if (xsdSchema == owningEditor.getAdapter(XSDSchema.class))
-        {
-          isReadOnly = false;
-        }
-        else
-        {
-          isReadOnly = true;
-        }
-
-    }
-
-    public void refresh()
-    {
-      super.refresh();
-
-      if (isReadOnly)
-      {
-        composite.setEnabled(false);
-      }
-      else
-      {
-        composite.setEnabled(true);
-      }
-    }
-
-    public void applyAllListeners(Control control)
-    {
-      control.addListener(SWT.Modify, customListener);
-      control.addListener(SWT.FocusOut, customListener);
-      control.addListener(SWT.KeyDown, customListener);
-    }
-    
-    public void applyModifyListeners(Control control)
-    {
-      control.addListener(SWT.Modify, customListener);
-      control.addListener(SWT.FocusOut, customListener);
-    }
-
-    public void applyKeyListener(Control control)
-    {
-      control.addListener(SWT.KeyDown, customListener);
-    }
-
-    public void removeListeners(Control control)
-    {
-      control.removeListener(SWT.Modify, customListener);
-      control.removeListener(SWT.FocusOut, customListener);
-      control.removeListener(SWT.KeyDown, customListener);
-    }
-    
-    public void doWidgetDefaultSelected(SelectionEvent e)
-    {}
-    
-    public void doWidgetSelected(SelectionEvent e)
-    {}
-
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (isListenerEnabled() &&
-          input != null &&
-          !isReadOnly) 
-      {
-        doWidgetSelected(e);
-      }
-    }
-
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-      if (isListenerEnabled() &&
-          input != null &&
-          !isReadOnly) 
-      {
-        doWidgetDefaultSelected(e);
-      }
-    }
-
-    /**
-     * Get the value of listenerEnabled.
-     * @return value of listenerEnabled.
-     */
-    public boolean isListenerEnabled() 
-    {
-      return listenerEnabled;
-    }
-    
-    /**
-     * Set the value of listenerEnabled.
-     * @param v  Value to assign to listenerEnabled.
-     */
-    public void setListenerEnabled(boolean  v) 
-    {
-      this.listenerEnabled = v;
-    }
-
-    /**
-     * Sent when an event that the receiver has registered for occurs.
-     *
-     * @param event the event which occurred
-     */
-    public void handleEvent(Event event)
-    {
-      if (isListenerEnabled() && !isReadOnly) 
-      {
-        doHandleEvent(event);
-      }
-    }
-
-    /**
-     * Subclasses should override
-     * @param event
-     */
-    protected void doHandleEvent(Event event)
-    {
-    }
-
-    protected IEditorPart getActiveEditor()
-    {
-      IWorkbench workbench = PlatformUI.getWorkbench();
-      IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-      IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-      this.owningEditor = editorPart;
-      return editorPart;
-    }
-    
-    public CommandStack getCommandStack()
-    {
-      Object commandStack = owningEditor.getAdapter(CommandStack.class); 
-          
-      if (commandStack==null)
-          return null;
-      else
-          return (CommandStack)commandStack;
-    }
-    
-    public boolean getIsSimple()
-    {
-      return false;
-    }
-    
-    
-    
-    /**
-     * Intended to display error messages.
-     * @return
-     */
-    private IStatusLineManager getStatusLineManager()
-    {
-      if (statusLine==null && getPart()!=null)
-      {
-        if(getPart().getSite() instanceof IEditorSite)
-          statusLine = ((IEditorSite)getPart().getSite()).getActionBars().getStatusLineManager();
-        else if (getPart().getSite() instanceof IViewSite)
-          statusLine = ((IViewSite)getPart().getSite()).getActionBars().getStatusLineManager();
-        
-        /* 
-         * We must manually set the visibility of the status line since the action bars are from the editor
-         * which means the status line only shows up when the editor is in focus (by default).
-         * Note only a SubStatusLineManager can set the visibility.
-         */
-        if (statusLine instanceof SubStatusLineManager)
-          ((SubStatusLineManager)statusLine).setVisible(true);
-      }
-      
-      return statusLine;
-    }
-
-    /**
-     * Display an error message in the status line.
-     * Call setErrorMessage(null) to clear the status line.
-     * @param text 
-     */
-    public void setErrorMessage(String text)
-    {
-      IStatusLineManager statusLine = getStatusLineManager();
-
-      if (statusLine!=null)
-      {
-        if (text==null || text.length()<1)
-          statusLine.setErrorMessage(null);
-        else
-          statusLine.setErrorMessage(ICON_ERROR, text);
-
-        // ensure our message gets displayed
-        if (statusLine instanceof SubContributionManager)
-          ((SubContributionManager)statusLine).setVisible(true);
-        
-        statusLine.update(true);
-      }
-    }
-
-    
-    protected EObject getModel()
-    {
-      return (XSDComponent)input;
-    }
-
-    
-    class CustomListener implements Listener
-    {
-      boolean handlingEvent = false;
-      public void handleEvent(Event event)
-      {
-        if (isListenerEnabled() && !isReadOnly) 
-        {
-          switch (event.type)
-          {
-            case SWT.KeyDown :
-            {
-              if (event.character == SWT.CR)
-              {
-                if (!handlingEvent)
-                {
-                  handlingEvent = true;
-                  doHandleEvent(event);
-                  handlingEvent = false;
-                }
-              }
-              break;
-            }
-            case SWT.FocusOut :
-            {
-              if (!handlingEvent)
-              {
-                handlingEvent = true;
-                doHandleEvent(event);
-                handlingEvent = false;
-              }
-              break;
-            }
-          }
-        }
-      }
-    }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AbstractSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AbstractSectionDescriptor.java
deleted file mode 100644
index 19a3545..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AbstractSectionDescriptor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class AbstractSectionDescriptor implements ISectionDescriptor
-{
-  /**
-   * 
-   */
-  public AbstractSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getFilter()
-   */
-  public IFilter getFilter()
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDConcreteComponent.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDConcreteComponent || object instanceof Element)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
-   */
-  public String getAfterSection()
-  {
-    return "";
-  }
-
-  
-  public int getEnablesFor()
-  {
-	return ENABLES_FOR_ANY;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AnnotationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AnnotationSection.java
deleted file mode 100644
index 9ec3844..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/AnnotationSection.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.common.commands.AddDocumentationCommand;
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AnnotationSection extends AbstractSection
-{
-  Text simpleText;
-
-  public void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-
-    simpleText = getWidgetFactory().createText(composite, "", SWT.V_SCROLL | SWT.H_SCROLL); //$NON-NLS-1$
-    simpleText.addListener(SWT.Modify, this);
-
-    FormData data = new FormData();
-    data.left = new FormAttachment(0, 1);
-    data.right = new FormAttachment(100, -1);
-    data.top = new FormAttachment(0, 1);
-    data.bottom = new FormAttachment(100, -1);
-    simpleText.setLayoutData(data);
-  }
-
-  public AnnotationSection()
-  {
-    super();
-  }
-
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    super.refresh();
-    setListenerEnabled(false);
-    if (input instanceof XSDConcreteComponent)
-    {
-      XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation((XSDConcreteComponent) input, false);
-      setInitialText(xsdAnnotation);
-    }
-    setListenerEnabled(true);
-  }
-
-  public void doHandleEvent(Event event)
-  {
-    if (input instanceof XSDConcreteComponent)
-    {
-      if (event.widget == simpleText)
-      {
-        AddDocumentationCommand command = new AddDocumentationCommand("Add Documentation", null, (XSDConcreteComponent) input, simpleText.getText(), "");
-        getCommandStack().execute(command);
-      }
-    }
-
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-
-  public void dispose()
-  {
-
-  }
-
-  private void setInitialText(XSDAnnotation an)
-  {
-    if (an != null)
-    {
-      try
-      {
-        List documentationList = an.getUserInformation();
-        if (documentationList.size() > 0)
-        {
-          Element docElement = (Element) documentationList.get(0);
-          if (docElement != null)
-          {
-            simpleText.setText(doSerialize(docElement));
-          }
-        }
-      }
-      catch (Exception e)
-      {
-
-      }
-    }
-    else
-    {
-      simpleText.setText("");
-    }
-  }
-
-  private String doSerialize(Element element) throws IOException
-  {
-    String source = "";
-
-    Node firstChild = element.getFirstChild();
-    Node lastChild = element.getLastChild();
-    int start = 0;
-    int end = 0;
-
-    if (element instanceof IDOMElement)
-    {
-      IDOMElement domElement = (IDOMElement) element;
-      IDOMModel model = domElement.getModel();
-      IDOMDocument doc = model.getDocument();
-
-      if (firstChild instanceof IDOMNode)
-      {
-        IDOMNode first = (IDOMNode) firstChild;
-        start = first.getStartOffset();
-      }
-      if (lastChild instanceof IDOMNode)
-      {
-        IDOMNode last = (IDOMNode) lastChild;
-        end = last.getEndOffset();
-      }
-      source = doc.getSource().substring(start, end);
-    }
-
-    return source;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/ApplicationInfoSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/ApplicationInfoSection.java
deleted file mode 100644
index 29e27e7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/ApplicationInfoSection.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.commands.AddAppInfoAttributeCommand;
-import org.eclipse.wst.xsd.ui.common.commands.AddAppInfoCommand;
-import org.eclipse.wst.xsd.ui.common.commands.AddAppInfoElementCommand;
-import org.eclipse.wst.xsd.ui.common.commands.RemoveAppInfoAttrCommand;
-import org.eclipse.wst.xsd.ui.common.commands.RemoveAppInfoElementCommand;
-import org.eclipse.wst.xsd.ui.common.properties.sections.appinfo.AddApplicationInfoDialog;
-import org.eclipse.wst.xsd.ui.common.properties.sections.appinfo.ApplicationInformationPropertiesRegistry;
-import org.eclipse.wst.xsd.ui.common.properties.sections.appinfo.ApplicationInformationTableTreeViewer;
-import org.eclipse.wst.xsd.ui.common.properties.sections.appinfo.SpecificationForAppinfoSchema;
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class ApplicationInfoSection extends AbstractSection
-{
-  protected static final Image DEFAULT_ELEMENT_ICON = XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
-  protected static final Image DEFAULT_ATTR_ICON = XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
-  protected ApplicationInformationTableTreeViewer tableTree;
-  protected TableViewer extensibleElementsTable;
-  protected Label extensibilityElementsLabel, contentLabel;
-  protected ISelectionChangedListener elementSelectionChangedListener;
-
-  private Composite page, pageBook2;
-  private Button addButton, removeButton;
-  private PageBook pageBook;
-
-  /**
-   * 
-   */
-  public ApplicationInfoSection()
-  {
-    super();
-  }
-
-  public void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 1;
-    composite.setLayout(gridLayout);
-
-    GridData gridData = new GridData();
-
-    page = getWidgetFactory().createComposite(composite);
-    gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 1;
-    page.setLayout(gridLayout);
-
-    gridData = new GridData();
-    gridData.grabExcessHorizontalSpace = true;
-    gridData.grabExcessVerticalSpace = true;
-    gridData.verticalAlignment = GridData.FILL;
-    gridData.horizontalAlignment = GridData.FILL;
-    page.setLayoutData(gridData);
-
-    pageBook = new PageBook(page, SWT.FLAT);
-    gridData = new GridData();
-    gridData.grabExcessHorizontalSpace = true;
-    gridData.grabExcessVerticalSpace = true;
-    gridData.verticalAlignment = GridData.FILL;
-    gridData.horizontalAlignment = GridData.FILL;
-    pageBook.setLayoutData(gridData);
-
-    pageBook2 = getWidgetFactory().createComposite(pageBook, SWT.FLAT);
-
-    gridLayout = new GridLayout();
-    gridLayout.marginHeight = 2;
-    gridLayout.marginWidth = 2;
-    gridLayout.numColumns = 1;
-    pageBook2.setLayout(gridLayout);
-
-    gridData = new GridData();
-    gridData.grabExcessHorizontalSpace = true;
-    gridData.grabExcessVerticalSpace = true;
-    gridData.verticalAlignment = GridData.FILL;
-    gridData.horizontalAlignment = GridData.FILL;
-    pageBook2.setLayoutData(gridData);
-
-    SashForm sashForm = new SashForm(pageBook2, SWT.HORIZONTAL);
-    gridData = new GridData();
-    gridData.grabExcessHorizontalSpace = true;
-    gridData.grabExcessVerticalSpace = true;
-    gridData.verticalAlignment = GridData.FILL;
-    gridData.horizontalAlignment = GridData.FILL;
-    sashForm.setLayoutData(gridData);
-
-    Composite leftContent = getWidgetFactory().createComposite(sashForm, SWT.FLAT);
-    gridLayout = new GridLayout();
-    gridLayout.numColumns = 1;
-    leftContent.setLayout(gridLayout);
-
-    extensibilityElementsLabel = getWidgetFactory().createLabel(leftContent, "Extensibility Items");
-    extensibleElementsTable = new TableViewer(leftContent, SWT.FLAT | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.LINE_SOLID);
-    gridLayout = new GridLayout();
-    gridLayout.numColumns = 1;
-    extensibleElementsTable.getTable().setLayout(gridLayout);
-    gridData = new GridData();
-    gridData.grabExcessHorizontalSpace = true;
-    gridData.grabExcessVerticalSpace = true;
-    gridData.verticalAlignment = GridData.FILL;
-    gridData.horizontalAlignment = GridData.FILL;
-    extensibleElementsTable.getTable().setLayoutData(gridData);
-    extensibleElementsTable.setContentProvider(new ElementTableContentProvider());
-    extensibleElementsTable.setLabelProvider(new ElementTableLabelProvider());
-    elementSelectionChangedListener = new ElementSelectionChangedListener();
-    extensibleElementsTable.addSelectionChangedListener(elementSelectionChangedListener);
-    extensibleElementsTable.getTable().addMouseTrackListener(new MouseTrackAdapter()
-    {
-      public void mouseHover(org.eclipse.swt.events.MouseEvent e)
-      {
-        ISelection selection = extensibleElementsTable.getSelection();
-        if (selection instanceof StructuredSelection)
-        {
-          Object obj = ((StructuredSelection) selection).getFirstElement();
-          if (obj instanceof Element)
-          {
-            Element element = (Element) obj;
-            ApplicationInformationPropertiesRegistry registry = XSDEditorPlugin.getDefault().getApplicationInformationPropertiesRegistry();
-            // ApplicationSpecificSchemaProperties[] properties =
-            // registry.getAllApplicationSpecificSchemaProperties();
-            // ApplicationSpecificSchemaProperties[] properties =
-            // (ApplicationSpecificSchemaProperties[])
-            // registry.getAllApplicationSpecificSchemaProperties().toArray(new
-            // ApplicationSpecificSchemaProperties[0]);
-            List properties = registry.getAllApplicationSpecificSchemaProperties();
-
-            int length = properties.size();
-            for (int i = 0; i < length; i++)
-            {
-              SpecificationForAppinfoSchema current = (SpecificationForAppinfoSchema) properties.get(i);
-              if (current.getNamespaceURI().equals(element.getNamespaceURI()))
-              {
-                extensibleElementsTable.getTable().setToolTipText(current.getDescription());
-                break;
-              }
-            }
-          }
-        }
-      };
-
-    });
-
-    Composite rightContent = getWidgetFactory().createComposite(sashForm, SWT.FLAT);
-
-    contentLabel = getWidgetFactory().createLabel(rightContent, "Content");
-
-    Composite testComp = getWidgetFactory().createComposite(rightContent, SWT.FLAT);
-
-    gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.marginLeft = 0;
-    gridLayout.marginRight = 0;
-    gridLayout.numColumns = 1;
-    gridLayout.marginHeight = 3;
-    gridLayout.marginWidth = 3;
-    rightContent.setLayout(gridLayout);
-
-    gridData = new GridData();
-    gridData.grabExcessHorizontalSpace = true;
-    gridData.grabExcessVerticalSpace = true;
-    gridData.verticalAlignment = GridData.FILL;
-    gridData.horizontalAlignment = GridData.FILL;
-    rightContent.setLayoutData(gridData);
-
-    gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginLeft = 0;
-    gridLayout.marginRight = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.marginHeight = 3;
-    gridLayout.marginWidth = 3;
-    gridLayout.numColumns = 1;
-    testComp.setLayout(gridLayout);
-
-    gridData = new GridData();
-    gridData.grabExcessHorizontalSpace = true;
-    gridData.grabExcessVerticalSpace = true;
-    gridData.verticalAlignment = GridData.FILL;
-    gridData.horizontalAlignment = GridData.FILL;
-    testComp.setLayoutData(gridData);
-
-    createElementContentWidget(testComp);
-
-    int[] weights = { 30, 70 };
-    sashForm.setWeights(weights);
-
-    Composite buttonComposite = getWidgetFactory().createComposite(pageBook2, SWT.FLAT);
-    gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 2;
-    gridLayout.makeColumnsEqualWidth = true;
-    buttonComposite.setLayout(gridLayout);
-    addButton = getWidgetFactory().createButton(buttonComposite, "Add...", SWT.FLAT);
-    addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-    addButton.addSelectionListener(this);
-    addButton.setToolTipText("Add Extension Component");
-    removeButton = getWidgetFactory().createButton(buttonComposite, "Remove", SWT.FLAT);
-    removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-    removeButton.addSelectionListener(this);
-    removeButton.setToolTipText("Remove Extension Component");
-
-    pageBook.showPage(pageBook2);
-  }
-
-  protected void createElementContentWidget(Composite parent)
-  {
-    tableTree = new ApplicationInformationTableTreeViewer(parent);
-    GridData gridData = new GridData();
-    gridData.grabExcessHorizontalSpace = true;
-    gridData.grabExcessVerticalSpace = true;
-    gridData.verticalAlignment = GridData.FILL;
-    gridData.horizontalAlignment = GridData.FILL;
-
-    tableTree.getControl().setLayoutData(gridData);
-  }
-
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    setListenerEnabled(false);
-    if (input != null)
-    {
-      tableTree.setInput(null);
-      tableTree.getTree().removeAll();
-      extensibleElementsTable.getTable().removeAll();
-      
-      extensibleElementsTable.setInput(input);
-
-      if (extensibleElementsTable.getTable().getSelectionCount() == 0)
-      {
-        Object o = extensibleElementsTable.getElementAt(0);
-        if (o != null)
-        {
-          extensibleElementsTable.setSelection(new StructuredSelection(o));
-          if (o instanceof Element)
-          {
-            tableTree.setInput(((Element) o).getParentNode());
-          }
-        }
-        tableTree.refresh();
-      }
-
-    }
-    setListenerEnabled(true);
-
-  }
-
-  public Composite getPage()
-  {
-    return page;
-  }
-
-  public void widgetSelected(SelectionEvent event)
-  {
-    if (event.widget == addButton)
-    {
-        ApplicationInformationPropertiesRegistry registry = XSDEditorPlugin.getDefault().getApplicationInformationPropertiesRegistry();
-      AddApplicationInfoDialog dialog = new AddApplicationInfoDialog(composite.getShell(), registry);
-
-      List properties = registry.getAllApplicationSpecificSchemaProperties();
-
-      dialog.setInput(properties);
-      dialog.setBlockOnOpen(true);
-
-      if (dialog.open() == Window.OK)
-      {
-        Object[] result = dialog.getResult();
-        if (result != null)
-        {
-          SpecificationForAppinfoSchema appInfoSchemaSpec = (SpecificationForAppinfoSchema) result[1];
-          if (input instanceof XSDConcreteComponent)
-          {
-            AddAppInfoCommand addAppInfo = null;
-            if (result[0] instanceof XSDElementDeclaration)
-            {
-              XSDElementDeclaration element = (XSDElementDeclaration) result[0];
-              addAppInfo = new AddAppInfoElementCommand("Add AppInfo Element", (XSDConcreteComponent) input, element);
-            }
-            else if (result[0] instanceof XSDAttributeDeclaration)
-            {
-              XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) result[0];
-              addAppInfo = new AddAppInfoAttributeCommand("Add AppInfo Attribute", (XSDConcreteComponent) input, attribute);
-            }
-            else
-              return;
-
-            addAppInfo.setSchemaProperties(appInfoSchemaSpec);
-            if (getCommandStack() != null)
-            {
-              getCommandStack().execute(addAppInfo);
-            }
-          }
-        }
-        extensibleElementsTable.refresh();
-        refresh();
-      }
-
-    }
-    else if (event.widget == removeButton)
-    {
-      ISelection selection = extensibleElementsTable.getSelection();
-      
-      if (selection instanceof StructuredSelection)
-      {
-    	Command command = null;
-        Object o = ((StructuredSelection) selection).getFirstElement();
-        if (o instanceof Element)
-        {
-            XSDAnnotation xsdAnnotation = (XSDAnnotation) extensibleElementsTable.getInput();
-        	Node appInfoElement = ((Element) o).getParentNode();
-        	command = new RemoveAppInfoElementCommand("Remove AppInfo Element",
-        			xsdAnnotation, appInfoElement);
-        }
-        else if (o instanceof Attr){
-        	Element hostElement = ((Attr) o).getOwnerElement();
-        	command = new RemoveAppInfoAttrCommand("Remove AppInfo Attribute",
-        			hostElement, (Attr) o);
-        }
-        else 
-        	return;
-        if (getCommandStack() != null)
-        {
-        	getCommandStack().execute(command);
-        	extensibleElementsTable.setInput(input);
-        	extensibleElementsTable.refresh();
-        	
-        	if (extensibleElementsTable.getTable().getItemCount() > 0)
-        	{
-        		Object object = extensibleElementsTable.getElementAt(0);
-        		if (object != null)
-        		{
-        			extensibleElementsTable.setSelection(new StructuredSelection(object));
-        		}
-        	}
-        	else
-        	{
-        		tableTree.setInput(null);
-        	}
-        }
-      }
-    }
-    else if (event.widget == extensibleElementsTable.getTable())
-    {
-
-    }
-  }
-
-  public void widgetDefaultSelected(SelectionEvent event)
-  {
-
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-
-  public void dispose()
-  {
-
-  }
-
-  static class ElementTableContentProvider implements IStructuredContentProvider
-  {
-    protected String facet;
-
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-    }
-
-    public java.lang.Object[] getElements(java.lang.Object inputElement)
-    {
-      if (inputElement instanceof XSDConcreteComponent)
-      {
-        XSDConcreteComponent component = (XSDConcreteComponent) inputElement;
-        List elementsAndAttributes = new ArrayList();
-        
-        /** Construct elements list */
-        XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(component, false);
-        if (xsdAnnotation != null)
-        {
-          List appInfoList = xsdAnnotation.getApplicationInformation();
-          Element appInfoElement = null;
-          if (appInfoList.size() > 0)
-          {
-            appInfoElement = (Element) appInfoList.get(0);
-          }
-          if (appInfoElement != null)
-          {            
-            for (Iterator it = appInfoList.iterator(); it.hasNext();)
-            {
-              Object obj = it.next();
-              if (obj instanceof Element)
-              {
-                Element appInfo = (Element) obj;
-                NodeList nodeList = appInfo.getChildNodes();
-                int length = nodeList.getLength();
-                for (int i = 0; i < length; i++)
-                {
-                  Node node = nodeList.item(i);
-                  if (node instanceof Element)
-                  {
-                    elementsAndAttributes.add(node);
-                  }
-                }
-              }
-            }
-          }
-        }
-        
-        /** Construct attributes list */
-        NamedNodeMap attributes = component.getElement().getAttributes();
-        if ( attributes != null ){
-          //String defaultNamespace = (String)component.getSchema().getQNamePrefixToNamespaceMap().get("");          
-          int length = attributes.getLength();
-          for (int i = 0; i < length; i++){
-            Node oneAttribute = attributes.item(i);
-            if (!isXmlnsAttribute(oneAttribute))
-            {  
-              String namespace = oneAttribute.getNamespaceURI();        
-              boolean isExtension = true;
-              if (namespace == null && oneAttribute.getPrefix() == null) 
-              {
-                isExtension = false;
-              }  
-              else if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(namespace))
-              {
-                isExtension = true;
-              }           
-              if (isExtension)
-              {  
-                elementsAndAttributes.add(oneAttribute);
-              }    
-            }
-          }
-        }
-        return elementsAndAttributes.toArray();
-      }
-      return Collections.EMPTY_LIST.toArray();
-    }
-    
-    private static boolean isXmlnsAttribute(Node attribute)
-    {
-      String prefix = attribute.getPrefix();
-      if (prefix != null)
-      {
-        // this handle the xmlns:foo="blah" case
-        return "xmlns".equals(prefix);
-      }
-      else
-      {
-        // this handles the xmlns="blah" case
-        return "xmlns".equals(attribute.getNodeName());
-      }  
-    }
-
-    public void dispose()
-    {
-
-    }
-  }
-
-  static class ElementTableLabelProvider extends LabelProvider implements ITableLabelProvider
-  {
-    public Image getColumnImage(Object element, int columnIndex)
-    {
-      ApplicationInformationPropertiesRegistry registry = XSDEditorPlugin.getDefault().getApplicationInformationPropertiesRegistry();
-      if (element instanceof Element)
-      {
-        Element domElement = (Element) element;
-        ILabelProvider lp = registry.getLabelProvider(domElement);
-        if (lp != null)
-        {
-          Image img = lp.getImage(domElement);
-          if (img != null)
-            return img;
-        }
-        return DEFAULT_ELEMENT_ICON;
-      }
-      if (element instanceof Attr)
-    	return DEFAULT_ATTR_ICON;
-      return null;
-    }
-
-    public String getColumnText(Object input, int columnIndex)
-    {
-      if (input instanceof Element)
-      {
-        Element domElement = (Element) input;
-        return domElement.getLocalName();
-      }
-      if ( input instanceof Attr){
-        return ((Attr) input).getLocalName();
-      }
-      return "";
-    }
-  }
-
-  Element selectedElement;
-
-  class ElementSelectionChangedListener implements ISelectionChangedListener
-  {
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      ISelection selection = event.getSelection();
-      if (selection instanceof StructuredSelection)
-      {
-        Object obj = ((StructuredSelection) selection).getFirstElement();
-        if (obj instanceof Element)
-        {
-          selectedElement = (Element) obj;
-          tableTree.setInput(selectedElement.getParentNode());
-          tableTree.setASIElement(selectedElement);
-          tableTree.setCommandStack(getCommandStack());
-          contentLabel.setText("Structure of " + selectedElement.getLocalName());
-          contentLabel.getParent().layout();
-        }
-      }
-    }
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/CommonDirectivesSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/CommonDirectivesSection.java
deleted file mode 100644
index f77f0ae..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/CommonDirectivesSection.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDParser;
-
-public abstract class CommonDirectivesSection extends AbstractSection
-{
-  Text schemaLocationText;
-  Button wizardButton;
-  StyledText errorText;
-  Color red;
-
-  // TODO: common up code with XSDSelectIncludeFileWizard
-  public void doHandleEvent(Event event)
-  {
-    errorText.setText("");
-    if (event.type == SWT.Modify)
-    {
-      if (event.widget == schemaLocationText)
-      {
-        String errorMessage = "";
-        boolean isValidSchemaLocation = true;
-        String xsdModelFile = schemaLocationText.getText();
-        String namespace = "";
-        XSDSchema externalSchema = null;
-        
-        if (xsdModelFile.length() == 0)
-        {
-          handleSchemaLocationChange(xsdModelFile, "", null);
-          return;
-        }
-
-        try
-        {
-          IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-
-          URI newURI = URI.createURI(xsdModelFile);
-          String xsdFile = URIHelper.getRelativeURI(newURI.toString(), currentIFile.getFullPath().toString());
-          final String normalizedXSDFile = URIHelper.normalize(xsdFile, currentIFile.getLocation().toString(), "");
-          
-          XSDParser parser = new XSDParser();
-          parser.parse(normalizedXSDFile);
-          
-          externalSchema = parser.getSchema();
-
-          if (externalSchema != null)
-          {
-            String extNamespace = externalSchema.getTargetNamespace();
-            if (extNamespace == null) extNamespace = "";
-            namespace = extNamespace;
-            
-            if (externalSchema.getDiagnostics() != null &&
-                externalSchema.getDiagnostics().size() > 0)
-            {
-              isValidSchemaLocation = false;
-              errorMessage = XSDEditorPlugin.getResourceString("_UI_INCORRECT_XML_SCHEMA", xsdModelFile);
-            }  
-            else
-            {
-              String currentNameSpace = xsdSchema.getTargetNamespace();
-              if (input instanceof XSDInclude || input instanceof XSDRedefine)
-              {  
-                // Check the namespace to make sure they are the same as current file
-                if (extNamespace != null)
-                {
-                  if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
-                  {
-                    errorMessage = XSDEditorPlugin.getResourceString("_UI_DIFFERENT_NAME_SPACE", xsdModelFile);
-                    isValidSchemaLocation = false;
-                  }
-                }
-              }
-              else
-              {  
-                // Check the namespace to make sure they are different from the current file
-                if (extNamespace != null)
-                {
-                  if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
-                  {
-                    errorMessage = XSDEditorPlugin.getResourceString("_UI_SAME_NAME_SPACE", xsdModelFile);
-                    isValidSchemaLocation = false;
-                  }
-                }
-              }
-            }
-          }
-          else
-          {
-            errorMessage = "Invalid file";
-            isValidSchemaLocation = false;
-          }
-        }
-        catch(Exception e)
-        {
-          errorMessage = "Invalid file";
-          isValidSchemaLocation = false;
-        }
-        finally
-        {
-          if (!isValidSchemaLocation)
-          {
-            errorText.setText(errorMessage);
-            int length = errorText.getText().length();
-            red = new Color(null, 255, 0, 0);
-            StyleRange style = new StyleRange(0, length, red, schemaLocationText.getBackground());
-            errorText.setStyleRange(style);
-          }
-          else
-          {
-            handleSchemaLocationChange(xsdModelFile, namespace, externalSchema);          
-          }
-        }
-      }
-    }
-  }
-  
-  protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
-  {
-    
-  }
-
-  
-  public void dispose()
-  {
-    super.dispose();
-    if (red != null)
-    {
-      red.dispose();
-      red = null;
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/EnumerationsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/EnumerationsSection.java
deleted file mode 100644
index 7f2723f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/EnumerationsSection.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.commands.AddEnumerationsCommand;
-import org.eclipse.wst.xsd.ui.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.common.commands.SetXSDFacetValueCommand;
-import org.eclipse.wst.xsd.ui.internal.widgets.EnumerationsDialog;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class EnumerationsSection extends AbstractSection
-{
-  private EnumerationsTableViewer enumerationsTable;
-  private Button addButton;
-  private Button addManyButton;
-  private Button deleteButton;
-
-  /**
-   * 
-   */
-  public EnumerationsSection()
-  {
-    super();
-  }
-
-  public void widgetSelected(SelectionEvent e)
-  {
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-
-    if (e.widget == addButton)
-    {
-      List enumList = st.getEnumerationFacets();
-      StringBuffer newName = new StringBuffer("value1"); //$NON-NLS-1$
-      int suffix = 1;
-      for (Iterator i = enumList.iterator(); i.hasNext();)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) i.next();
-        String value = enumFacet.getLexicalValue();
-        if (value != null)
-        {
-          if (value.equals(newName.toString()))
-          {
-            suffix++;
-            newName = new StringBuffer("value" + String.valueOf(suffix)); //$NON-NLS-1$
-          }
-        }
-      }
-
-      AddEnumerationsCommand command = new AddEnumerationsCommand("Add Enumeration", (XSDSimpleTypeDefinition) input);
-      command.setValue(newName.toString());
-      getCommandStack().execute(command);
-
-      enumerationsTable.refresh();
-      int newItemIndex = enumerationsTable.getTable().getItemCount() - 1;
-      enumerationsTable.editElement(enumerationsTable.getElementAt(newItemIndex), 0);
-    }
-    else if (e.widget == addManyButton)
-    {
-      Display display = Display.getCurrent();
-      // if it is null, get the default one
-      display = display == null ? Display.getDefault() : display;
-      Shell parentShell = display.getActiveShell();
-      EnumerationsDialog dialog = new EnumerationsDialog(parentShell);
-      dialog.setBlockOnOpen(true);
-      int result = dialog.open();
-
-      if (result == Window.OK)
-      {
-        String text = dialog.getText();
-        String delimiter = dialog.getDelimiter();
-        StringTokenizer tokenizer = new StringTokenizer(text, delimiter);
-        CompoundCommand compoundCommand = new CompoundCommand("Add Enumerations");
-        while (tokenizer.hasMoreTokens())
-        {
-          String token = tokenizer.nextToken();
-          if (dialog.isPreserveWhitespace() == false)
-          {
-            token = token.trim();
-          }
-          AddEnumerationsCommand command = new AddEnumerationsCommand("Add Enumerations", (XSDSimpleTypeDefinition) input);
-          command.setValue(token);
-          compoundCommand.add(command);
-        }
-        getCommandStack().execute(compoundCommand);
-      }
-      enumerationsTable.refresh();
-    }
-    else if (e.widget == deleteButton)
-    {
-      StructuredSelection selection = (StructuredSelection) enumerationsTable.getSelection();
-      if (selection != null)
-      {
-        Iterator i = selection.iterator();
-        CompoundCommand compoundCommand = new CompoundCommand("Delete Enumeration");
-        while (i.hasNext())
-        {
-          Object obj = i.next();
-          if (obj != null)
-          {
-            if (obj instanceof XSDEnumerationFacet)
-            {
-              XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) obj;
-
-              DeleteCommand deleteCommand = new DeleteCommand("Delete Enumeration", enumFacet);
-              compoundCommand.add(deleteCommand);
-            }
-          }
-        }
-        getCommandStack().execute(compoundCommand);
-        enumerationsTable.refresh();
-      }
-    }
-    else if (e.widget == enumerationsTable.getTable())
-    {
-      StructuredSelection selection = (StructuredSelection) enumerationsTable.getSelection();
-      if (selection.getFirstElement() != null)
-      {
-        deleteButton.setEnabled(true);
-      }
-      else
-      {
-        deleteButton.setEnabled(false);
-      }
-    }
-
-  }
-
-  public void widgetDefaultSelected(SelectionEvent e)
-  {
-
-  }
-
-  public void createContents(Composite parent)
-  {
-    TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
-    composite = factory.createFlatFormComposite(parent);
-
-    enumerationsTable = new EnumerationsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
-    enumerationsTable.setInput(input);
-    Table table = enumerationsTable.getTable();
-    table.addSelectionListener(this);
-
-    addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"), SWT.PUSH); //$NON-NLS-1$
-    addManyButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL") + "...", SWT.PUSH); //$NON-NLS-1$
-    deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH); //$NON-NLS-1$
-
-    FormData data2 = new FormData();
-    data2.top = new FormAttachment(0, 0);
-    data2.left = new FormAttachment(100, -100);
-    data2.right = new FormAttachment(100, 0);
-    // data2.width = 50;
-    addButton.setLayoutData(data2);
-    addButton.addSelectionListener(this);
-
-    FormData data = new FormData();
-    data.left = new FormAttachment(addButton, 0, SWT.LEFT);
-    data.right = new FormAttachment(100, 0);
-    data.top = new FormAttachment(addButton, 0);
-    addManyButton.setLayoutData(data);
-    addManyButton.addSelectionListener(this);
-
-    data = new FormData();
-    data.left = new FormAttachment(addButton, 0, SWT.LEFT);
-    data.right = new FormAttachment(100, 0);
-    data.top = new FormAttachment(addManyButton, 0);
-    deleteButton.setLayoutData(data);
-    deleteButton.setEnabled(false);
-    deleteButton.addSelectionListener(this);
-
-    data = new FormData();
-    data.top = new FormAttachment(0, 0);
-    data.left = new FormAttachment(0, 0);
-    data.right = new FormAttachment(addButton, 0);
-    data.bottom = new FormAttachment(100, 0);
-    data.width = 50;
-    table.setLayoutData(data);
-    table.addListener(SWT.Resize, this);
-  }
-
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-
-    Iterator validFacets = st.getValidFacets().iterator();
-
-    boolean isApplicable = false;
-    while (validFacets.hasNext())
-    {
-      String aValidFacet = (String) validFacets.next();
-      if (aValidFacet.equals(XSDConstants.ENUMERATION_ELEMENT_TAG))
-      {
-        isApplicable = true;
-      }
-    }
-
-    if (isApplicable)
-    {
-      addButton.setEnabled(true);
-      addManyButton.setEnabled(true);
-    }
-    else
-    {
-      addButton.setEnabled(false);
-      addManyButton.setEnabled(false);
-    }
-    enumerationsTable.setInput(input);
-  }
-
-  public void handleEvent(Event event)
-  {
-    Table table = enumerationsTable.getTable();
-    if (event.type == SWT.Resize && event.widget == table)
-    {
-      TableColumn tableColumn = table.getColumn(0);
-      tableColumn.setWidth(table.getSize().x);
-    }
-  }
-
-  public void dispose()
-  {
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-
-  class EnumerationsTableViewer extends NavigableTableViewer implements ICellModifier
-  {
-    protected String[] columnProperties = { XSDConstants.ENUMERATION_ELEMENT_TAG };
-
-    protected CellEditor[] cellEditors;
-
-    Table table;
-
-    public EnumerationsTableViewer(Table table)
-    {
-      super(table);
-      table = getTable();
-
-      table.setLinesVisible(true);
-
-      setContentProvider(new EnumerationsTableContentProvider());
-      setLabelProvider(new EnumerationsTableLabelProvider());
-      setColumnProperties(columnProperties);
-
-      setCellModifier(this);
-
-      TableColumn column = new TableColumn(table, SWT.NONE, 0);
-      column.setText(columnProperties[0]);
-      column.setAlignment(SWT.LEFT);
-      column.setResizable(true);
-
-      cellEditors = new CellEditor[1];
-
-      TableLayout layout = new TableLayout();
-      ColumnWeightData data = new ColumnWeightData(100);
-
-      layout.addColumnData(data);
-      cellEditors[0] = new TextCellEditor(table);
-
-      getTable().setLayout(layout);
-      setCellEditors(cellEditors);
-    }
-
-    public boolean canModify(Object element, String property)
-    {
-      return true;
-    }
-
-    public void modify(Object element, String property, Object value)
-    {
-      if (element instanceof TableItem && (value != null))
-      {
-        TableItem item = (TableItem) element;
-
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) item.getData();
-        SetXSDFacetValueCommand command = new SetXSDFacetValueCommand("Set Enumeration Value", enumFacet);
-        command.setValue((String) value);
-        getCommandStack().execute(command);
-        item.setData(enumFacet);
-        item.setText((String) value);
-      }
-    }
-
-    public Object getValue(Object element, String property)
-    {
-      if (element instanceof XSDEnumerationFacet)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
-        String value = enumFacet.getLexicalValue();
-        if (value == null)
-          value = ""; //$NON-NLS-1$
-        return value;
-      }
-      return ""; //$NON-NLS-1$
-    }
-
-  }
-
-  class EnumerationsTableContentProvider implements IStructuredContentProvider
-  {
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-    }
-
-    public java.lang.Object[] getElements(java.lang.Object inputElement)
-    {
-      java.util.List list = new ArrayList();
-      if (inputElement instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) inputElement;
-        return st.getEnumerationFacets().toArray();
-      }
-      return list.toArray();
-    }
-
-    public void dispose()
-    {
-    }
-  }
-
-  class EnumerationsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-  {
-    public EnumerationsTableLabelProvider()
-    {
-
-    }
-
-    public Image getColumnImage(Object element, int columnIndex)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif");
-    }
-
-    public String getColumnText(Object element, int columnIndex)
-    {
-      if (element instanceof XSDEnumerationFacet)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
-        String value = enumFacet.getLexicalValue();
-        if (value == null)
-          value = "";
-        return value;
-      }
-      return "";
-    }
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/FacetViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/FacetViewer.java
deleted file mode 100644
index 3ae9947..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/FacetViewer.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-//import java.util.ArrayList;
-//import java.util.Iterator;
-//import java.util.List;
-//
-//import org.eclipse.jface.viewers.CellEditor;
-//import org.eclipse.jface.viewers.ColumnWeightData;
-//import org.eclipse.jface.viewers.ICellModifier;
-//import org.eclipse.jface.viewers.ISelectionChangedListener;
-//import org.eclipse.jface.viewers.IStructuredContentProvider;
-//import org.eclipse.jface.viewers.ITableLabelProvider;
-//import org.eclipse.jface.viewers.LabelProvider;
-//import org.eclipse.jface.viewers.SelectionChangedEvent;
-//import org.eclipse.jface.viewers.StructuredSelection;
-//import org.eclipse.jface.viewers.TableLayout;
-//import org.eclipse.jface.viewers.TextCellEditor;
-//import org.eclipse.jface.viewers.Viewer;
-//import org.eclipse.swt.SWT;
-//import org.eclipse.swt.events.MouseEvent;
-//import org.eclipse.swt.events.MouseTrackAdapter;
-//import org.eclipse.swt.graphics.Image;
-//import org.eclipse.swt.graphics.Point;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.swt.widgets.Table;
-//import org.eclipse.swt.widgets.TableColumn;
-//import org.eclipse.swt.widgets.TableItem;
-//import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-//import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-//import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-//import org.eclipse.wst.xsd.ui.internal.properties.XSDComboBoxPropertyDescriptor;
-//import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-//import org.eclipse.xsd.XSDConstrainingFacet;
-//import org.eclipse.xsd.XSDFactory;
-//import org.eclipse.xsd.XSDMaxExclusiveFacet;
-//import org.eclipse.xsd.XSDMaxFacet;
-//import org.eclipse.xsd.XSDMaxInclusiveFacet;
-//import org.eclipse.xsd.XSDMinExclusiveFacet;
-//import org.eclipse.xsd.XSDMinFacet;
-//import org.eclipse.xsd.XSDMinInclusiveFacet;
-//import org.eclipse.xsd.XSDSimpleTypeDefinition;
-//import org.eclipse.xsd.util.XSDConstants;
-//import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-//import org.w3c.dom.Element;
-
-public class FacetViewer //extends NavigableTableViewer implements ICellModifier
-{
-//  public static final String FACET_NAME = XSDEditorPlugin.getXSDString("_UI_FACET_NAME"); // "Name";
-//  public static final String FACET_VALUE = XSDEditorPlugin.getXSDString("_UI_FACET_VALUE"); // "Value";
-//  public static final String FACET_OTHER = XSDEditorPlugin.getXSDString("_UI_FACET_FIXED"); // "Fixed";
-//
-//  protected FacetsTableLabelProvider facetsTableLabelProvider = new FacetsTableLabelProvider();
-//  protected FacetsTableContentProvider facetsTableContentProvider = new FacetsTableContentProvider();
-//  protected String[] columnProperties = { FACET_NAME, FACET_VALUE, FACET_OTHER };
-//  protected CellEditor[] cellEditors; // these cellEditors are used when
-//                                      // non-whitespace facet is selected
-//  protected CellEditor[] altCellEditors; // these cellEditors are used when
-//                                          // whitespace facet is selected
-//
-//  protected String[] whiteSpaceValues = new String[] { "", "preserve", "replace", "collapse" };
-//  protected String[] trueFalseValues = new String[] { "", "false", "true" };
-//
-//  /**
-//   * @param parent
-//   */
-//  public FacetViewer(Composite parent)
-//  {
-//    super(new Table(parent, SWT.FULL_SELECTION | SWT.SINGLE));
-//
-//    getTable().setLinesVisible(true);
-//    getTable().setHeaderVisible(true);
-//
-//    addSelectionChangedListener(new SelectionChangedListener());
-//    getTable().addMouseTrackListener(new MyMouseTrackListener());
-//
-//    setContentProvider(facetsTableContentProvider);
-//    setLabelProvider(facetsTableLabelProvider);
-//    setColumnProperties(columnProperties);
-//
-//    setCellModifier(this);
-//
-//    for (int i = 0; i < 3; i++)
-//    {
-//      TableColumn column = new TableColumn(getTable(), SWT.NONE, i);
-//      column.setText(columnProperties[i]);
-//      column.setAlignment(SWT.LEFT);
-//      column.setResizable(true);
-//    }
-//
-//    cellEditors = new CellEditor[3];
-//    altCellEditors = new CellEditor[3];
-//
-//    TableLayout layout = new TableLayout();
-//    ColumnWeightData data = new ColumnWeightData(60, 80, true);
-//    layout.addColumnData(data);
-//    cellEditors[0] = null;
-//
-//    ColumnWeightData data2 = new ColumnWeightData(120, 80, true);
-//    layout.addColumnData(data2);
-//
-//    cellEditors[1] = new TextCellEditor(getTable());
-//    XSDComboBoxPropertyDescriptor pd = new XSDComboBoxPropertyDescriptor("combo", "whitespace", whiteSpaceValues);
-//    altCellEditors[1] = pd.createPropertyEditor(getTable());
-//
-//    ColumnWeightData data3 = new ColumnWeightData(60, 60, true);
-//    layout.addColumnData(data3);
-//
-//    XSDComboBoxPropertyDescriptor pd2 = new XSDComboBoxPropertyDescriptor("combo", "other", trueFalseValues);
-//    cellEditors[2] = pd2.createPropertyEditor(getTable());
-//    altCellEditors[2] = pd2.createPropertyEditor(getTable());
-//
-//    getTable().setLayout(layout);
-//    setCellEditors(cellEditors);
-//
-//  }
-//
-//  /*
-//   * (non-Javadoc)
-//   * 
-//   * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
-//   *      java.lang.String)
-//   */
-//  public boolean canModify(Object element, String property)
-//  {
-//    return property.equals(FACET_VALUE) || property.equals(FACET_OTHER);
-//  }
-//
-//  /*
-//   * (non-Javadoc)
-//   * 
-//   * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
-//   *      java.lang.String)
-//   */
-//  public Object getValue(Object element, String property)
-//  {
-//    int column = 0;
-//    if (property.equals(columnProperties[0]))
-//    {
-//      column = 0;
-//    }
-//    else if (property.equals(columnProperties[1]))
-//    {
-//      column = 1;
-//    }
-//    else if (property.equals(columnProperties[2]))
-//    {
-//      column = 2;
-//    }
-//
-//    return facetsTableLabelProvider.getColumnText(element, column);
-//  }
-//
-//  /*
-//   * (non-Javadoc)
-//   * 
-//   * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object,
-//   *      java.lang.String, java.lang.Object)
-//   */
-//  public void modify(Object element, String property, Object value)
-//  {
-//    XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition) getInput();
-//    TableItem item = (TableItem) element;
-//    if (item != null)
-//    {
-//      Object o = item.getData();
-//      if (o != null)
-//      {
-//        if (o instanceof String)
-//        {
-//          String facet = (String) o;
-//
-//          Element simpleTypeElement = xsdSimpleType.getElement();
-//          XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-//          Element derivedByElement = xsdDOMHelper.getDerivedByElement(simpleTypeElement);
-//
-//          String prefix = simpleTypeElement.getPrefix();
-//          prefix = (prefix == null) ? "" : (prefix + ":");
-//
-//          Element childNodeElement = null;
-//          DOMAttribute valueAttr = null;
-//
-//          XSDConstrainingFacet targetFacet = getXSDConstrainingFacet(facet);
-//
-//          String newValue = "";
-//          if (value != null && value instanceof String)
-//          {
-//            newValue = (String) value;
-//          }
-//
-//          if (property.equals(columnProperties[1]))
-//          {
-//            if (targetFacet == null && newValue.length() > 0)
-//            {
-//              targetFacet = createFacet(facet);
-//              childNodeElement = (derivedByElement.getOwnerDocument()).createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + facet);
-//              valueAttr = new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newValue);
-//              childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());
-//              // add and format child
-//              derivedByElement.appendChild(childNodeElement);
-//              targetFacet.setElement(childNodeElement);
-//              XSDDOMHelper.formatChild(childNodeElement);
-//
-//              // XSDSchemaHelper.updateElement(xsdSimpleType);
-//            }
-//            if (targetFacet == null)
-//            {
-//              return;
-//            }
-//
-//            if (newValue.length() > 0)
-//            {
-//              targetFacet.setLexicalValue(newValue);
-//
-//              if (targetFacet instanceof XSDMaxFacet || targetFacet instanceof XSDMinFacet)
-//              {
-//                if (targetFacet instanceof XSDMaxFacet)
-//                {
-//                  if (targetFacet instanceof XSDMaxExclusiveFacet)
-//                  {
-//                    XSDMaxInclusiveFacet xsdMaxInclusiveFacet = xsdSimpleType.getMaxInclusiveFacet();
-//                    if (xsdMaxInclusiveFacet != null)
-//                    {
-//                      Element xsdMaxInclusiveFacetElement = xsdMaxInclusiveFacet.getElement();
-//                      XSDDOMHelper.removeNodeAndWhitespace(xsdMaxInclusiveFacetElement);
-//                    }
-//                  }
-//                  else if (targetFacet instanceof XSDMaxInclusiveFacet)
-//                  {
-//                    XSDMaxExclusiveFacet xsdMaxExclusiveFacet = xsdSimpleType.getMaxExclusiveFacet();
-//                    if (xsdMaxExclusiveFacet != null)
-//                    {
-//                      Element xsdMaxExclusiveFacetElement = xsdMaxExclusiveFacet.getElement();
-//                      XSDDOMHelper.removeNodeAndWhitespace(xsdMaxExclusiveFacetElement);
-//                    }
-//                  }
-//                }
-//                else if (targetFacet instanceof XSDMinFacet)
-//                {
-//                  if (targetFacet instanceof XSDMinExclusiveFacet)
-//                  {
-//                    XSDMinInclusiveFacet xsdMinInclusiveFacet = xsdSimpleType.getMinInclusiveFacet();
-//                    if (xsdMinInclusiveFacet != null)
-//                    {
-//                      Element xsdMinInclusiveFacetElement = xsdMinInclusiveFacet.getElement();
-//                      XSDDOMHelper.removeNodeAndWhitespace(xsdMinInclusiveFacetElement);
-//                    }
-//                  }
-//                  else if (targetFacet instanceof XSDMinInclusiveFacet)
-//                  {
-//                    XSDMinExclusiveFacet xsdMinExclusiveFacet = xsdSimpleType.getMinExclusiveFacet();
-//                    if (xsdMinExclusiveFacet != null)
-//                    {
-//                      Element xsdMinExclusiveFacetElement = xsdMinExclusiveFacet.getElement();
-//                      XSDDOMHelper.removeNodeAndWhitespace(xsdMinExclusiveFacetElement);
-//                    }
-//                  }
-//                }
-//              }
-//            }
-//            else
-//            // newValue.length == 0
-//            {
-//              Element targetFacetElement = targetFacet.getElement();
-//              XSDDOMHelper.removeNodeAndWhitespace(targetFacetElement);
-//            }
-//          }
-//          else if (property.equals(columnProperties[2]))
-//          {
-//            if (targetFacet != null)
-//            {
-//              if (newValue.length() > 0)
-//              {
-//                targetFacet.getElement().setAttribute(XSDConstants.FIXED_ATTRIBUTE, newValue);
-//              }
-//              else
-//              {
-//                targetFacet.getElement().removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
-//              }
-//            }
-//          }
-//          xsdSimpleType.setElement(simpleTypeElement);
-//          // xsdSimpleType.updateElement();
-//          refresh();
-//        }
-//      }
-//    }
-//  }
-//
-//  private XSDConstrainingFacet getXSDConstrainingFacet(String facetString)
-//  {
-//    XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition) getInput();
-//    List list = xsdSimpleType.getFacetContents();
-//    if (list == null)
-//    {
-//      return null;
-//    }
-//    Iterator iter = list.iterator();
-//    XSDConstrainingFacet targetFacet = null;
-//
-//    while (iter.hasNext())
-//    {
-//      XSDConstrainingFacet xsdConstrainingFacet = (XSDConstrainingFacet) iter.next();
-//      if (xsdConstrainingFacet.getFacetName().equals(facetString))
-//      {
-//        targetFacet = xsdConstrainingFacet;
-//        break;
-//      }
-//    }
-//    return targetFacet;
-//  }
-//
-//  private XSDConstrainingFacet createFacet(String facet)
-//  {
-//    XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-//    XSDConstrainingFacet xsdFacet = null;
-//    if (facet.equals("length"))
-//    {
-//      xsdFacet = factory.createXSDLengthFacet();
-//    }
-//    else if (facet.equals("minLength"))
-//    {
-//      xsdFacet = factory.createXSDMinLengthFacet();
-//    }
-//    else if (facet.equals("maxLength"))
-//    {
-//      xsdFacet = factory.createXSDMaxLengthFacet();
-//    }
-//    else if (facet.equals("minInclusive"))
-//    {
-//      xsdFacet = factory.createXSDMinInclusiveFacet();
-//    }
-//    else if (facet.equals("minExclusive"))
-//    {
-//      xsdFacet = factory.createXSDMinExclusiveFacet();
-//    }
-//    else if (facet.equals("maxInclusive"))
-//    {
-//      xsdFacet = factory.createXSDMaxInclusiveFacet();
-//    }
-//    else if (facet.equals("maxExclusive"))
-//    {
-//      xsdFacet = factory.createXSDMaxExclusiveFacet();
-//    }
-//
-//    else if (facet.equals("totalDigits"))
-//    {
-//      xsdFacet = factory.createXSDTotalDigitsFacet();
-//    }
-//    else if (facet.equals("fractionDigits"))
-//    {
-//      xsdFacet = factory.createXSDFractionDigitsFacet();
-//    }
-//    else if (facet.equals("whiteSpace"))
-//    {
-//      xsdFacet = factory.createXSDWhiteSpaceFacet();
-//    }
-//    return xsdFacet;
-//  }
-//
-//  /**
-//   * Get the tooltip for the facet
-//   */
-//  public String getToolTip(String facet)
-//  {
-//    String key = "";
-//    if (facet.equals("length"))
-//    {
-//      key = "_UI_TOOLTIP_LENGTH";
-//    }
-//    else if (facet.equals("minLength"))
-//    {
-//      key = "_UI_TOOLTIP_MIN_LEN";
-//    }
-//    else if (facet.equals("maxLength"))
-//    {
-//      key = "_UI_TOOLTIP_MAX_LEN";
-//    }
-//
-//    else if (facet.equals("minInclusive"))
-//    {
-//      key = "_UI_TOOLTIP_MIN_INCLUSIVE";
-//    }
-//    else if (facet.equals("minExclusive"))
-//    {
-//      key = "_UI_TOOLTIP_MIN_EXCLUSIVE";
-//    }
-//
-//    else if (facet.equals("maxInclusive"))
-//    {
-//      key = "_UI_TOOLTIP_MAX_INCLUSIVE";
-//    }
-//    else if (facet.equals("maxExclusive"))
-//    {
-//      key = "_UI_TOOLTIP_MAX_EXCLUSIVE";
-//    }
-//
-//    else if (facet.equals("totalDigits"))
-//    {
-//      key = "_UI_TOOLTIP_TOTAL_DIGITS";
-//    }
-//    else if (facet.equals("fractionDigits"))
-//    {
-//      key = "_UI_TOOLTIP_FRACTION_DIGITS";
-//    }
-//
-//    else if (facet.equals("whiteSpace"))
-//    {
-//      key = "_UI_TOOLTIP_WHITE_SPACE";
-//    }
-//
-//    return (key != null) ? XSDEditorPlugin.getXSDString(key) : "";
-//  }
-//
-//  /**
-//   * This listener detects which row is selected and add a tool tip for that row
-//   */
-//  public class MyMouseTrackListener extends MouseTrackAdapter
-//  {
-//    public void mouseHover(MouseEvent e)
-//    {
-//      TableItem item = getTable().getItem(new Point(e.x, e.y));
-//      if (item != null)
-//      {
-//        Object o = item.getData();
-//        if (o != null)
-//        {
-//          String facetName = (String) o;
-//          getTable().setToolTipText(getToolTip(facetName));
-//        }
-//      }
-//    }
-//  }
-//
-//  /**
-//   * Based on the selection, detects if it is a white space or not, and add the
-//   * corresponding cell editors
-//   */
-//  public class SelectionChangedListener implements ISelectionChangedListener
-//  {
-//    public void selectionChanged(SelectionChangedEvent event)
-//    {
-//      Object selection = event.getSelection();
-//      if (selection instanceof StructuredSelection)
-//      {
-//        Object o = ((StructuredSelection) selection).getFirstElement();
-//        if (o != null)
-//        {
-//          String facet = (String) o;
-//          if (facet.equals("whiteSpace"))
-//          {
-//            setCellEditors(altCellEditors);
-//          }
-//          else
-//          {
-//            setCellEditors(cellEditors);
-//          }
-//        }
-//      }
-//    }
-//  }
-//
-//  class FacetsTableContentProvider implements IStructuredContentProvider
-//  {
-//    protected String facet;
-//
-//    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-//    {
-//    }
-//
-//    public java.lang.Object[] getElements(java.lang.Object inputElement)
-//    {
-//      List v = new ArrayList();
-//      XSDSimpleTypeDefinition inputXSDSimpleType = (XSDSimpleTypeDefinition) inputElement;
-//      XSDSimpleTypeDefinition base = inputXSDSimpleType.getPrimitiveTypeDefinition();
-//
-//      if (base != null)
-//      {
-//        Iterator validFacets = inputXSDSimpleType.getValidFacets().iterator();
-//        while (validFacets.hasNext())
-//        {
-//          String aValidFacet = (String) validFacets.next();
-//          if (!(aValidFacet.equals("pattern") || aValidFacet.equals("enumeration")))
-//          {
-//            v.add(aValidFacet);
-//          }
-//        }
-//      }
-//      return v.toArray();
-//    }
-//
-//    public void dispose()
-//    {
-//    }
-//  }
-//
-//  class FacetsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-//  {
-//    public Image getColumnImage(Object element, int columnIndex)
-//    {
-//      return null;
-//    }
-//
-//    public String getColumnText(Object element, int columnIndex)
-//    {
-//      if (element instanceof String)
-//      {
-//        String value = null;
-//        XSDConstrainingFacet targetFacet = getXSDConstrainingFacet((String) element);
-//        switch (columnIndex)
-//        {
-//        case 0:
-//        {
-//          value = (String) element;
-//          break;
-//        }
-//        case 1:
-//        {
-//          if (targetFacet == null)
-//          {
-//            value = "";
-//          }
-//          else
-//          {
-//            value = targetFacet.getLexicalValue();
-//          }
-//
-//          break;
-//        }
-//        case 2:
-//        {
-//          if (targetFacet == null)
-//          {
-//            value = "";
-//          }
-//          else
-//          {
-//            Element elem = targetFacet.getElement();
-//            value = elem.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
-//            if (value == null)
-//              value = "";
-//          }
-//        }
-//        }
-//        return value;
-//      }
-//      return "";
-//    }
-//  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/MultiplicitySection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/MultiplicitySection.java
deleted file mode 100644
index 128991f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/MultiplicitySection.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateMaxOccursCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateMinOccursCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class MultiplicitySection extends AbstractSection
-{
-  protected CCombo minCombo, maxCombo;
-  protected Button listButton;
-  protected Button requiredButton;
-  protected boolean isRequired;
- 
-  public MultiplicitySection()
-  {
-    super();
-  }
-
-  protected void createContents(Composite parent)
-  {
-  }
-
-  
-  public void doHandleEvent(Event event)
-  {
-    if (event.widget == minCombo)
-    {
-      updateMinAttribute();
-    }
-    else if (event.widget == maxCombo)
-    {
-      updateMaxAttribute();
-    }
-  }
-
-  public void doWidgetSelected(SelectionEvent e)
-  {
-    if (e.widget == minCombo)
-    {
-      updateMinAttribute();
-    }
-    else if (e.widget == maxCombo)
-    {
-      updateMaxAttribute();
-    }
-  }
-
-  protected void updateMaxAttribute()
-  {
-    setErrorMessage(null);
-    XSDParticle particle = null;
-
-    if (input instanceof XSDParticleContent)
-    {
-      particle = getAssociatedParticle((XSDParticleContent) input);
-    }
-    if (particle != null)
-    {
-      String newValue = maxCombo.getText().trim();
-      
-      if (newValue.length() == 0)
-      {
-        particle.unsetMaxOccurs();
-        return;
-      }
-      try
-      {
-        int newMax = 1;
-        if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$
-        {
-          newMax = XSDParticle.UNBOUNDED;
-        }
-        else
-        {
-          if (newValue.length() > 0)
-          {
-            newMax = Integer.parseInt(newValue);
-          }
-        }
-        setListenerEnabled(false);
-        UpdateMaxOccursCommand command = new UpdateMaxOccursCommand("Maximum Occurrence Change", particle, newMax);
-        getCommandStack().execute(command);
-        setListenerEnabled(true);
-
-      }
-      catch (NumberFormatException e)
-      {
-        setErrorMessage("Invalid value for maximum occurrence");
-      }
-    }
-  }
-
-  protected void updateMinAttribute()
-  {
-    setErrorMessage(null);
-    XSDParticle particle = null;
-
-    if (input instanceof XSDParticleContent)
-    {
-      particle = getAssociatedParticle((XSDParticleContent) input);
-    }
-    if (particle != null)
-    {
-      String newValue = minCombo.getText();
-      isRequired = false;
-      if (newValue.length() == 0)
-      {
-        particle.unsetMinOccurs();
-      }
-      try
-      {
-        int newMin = 1;
-        if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$
-        {
-          newMin = XSDParticle.UNBOUNDED;
-          isRequired = true;
-        }
-        else
-        {
-          newMin = Integer.parseInt(newValue);
-          isRequired = newMin > 0;
-        }
-        UpdateMinOccursCommand command = new UpdateMinOccursCommand("Minimum Occurrence Change", particle, newMin);
-        getCommandStack().execute(command);
-      }
-      catch (NumberFormatException e)
-      {
-
-      }
-    }
-  }
-  
-  protected void refreshMinMax()
-  {
-    boolean refreshMinText = true;
-    boolean refreshMaxText = true;
-    if (minCombo.isFocusControl())
-    {
-      refreshMinText = false;
-    }
-    if (maxCombo.isFocusControl())
-    {
-      refreshMaxText = false;
-    }
-    if (refreshMinText)
-    {
-      minCombo.setText(""); //$NON-NLS-1$
-    }
-    if (refreshMaxText)
-    {
-      maxCombo.setText(""); //$NON-NLS-1$
-    }
-
-    if (input != null)
-    {
-      if (input instanceof XSDParticleContent)
-      {
-        XSDParticle particle = getAssociatedParticle((XSDParticleContent) input);
-        if (particle != null)
-        {
-          // minText.setText(String.valueOf(particle.getMinOccurs()));
-          // maxText.setText(String.valueOf(particle.getMaxOccurs()));
-          Element element = particle.getElement();
-          if (element != null)
-          {
-            String min = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-            String max = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-            if (min != null && refreshMinText)
-            {
-              minCombo.setText(min);
-            }
-            if (max != null && refreshMaxText)
-            {
-              maxCombo.setText(max);
-            }
-          }
-        }
-      }
-    }
-  }
-
-  protected XSDParticle getAssociatedParticle(XSDParticleContent particleContent)
-  {
-    XSDConcreteComponent xsdComp = particleContent.getContainer();
-    if (xsdComp instanceof XSDParticle)
-    {
-      return (XSDParticle) xsdComp;
-    }
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SchemaLocationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SchemaLocationSection.java
deleted file mode 100644
index 4b2f160..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SchemaLocationSection.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDIncludeImpl;
-import org.eclipse.xsd.impl.XSDRedefineImpl;
-import org.w3c.dom.Element;
-
-public class SchemaLocationSection extends CommonDirectivesSection
-{
-	  IWorkbenchPart part;
-	  
-	  /**
-	   * 
-	   */
-	  public SchemaLocationSection()
-	  {
-	    super();
-	  }
-
-		/**
-		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-		 */
-		public void createContents(Composite parent)
-		{
-			composite = getWidgetFactory().createFlatFormComposite(parent);
-
-      GridLayout gridLayout = new GridLayout();
-      gridLayout.marginTop = 0;
-      gridLayout.marginBottom = 0;
-      gridLayout.numColumns = 3;
-      composite.setLayout(gridLayout);
-      
-      GridData data = new GridData();
-
-			// Create Schema Location Label
-			CLabel schemaLocationLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")); //$NON-NLS-1$
-      data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-      data.grabExcessHorizontalSpace = false;
-      schemaLocationLabel.setLayoutData(data);
-			
-      // Create Schema Location Text
-      schemaLocationText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-      schemaLocationText.setEditable(true);
-      applyAllListeners(schemaLocationText);       
-
-      data = new GridData();
-      data.grabExcessHorizontalSpace = true;
-      data.horizontalAlignment = GridData.FILL;
-      schemaLocationText.setLayoutData(data);
-      
-			// Create Wizard Button
-			wizardButton = getWidgetFactory().createButton(composite, "", SWT.NONE); //$NON-NLS-1$
-      wizardButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
-      data = new GridData();
-      data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-      data.grabExcessHorizontalSpace = false;
-			wizardButton.setLayoutData(data);
-			wizardButton.addSelectionListener(this);
-			
-      // error text
-      errorText = new StyledText(composite, SWT.FLAT);
-      errorText.setEditable(false);
-      errorText.setEnabled(false);
-      errorText.setText("");
-      
-      data = new GridData();
-      data.horizontalAlignment = GridData.FILL;
-      data.horizontalSpan = 3;
-      data.grabExcessHorizontalSpace = true;
-      errorText.setLayoutData(data);
-
-		}
-		
-		public void widgetSelected(SelectionEvent event)
-    {
-			if (event.widget == wizardButton)
-      {
-				Shell shell = Display.getCurrent().getActiveShell();
-			    
-				IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-				ViewerFilter filter = new ResourceFilter(new String[] { ".xsd" },  //$NON-NLS-1$
-			            new IFile[] { currentIFile },
-			            null);
-			      
-			  XSDSelectIncludeFileWizard fileSelectWizard = 
-			      new XSDSelectIncludeFileWizard(xsdSchema, true,
-			          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
-			          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
-			          filter,
-			          (IStructuredSelection) getSelection());
-
-			  WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
-			  wizardDialog.create();
-			  wizardDialog.setBlockOnOpen(true);
-			  int result = wizardDialog.open();
-				  
-	      String value = schemaLocationText.getText();
-	      if (result == Window.OK)
-	      {
-          errorText.setText("");
-	        IFile selectedIFile = fileSelectWizard.getResultFile();
-	        String schemaFileString = value;
-	        if (selectedIFile != null) 
-	        {
-	          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
-	        }
-	        else
-	        {
-	          schemaFileString = fileSelectWizard.getURL();
-	        }
-
-          handleSchemaLocationChange(schemaFileString, fileSelectWizard.getNamespace(), null);
-	        refresh();
-			  } 
-			}
-		}
-
-		/*
-		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-		 */
-		public void refresh()
-		{
-				setListenerEnabled(false);
-
-				Element element = null;
-				if (input instanceof XSDInclude)
-        { 
-					element = ((XSDIncludeImpl) input).getElement();
-				}
-				else if (input instanceof XSDRedefine)
-        {
-					element = ((XSDRedefineImpl) input).getElement();
-				}
-				
-				if (element != null)
-        {
-					String location = ""; //$NON-NLS-1$
-					location = element.getAttribute("schemaLocation"); //$NON-NLS-1$
-          if (location == null)
-          {
-            location = "";
-          }
-					schemaLocationText.setText(location);
-				}
-
-        setListenerEnabled(true);
-		}
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	   */
-	  public boolean shouldUseExtraSpace()
-	  {
-	    return true;
-	  }
-    
-    protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
-    {
-      if (input instanceof XSDInclude)
-      {
-        Element element = ((XSDIncludeImpl) input).getElement();
-        element.setAttribute("schemaLocation", schemaFileString); //$NON-NLS-1$
-      }
-      else if (input instanceof XSDRedefine)
-      {
-        Element element = ((XSDRedefineImpl) input).getElement();
-        element.setAttribute("schemaLocation", schemaFileString); //$NON-NLS-1$
-      }
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SimpleContentUnionMemberTypesDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SimpleContentUnionMemberTypesDialog.java
deleted file mode 100644
index 1f921f9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SimpleContentUnionMemberTypesDialog.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class SimpleContentUnionMemberTypesDialog extends Dialog implements SelectionListener
-{
-  XSDSimpleTypeDefinition simpleType;
-  /**
-   * @param parentShell
-   */
-  public SimpleContentUnionMemberTypesDialog(Shell parentShell, XSDSimpleTypeDefinition simpleType)
-  {
-    super(parentShell);
-    this.simpleType = simpleType;
-  }
-  
-  Table table;
-  TypeSection typeSection;
-  Button addButton, removeButton;
-  org.eclipse.swt.widgets.List memberTypesList;
-  
-  private String result;
-
-  protected void configureShell(Shell shell)
-  {
-    super.configureShell(shell);
-  }
-
-  protected void buttonPressed(int buttonId)
-  {
-    if (buttonId == Dialog.OK)
-    {
-      StringBuffer sb = new StringBuffer();
-      int length = memberTypesList.getItemCount();
-      for (int i=0 ; i < length; i++)
-      {
-        sb.append(memberTypesList.getItem(i));
-        if (i < length - 1)
-        {
-          sb.append(" ");
-        }
-      }
-      result = sb.toString();
-    }
-    super.buttonPressed(buttonId);
-  }
-
-  public String getResult() { return result; }
-
-  //
-  // Create the controls
-  //
-  public Control createDialogArea(Composite parent)
-  {
-    Composite client = (Composite)super.createDialogArea(parent);
-    getShell().setText("Union " + XSDConstants.MEMBERTYPES_ATTRIBUTE); 
-    
-    Label instructions = new Label(client, SWT.LEFT | SWT.WRAP);
-    instructions.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SELECT_MEMBERTYPES"));
-    
-    Composite columnsComposite = new Composite(client, SWT.NONE);
-    GridLayout ccGL = new GridLayout();
-    ccGL.verticalSpacing = 0;
-    ccGL.horizontalSpacing = 0;
-    ccGL.marginHeight = 0;
-    ccGL.marginWidth = 0;
-    ccGL.makeColumnsEqualWidth = true;
-    ccGL.numColumns = 3;
-    columnsComposite.setLayout(ccGL);
-    
-    GridData ccGD = new GridData();
-    ccGD.grabExcessHorizontalSpace = true;
-    ccGD.horizontalAlignment = GridData.FILL;
-    columnsComposite.setLayoutData(ccGD);     
-                           
-    typeSection = new TypeSection(columnsComposite);
-    typeSection.setShowUserComplexType(false);
-
-    typeSection.createClient(columnsComposite);
-    typeSection.getSimpleType().setSelection(false);
-    typeSection.getSimpleType().addSelectionListener(this);
-    typeSection.getUserSimpleType().addSelectionListener(this);
-    
-    ViewUtility.createHorizontalFiller(columnsComposite, 1);
-    
-    Label memberListLabel = new Label(columnsComposite, SWT.LEFT);
-    memberListLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_VALUE"));
-    
-    Composite dataComposite = new Composite(client, SWT.NONE);
-    GridLayout dcGL = new GridLayout();
-    dcGL.verticalSpacing = 0;
-    dcGL.marginHeight = 0;
-    dcGL.marginWidth = 0;
-    dcGL.numColumns = 3;
-    dataComposite.setLayout(dcGL);
-    
-    GridData dcGD = new GridData();
-    dcGD.grabExcessHorizontalSpace = true;
-    dcGD.grabExcessVerticalSpace = true;
-    dataComposite.setLayoutData(dcGD);
-    
-    table = new Table(dataComposite,
-        SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); 
-    table.setHeaderVisible(false);
-    table.setLinesVisible(true);
-    GridData gd2 = new GridData();
-    gd2.grabExcessHorizontalSpace = true;
-    gd2.grabExcessVerticalSpace = true;
-    gd2.horizontalAlignment = GridData.FILL;
-    gd2.verticalAlignment = GridData.FILL;
-    gd2.heightHint = 200;
-    gd2.widthHint = 200;
-    table.setLayoutData(gd2);
-
-    // Fill table
-    handleSetInput();
-    table.getItemCount();
-
-    TableColumn tc = new TableColumn(table, SWT.LEFT);
-    tc.setWidth(200);
-    tc.setResizable(true);
-    
-    Composite buttonComposite = new Composite(dataComposite, SWT.NONE);
-    GridLayout bcGL = new GridLayout();
-    bcGL.numColumns = 1;
-    buttonComposite.setLayout(bcGL);
-    addButton = new Button(buttonComposite, SWT.PUSH);
-    addButton.setText(">");
-    addButton.addSelectionListener(this);
-    removeButton = new Button(buttonComposite, SWT.PUSH);
-    removeButton.setText("<");
-    removeButton.addSelectionListener(this);
-    
-    Composite listComposite = new Composite(dataComposite, SWT.NONE);
-    GridLayout mtGL = new GridLayout();
-    mtGL.numColumns = 1;
-    mtGL.marginHeight = 0;
-    mtGL.marginWidth = 0;
-    mtGL.horizontalSpacing = 0;
-    mtGL.verticalSpacing = 0;
-    listComposite.setLayout(mtGL);
-
-    GridData mtGD = new GridData();
-    mtGD.grabExcessHorizontalSpace = true;
-    mtGD.grabExcessVerticalSpace = true;
-    mtGD.verticalAlignment = GridData.FILL;
-    mtGD.horizontalAlignment = GridData.FILL;
-    listComposite.setLayoutData(mtGD);
-    
-    memberTypesList = new org.eclipse.swt.widgets.List(listComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-    GridData mtlGD = new GridData();
-    mtlGD.grabExcessHorizontalSpace = true;
-    mtlGD.grabExcessVerticalSpace = true;
-    mtlGD.verticalAlignment = GridData.FILL;
-    mtlGD.horizontalAlignment = GridData.FILL;
-    mtlGD.heightHint = 200;
-    mtlGD.widthHint = 200;
-    memberTypesList.setLayoutData(mtlGD);
-    
-    initializeMemberListContent();
-    return client;
-  }
-
-  private void initializeMemberListContent()
-  {
-//    String result = element.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-//    if (result == null)
-//    {
-//      return;
-//    }
-//    StringTokenizer token = new StringTokenizer(result);
-//    while (token.hasMoreTokens())
-//    {
-//      memberTypesList.add(token.nextToken());
-//    }
-    XSDSchema schema = simpleType.getSchema();
-    for (Iterator i = simpleType.getMemberTypeDefinitions().iterator(); i.hasNext(); )
-    {
-      String name = ((XSDSimpleTypeDefinition)i.next()).getQName(schema);
-      if (name != null)
-      memberTypesList.add(name);
-    }
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
-     {
-      populateBuiltInType();
-    }
-    else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
-     {
-      populateUserSimpleType(false);
-    }
-    else if (e.widget == addButton)
-    {
-      TableItem[] items = table.getItems();
-      int selection = table.getSelectionIndex();
-      if (items != null && items.length > 0 && selection >= 0)
-      {
-        String typeToAdd = items[selection].getData().toString();
-        if (memberTypesList.indexOf(typeToAdd) < 0)
-        {
-          memberTypesList.add(items[selection].getData().toString());
-        }
-      }
-    }
-    else if (e.widget == removeButton)
-    {
-      String[] typesToRemove = memberTypesList.getSelection();
-      for (int i=0; i < typesToRemove.length; i++)
-      {
-        memberTypesList.remove(typesToRemove[i]);
-      }
-    }
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
-   */
-  public void widgetDefaultSelected(SelectionEvent e)
-  {
-  }
-  
-  public void handleSetInput()
-  {
-    populateBuiltInType();
-  }
-  
-  public void populateBuiltInType()
-  {
-    table.removeAll();
-    List items = getBuiltInTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-     {
-      TableItem item = new TableItem(table, SWT.NONE);
-      item.setText(items.get(i).toString());
-      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-      item.setData(items.get(i));
-    }
-  }
-
-  public void populateUserSimpleType(boolean showAnonymous)
-  {
-    table.removeAll();
-    if (showAnonymous)
-     {
-      TableItem anonymousItem = new TableItem(table, SWT.NONE);
-      anonymousItem.setText("**anonymous**");
-      anonymousItem.setData("**anonymous**");
-    }
-    List items = getUserSimpleTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-     {
-      TableItem item = new TableItem(table, SWT.NONE);
-      item.setText(items.get(i).toString());
-      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-      item.setData(items.get(i));
-    }
-  }
-  
-  public java.util.List getBuiltInTypeNamesList()
-  {
-    TypesHelper helper = new TypesHelper(simpleType.getSchema());
-    return helper.getBuiltInTypeNamesList();
-  }
-
-  public java.util.List getUserSimpleTypeNamesList()
-  {
-    TypesHelper helper = new TypesHelper(simpleType.getSchema());
-    return helper.getUserSimpleTypeNamesList();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SpecificConstraintsWidget.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SpecificConstraintsWidget.java
deleted file mode 100644
index 40b7dab..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/SpecificConstraintsWidget.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.commands.AddEnumerationsCommand;
-import org.eclipse.wst.xsd.ui.common.commands.ChangeToLocalSimpleTypeCommand;
-import org.eclipse.wst.xsd.ui.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.common.commands.SetXSDFacetValueCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateXSDPatternFacetCommand;
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.widgets.EnumerationsDialog;
-import org.eclipse.wst.xsd.ui.internal.wizards.RegexWizard;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class SpecificConstraintsWidget implements SelectionListener, Listener
-{
-  public static int ENUMERATION = 0;
-  public static int PATTERN = 1;
-  
-  int kind;
-  ConstraintsTableViewer constraintsTableViewer;
-  Button addButton;
-  Button addUsingDialogButton;
-  Button deleteButton;
-  Button editButton;
-  Composite composite;
-  boolean isEnabled;
-  TabbedPropertySheetWidgetFactory factory;
-  XSDSimpleTypeDefinition input;
-  XSDFeature feature;
-  boolean isReadOnly;
-  CommandStack commandStack;
-  XSDFacetSection facetSection;
-
-  public SpecificConstraintsWidget(Composite composite, TabbedPropertySheetWidgetFactory factory, XSDFeature feature, XSDSimpleTypeDefinition input, XSDFacetSection facetSection)
-  {
-    this.factory = factory;
-    this.input = input;
-    this.composite = composite;
-    this.feature = feature;
-    this.facetSection = facetSection;
-    createControl(composite);
-  }
-
-  public void setCommandStack(CommandStack commandStack)
-  {
-    this.commandStack = commandStack; 
-  }
-
-  public void setIsReadOnly(boolean isReadOnly)
-  {
-    this.isReadOnly = isReadOnly;
-  }
-
-  public TabbedPropertySheetWidgetFactory getWidgetFactory()
-  {
-    return factory;
-  }
-  
-  public Control getControl()
-  {
-    return composite;
-  }
-  
-  public void setEnabled(boolean isEnabled)
-  {
-    this.isEnabled = isEnabled;
-    addButton.setEnabled(isEnabled);
-    addUsingDialogButton.setEnabled(isEnabled);
-    editButton.setEnabled(isEnabled);
-    constraintsTableViewer.getTable().setEnabled(isEnabled);
-    composite.setEnabled(isEnabled);
-  }
-
-  public Control createControl(Composite parent)
-  {
-    composite = factory.createFlatFormComposite(parent);
-    GridData data = new GridData();
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 2;
-    composite.setLayout(gridLayout);
-
-    constraintsTableViewer = new ConstraintsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
-    constraintsTableViewer.setInput(input);
-    Table table = constraintsTableViewer.getTable();
-    table.addSelectionListener(this);
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    data.widthHint = 150;
-    data.grabExcessVerticalSpace = true;
-    table.setLayoutData(data);
-    table.addListener(SWT.Resize, this);
-    
-    Composite buttonComposite = getWidgetFactory().createComposite(composite, SWT.FLAT);
-    GridLayout buttonCompositeLayout = new GridLayout();
-    buttonCompositeLayout.marginTop = 0;
-    buttonCompositeLayout.marginBottom = 0;
-    buttonCompositeLayout.numColumns = 1;
-    buttonComposite.setLayout(buttonCompositeLayout);
-    data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = false;
-    buttonComposite.setLayoutData(data);
-
-    
-    addButton = getWidgetFactory().createButton(buttonComposite, "Add", SWT.PUSH);
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = GridData.BEGINNING;
-    addButton.setLayoutData(data);
-    addButton.addSelectionListener(this);
-    
-    addUsingDialogButton = getWidgetFactory().createButton(buttonComposite, "Add...", SWT.PUSH);
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = GridData.BEGINNING;
-    addUsingDialogButton.setLayoutData(data);
-    addUsingDialogButton.addSelectionListener(this);
-
-    editButton = getWidgetFactory().createButton(buttonComposite, "Edit...", SWT.PUSH);
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    editButton.setLayoutData(data);
-    editButton.setEnabled(false);
-    editButton.addSelectionListener(this);
-    
-    
-    deleteButton = getWidgetFactory().createButton(buttonComposite, "Delete", SWT.PUSH);
-
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    deleteButton.setLayoutData(data);
-    deleteButton.setEnabled(false);
-    deleteButton.addSelectionListener(this);
-
-
-    return composite;
-  }
-
-  public void handleEvent(Event event)
-  {
-    Table table = constraintsTableViewer.getTable();
-    if (event.type == SWT.Resize && event.widget == table)
-    {
-      TableColumn tableColumn = table.getColumn(0);
-      tableColumn.setWidth(table.getSize().x);
-    }
-  }
-
-  public void setInput(Object input)
-  {
-    constraintsTableViewer.setInput(input);
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-//    constraintsTableViewer.refresh();
-  }
-
-  public void widgetSelected(SelectionEvent e)
-  {
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-    Element element = st.getElement();
-
-    if (e.widget == addButton)
-    {
-      List enumList = st.getEnumerationFacets();
-      StringBuffer newName = new StringBuffer("value1"); //$NON-NLS-1$
-      int suffix = 1;
-      for (Iterator i = enumList.iterator(); i.hasNext();)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) i.next();
-        String value = enumFacet.getLexicalValue();
-        if (value != null)
-        {
-          if (value.equals(newName.toString()))
-          {
-            suffix++;
-            newName = new StringBuffer("value" + String.valueOf(suffix)); //$NON-NLS-1$
-          }
-        }
-      }
-
-      if (kind == ENUMERATION)
-      {
-        CompoundCommand compoundCommand = new CompoundCommand();
-        XSDSimpleTypeDefinition targetSimpleType = null;
-        if (feature != null)
-        {
-          XSDSimpleTypeDefinition anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType(feature, input);
-          if (anonymousSimpleType == null)
-          {
-            anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-            anonymousSimpleType.setBaseTypeDefinition(input);
-
-            ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand("Change pattern", (XSDFeature) feature);
-            changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
-            compoundCommand.add(changeToAnonymousCommand);
-            input = anonymousSimpleType;
-          }
-          targetSimpleType = anonymousSimpleType;
-        }
-        else
-        {
-          targetSimpleType = input;
-        }
-
-        AddEnumerationsCommand command = new AddEnumerationsCommand("Add Enumeration", targetSimpleType);
-        command.setValue(newName.toString());
-        compoundCommand.add(command);
-        commandStack.execute(compoundCommand);
-        setInput(input);
-        constraintsTableViewer.refresh();
-        int newItemIndex = constraintsTableViewer.getTable().getItemCount() - 1;
-        constraintsTableViewer.editElement(constraintsTableViewer.getElementAt(newItemIndex), 0);
-      }
-    }
-    else if (e.widget == addUsingDialogButton)
-    {
-      Display display = Display.getCurrent();
-      // if it is null, get the default one
-      display = display == null ? Display.getDefault() : display;
-      Shell shell = display.getActiveShell();
-
-      if (kind == PATTERN)
-      {
-        String initialValue = ""; //$NON-NLS-1$
-        RegexWizard wizard = new RegexWizard(initialValue);
-
-        WizardDialog wizardDialog = new WizardDialog(shell, wizard);
-        wizardDialog.setBlockOnOpen(true);
-        wizardDialog.create();
-
-        int result = wizardDialog.open();
-
-        if (result == Window.OK)
-        {
-          String newPattern = wizard.getPattern();
-          CompoundCommand compoundCommand = new CompoundCommand();
-          XSDSimpleTypeDefinition targetSimpleType = null;
-          if (feature != null)
-          {
-            XSDSimpleTypeDefinition anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType(feature, input);
-            if (anonymousSimpleType == null)
-            {
-              anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-              anonymousSimpleType.setBaseTypeDefinition(input);
-
-              ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand("Change pattern", (XSDFeature) feature);
-              changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
-              compoundCommand.add(changeToAnonymousCommand);
-              input = anonymousSimpleType;
-            }
-            targetSimpleType = anonymousSimpleType;
-          }
-          else
-          {
-            targetSimpleType = input;
-          }
-          
-          UpdateXSDPatternFacetCommand command = new UpdateXSDPatternFacetCommand("Add pattern", targetSimpleType, UpdateXSDPatternFacetCommand.ADD);
-          command.setValue(newPattern);
-          setInput(input);
-          compoundCommand.add(command);
-          commandStack.execute(compoundCommand);
-          facetSection.doSetInput();
-        }
-        constraintsTableViewer.refresh();
-      }
-      else
-      {
-        EnumerationsDialog dialog = new EnumerationsDialog(shell);
-        dialog.setBlockOnOpen(true);
-        int result = dialog.open();
-
-        if (result == Window.OK)
-        {
-          String text = dialog.getText();
-          String delimiter = dialog.getDelimiter();
-          StringTokenizer tokenizer = new StringTokenizer(text, delimiter);
-          CompoundCommand compoundCommand = new CompoundCommand("Add Enumerations");
-          
-          XSDSimpleTypeDefinition targetSimpleType = null;
-          if (feature != null)
-          {
-            XSDSimpleTypeDefinition anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType(feature, input);
-            if (anonymousSimpleType == null)
-            {
-              anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-              anonymousSimpleType.setBaseTypeDefinition(input);
-
-              ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand("", (XSDFeature) feature);
-              changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
-              compoundCommand.add(changeToAnonymousCommand);
-              input = anonymousSimpleType;
-            }
-            targetSimpleType = anonymousSimpleType;
-          }
-          else
-          {
-            targetSimpleType = input;
-          }
-
-          while (tokenizer.hasMoreTokens())
-          {
-            String token = tokenizer.nextToken();
-            if (dialog.isPreserveWhitespace() == false)
-            {
-              token = token.trim();
-            }
-            AddEnumerationsCommand command = new AddEnumerationsCommand("Add Enumerations", targetSimpleType);
-            command.setValue(token);
-            compoundCommand.add(command);
-          }
-          commandStack.execute(compoundCommand);
-        }
-        //setInput(input);
-        facetSection.doSetInput();
-        constraintsTableViewer.refresh();
-      }
-    }
-    else if (e.widget == deleteButton)
-    {
-      StructuredSelection selection = (StructuredSelection) constraintsTableViewer.getSelection();
-      CompoundCommand compoundCommand = new CompoundCommand();
-      if (selection != null)
-      {
-        Iterator i = selection.iterator();
-        if (selection.size() > 0)
-        {
-          compoundCommand.setLabel("Delete Constraints");
-        }
-        else
-        {
-          compoundCommand.setLabel("Delete Pattern");
-        }
-        while (i.hasNext())
-        {
-          Object obj = i.next();
-          if (obj != null)
-          {
-            if (obj instanceof XSDPatternFacet)
-            {
-              UpdateXSDPatternFacetCommand command = new UpdateXSDPatternFacetCommand("", input, UpdateXSDPatternFacetCommand.DELETE);
-              command.setPatternToEdit((XSDPatternFacet)obj);
-              compoundCommand.add(command);
-            }
-            else if (obj instanceof XSDEnumerationFacet)
-            {
-              XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) obj;
-              DeleteCommand deleteCommand = new DeleteCommand("Delete Enumeration", enumFacet);
-              compoundCommand.add(deleteCommand);
-            }
-          }
-        }
-        commandStack.execute(compoundCommand);
-        constraintsTableViewer.refresh();
-
-        if (constraintsTableViewer.getTable().getItemCount() == 0)
-        {
-          editButton.setEnabled(false);
-          deleteButton.setEnabled(false);
-        }
-      }
-    }
-    else if (e.widget == editButton)
-    {
-      StructuredSelection selection = (StructuredSelection) constraintsTableViewer.getSelection();
-      if (selection != null)
-      {
-        Object obj = selection.getFirstElement();
-        if (obj instanceof XSDPatternFacet)
-        {
-          XSDPatternFacet pattern = (XSDPatternFacet) obj;
-          String initialValue = pattern.getLexicalValue();
-          if (initialValue == null)
-          {
-            initialValue = ""; //$NON-NLS-1$
-          }
-
-          Shell shell = Display.getCurrent().getActiveShell();
-
-          RegexWizard wizard = new RegexWizard(initialValue);
-
-          WizardDialog wizardDialog = new WizardDialog(shell, wizard);
-          wizardDialog.setBlockOnOpen(true);
-          wizardDialog.create();
-
-          int result = wizardDialog.open();
-
-          if (result == Window.OK)
-          {
-            String newPattern = wizard.getPattern();
-            element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, newPattern);
-            pattern.setLexicalValue(newPattern);
-            constraintsTableViewer.refresh();
-          }
-        }
-      }
-    }
-    else if (e.widget == constraintsTableViewer.getTable())
-    {
-      StructuredSelection selection = (StructuredSelection) constraintsTableViewer.getSelection();
-      if (selection.getFirstElement() != null)
-      {
-        editButton.setEnabled(true);
-        deleteButton.setEnabled(true);
-      }
-      else
-      {
-        editButton.setEnabled(false);
-        deleteButton.setEnabled(false);
-      }
-    }
-  }
-  
-  public void widgetDefaultSelected(SelectionEvent e)
-  {
-
-  }
-
-  
-  public void setConstraintKind(int kind)
-  {
-    this.kind = kind;
-    constraintsTableViewer.setInput(input);
-    constraintsTableViewer.refresh();
-  }
-  
-  public void doModify(Object element, String property, Object value)
-  {
-    if (element instanceof TableItem && (value != null))
-    {
-      TableItem item = (TableItem) element;
-
-      if (item.getData() instanceof XSDPatternFacet)
-      {
-        XSDPatternFacet patternFacet = (XSDPatternFacet) item.getData();
-        patternFacet.setLexicalValue((String) value);
-
-        item.setData(patternFacet);
-        item.setText((String) value);
-      }
-      else if (item.getData() instanceof XSDEnumerationFacet)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) item.getData();
-        SetXSDFacetValueCommand command = new SetXSDFacetValueCommand("Set Enumeration Value", enumFacet);
-        command.setValue((String) value);
-        commandStack.execute(command);
-        item.setData(enumFacet);
-        item.setText((String) value);
-      }
-    }
-  }
-  
-  public Object doGetValue(Object element, String property)
-  {
-    if (element instanceof XSDPatternFacet)
-    {
-      XSDPatternFacet patternFacet = (XSDPatternFacet) element;
-      String value = patternFacet.getLexicalValue();
-      if (value == null)
-        value = ""; //$NON-NLS-1$
-      return value;
-    }
-    else if (element instanceof XSDEnumerationFacet)
-    {
-      XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
-      String value = enumFacet.getLexicalValue();
-      if (value == null)
-        value = ""; //$NON-NLS-1$
-      return value;
-    }
-
-    return ""; //$NON-NLS-1$
-  }
-  
-  class ConstraintsTableViewer extends NavigableTableViewer implements ICellModifier
-  {
-    protected String[] columnProperties = { "Pattern" };
-
-    protected CellEditor[] cellEditors;
-
-    Table table;
-
-    public ConstraintsTableViewer(Table table)
-    {
-      super(table);
-      table = getTable();
-
-      table.setLinesVisible(true);
-
-      setContentProvider(new ConstraintsContentProvider());
-      setLabelProvider(new ConstraintsTableLabelProvider());
-      setColumnProperties(columnProperties);
-
-      setCellModifier(this);
-
-      TableColumn column = new TableColumn(table, SWT.NONE, 0);
-      column.setText(columnProperties[0]);
-      column.setAlignment(SWT.LEFT);
-      column.setResizable(true);
-
-      cellEditors = new CellEditor[1];
-
-      TableLayout layout = new TableLayout();
-      ColumnWeightData data = new ColumnWeightData(100);
-
-      layout.addColumnData(data);
-      cellEditors[0] = new TextCellEditor(table);
-
-      getTable().setLayout(layout);
-      setCellEditors(cellEditors);
-    }
-    
-    public boolean canModify(Object element, String property)
-    {
-      return true;
-    }
-
-    public void modify(Object element, String property, Object value)
-    {
-      doModify(element, property, value);
-    }
-
-    public Object getValue(Object element, String property)
-    {
-      return doGetValue(element, property);
-    }
-
-  }
-
-  class ConstraintsContentProvider implements IStructuredContentProvider
-  {
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-    }
-
-    public java.lang.Object[] getElements(java.lang.Object inputElement)
-    {
-      java.util.List list = new ArrayList();
-      if (inputElement instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) inputElement;
-        if (kind == PATTERN)
-        {
-          return st.getPatternFacets().toArray();
-        }
-        else
-        {
-          return st.getEnumerationFacets().toArray();
-        }
-      }
-      return list.toArray();
-    }
-
-    public void dispose()
-    {
-    }
-  }
-
-  class ConstraintsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-  {
-    public ConstraintsTableLabelProvider()
-    {
-
-    }
-
-    public Image getColumnImage(Object element, int columnIndex)
-    {
-      if (kind == PATTERN)
-      {
-        return XSDEditorPlugin.getXSDImage("icons/XSDSimplePattern.gif"); //$NON-NLS-1$
-      }
-      else
-      {
-        return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif");
-      }
-    }
-
-    public String getColumnText(Object element, int columnIndex)
-    {
-      if (element instanceof XSDPatternFacet)
-      {
-        XSDPatternFacet pattern = (XSDPatternFacet) element;
-        String value = pattern.getLexicalValue();
-        if (value == null)
-          value = ""; //$NON-NLS-1$
-        return value;
-      }
-      else if (element instanceof XSDEnumerationFacet)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
-        String value = enumFacet.getLexicalValue();
-        if (value == null)
-          value = "";
-        return value;
-      }
-      return ""; //$NON-NLS-1$
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDActionManager.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDActionManager.java
deleted file mode 100644
index 04f0a5e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDActionManager.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.actions.EditAttributeAction;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDActionManager extends XMLNodeActionManager {
-
-  private CommandStack commandStack;
-  
-	public XSDActionManager(IStructuredModel model, Viewer viewer) {
-		super(model, viewer);
-	}
-  
-  public void setCommandStack(CommandStack commandStack) {
-    this.commandStack = commandStack;
-  }
-
-  protected Action createAddCDataSectionAction(Node parent, int index)
-  {
-    return null;
-  }
-  
-  protected Action createAddPCDataAction(Node parent, CMDataType dataType, int index) {
-    return null;
-  }
-  
-  
-	protected void contributeAddDocumentChildActions(IMenuManager menu, Document document, int ic, int vc) {
-	}
-  
-	protected void contributeEditGrammarInformationActions(IMenuManager menu, Node node) {
-	}
-	
-	protected void contributePIAndCommentActions(IMenuManager menu, Document document, int index) {
-	}
-	
-	protected void contributePIAndCommentActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
-	}
-	
-	protected void contributeTextNodeActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
-		super.contributeTextNodeActions(menu, parentElement, parentEd, index);
-	}
-  
-  protected Action createAddAttributeAction(Element parent, CMAttributeDeclaration ad) {
-    Action action = null;
-    if (ad == null) {
-      action = new EditAttributeAction(this, parent, null, XMLUIMessages._UI_MENU_NEW_ATTRIBUTE, XMLUIMessages._UI_MENU_NEW_ATTRIBUTE_TITLE); //$NON-NLS-1$ //$NON-NLS-2$
-    } else {
-      action = new AddNodeAction(ad, parent, -1);
-    }
-    
-    WrapperCommand command = new WrapperCommand(action, parent, ad);
-    WrapperAction wrapperAction = new WrapperAction(command);
-    return wrapperAction;
-  }
-  
-  class WrapperAction extends Action
-  {
-    WrapperCommand command;
-    
-    public WrapperAction(WrapperCommand command)
-    {
-      super();
-      this.command = command;
-    }
-    
-    public String getText()
-    {
-      return command.getAction().getText();
-    }
-
-    public void run()
-    {
-      // Some editors may not use a command stack
-      if (commandStack != null)
-      {
-        commandStack.execute(command);
-      }
-      else
-      {
-        command.execute();
-      }
-    }
-  }
-
-  class WrapperCommand extends Command
-  {
-    Action action;
-    Element parent;
-    CMAttributeDeclaration ad;
-    public WrapperCommand(Action action, Element parent, CMAttributeDeclaration ad)
-    {
-      super();
-      this.action = action;
-      this.parent = parent;
-      this.ad = ad;
-    }
-    
-    public String getLabel()
-    {
-      return action.getText();
-    }
-    
-    public Action getAction()
-    {
-      return action;
-    }
-    
-    public void execute()
-    {
-      action.run();
-    }
-    
-    public void undo() {
-      
-//      ((Element)parent).removeAttribute(ad.getAttrName());
-
-      getModel().getUndoManager().undo();
-
-    } 
-        
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDAttributeDeclarationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDAttributeDeclarationSection.java
deleted file mode 100644
index 2c89dc0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDAttributeDeclarationSection.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.editor.Messages;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNameCommand;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDAttributeDeclarationSection extends AbstractSection
-{
-  protected Text nameText;
-  protected Text typeCombo;
-  protected Button button;
-  boolean isAttributeReference;
-  
-  public XSDAttributeDeclarationSection()
-  {
-    super();
-  }
-
-  protected void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-
-    String typeLabel = Messages.UI_LABEL_TYPE; //$NON-NLS-1$
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.numColumns = 3;
-    composite.setLayout(gridLayout);
-
-    // ------------------------------------------------------------------
-    // NameLabel
-    // ------------------------------------------------------------------
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    CLabel nameLabel = getWidgetFactory().createCLabel(composite, "Name:"); //$NON-NLS-1$
-    nameLabel.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // NameText
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    nameText.setLayoutData(data);
-    applyAllListeners(nameText);
-
-    // ------------------------------------------------------------------
-    // DummyLabel
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // typeLabel
-    // ------------------------------------------------------------------
-    getWidgetFactory().createCLabel(composite, typeLabel); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // typeCombo
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    typeCombo = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    typeCombo.setEditable(false);
-    // baseTypeCombo.addListener(SWT.Modify, this);
-    typeCombo.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // BaseTypeButton
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-
-    button = getWidgetFactory().createButton(composite, "", SWT.PUSH);
-    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif"));
-    button.addSelectionListener(this);
-    button.setLayoutData(data);
-  }
-
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    super.refresh();
-
-    setListenerEnabled(false);
-
-    // refresh name
-
-    nameText.setText("");
-    if (input instanceof XSDAttributeDeclaration)
-    {
-      XSDAttributeDeclaration namedComponent = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration();
-
-      String name = namedComponent.getName();
-      if (name != null)
-      {
-        nameText.setText(name);
-      }
-    }
-
-    // refresh type
-
-    typeCombo.setText(""); //$NON-NLS-1$
-    if (input != null)
-    {
-      if (input instanceof XSDAttributeDeclaration)
-      {
-        XSDAttributeDeclaration xsdAttribute = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration();
-        isAttributeReference = ((XSDAttributeDeclaration)input).isAttributeDeclarationReference();
-        XSDTypeDefinition typeDef = xsdAttribute.getTypeDefinition();
-        boolean isAnonymous = xsdAttribute.getAnonymousTypeDefinition() != null;
-
-        if (isAnonymous)
-        {
-          typeCombo.setText("**anonymous**"); //$NON-NLS-1$
-        }
-        else
-        {
-          String typeName = ""; //$NON-NLS-1$
-          if (typeDef != null)
-          {
-            typeName = typeDef.getQName(xsdSchema);
-            if (typeName == null)
-            {
-              typeName = ""; //$NON-NLS-1$
-            }
-            typeCombo.setText(typeName);
-          }
-          else
-          {
-            typeCombo.setText(Messages.UI_NO_TYPE); //$NON-NLS-1$
-          }
-        }
-      }
-    }
-
-    setListenerEnabled(true);
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-  protected void doHandleEvent(Event event)
-  {
-    super.doHandleEvent(event);
-    if (event.widget == nameText)
-    {
-      if (!nameText.getEditable())
-        return;
-
-      String newValue = nameText.getText().trim();
-      if (input instanceof XSDAttributeDeclaration)
-      {
-        XSDAttributeDeclaration namedComponent = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration();
-
-        if (!validateSection())
-          return;
-
-        Command command = null;
-
-        // Make sure an actual name change has taken place
-        String oldName = namedComponent.getName();
-        if (!newValue.equals(oldName))
-        {
-          command = new UpdateNameCommand("Rename", namedComponent, newValue);
-        }
-
-        if (command != null && getCommandStack() != null)
-        {
-          getCommandStack().execute(command);
-        }
-        
-        if (isAttributeReference)
-        {
-          XSDAttributeDeclaration attrRef = (XSDAttributeDeclaration)input;
-          String qname = attrRef.getResolvedAttributeDeclaration().getQName();
-          attrRef.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, qname);
-          
-//          TypesHelper helper = new TypesHelper(xsdSchema);
-//          List items = new ArrayList();
-//          items = helper.getGlobalElements();
-//          items.add(0, "");
-//          componentNameCombo.setItems((String [])items.toArray(new String[0]));
-//
-//          refreshRefCombo();
-        }
-
-      }
-    }
-  }
-  
-  protected boolean validateSection()
-  {
-    if (nameText == null || nameText.isDisposed())
-      return true;
-
-    setErrorMessage(null);
-
-    String name = nameText.getText().trim();
-
-    // validate against NCName
-    if (name.length() < 1 || !XMLChar.isValidNCName(name))
-    {
-      setErrorMessage("Error Invalid Name");
-      return false;
-    }
-
-    return true;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDAttributeGroupDefinitionSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDAttributeGroupDefinitionSection.java
deleted file mode 100644
index cee4335..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDAttributeGroupDefinitionSection.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDAttributeGroupDefinitionSection extends AbstractSection
-{
-  protected CCombo refCombo;
-
-  public XSDAttributeGroupDefinitionSection()
-  {
-    super();
-  }
-
-  protected void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.numColumns = 2;
-    composite.setLayout(gridLayout);
-
-    // ------------------------------------------------------------------
-    // Ref Label
-    // ------------------------------------------------------------------
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    CLabel refLabel = getWidgetFactory().createCLabel(composite, XSDConstants.REF_ATTRIBUTE + ":");  //$NON-NLS-1$
-    refLabel.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // Ref Combo
-    // ------------------------------------------------------------------
-
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    refCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    refCombo.addSelectionListener(this);
-    refCombo.setLayoutData(data);
-  }
-
-  public void refresh()
-  {
-    super.refresh();
-
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-
-    setListenerEnabled(false);
-
-    if (input instanceof XSDNamedComponent)
-    {
-      XSDNamedComponent namedComponent = (XSDNamedComponent)input;
-      Element element = namedComponent.getElement();
-      if (element != null)
-      {
-        String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
-        if (attrValue == null)
-        {
-          attrValue = "";
-        }
-        refCombo.setText(attrValue);
-      }
-    }
-
-    setListenerEnabled(true);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDComplexTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDComplexTypeSection.java
deleted file mode 100644
index 677759d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDComplexTypeSection.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.editor.Messages;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNameCommand;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDDerivationMethod;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDComplexTypeSection extends AbstractSection implements SelectionListener
-{
-  protected Text nameText;
-  protected Text baseTypeCombo;
-  protected CCombo derivedByCombo;
-  protected Button button;
-  private String derivedByChoicesComboValues[] = { "", XSDConstants.RESTRICTION_ELEMENT_TAG, XSDConstants.EXTENSION_ELEMENT_TAG };
-
-  public XSDComplexTypeSection()
-  {
-    super();
-  }
-
-  /**
-   * Contents of the property tab
-   * 
-   * NameLabel NameText DummyLabel BaseTypeLabel BaseTypeCombo BaseTypeButton
-   * DerivedByLabel DerivedByCombo
-   */
-  public void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.numColumns = 3;
-    composite.setLayout(gridLayout);
-
-    // ------------------------------------------------------------------
-    // NameLabel
-    // ------------------------------------------------------------------
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    CLabel nameLabel = getWidgetFactory().createCLabel(composite, "Name:"); //$NON-NLS-1$
-    nameLabel.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // NameText
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    nameText.setLayoutData(data);
-    applyAllListeners(nameText);
-
-    // ------------------------------------------------------------------
-    // DummyLabel
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // BaseTypeLabel
-    // ------------------------------------------------------------------
-
-    getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_INHERIT_FROM); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // BaseTypeCombo
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    baseTypeCombo = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    baseTypeCombo.setEditable(false);
-    // baseTypeCombo.addListener(SWT.Modify, this);
-    baseTypeCombo.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // BaseTypeButton
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-
-    button = getWidgetFactory().createButton(composite, "", SWT.PUSH);
-    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif"));
-    button.addSelectionListener(this);
-    button.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // DerivedByLabel
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-
-    CLabel derivedByLabel = getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_INHERIT_BY); //$NON-NLS-1$
-    derivedByLabel.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // DerivedByCombo
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    derivedByCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    derivedByCombo.setLayoutData(data);
-    derivedByCombo.setItems(derivedByChoicesComboValues);
-    // derivedByCombo.addSelectionListener(this);
-
-  }
-
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    super.refresh();
-    if (Display.getCurrent() == null)
-      return;
-
-    setListenerEnabled(false);
-
-    try
-    {
-      nameText.setText("");
-      baseTypeCombo.setText(""); //$NON-NLS-1$
-
-      if (input instanceof XSDComplexTypeDefinition)
-      {
-        XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
-        String name = complexType.getName();
-        if (name == null)
-          name = "";
-
-        boolean isAnonymousType = name.equals("") ? true : false;
-        if (isAnonymousType)
-        {
-          nameText.setText("**anonymous**"); //$NON-NLS-1$
-          nameText.setEditable(false);
-        }
-        else
-        {
-          nameText.setText(name);
-          nameText.setEditable(true);
-        }
-
-        XSDTypeDefinition baseTypeDefinition = complexType.getBaseTypeDefinition();
-        String baseType = ""; //$NON-NLS-1$
-        if (baseTypeDefinition != null)
-        {
-          baseType = baseTypeDefinition.getName();
-          if (baseType == null)
-          {
-            baseType = "";
-          }
-        }
-        baseTypeCombo.setText(baseType);
-
-        derivedByCombo.setText(""); //$NON-NLS-1$
-        int derivationMethod = complexType.getDerivationMethod().getValue();
-        if (derivationMethod == XSDDerivationMethod.EXTENSION)
-        {
-          derivedByCombo.setText(XSDConstants.EXTENSION_ELEMENT_TAG);
-        }
-        else if (derivationMethod == XSDDerivationMethod.RESTRICTION)
-        {
-          derivedByCombo.setText(XSDConstants.RESTRICTION_ELEMENT_TAG);
-        }
-      }
-
-    }
-    finally
-    {
-      setListenerEnabled(true);
-    }
-  }
-
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-//    XSDComplexTypeDefinition xsdComplexType = (XSDComplexTypeDefinition) input;
-//    Element ctElement = xsdComplexType.getElement();
-    if (e.widget == button)
-    {
-//      Shell shell = Display.getCurrent().getActiveShell();
-//      Element element = null;
-//      if (xsdComplexType.getContent() != null)
-//      {
-//        element = xsdComplexType.getContent().getElement();
-//      }
-
-      // SimpleContentBaseTypeOptionsDialog dialog = new
-      // SimpleContentBaseTypeOptionsDialog(shell, element, BASE_TYPE_ID,
-      // xsdComplexType.getSchema());
-      // dialog.setBlockOnOpen(true);
-      // dialog.create();
-      // int result = dialog.open();
-
-//      IFile currentIFile = ((IFileEditorInput) getActiveEditor().getEditorInput()).getFile();
-
-//      XSDSchema schema = xsdComplexType.getSchema();
-      
-      // issuec (cs) need to move the common.ui's selection dialog
-      /*
-      XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
-      XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, Messages.UI_LABEL_SET_TYPE, provider);
-      provider.setDialog(dialog);
-      dialog.setBlockOnOpen(true);
-      dialog.create();
-      int result = dialog.open();
-
-      if (result == Window.OK)
-      {
-        XMLComponentSpecification spec = dialog.getSelection();
-        XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
-        helper.addImportIfNecessary(element, spec);
-
-        String typeString = helper.getPrefixedTypeName(spec);
-
-        String derivedBy = "";
-        int derivationMethod = xsdComplexType.getDerivationMethod().getValue();
-        if (derivationMethod == XSDDerivationMethod.EXTENSION)
-        {
-          derivedBy = XSDConstants.EXTENSION_ELEMENT_TAG;
-        }
-        else if (derivationMethod == XSDDerivationMethod.RESTRICTION)
-        {
-          derivedBy = XSDConstants.RESTRICTION_ELEMENT_TAG;
-        }
-
-        SetBaseTypeAction setBaseTypeAction = new SetBaseTypeAction("_UI_LABEL_SET_BASE_TYPE"); //$NON-NLS-1$
-        setBaseTypeAction.setXSDSchema(xsdSchema);
-        setBaseTypeAction.setComplexTypeElement(ctElement);
-        setBaseTypeAction.setType(typeString);
-        setBaseTypeAction.setDerivedBy(derivedBy);
-        setBaseTypeAction.performAction();
-
-      }
-      refresh();
-      // }
-      // else if (e.widget == derivedByCombo)
-      // {
-      // Element contentModelElement =
-      // getDomHelper().getContentModelFromParent(ctElement);
-      // String baseType = getDomHelper().getBaseType(contentModelElement);
-      // beginRecording(XSDEditorPlugin.getXSDString("_UI_DERIVEDBY_CHANGE"),
-      // ctElement); //$NON-NLS-1$
-      // if (contentModelElement != null)
-      // {
-      // getDomHelper().changeDerivedByType(contentModelElement,
-      // derivedByCombo.getText(), baseType);
-      // }
-      // endRecording(ctElement);       
-       */
-    }
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-  public void dispose()
-  {
-    super.dispose();
-  }
-
-  public void doHandleEvent(Event event)
-  {
-    super.doHandleEvent(event);
-    if (event.widget == nameText)
-    {
-      if (!nameText.getEditable())
-        return;
-
-      String newValue = nameText.getText().trim();
-      if (input instanceof XSDNamedComponent)
-      {
-        XSDNamedComponent namedComponent = (XSDNamedComponent) input;
-
-        if (!validateSection())
-          return;
-
-        Command command = null;
-
-        // Make sure an actual name change has taken place
-        String oldName = namedComponent.getName();
-        if (!newValue.equals(oldName))
-        {
-          command = new UpdateNameCommand("Rename", namedComponent, newValue);
-        }
-
-        if (command != null && getCommandStack() != null)
-        {
-          getCommandStack().execute(command);
-        }
-        // doReferentialIntegrityCheck(namedComponent, newValue);
-      }
-    }
-  }
-
-  protected boolean validateSection()
-  {
-    if (nameText == null || nameText.isDisposed())
-      return true;
-
-    setErrorMessage(null);
-
-    String name = nameText.getText().trim();
-
-    // validate against NCName
-    if (name.length() < 1 || !XMLChar.isValidNCName(name))
-    {
-      setErrorMessage("Error Invalid Name");
-      return false;
-    }
-
-    return true;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDElementDeclarationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDElementDeclarationSection.java
deleted file mode 100644
index e92363c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDElementDeclarationSection.java
+++ /dev/null
@@ -1,564 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialog;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialogConfiguration;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ScopedComponentSearchListDialog;
-import org.eclipse.wst.xsd.editor.Messages;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.editor.internal.dialogs.NewTypeButtonHandler;
-import org.eclipse.wst.xsd.editor.internal.search.XSDComponentDescriptionProvider;
-import org.eclipse.wst.xsd.editor.internal.search.XSDTypesSearchListProvider;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateMaxOccursCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateMinOccursCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateTypeReferenceCommand;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDElementDeclarationSection extends MultiplicitySection
-{
-  protected Text nameText;
-  protected Text typeCombo;
-  protected Button typesBrowseButton;
-  protected CCombo componentNameCombo;
-  boolean isElementReference;
-
-  private XSDTypeDefinition typeDefinition;
-
-  public XSDElementDeclarationSection()
-  {
-    super();
-  }
-
-  /**
-   * Contents of the property tab
-   */
-  public void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-    TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
-
-    String typeLabel = Messages.UI_LABEL_TYPE; //$NON-NLS-1$
-
-    GridData data = new GridData();
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 3;
-    composite.setLayout(gridLayout);
-    
-      // ------------------------------------------------------------------
-      // NameLabel
-      // ------------------------------------------------------------------
-
-      data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-      data.grabExcessHorizontalSpace = false;
-      CLabel nameLabel = factory.createCLabel(composite, "Name:");
-      nameLabel.setLayoutData(data);
-
-      // ------------------------------------------------------------------
-      // NameText
-      // ------------------------------------------------------------------
-      data = new GridData();
-      data.grabExcessHorizontalSpace = true;
-      data.horizontalAlignment = GridData.FILL;
-      nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-      nameText.setLayoutData(data);
-      applyAllListeners(nameText);   
-     
-      // ------------------------------------------------------------------
-      // DummyLabel
-      // ------------------------------------------------------------------
-      data = new GridData();
-      data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-      data.grabExcessHorizontalSpace = false;
-      getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // Ref Label
-    // ------------------------------------------------------------------
-    if (isElementReference)
-    {
-      data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-      data.grabExcessHorizontalSpace = false;
-      CLabel refLabel = getWidgetFactory().createCLabel(composite, "Reference:");
-      refLabel.setLayoutData(data);
-
-      // ------------------------------------------------------------------
-      // Ref Combo
-      // ------------------------------------------------------------------
-
-      data = new GridData();
-      data.grabExcessHorizontalSpace = true;
-      data.horizontalAlignment = GridData.FILL;
-
-      componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-      componentNameCombo.addSelectionListener(this);
-      componentNameCombo.setLayoutData(data);
-
-      data = new GridData();
-      data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-      data.grabExcessHorizontalSpace = false;
-
-      getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-    }
-
-    // ------------------------------------------------------------------
-    // typeLabel
-    // ------------------------------------------------------------------
-    getWidgetFactory().createCLabel(composite, typeLabel);
-
-    // ------------------------------------------------------------------
-    // typeCombo
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    typeCombo = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    typeCombo.setEditable(false);
-    typeCombo.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // BaseTypeButton
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-
-    typesBrowseButton = getWidgetFactory().createButton(composite, "", SWT.PUSH);
-    typesBrowseButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif"));
-    typesBrowseButton.addSelectionListener(this);
-    typesBrowseButton.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // min/max button modifiers
-    // ------------------------------------------------------------------
-
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-
-    getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
-    Composite modifierComposite = getWidgetFactory().createComposite(composite, SWT.FLAT);
-    GridLayout gridLayout2 = new GridLayout();
-    gridLayout2.marginLeft = 0;
-    gridLayout2.marginRight = 0;
-    gridLayout2.marginTop = 0;
-    gridLayout2.marginBottom = 0;
-    gridLayout2.numColumns = 2;
-    modifierComposite.setLayout(gridLayout2);
-    modifierComposite.setLayoutData(data);
-    requiredButton = getWidgetFactory().createButton(modifierComposite, "Required", SWT.CHECK | SWT.FLAT); //$NON-NLS-1$
-    requiredButton.addSelectionListener(this);
-
-    listButton = getWidgetFactory().createButton(modifierComposite, "Array", SWT.CHECK | SWT.FLAT); //$NON-NLS-1$
-    listButton.addSelectionListener(this);
-
-    getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // min property
-    // ------------------------------------------------------------------
-
-    getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MINOCCURS);
-
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    minCombo.setLayoutData(data);
-    minCombo.add("0"); //$NON-NLS-1$
-    minCombo.add("1"); //$NON-NLS-1$
-    applyModifyListeners(minCombo);
-    minCombo.addSelectionListener(this);
-
-    // ------------------------------------------------------------------
-    // DummyLabel
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // max property
-    // ------------------------------------------------------------------
-    getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MAXOCCURS);
-
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    maxCombo.setLayoutData(data);
-    maxCombo.add("0"); //$NON-NLS-1$
-    maxCombo.add("1"); //$NON-NLS-1$
-    maxCombo.add("unbounded"); //$NON-NLS-1$
-    applyModifyListeners(maxCombo);
-    maxCombo.addSelectionListener(this);
-  }
-
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-    super.setInput(part, selection);
-    setListenerEnabled(false);
-    init();
-    relayout();
-    
-    if (isElementReference)
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      List items = new ArrayList();
-      items = helper.getGlobalElements();
-      items.add(0, "");
-      componentNameCombo.setItems((String [])items.toArray(new String[0]));
-    }
-    setListenerEnabled(true);
-  }
-  
-  protected void init()
-  {
-    if (input instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) input;
-      isElementReference = xsdElementDeclaration.isElementDeclarationReference();
-
-      typeDefinition = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
-    }
-  }
-  
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    super.refresh();
-
-    setListenerEnabled(false);
-
-    XSDElementDeclaration xsdElementDeclaration = ((XSDElementDeclaration) input).getResolvedElementDeclaration();
-
-    // refresh name
-    nameText.setText("");
-    typeCombo.setText(""); //$NON-NLS-1$
-    typesBrowseButton.setEnabled(true);
-    String name = xsdElementDeclaration.getName();
-    if (name != null)
-    {
-      nameText.setText(name);
-    }
-    
-    if (isElementReference)
-    {
-      refreshRefCombo();
-    }
-
-    // refresh type
-    if (input != null)
-    {
-      if (input instanceof XSDElementDeclaration)
-      {
-        boolean isAnonymous = xsdElementDeclaration.getAnonymousTypeDefinition() != null;
-        //XSDTypeDefinition typeDef = XSDUtils.getResolvedType(xsdElementDeclaration);
-        XSDTypeDefinition typeDef = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
-        
-        String typeName = ""; //$NON-NLS-1$
-        if (typeDef != null)
-          typeName = typeDef.getQName(xsdSchema);
-
-        if (typeName == null)
-        {
-          typeName = ""; //$NON-NLS-1$
-        }
-
-        if (isAnonymous)
-        {
-          typeCombo.setText("**anonymous**"); //$NON-NLS-1$
-        }
-        else
-        {
-          if (typeDefinition != null)
-          {
-            typeCombo.setText(typeName);
-          }
-          else
-          {
-            typeCombo.setText(Messages.UI_NO_TYPE); //$NON-NLS-1$
-          }
-        }
-      }
-    }
-
-    // refresh min max
-    refreshMinMax();
-
-    setListenerEnabled(true);
-
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-  public void doWidgetSelected(SelectionEvent e)
-  {
-    if (e.widget == typesBrowseButton)
-    {
-      Shell shell = Display.getCurrent().getActiveShell();
-      IFile currentIFile = ((IFileEditorInput) getActiveEditor().getEditorInput()).getFile();
-
-      /** Initialize the Set types Dialog */
-      final XSDTypesSearchListProvider searchListProvider = 
-    	  new XSDTypesSearchListProvider(currentIFile, new XSDSchema[] {xsdSchema} );      
-      ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
-      configuration.setDescriptionProvider(new XSDComponentDescriptionProvider() );
-      configuration.setSearchListProvider(searchListProvider);      
-      configuration.setNewComponentHandler(new NewTypeButtonHandler());
-      ComponentSearchListDialog dialog = new ScopedComponentSearchListDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), configuration);
-      //dialog.setFilterLabel("Text:");
-
-      if (input instanceof XSDAttributeDeclaration)
-      {
-        searchListProvider.showComplexTypes(false);
-      }
-
-      dialog.setBlockOnOpen(true);
-      dialog.create();
-
-      if (dialog.open() == Window.OK)
-      {
-        //String newType = (String) dialog.getSelection().getAttributeInfo("name");
-        //String nsType = (String) dialog.getSelection().getTargetNamespace();
-        
-        ComponentSpecification selection = dialog.getSelectedComponent();
-        String newType = selection.getName();
-        String namespace = selection.getQualifier();
-        
-        UpdateTypeReferenceCommand command = new UpdateTypeReferenceCommand((XSDElementDeclaration) input, xsdSchema.resolveTypeDefinition(namespace, newType));
-        getCommandStack().execute(command);
-
-        init();
-        relayout();
-      }
-    }
-    else if (e.widget == listButton)
-    {
-      int maxOccurs = (listButton.getSelection() ? XSDParticle.UNBOUNDED : 1);
-      if (input instanceof XSDElementDeclaration)
-      {
-        XSDParticle particle = (XSDParticle) ((XSDElementDeclaration) input).eContainer();
-        UpdateMaxOccursCommand command = new UpdateMaxOccursCommand("Update Maximum Occurence", particle, maxOccurs);
-        getCommandStack().execute(command);
-        if (maxOccurs == -1)
-          maxCombo.setText("*");
-        else
-          maxCombo.setText("");
-      }
-    }
-    else if (e.widget == requiredButton)
-    {
-      int minOccurs = requiredButton.getSelection() ? 1 : 0;
-      if (input instanceof XSDElementDeclaration)
-      {
-        XSDParticle particle = (XSDParticle) ((XSDElementDeclaration) input).eContainer();
-        UpdateMinOccursCommand command = new UpdateMinOccursCommand("Update Minimum Occurrence", particle, minOccurs);
-        getCommandStack().execute(command);
-      }
-      minCombo.setText("" + minOccurs);
-    }
-    else if (e.widget == componentNameCombo)
-    {
-      String newValue = componentNameCombo.getText();
-      if (input instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration element = (XSDElementDeclaration)input;
-// TODO: We should set the ref using the model, and not the DOM.        
-        element.setResolvedElementDeclaration(element.resolveElementDeclaration(newValue));
-//        element.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
-      }
-    }
-    else if (e.widget == maxCombo)
-    {
-      updateMaxAttribute();
-    }
-    else if (e.widget == minCombo)
-    {
-      updateMinAttribute();
-    }
-
-  }
-
-  protected void relayout()
-  {
-    Composite parentComposite = composite.getParent();
-    parentComposite.getParent().setRedraw(false);
-
-    if (parentComposite != null && !parentComposite.isDisposed())
-    {
-      Control[] children = parentComposite.getChildren();
-      for (int i = 0; i < children.length; i++)
-      {
-        children[i].dispose();
-      }
-    }
-
-    // Now initialize the new handler
-    createContents(parentComposite);
-    parentComposite.getParent().layout(true, true);
-
-    // Now turn painting back on
-    parentComposite.getParent().setRedraw(true);
-    refresh();
-  }
-
-  public void doHandleEvent(Event event)
-  {
-    super.doHandleEvent(event);
-    if (event.widget == nameText)
-    {
-      String newValue = nameText.getText().trim();
-      if (input instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration namedComponent = ((XSDElementDeclaration) input).getResolvedElementDeclaration();
-        if (!validateSection())
-          return;
-
-        Command command = null;
-
-        // Make sure an actual name change has taken place
-        String oldName = namedComponent.getName();
-        if (!newValue.equals(oldName))
-        {
-          command = new UpdateNameCommand("Rename", namedComponent, newValue);
-        }
-
-        if (command != null && getCommandStack() != null)
-        {
-          getCommandStack().execute(command);
-        }
-        
-        if (isElementReference)
-        {
-          XSDElementDeclaration elementRef = (XSDElementDeclaration)input;
-          String qname = elementRef.getResolvedElementDeclaration().getQName();
-          elementRef.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, qname);
-          
-          TypesHelper helper = new TypesHelper(xsdSchema);
-          List items = new ArrayList();
-          items = helper.getGlobalElements();
-          items.add(0, "");
-          componentNameCombo.setItems((String [])items.toArray(new String[0]));
-
-          refreshRefCombo();
-        }
-
-        // doReferentialIntegrityCheck(namedComponent, newValue);
-      }
-    }
-    else if (event.widget == minCombo)
-    {
-      requiredButton.setSelection(isRequired);
-    }
-
-  }
-
-  protected boolean validateSection()
-  {
-    if (nameText == null || nameText.isDisposed())
-      return true;
-
-    setErrorMessage(null);
-
-    String name = nameText.getText().trim();
-
-    // validate against NCName
-    if (name.length() < 1 || !XMLChar.isValidNCName(name))
-    {
-      setErrorMessage("Invalid name");
-      return false;
-    }
-
-    return true;
-  }
-
-  public void dispose()
-  {
-    if (typesBrowseButton != null && !typesBrowseButton.isDisposed())
-      typesBrowseButton.removeSelectionListener(this);
-    if (componentNameCombo != null && !componentNameCombo.isDisposed())
-      componentNameCombo.removeSelectionListener(this);
-    if (minCombo != null && !minCombo.isDisposed())
-      minCombo.removeSelectionListener(this);
-    if (maxCombo != null && !maxCombo.isDisposed())
-      maxCombo.removeSelectionListener(this);
-    if (requiredButton != null && !requiredButton.isDisposed())
-      requiredButton.removeSelectionListener(this);
-    if (listButton != null && !listButton.isDisposed())
-      listButton.removeSelectionListener(this);
-    super.dispose();
-  }
-
-  protected void refreshRefCombo()
-  {
-    componentNameCombo.setText("");
-    typesBrowseButton.setEnabled(false);
-
-    XSDElementDeclaration namedComponent = (XSDElementDeclaration) input;
-    Element element = namedComponent.getElement();
-    if (element != null)
-    {
-      String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
-      if (attrValue == null)
-      {
-        attrValue = "";
-      }
-      componentNameCombo.setText(attrValue);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDFacetSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDFacetSection.java
deleted file mode 100644
index 0a07f3c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDFacetSection.java
+++ /dev/null
@@ -1,912 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.common.commands.ChangeToLocalSimpleTypeCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNumericBoundsFacetCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateStringLengthFacetCommand;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateXSDWhiteSpaceFacetCommand;
-import org.eclipse.wst.xsd.ui.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDLengthFacet;
-import org.eclipse.xsd.XSDMaxExclusiveFacet;
-import org.eclipse.xsd.XSDMaxFacet;
-import org.eclipse.xsd.XSDMaxInclusiveFacet;
-import org.eclipse.xsd.XSDMaxLengthFacet;
-import org.eclipse.xsd.XSDMinExclusiveFacet;
-import org.eclipse.xsd.XSDMinFacet;
-import org.eclipse.xsd.XSDMinInclusiveFacet;
-import org.eclipse.xsd.XSDMinLengthFacet;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWhiteSpace;
-import org.eclipse.xsd.XSDWhiteSpaceFacet;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDFacetSection extends AbstractSection
-{
-  private String minLengthString, maxLengthString, titleString;
-  Font titleFont;
-  CLabel title;
-  Label minLengthLabel;
-  Text minLengthText;
-  Label maxLengthLabel;
-  Text maxLengthText;
-  Group simpleTypeModifierGroup;
-  String simpleTypeModifierGroupTitle = "";
-  Button collapseWhitespaceButton;
-  Button useEnumerationsButton, usePatternsButton;
-  Button minimumInclusiveCheckbox;
-  Button maximumInclusiveCheckbox;
-  boolean isNumericBaseType;
-  private XSDTypeDefinition typeDefinition;
-  private XSDSimpleTypeDefinition xsdSimpleTypeDefinition;
-  private XSDElementDeclaration xsdElementDeclaration;
-  private XSDAttributeDeclaration xsdAttributeDeclaration;
-  private XSDFeature xsdFeature;
-  boolean hasMaxMinFacets;
-
-  SpecificConstraintsWidget constraintsWidget;
-
-  public XSDFacetSection()
-  {
-    super();
-  }
-
-  protected void createContents(Composite parent)
-  {
-    TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
-    composite = factory.createFlatFormComposite(parent);
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 1;
-    composite.setLayout(gridLayout);
-
-    title = factory.createCLabel(composite, ""); //$NON-NLS-1$
-    FontData fontData = composite.getFont().getFontData()[0];
-    int height = fontData.getHeight();
-    fontData.setHeight(height + 2);
-    fontData.setStyle(SWT.BOLD);
-    titleFont = new Font(null, fontData);
-    title.setFont(titleFont);
-    title.setText(titleString + (isReadOnly ? " - ReadOnly" : ""));
-
-    Composite facetComposite = factory.createComposite(composite, SWT.FLAT);
-
-    GridData data = new GridData();
-    gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 2;
-    facetComposite.setLayout(gridLayout);
-    data.grabExcessVerticalSpace = true;
-    data.grabExcessHorizontalSpace = true;
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-    facetComposite.setLayoutData(data);
-
-    data = new GridData();
-    data.grabExcessVerticalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = GridData.FILL;
-
-    simpleTypeModifierGroup = getWidgetFactory().createGroup(facetComposite, simpleTypeModifierGroupTitle);
-    GridLayout groupGrid = new GridLayout();
-    groupGrid.marginTop = 0;
-    groupGrid.marginBottom = 0;
-    groupGrid.numColumns = 1;
-    simpleTypeModifierGroup.setLayoutData(data);
-    simpleTypeModifierGroup.setLayout(groupGrid);
-
-    Composite simpleTypeModifierComposite = getWidgetFactory().createFlatFormComposite(simpleTypeModifierGroup);
-    data = new GridData();
-    data.grabExcessVerticalSpace = true;
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-
-    GridLayout grid = new GridLayout();
-    grid.marginTop = 0;
-    grid.marginBottom = 0;
-    grid.numColumns = 3;
-    simpleTypeModifierComposite.setLayout(grid);
-    simpleTypeModifierComposite.setLayoutData(data);
-    if (hasMaxMinFacets)
-    {
-      minLengthLabel = factory.createLabel(simpleTypeModifierComposite, minLengthString);
-      minLengthText = factory.createText(simpleTypeModifierComposite, "");
-      applyAllListeners(minLengthText);
-
-      GridData minGridData = new GridData();
-      minGridData.widthHint = 100;
-      minLengthText.setLayoutData(minGridData);
-      minimumInclusiveCheckbox = factory.createButton(simpleTypeModifierComposite, "Inclusive", SWT.CHECK);
-      minimumInclusiveCheckbox.addSelectionListener(this);
-
-      maxLengthLabel = factory.createLabel(simpleTypeModifierComposite, maxLengthString);
-      maxLengthText = factory.createText(simpleTypeModifierComposite, "");
-      applyAllListeners(maxLengthText);
-
-      GridData maxGridData = new GridData();
-      maxGridData.widthHint = 100;
-      maxLengthText.setLayoutData(maxGridData);
-
-      maximumInclusiveCheckbox = factory.createButton(simpleTypeModifierComposite, "Inclusive", SWT.CHECK);
-      maximumInclusiveCheckbox.addSelectionListener(this);
-
-      minimumInclusiveCheckbox.setVisible(isNumericBaseType);
-      maximumInclusiveCheckbox.setVisible(isNumericBaseType);
-    }
-    collapseWhitespaceButton = factory.createButton(simpleTypeModifierComposite, "Collapse whitespace", SWT.CHECK);
-    collapseWhitespaceButton.addSelectionListener(this);
-
-    Group specificValueConstraintsGroup = factory.createGroup(facetComposite, "Specific constraint values");
-    gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 2;
-    specificValueConstraintsGroup.setLayout(gridLayout);
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.grabExcessVerticalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = GridData.FILL;
-    specificValueConstraintsGroup.setLayoutData(data);
-
-    Composite compositeForButtons = factory.createFlatFormComposite(specificValueConstraintsGroup);
-    gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.verticalSpacing = 1;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 1;
-    compositeForButtons.setLayout(gridLayout);
-    data = new GridData();
-    data.verticalAlignment = GridData.BEGINNING;
-    compositeForButtons.setLayoutData(data);
-
-    factory.createCLabel(compositeForButtons, "Restrict values by:");
-//    useDefinedValuesButton = factory.createButton(compositeForButtons, "Only permit certain values", SWT.CHECK);
-//    useDefinedValuesButton.addSelectionListener(this);
-
-    Composite compositeForRadioButtons = factory.createFlatFormComposite(compositeForButtons);
-    gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginLeft = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 1;
-    compositeForRadioButtons.setLayout(gridLayout);
-    useEnumerationsButton = factory.createButton(compositeForRadioButtons, "Enumerations", SWT.RADIO);
-    useEnumerationsButton.addSelectionListener(this);
-    usePatternsButton = factory.createButton(compositeForRadioButtons, "Patterns", SWT.RADIO);
-    usePatternsButton.addSelectionListener(this);
-    
-    constraintsWidget = new SpecificConstraintsWidget(specificValueConstraintsGroup, factory, (input instanceof XSDFeature) ? (XSDFeature)input : null, xsdSimpleTypeDefinition, this);
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.grabExcessVerticalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = GridData.FILL;
-    constraintsWidget.getControl().setLayoutData(data);
-  }
-  
-  public void doSetInput()
-  {
-    setInput(getPart(), getSelection());
-  }
-
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-    super.setInput(part, selection);
-    init();
-    
-    XSDSchema schemaOfType = null;
-
-    if (!isReadOnly)
-    {
-      schemaOfType = xsdSimpleTypeDefinition.getSchema();
-    }
-    if (schemaOfType == owningEditor.getAdapter(XSDSchema.class))
-    {
-      isReadOnly = false;
-    }
-    else
-    {
-      if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
-        isReadOnly = true;
-    }
-    if (hasMaxMinFacets)
-    {
-      title.setText(titleString + (isReadOnly ? " - ReadOnly" : ""));
-    }
-    relayout();
-    constraintsWidget.setCommandStack(getCommandStack());
-  }
-
-  protected void init()
-  {
-    hasMaxMinFacets = false;
-    try
-    {
-    updateInput();
-    
-    if (xsdSimpleTypeDefinition != null)
-    {
-      XSDSimpleTypeDefinition targetST = xsdSimpleTypeDefinition;
-      XSDSimpleTypeDefinition basePrimitive = xsdSimpleTypeDefinition.getPrimitiveTypeDefinition();
-      if (basePrimitive != null) 
-        targetST = basePrimitive;
-      else
-        targetST = xsdSimpleTypeDefinition.getBaseTypeDefinition();
-      
-      minLengthString = "";
-      maxLengthString = "";
-      if (targetST.getValidFacets().contains("length"))
-      {
-        minLengthString = "Minimum length:";
-        maxLengthString = "Maximum length:";
-        simpleTypeModifierGroupTitle = "Constraints on length of " + targetST.getName();
-        isNumericBaseType = false;
-        hasMaxMinFacets = true;
-      }
-      else if (targetST.getValidFacets().contains("maxInclusive"))
-      {
-        simpleTypeModifierGroupTitle = "Constraints on value of " + targetST.getName();
-        minLengthString = "Minimum value:";
-        maxLengthString = "Maximum value:";
-        isNumericBaseType = true;
-        hasMaxMinFacets = true;
-      }
-      else
-      {
-        simpleTypeModifierGroupTitle = "Constraints on " + (basePrimitive != null ? basePrimitive.getName() : "anyType");
-      }
-    }
-    }
-    catch(Exception e)
-    {
-    }
-  }
-  
-  private void updateInput()
-  {
-    if (input instanceof XSDFeature)
-    {
-      xsdFeature = (XSDFeature) input;
-      typeDefinition = xsdFeature.getResolvedFeature().getType();
-      XSDTypeDefinition anonymousTypeDefinition = null;
-      if (xsdFeature instanceof XSDElementDeclaration)
-      {
-        xsdElementDeclaration = (XSDElementDeclaration)xsdFeature;
-        anonymousTypeDefinition = xsdElementDeclaration.getResolvedElementDeclaration().getAnonymousTypeDefinition();
-      }
-      else if (xsdFeature instanceof XSDAttributeDeclaration)
-      {
-        xsdAttributeDeclaration = (XSDAttributeDeclaration)xsdFeature;
-        anonymousTypeDefinition = xsdAttributeDeclaration.getResolvedAttributeDeclaration().getAnonymousTypeDefinition();
-      }
-      
-      if (typeDefinition instanceof XSDSimpleTypeDefinition)
-      {
-        xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) typeDefinition;
-      }
-      
-      if (anonymousTypeDefinition instanceof XSDSimpleTypeDefinition)
-      {
-        xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition)anonymousTypeDefinition;
-      }
-      
-      if (xsdSimpleTypeDefinition != null)
-        titleString = "Type: " + (anonymousTypeDefinition != null ? "(" + xsdElementDeclaration.getResolvedElementDeclaration().getName() + "Type)" : xsdSimpleTypeDefinition.getName())  + " , Base: " + xsdSimpleTypeDefinition.getPrimitiveTypeDefinition().getName();
-    }
-    else if (input instanceof XSDSimpleTypeDefinition)
-    {
-      xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) input;
-      titleString = "Type: " + xsdSimpleTypeDefinition.getName() + " , Base: " + xsdSimpleTypeDefinition.getPrimitiveTypeDefinition().getName();
-    }
-  }
-
-  public void refresh()
-  {
-    super.refresh();
-    init();
-    setListenerEnabled(false);
-    
-    collapseWhitespaceButton.setSelection(false);
-    XSDWhiteSpaceFacet whitespaceFacet = xsdSimpleTypeDefinition.getWhiteSpaceFacet();
-    if (whitespaceFacet != null)
-    {
-      if (xsdSimpleTypeDefinition.getFacetContents().contains(whitespaceFacet))
-      {
-        if (XSDWhiteSpace.COLLAPSE_LITERAL.equals(whitespaceFacet.getValue()))
-        {
-          if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
-          {
-            collapseWhitespaceButton.setSelection(true);
-          }
-        }
-      }
-    }
-
-    if (hasMaxMinFacets)
-    {
-      minLengthLabel.setText(minLengthString);
-      maxLengthLabel.setText(maxLengthString);
-
-      if (!isNumericBaseType)
-        refreshStringLength();
-      else
-        refreshValueLengths();
-    }
-
-    if (xsdSimpleTypeDefinition.getEnumerationFacets().size() > 0) 
-    {
-      usePatternsButton.setSelection(false);
-      useEnumerationsButton.setSelection(true);
-      constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
-      constraintsWidget.addButton.setEnabled(true);
-    }
-    else if (xsdSimpleTypeDefinition.getPatternFacets().size() > 0)
-    {
-      usePatternsButton.setSelection(true);
-      useEnumerationsButton.setSelection(false);
-      constraintsWidget.setConstraintKind(SpecificConstraintsWidget.PATTERN);
-      constraintsWidget.addButton.setEnabled(false);
-    }
-    else
-    {
-      usePatternsButton.setSelection(false);
-      useEnumerationsButton.setSelection(true);
-      constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
-      constraintsWidget.addButton.setEnabled(true);
-    }
-    constraintsWidget.setInput(xsdSimpleTypeDefinition);
-
-    setListenerEnabled(true);
-  }
-
-  protected void relayout()
-  {
-    Composite parent = composite.getParent();
-    parent.getParent().setRedraw(false);
-
-    if (parent != null && !parent.isDisposed())
-    {
-      Control[] children = parent.getChildren();
-      for (int i = 0; i < children.length; i++)
-      {
-        children[i].dispose();
-      }
-    }
-    createContents(parent);
-    parent.getParent().layout(true, true);
-    parent.getParent().setRedraw(true);
-    refresh();
-  }
-
-  public void dispose()
-  {
-    if (titleFont != null && !titleFont.isDisposed())
-      titleFont.dispose();
-    titleFont = null;
-    
-    if (minimumInclusiveCheckbox != null && !minimumInclusiveCheckbox.isDisposed())
-      minimumInclusiveCheckbox.removeSelectionListener(this);
-    if (maximumInclusiveCheckbox != null && !maximumInclusiveCheckbox.isDisposed())
-      maximumInclusiveCheckbox.removeSelectionListener(this);
-    
-    if (collapseWhitespaceButton != null && !collapseWhitespaceButton.isDisposed())
-      collapseWhitespaceButton.removeSelectionListener(this);
-
-    if (maxLengthText != null && !maxLengthText.isDisposed())
-      removeListeners(maxLengthText);
-    if (minLengthText != null && !minLengthText.isDisposed())
-      removeListeners(minLengthText);
-    
-    super.dispose();
-  }
-
-  public void refreshStringLength()
-  {
-    XSDMinLengthFacet minLengthFacet = xsdSimpleTypeDefinition.getMinLengthFacet();
-    XSDMaxLengthFacet maxLengthFacet = xsdSimpleTypeDefinition.getMaxLengthFacet();
-    XSDLengthFacet lengthFacet = xsdSimpleTypeDefinition.getLengthFacet();
-
-    try
-    {
-      if (minLengthFacet != null)
-      {
-        int minLengthValue = minLengthFacet.getValue();
-        if (minLengthValue >= 0)
-        {
-          minLengthText.setText(Integer.toString(minLengthValue));
-        }
-        else
-        {
-          minLengthText.setText(""); //$NON-NLS-1$
-        }
-      }
-      if (maxLengthFacet != null)
-      {
-        int maxLength = maxLengthFacet.getValue();
-        if (maxLength >= 0)
-        {
-          maxLengthText.setText(Integer.toString(maxLength));
-        }
-        else
-        {
-          maxLengthText.setText(""); //$NON-NLS-1$
-        }
-      }
-      if (lengthFacet != null)
-      {
-        int length = lengthFacet.getValue();
-        if (length >= 0)
-        {
-          minLengthText.setText(Integer.toString(length));
-          maxLengthText.setText(Integer.toString(length));
-        }
-      }
-    }
-    catch (Exception e)
-    {
-
-    }
-
-  }
-
-  public void refreshValueLengths()
-  {
-    XSDSimpleTypeDefinition type = xsdSimpleTypeDefinition;
-    XSDMinFacet minFacet = type.getMinFacet();
-    XSDMaxFacet maxFacet = type.getMaxFacet();
-
-    minimumInclusiveCheckbox.removeSelectionListener(this);
-    maximumInclusiveCheckbox.removeSelectionListener(this);
-    try
-    {
-      minLengthText.setText(""); //$NON-NLS-1$
-      maxLengthText.setText(""); //$NON-NLS-1$
-
-      minimumInclusiveCheckbox.setSelection(false);
-      minimumInclusiveCheckbox.setEnabled(false);
-      if (minFacet != null)
-      {
-        if (minFacet.getElement().getNodeName().equals(XSDConstants.MINEXCLUSIVE_ELEMENT_TAG) ||
-            minFacet.getElement().getNodeName().equals(XSDConstants.MININCLUSIVE_ELEMENT_TAG))
-        {
-          minLengthText.setText(minFacet.getLexicalValue());
-          minimumInclusiveCheckbox.setSelection(minFacet.isInclusive());
-          minimumInclusiveCheckbox.setEnabled(true);
-        }
-      }
-
-      maximumInclusiveCheckbox.setSelection(false);
-      maximumInclusiveCheckbox.setEnabled(false);
-      if (maxFacet != null)
-      {
-        if (maxFacet.getElement().getNodeName().equals(XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG) ||
-            maxFacet.getElement().getNodeName().equals(XSDConstants.MAXINCLUSIVE_ELEMENT_TAG))
-        {
-          maxLengthText.setText(maxFacet.getLexicalValue());
-          maximumInclusiveCheckbox.setSelection(maxFacet.isInclusive());
-          maximumInclusiveCheckbox.setEnabled(true);
-        }
-      }
-    }
-    finally
-    {
-      minimumInclusiveCheckbox.addSelectionListener(this);
-      maximumInclusiveCheckbox.addSelectionListener(this);
-    }
-  }
-
-  protected void doHandleEvent(Event event)
-  {
-    super.doHandleEvent(event);
-    Command command = null;
-    boolean doUpdateMax = false, doUpdateMin = false;
-    
-    String minValue = minLengthText.getText().trim();
-    String maxValue = maxLengthText.getText().trim();
-
-    XSDLengthFacet lengthFacet = xsdSimpleTypeDefinition.getLengthFacet();
-    XSDMinLengthFacet minLengthFacet = xsdSimpleTypeDefinition.getMinLengthFacet();
-    XSDMaxLengthFacet maxLengthFacet = xsdSimpleTypeDefinition.getMaxLengthFacet();
-    
-    XSDMinInclusiveFacet minInclusiveFacet = xsdSimpleTypeDefinition.getMinInclusiveFacet();
-    XSDMinExclusiveFacet minExclusiveFacet = xsdSimpleTypeDefinition.getMinExclusiveFacet();
-    XSDMaxInclusiveFacet maxInclusiveFacet = xsdSimpleTypeDefinition.getMaxInclusiveFacet();
-    XSDMaxExclusiveFacet maxExclusiveFacet = xsdSimpleTypeDefinition.getMaxExclusiveFacet();
-
-    String currentMinInclusive = null, currentMinExclusive = null, currentMaxInclusive = null, currentMaxExclusive = null;
-    if (minInclusiveFacet != null)
-    {
-      currentMinInclusive = minInclusiveFacet.getLexicalValue();
-    }
-    if (minExclusiveFacet != null)
-    {
-      currentMinExclusive = minExclusiveFacet.getLexicalValue();
-    }
-    if (maxInclusiveFacet != null)
-    {
-      currentMaxInclusive = maxInclusiveFacet.getLexicalValue();
-    }
-    if (maxExclusiveFacet != null)
-    {
-      currentMaxExclusive = maxExclusiveFacet.getLexicalValue();
-    }
-    
-    
-    String currentLength = null, currentMin = null, currentMax = null;
-    if (lengthFacet != null)
-    {
-      currentLength = lengthFacet.getLexicalValue();
-    }
-    if (minLengthFacet != null)
-    {
-      currentMin = minLengthFacet.getLexicalValue();
-    }
-    if (maxLengthFacet != null)
-    {
-      currentMax = maxLengthFacet.getLexicalValue();
-    }
-    
-    if (event.widget == minLengthText)
-    {
-      try
-      {
-        if (minValue.length() > 0)
-        {
-          if (!isNumericBaseType)
-          {
-            Number big = new BigInteger(minValue);
-            big.toString();
-            if (minLengthFacet != null)
-            {
-              if (minValue.equals(currentMin) || minValue.equals(currentLength))
-                return;
-            }
-            else
-            {
-              if (maxValue != null && minValue.equals(maxValue) && lengthFacet != null)
-              {
-                return;
-              }
-            }
-          }
-          else
-          {
-            if (xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("double").equals(xsdSimpleTypeDefinition) ||
-                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("float").equals(xsdSimpleTypeDefinition) ||
-                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("decimal").equals(xsdSimpleTypeDefinition))
-            {
-              BigDecimal bigDecimal = new BigDecimal(minValue);
-              bigDecimal.toString();
-              if ( (currentMinInclusive != null && minValue.equals(currentMinInclusive)) ||
-                   (currentMinExclusive != null && minValue.equals(currentMinExclusive)) )
-              {
-                return;
-              }
-            }
-            else
-            {
-              Number big = new BigInteger(minValue);
-              big.toString();
-            }
-            minimumInclusiveCheckbox.setEnabled(true);
-          }
-        }
-        else
-        {
-          if (!isNumericBaseType)
-          {
-            if (currentMin == null && currentLength == null)
-              return;
-          }
-          else
-          {
-            if (currentMinInclusive == null && minimumInclusiveCheckbox.getSelection())
-            {
-              return;
-            }
-            else if (currentMinExclusive == null && !minimumInclusiveCheckbox.getSelection())
-            {
-              return;
-            }
-          }
-          minimumInclusiveCheckbox.setEnabled(false);
-          minValue = null;
-        }
-        doUpdateMin = true;
-      }
-      catch (NumberFormatException e)
-      {
-        // TODO show error message
-        doUpdateMin = false;
-      }
-    }
-    if (event.widget == maxLengthText)
-    {
-      try
-      {
-        if (maxValue.length() > 0)
-        {
-          if (!isNumericBaseType)
-          {
-            Number big = new BigInteger(maxValue);
-            big.toString();
-            if (maxLengthFacet != null)
-            {
-              if (maxValue.equals(currentMax) || maxValue.equals(currentLength))
-                return;
-            }
-            else
-            {
-              if (minValue != null && maxValue.equals(minValue) && lengthFacet != null)
-              {
-                return;
-              }
-            }
-          }
-          else
-          {
-            if (xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("double").equals(xsdSimpleTypeDefinition) ||
-                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("float").equals(xsdSimpleTypeDefinition) ||
-                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("decimal").equals(xsdSimpleTypeDefinition))
-            {
-              BigDecimal bigDecimal = new BigDecimal(maxValue);
-              bigDecimal.toString();
-            }
-            else
-            {
-              Number big = new BigInteger(maxValue);
-              big.toString();
-            }
-            maximumInclusiveCheckbox.setEnabled(true);
-          }
-        }
-        else
-        {
-          if (!isNumericBaseType)
-          {
-            if (currentMax == null && currentLength == null)
-              return;
-          }
-          else
-          {
-            if (currentMaxInclusive == null && maximumInclusiveCheckbox.getSelection())
-            {
-              return;
-            }
-            else if (currentMaxExclusive == null && !maximumInclusiveCheckbox.getSelection())
-            {
-              return;
-            }
-            maximumInclusiveCheckbox.setEnabled(false);
-          }
-          maxValue = null;
-        }
-
-        doUpdateMax = true;
-      }
-      catch (NumberFormatException e)
-      {
-        doUpdateMax = false;
-        // TODO show error message
-      }
-    }
-    
-    if (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()) && (doUpdateMax || doUpdateMin))
-    {
-      XSDSimpleTypeDefinition anonymousSimpleType = null;
-      CompoundCommand compoundCommand = new CompoundCommand();
-      ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = null;
-      if (input instanceof XSDFeature)
-      {
-        anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType((XSDFeature)input, xsdSimpleTypeDefinition);
-        if (anonymousSimpleType == null)
-        {
-          anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-          anonymousSimpleType.setBaseTypeDefinition(xsdSimpleTypeDefinition);
-       
-          changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand("Constrain length", (XSDFeature)input);
-          changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
-          compoundCommand.add(changeToAnonymousCommand);
-        }
-
-        if (!isNumericBaseType)
-        {
-          UpdateStringLengthFacetCommand updateCommand = new UpdateStringLengthFacetCommand("", anonymousSimpleType);
-          if (doUpdateMax)
-          {
-            updateCommand.setMax(maxValue);
-          }
-          if (doUpdateMin)
-          {
-            updateCommand.setMin(minValue);
-          }
-          compoundCommand.add(updateCommand);
-        }
-        else
-        {
-          UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand("Update bounds", anonymousSimpleType, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
-          if (doUpdateMax)
-          {
-            updateCommand.setMax(maxValue);
-          }
-          if (doUpdateMin)
-          {
-            updateCommand.setMin(minValue);
-          }
-          compoundCommand.add(updateCommand);
-        }
-        command = compoundCommand;
-        getCommandStack().execute(command);
-      }
-      else if (input instanceof XSDSimpleTypeDefinition)
-      {
-        if (!isNumericBaseType)
-        {
-          UpdateStringLengthFacetCommand updateCommand = new UpdateStringLengthFacetCommand("", xsdSimpleTypeDefinition);
-          if (doUpdateMax)
-          {
-            updateCommand.setMax(maxValue);
-          }
-          if (doUpdateMin)
-          {
-            updateCommand.setMin(minValue);
-          }
-          command = updateCommand;
-        }
-        else
-        {
-          UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand("Update bounds", xsdSimpleTypeDefinition, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
-          if (doUpdateMax)
-          {
-            updateCommand.setMax(maxValue);
-          }
-          if (doUpdateMin)
-          {
-            updateCommand.setMin(minValue);
-          }
-          command = updateCommand;
-        }
-        getCommandStack().execute(command);
-      }
-    }
-    else
-    {
-      if (!isNumericBaseType)
-      {
-        UpdateStringLengthFacetCommand updateCommand = new UpdateStringLengthFacetCommand("", xsdSimpleTypeDefinition);
-        if (doUpdateMax)
-        {
-          updateCommand.setMax(maxValue);
-        }
-        if (doUpdateMin)
-        {
-          updateCommand.setMin(minValue);
-        }
-        getCommandStack().execute(updateCommand);
-      }
-      else
-      {
-        UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand("Update bounds", xsdSimpleTypeDefinition, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
-        if (doUpdateMax)
-        {
-          updateCommand.setMax(maxValue);
-        }
-        if (doUpdateMin)
-        {
-          updateCommand.setMin(minValue);
-        }
-        getCommandStack().execute(updateCommand);
-      }
-      
-    }
-    setInput(getPart(), getSelection());
-  }
-  
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == collapseWhitespaceButton)
-    {
-       CompoundCommand compoundCommand = new CompoundCommand();
-       XSDSimpleTypeDefinition anonymousSimpleType = null;
-       if (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
-       {
-         if (input instanceof XSDFeature)
-         {
-           anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType((XSDFeature)input, xsdSimpleTypeDefinition);
-           if (anonymousSimpleType == null)
-           {
-             anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-             anonymousSimpleType.setBaseTypeDefinition(xsdSimpleTypeDefinition);
-           
-             ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand("Constrain length", (XSDFeature)input);
-             changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
-             compoundCommand.add(changeToAnonymousCommand);
-           }
-  
-           UpdateXSDWhiteSpaceFacetCommand whiteSpaceCommand = new UpdateXSDWhiteSpaceFacetCommand("Collapse whitespace", anonymousSimpleType, collapseWhitespaceButton.getSelection());
-           compoundCommand.add(whiteSpaceCommand);
-            
-           getCommandStack().execute(compoundCommand);
-        }
-         setInput(getPart(), getSelection());
-      }
-      else
-      {
-        UpdateXSDWhiteSpaceFacetCommand whiteSpaceCommand = new UpdateXSDWhiteSpaceFacetCommand("Collapse whitespace", xsdSimpleTypeDefinition, collapseWhitespaceButton.getSelection());
-        getCommandStack().execute(whiteSpaceCommand);
-      }
-    }
-    else if (e.widget == minimumInclusiveCheckbox)
-    {
-      String minValue = minLengthText.getText().trim();
-      if (minValue.length() == 0) minValue = null;
-
-      UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand("Update bounds", xsdSimpleTypeDefinition, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
-      updateCommand.setMin(minValue);
-      
-      if (minValue != null)
-        getCommandStack().execute(updateCommand);
-    }
-    else if (e.widget == maximumInclusiveCheckbox)
-    {
-      String maxValue = maxLengthText.getText().trim();
-      if (maxValue.length() == 0) maxValue = null;
-      UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand("Update bounds", xsdSimpleTypeDefinition, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
-      updateCommand.setMax(maxValue);
-      if (maxValue != null)
-        getCommandStack().execute(updateCommand);
-    }
-    else if (e.widget == useEnumerationsButton)
-    {
-      constraintsWidget.addButton.setEnabled(true);
-      if (isListenerEnabled())
-        constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
-    }
-    else if (e.widget == usePatternsButton)
-    {
-      constraintsWidget.addButton.setEnabled(false);
-      if (isListenerEnabled())
-        constraintsWidget.setConstraintKind(SpecificConstraintsWidget.PATTERN);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDFacetSectionFilter.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDFacetSectionFilter.java
deleted file mode 100644
index 294189c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDFacetSectionFilter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class XSDFacetSectionFilter implements IFilter
-{
-  public boolean select(Object toTest)
-  {
-    if (toTest instanceof XSDFeature)
-    {
-      XSDTypeDefinition type = ((XSDFeature)toTest).getResolvedFeature().getType();
-      if (type instanceof XSDSimpleTypeDefinition)
-      {
-        return true;
-      }
-    }
-    else if (toTest instanceof XSDSimpleTypeDefinition)
-    {
-      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)toTest;
-      if (st.eContainer() instanceof XSDSchema ||
-          st.eContainer() instanceof XSDFeature)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDModelGroupDefinitionSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDModelGroupDefinitionSection.java
deleted file mode 100644
index f499498..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDModelGroupDefinitionSection.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDModelGroupDefinitionSection extends AbstractSection
-{
-  protected Text nameText;
-  protected CCombo componentNameCombo;
-  boolean isReference;
-
-  public XSDModelGroupDefinitionSection()
-  {
-    super();
-  }
-
-  protected void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.numColumns = 2;
-    composite.setLayout(gridLayout);
-
-    if (isReference)
-    {
-      // ------------------------------------------------------------------
-      // Ref Label
-      // ------------------------------------------------------------------
-      GridData data = new GridData();
-      data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-      data.grabExcessHorizontalSpace = false;
-      CLabel refLabel = getWidgetFactory().createCLabel(composite, XSDConstants.REF_ATTRIBUTE + ":"); //$NON-NLS-1$
-      refLabel.setLayoutData(data);
-
-      // ------------------------------------------------------------------
-      // Ref Combo
-      // ------------------------------------------------------------------
-
-      data = new GridData();
-      data.grabExcessHorizontalSpace = true;
-      data.horizontalAlignment = GridData.FILL;
-
-      componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-      componentNameCombo.addSelectionListener(this);
-      componentNameCombo.setLayoutData(data);
-    }
-    else
-    {
-      // ------------------------------------------------------------------
-      // NameLabel
-      // ------------------------------------------------------------------
-      GridData data = new GridData();
-      data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-      data.grabExcessHorizontalSpace = false;
-      CLabel nameLabel = getWidgetFactory().createCLabel(composite, "Name:");
-      nameLabel.setLayoutData(data);
-
-      // ------------------------------------------------------------------
-      // NameText
-      // ------------------------------------------------------------------
-      data = new GridData();
-      data.grabExcessHorizontalSpace = true;
-      data.horizontalAlignment = GridData.FILL;
-      nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-      nameText.setLayoutData(data);
-      nameText.addListener(SWT.Modify, this);
-    }
-  }
-
-  public void refresh()
-  {
-    super.refresh();
-
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-
-    setListenerEnabled(false);
-
-    XSDNamedComponent namedComponent = (XSDNamedComponent) input;
-
-    if (isReference)
-    {
-      Element element = namedComponent.getElement();
-      if (element != null)
-      {
-        String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
-        if (attrValue == null)
-        {
-          attrValue = "";
-        }
-        componentNameCombo.setText(attrValue);
-      }
-    }
-    else
-    {
-      // refresh name
-      nameText.setText("");
-
-      String name = namedComponent.getName();
-      if (name != null)
-      {
-        nameText.setText(name);
-      }
-    }
-
-    setListenerEnabled(true);
-  }
-
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-    super.setInput(part, selection);
-    init();
-    relayout();
-    
-    if (isReference)
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      List items = new ArrayList();
-      items = helper.getModelGroups();
-      items.add(0, "");
-      componentNameCombo.setItems((String [])items.toArray(new String[0]));
-    }
-  }
-
-  protected void init()
-  {
-    if (input instanceof XSDModelGroupDefinition)
-    {
-      XSDModelGroupDefinition group = (XSDModelGroupDefinition) input;
-      isReference = group.isModelGroupDefinitionReference();
-    }
-  }
-
-  protected void relayout()
-  {
-    Composite parentComposite = composite.getParent();
-    parentComposite.getParent().setRedraw(false);
-
-    if (parentComposite != null && !parentComposite.isDisposed())
-    {
-      Control[] children = parentComposite.getChildren();
-      for (int i = 0; i < children.length; i++)
-      {
-        children[i].dispose();
-      }
-    }
-
-    // Now initialize the new handler
-    createContents(parentComposite);
-    parentComposite.getParent().layout(true, true);
-
-    // Now turn painting back on
-    parentComposite.getParent().setRedraw(true);
-    refresh();
-  }
-
-  public void doHandleEvent(Event event)
-  {
-    super.doHandleEvent(event);
-    if (event.widget == nameText)
-    {
-      String newValue = nameText.getText().trim();
-      if (input instanceof XSDNamedComponent)
-      {
-        XSDNamedComponent namedComponent = (XSDNamedComponent) input;
-        if (!validateSection())
-          return;
-
-        Command command = null;
-
-        // Make sure an actual name change has taken place
-        String oldName = namedComponent.getName();
-        if (!newValue.equals(oldName))
-        {
-          command = new UpdateNameCommand("Rename", namedComponent, newValue);
-        }
-
-        if (command != null && getCommandStack() != null)
-        {
-          getCommandStack().execute(command);
-        }
-        // doReferentialIntegrityCheck(namedComponent, newValue);
-      }
-    }
-  }
-
-  protected boolean validateSection()
-  {
-    if (nameText == null || nameText.isDisposed())
-      return true;
-
-    setErrorMessage(null);
-
-    String name = nameText.getText().trim();
-
-    // validate against NCName
-    if (name.length() < 1 || !XMLChar.isValidNCName(name))
-    {
-      setErrorMessage("Invalid name");
-      return false;
-    }
-
-    return true;
-  }
-  
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == componentNameCombo)
-    {
-      String newValue = componentNameCombo.getText();
-      if (input instanceof XSDNamedComponent)
-      {
-        XSDNamedComponent namedComponent = (XSDNamedComponent)input;
-        Element element = namedComponent.getElement();
-
-        if (namedComponent instanceof XSDModelGroupDefinition)
-        {
-          element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
-        }
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDModelGroupSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDModelGroupSection.java
deleted file mode 100644
index d9a653d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDModelGroupSection.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xsd.editor.Messages;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateContentModelCommand;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDModelGroup;
-
-public class XSDModelGroupSection extends MultiplicitySection
-{
-  protected CCombo modelGroupCombo;
-  private String[] modelGroupComboValues = { "sequence", "choice", "all" }; //$NON-NLS-1$
-
-  public XSDModelGroupSection()
-  {
-    super();
-  }
-
-  public void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-
-    String typeLabel = Messages.UI_LABEL_TYPE; //$NON-NLS-1$
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.numColumns = 2;
-    composite.setLayout(gridLayout);
-
-    // ------------------------------------------------------------------
-    // NameLabel
-    // ------------------------------------------------------------------
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    CLabel nameLabel = getWidgetFactory().createCLabel(composite, "Kind:"); //$NON-NLS-1$
-    nameLabel.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // NameText
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    modelGroupCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    modelGroupCombo.setLayoutData(data);
-    modelGroupCombo.addSelectionListener(this);
-    modelGroupCombo.setItems(modelGroupComboValues);
-
-    // ------------------------------------------------------------------
-    // min property
-    // ------------------------------------------------------------------
-    getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MINOCCURS);
-    
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    minCombo.setLayoutData(data);
-    minCombo.add("0"); //$NON-NLS-1$
-    minCombo.add("1"); //$NON-NLS-1$
-    minCombo.addListener(SWT.Modify, this);
-    minCombo.addSelectionListener(this);
-
-    // ------------------------------------------------------------------
-    // max property
-    // ------------------------------------------------------------------
-    getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MAXOCCURS);
-
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    maxCombo.setLayoutData(data);
-    maxCombo.add("0"); //$NON-NLS-1$
-    maxCombo.add("1"); //$NON-NLS-1$
-    maxCombo.add("unbounded"); //$NON-NLS-1$
-    maxCombo.addListener(SWT.Modify, this);
-    maxCombo.addSelectionListener(this);
-  }
-
-  
-  public void refresh()
-  {
-    super.refresh();
-
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-
-    setListenerEnabled(false);
-
-    if (input != null)
-    {
-      if (input instanceof XSDModelGroup)
-      {
-        XSDModelGroup particle = (XSDModelGroup)input;
-        String modelType = particle.getCompositor().getName();
-        modelGroupCombo.setText(modelType);
-      }
-    }
-    
-    refreshMinMax();
-
-    setListenerEnabled(true);
-  }
-  
-  public void doWidgetSelected(SelectionEvent e)
-  {
-    XSDModelGroup particle = (XSDModelGroup)input;
-    if (e.widget == modelGroupCombo)
-    {
-      XSDCompositor newValue = XSDCompositor.get(modelGroupCombo.getText());
-      UpdateContentModelCommand command = new UpdateContentModelCommand("Content Model Change", particle, newValue);
-      getCommandStack().execute(command);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDSchemaSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDSchemaSection.java
deleted file mode 100644
index 7100bc9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDSchemaSection.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.XSDEditNamespacesAction;
-import org.eclipse.wst.xsd.ui.internal.nsedit.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class XSDSchemaSection extends AbstractSection
-{
-  IWorkbenchPart part;
-  Text prefixText;
-  Text targetNamespaceText;
-  Button editButton;
-  StyledText errorText;
-  Color red;
-
-  /**
-   * 
-   */
-  public XSDSchemaSection()
-  {
-    super();
-  }
-
-  /**
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
-   *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-   */
-  public void createContents(Composite parent)
-  {
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 2;
-    composite.setLayout(gridLayout);
-
-    GridData data = new GridData();
-
-    // Create Prefix Label
-    CLabel prefixLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_PREFIX")); //$NON-NLS-1$
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    prefixLabel.setLayoutData(data);
-
-    // Create Prefix Text
-    prefixText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    prefixText.setLayoutData(data);
-    prefixText.addListener(SWT.Modify, this);
-
-    // Create TargetNamespace Label
-    CLabel targetNamespaceLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_TARGET_NAME_SPACE")); //$NON-NLS-1$
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    targetNamespaceLabel.setLayoutData(data);
-
-    // Create TargetNamespace Text
-    targetNamespaceText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    targetNamespaceText.setLayoutData(data);
-    targetNamespaceText.addListener(SWT.Modify, this);
-
-    // Advanced Button
-    editButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_SECTION_ADVANCED_ATTRIBUTES") + "...", SWT.PUSH);
-    data = new GridData(SWT.END, SWT.CENTER, true, false);
-    data.horizontalSpan = 2;
-    editButton.setLayoutData(data);
-    editButton.addSelectionListener(this);
-
-    // error text
-    errorText = new StyledText(composite, SWT.FLAT);
-    errorText.setEditable(false);
-    errorText.setEnabled(false);
-    errorText.setText("");
-    data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.horizontalSpan = 2;
-    data.grabExcessHorizontalSpace = true;
-    errorText.setLayoutData(data);
-
-  }
-
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    setListenerEnabled(false);
-
-    Element element = xsdSchema.getElement();
-
-    if (element != null)
-    {
-      // Handle prefixText
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      String aPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
-
-      if (aPrefix != null && aPrefix.length() > 0)
-      {
-        prefixText.setText(aPrefix);
-      }
-      else
-      {
-        prefixText.setText(""); //$NON-NLS-1$
-      }
-
-      // Handle TargetNamespaceText
-      String tns = element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
-      if (tns != null && tns.length() > 0)
-      {
-        targetNamespaceText.setText(tns);
-      }
-      else
-      {
-        targetNamespaceText.setText(""); //$NON-NLS-1$
-      }
-      errorText.setText("");
-    }
-    setListenerEnabled(true);
-  }
-
-  public void doHandleEvent(Event event)
-  {
-    errorText.setText("");
-    String prefixValue = prefixText.getText();
-    String tnsValue = targetNamespaceText.getText();
-    if (tnsValue.trim().length() == 0)
-    {
-      if (prefixValue.trim().length() > 0)
-      {
-        errorText.setText(XSDEditorPlugin.getXSDString("_ERROR_TARGET_NAMESPACE_AND_PREFIX"));
-        int length = errorText.getText().length();
-        red = new Color(null, 255, 0, 0);
-        StyleRange style = new StyleRange(0, length, red, targetNamespaceText.getBackground());
-        errorText.setStyleRange(style);
-        return;
-      }
-    }
-
-    if (event.widget == prefixText)
-    {
-      updateNamespaceInfo(prefixValue, tnsValue);
-    }
-    else if (event.widget == targetNamespaceText)
-    {
-      updateNamespaceInfo(prefixValue, tnsValue);
-    }
-  }
-
-  public void doWidgetSelected(SelectionEvent e)
-  {
-    if (e.widget == editButton)
-    {
-      XSDEditNamespacesAction nsAction = new XSDEditNamespacesAction(XSDEditorPlugin.getXSDString("_UI_ACTION_EDIT_NAMESPACES"), xsdSchema.getElement(), null, xsdSchema); //$NON-NLS-1$ 
-      nsAction.run();
-      refresh();
-    }
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-
-  private void updateNamespaceInfo(String newPrefix, String newTargetNamespace)
-  {
-    Element element = xsdSchema.getElement();
-    DocumentImpl doc = (DocumentImpl) element.getOwnerDocument();
-
-    String modelTargetNamespace = xsdSchema.getTargetNamespace();
-    String oldNamespace = xsdSchema.getTargetNamespace();
-
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    String oldPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
-
-    if (modelTargetNamespace == null)
-    {
-      modelTargetNamespace = ""; //$NON-NLS-1$
-    }
-
-    String targetNamespace = newTargetNamespace.trim();
-    String prefix = newPrefix.trim();
-
-    if (!validatePrefix(prefix) || !validateTargetNamespace(targetNamespace))
-    {
-      return;
-    }
-
-    if (prefix.length() > 0 && targetNamespace.length() == 0)
-    {
-      // can't have blank targetnamespace and yet specify a prefix
-      return;
-    }
-
-    doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_TARGETNAMESPACE_CHANGE")); //$NON-NLS-1$
-    String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
-    Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-
-    // For debugging
-    // System.out.println("1. SW Map is " + map.values());
-    // System.out.println("1. SW Map keys are " + map.keySet());
-
-    // Check if prefix is blank
-    // if it is, then make sure we have a prefix
-    // for schema for schema
-    if (prefix.length() == 0)
-    {
-      // if prefix for schema for schema is blank
-      // then set it to value specified in preference
-      // and update ALL nodes with this prefix
-      if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
-      {
-        // get preference prefix
-        xsdForXSDPrefix = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
-        // get a unique prefix by checking what's in the map
-
-        xsdForXSDPrefix = getUniqueSchemaForSchemaPrefix(xsdForXSDPrefix, map);
-        element.setAttribute("xmlns:" + xsdForXSDPrefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); //$NON-NLS-1$
-
-        updateAllNodes(element, xsdForXSDPrefix);
-
-        // remove the old xmlns attribute for the schema for schema
-        if (element.getAttribute("xmlns") != null && //$NON-NLS-1$
-            element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
-        {
-          element.removeAttribute("xmlns"); //$NON-NLS-1$
-        }
-      }
-    }
-
-    if (targetNamespace.length() > 0 || (targetNamespace.length() == 0 && prefix.length() == 0))
-    {
-      // clean up the old prefix for this schema
-      if (oldPrefix != null && oldPrefix.length() > 0)
-      {
-        element.removeAttribute("xmlns:" + oldPrefix); //$NON-NLS-1$
-        // element.setAttribute("xmlns:" + prefix, targetNamespace);
-        // java.util.Map prefixToNameSpaceMap =
-        // xsdSchema.getQNamePrefixToNamespaceMap();
-        // prefixToNameSpaceMap.remove(oldPrefix);
-      }
-      else
-      // if no prefix
-      {
-        if (element.getAttribute("xmlns") != null) //$NON-NLS-1$
-        {
-          if (!element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
-          {
-            element.removeAttribute("xmlns"); //$NON-NLS-1$
-          }
-        }
-      }
-    }
-
-    if (targetNamespace.length() > 0)
-    {
-      if (!modelTargetNamespace.equals(targetNamespace))
-      {
-        element.setAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE, targetNamespace);
-      }
-      // now set the new xmlns:prefix attribute
-      if (prefix.length() > 0)
-      {
-        element.setAttribute("xmlns:" + prefix, targetNamespace); //$NON-NLS-1$
-      }
-      else
-      {
-        element.setAttribute("xmlns", targetNamespace); //$NON-NLS-1$
-      }
-      // set the targetNamespace attribute
-    }
-    else
-    // else targetNamespace is blank
-    {
-      if (prefix.length() == 0)
-      {
-        element.removeAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
-      }
-    }
-
-    // System.out.println("1.5 SW Map is " + map.values());
-    // System.out.println("1.5 SW Map keys are " + map.keySet());
-
-    // do our own referential integrity
-    TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, oldNamespace, targetNamespace);
-    targetNamespaceChangeHandler.resolve();
-
-    updateElement(xsdSchema);
-
-    
-    doc.getModel().endRecording(this);
-
-    // For debugging
-    // map = xsdSchema.getQNamePrefixToNamespaceMap();
-    // System.out.println("2. SW Map is " + map.values());
-    // System.out.println("2. SW Map keys are " + map.keySet());
-  }
-
-  // issue (cs) I don't have a clue why we need to call this method
-  //
-  private static void updateElement(XSDConcreteComponent concreteComp)
-  {
-    try
-    {
-      concreteComp.updateElement();
-    }
-    catch (Exception e)
-    {
-      for (Iterator containments = concreteComp.eClass().getEAllReferences().iterator(); containments.hasNext(); )
-      {
-        EReference eReference = (EReference)containments.next();
-        if (eReference.isContainment())
-        {
-          if (eReference.isMany())
-          {
-            for (Iterator objects = ((Collection)concreteComp.eGet(eReference)).iterator(); objects.hasNext(); )
-            {
-              XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)objects.next();
-              try
-              {
-                xsdConcreteComponent.updateElement();
-              }
-              catch (Exception ex) {}
-            }
-          }
-          else
-          {
-            XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)concreteComp.eGet(eReference);
-            if (xsdConcreteComponent != null)
-            {
-              try
-              {
-                xsdConcreteComponent.updateElement();
-              }
-              catch (Exception ex) {}
-            }
-          }
-        }
-      }
-    }
-  }      
-  private String getUniqueSchemaForSchemaPrefix(String xsdForXSDPrefix, Map map)
-  {
-    if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
-    {
-      xsdForXSDPrefix = "xsd"; //$NON-NLS-1$
-    }
-    // ensure prefix is unique
-    int prefixExtension = 1;
-    while (map.containsKey(xsdForXSDPrefix) && prefixExtension < 100)
-    {
-      xsdForXSDPrefix = xsdForXSDPrefix + String.valueOf(prefixExtension);
-      prefixExtension++;
-    }
-    return xsdForXSDPrefix;
-  }
-
-  private void updateAllNodes(Element element, String prefix)
-  {
-    element.setPrefix(prefix);
-    NodeList list = element.getChildNodes();
-    if (list != null)
-    {
-      for (int i = 0; i < list.getLength(); i++)
-      {
-        Node child = list.item(i);
-        if (child != null && child instanceof Element)
-        {
-          child.setPrefix(prefix);
-          if (child.hasChildNodes())
-          {
-            updateAllNodes((Element) child, prefix);
-          }
-        }
-      }
-    }
-  }
-
-  private boolean validateTargetNamespace(String ns)
-  {
-    // will allow blank namespace !!
-    if (ns.equals(""))
-    {
-      return true;
-    }
-
-    String errorMessage = null;
-    try
-    {
-      URI testURI = new URI(ns);
-      testURI.isAbsolute();
-    }
-    catch (URISyntaxException e)
-    {
-      errorMessage = XSDEditorPlugin.getXSDString("_WARN_INVALID_TARGET_NAMESPACE"); //$NON-NLS-1$
-    }
-
-    if (errorMessage == null || errorMessage.length() == 0)
-    {
-      return true;
-    }
-    return false;
-  }
-
-  public void dispose()
-  {
-    super.dispose();
-    if (red != null)
-    {
-      red.dispose();
-      red = null;
-    }
-  }
-
-  protected boolean validatePrefix(String prefix)
-  {
-    // TODO
-    return true;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDSimpleTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDSimpleTypeSection.java
deleted file mode 100644
index 7660d5a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDSimpleTypeSection.java
+++ /dev/null
@@ -1,646 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class XSDSimpleTypeSection extends AbstractSection
-{
-  protected Text nameText;
-  CCombo varietyCombo;
-  Text typesText;
-  CLabel typesLabel;
-  Button button;
-  XSDSimpleTypeDefinition memberTypeDefinition, itemTypeDefinition, baseTypeDefinition;
-
-  public XSDSimpleTypeSection()
-  {
-    super();
-  }
-
-  protected void createContents(Composite parent)
-  {
-    TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
-    composite = factory.createFlatFormComposite(parent);
-
-    GridData data = new GridData();
-
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.marginTop = 0;
-    gridLayout.marginBottom = 0;
-    gridLayout.numColumns = 3;
-    composite.setLayout(gridLayout);
-
-    // ------------------------------------------------------------------
-    // NameLabel
-    // ------------------------------------------------------------------
-
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    CLabel nameLabel = factory.createCLabel(composite, "Name:");
-    nameLabel.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // NameText
-    // ------------------------------------------------------------------
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    nameText.setLayoutData(data);
-    applyAllListeners(nameText);
-
-    // ------------------------------------------------------------------
-    // DummyLabel
-    // ------------------------------------------------------------------
-    getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
-    // Variety Label
-    CLabel label = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY")); //$NON-NLS-1$
-
-    // Variety Combo
-    data = new GridData();
-    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    data.grabExcessHorizontalSpace = false;
-    label.setLayoutData(data);
-
-    varietyCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-
-    List list = XSDVariety.VALUES;
-    Iterator iter = list.iterator();
-    while (iter.hasNext())
-    {
-      varietyCombo.add(((XSDVariety) iter.next()).getName());
-    }
-    varietyCombo.addSelectionListener(this);
-    varietyCombo.setLayoutData(data);
-
-    // ------------------------------------------------------------------
-    // DummyLabel
-    // ------------------------------------------------------------------
-    getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // Types Label
-    // ------------------------------------------------------------------
-    typesLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-
-    // ------------------------------------------------------------------
-    // Types Text
-    // ------------------------------------------------------------------
-    typesText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    typesText.addListener(SWT.Modify, this);
-    data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = GridData.FILL;
-    typesText.setLayoutData(data);
-
-    button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
-    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
-    button.addSelectionListener(this);
-  }
-  
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-    super.setInput(part, selection);
-    relayout();
-  }
-
-  protected void relayout()
-  {
-    Composite parentComposite = composite.getParent();
-    parentComposite.getParent().setRedraw(false);
-
-    if (parentComposite != null && !parentComposite.isDisposed())
-    {
-      Control[] children = parentComposite.getChildren();
-      for (int i = 0; i < children.length; i++)
-      {
-        children[i].dispose();
-      }
-    }
-
-    // Now initialize the new handler
-    createContents(parentComposite);
-    parentComposite.getParent().layout(true, true);
-
-    // Now turn painting back on
-    parentComposite.getParent().setRedraw(true);
-    refresh();
-  }
-
-  public void refresh()
-  {
-    super.refresh();
-
-    setListenerEnabled(false);
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-
-    nameText.setText("");
-    varietyCombo.setText(""); //$NON-NLS-1$
-    typesText.setText(""); //$NON-NLS-1$
-    typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
-
-    if (input instanceof XSDSimpleTypeDefinition)
-    {
-      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-      String simpleTypeName = st.getName();
-      if (simpleTypeName != null)
-      {
-        nameText.setText(simpleTypeName);
-      }
-      else
-      {
-        nameText.setText("**anonymous**");
-      }
-      
-      String variety = st.getVariety().getName();
-      int intVariety = st.getVariety().getValue();
-
-      if (variety != null)
-      {
-        varietyCombo.setText(variety);
-        if (intVariety == XSDVariety.ATOMIC)
-        {
-          baseTypeDefinition = st.getBaseTypeDefinition();
-          String name = "";
-          if (baseTypeDefinition != null)
-          {
-            name = baseTypeDefinition.getName();
-          }
-          typesText.setText(name);
-          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
-        }
-        else if (intVariety == XSDVariety.LIST)
-        {
-          itemTypeDefinition = st.getItemTypeDefinition();
-          String name = "";
-          if (itemTypeDefinition != null)
-          {
-            name = itemTypeDefinition.getName();
-          }
-          typesText.setText(name);
-          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
-        }
-        else if (intVariety == XSDVariety.UNION)
-        {
-          List memberTypesList = st.getMemberTypeDefinitions();
-          StringBuffer sb = new StringBuffer();
-          for (Iterator i = memberTypesList.iterator(); i.hasNext();)
-          {
-            XSDSimpleTypeDefinition typeObject = (XSDSimpleTypeDefinition) i.next();
-            String name = typeObject.getQName();
-            if (name != null)
-            {
-              sb.append(name);
-              if (i.hasNext())
-              {
-                sb.append(" "); //$NON-NLS-1$
-              }
-            }
-          }
-          String memberTypes = sb.toString();
-          typesText.setText(memberTypes);
-          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-        }
-      }
-    }
-    setListenerEnabled(true);
-
-  }
-
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == varietyCombo)
-    {
-      if (input != null)
-      {
-        if (input instanceof XSDSimpleTypeDefinition)
-        {
-          XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-          Element parent = st.getElement();
-
-          String variety = varietyCombo.getText();
-          if (variety.equals(XSDVariety.ATOMIC_LITERAL.getName()))
-          {
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
-            st.setVariety(XSDVariety.ATOMIC_LITERAL);
-            addCreateElementActionIfNotExist(XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), parent, null); //$NON-NLS-1$
-          }
-          else if (variety.equals(XSDVariety.UNION_LITERAL.getName()))
-          {
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-            st.setVariety(XSDVariety.UNION_LITERAL);
-            addCreateElementActionIfNotExist(XSDConstants.UNION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_UNION"), parent, null); //$NON-NLS-1$
-          }
-          else if (variety.equals(XSDVariety.LIST_LITERAL.getName()))
-          {
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
-            st.setVariety(XSDVariety.LIST_LITERAL);
-            addCreateElementActionIfNotExist(XSDConstants.LIST_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LIST"), parent, null); //$NON-NLS-1$
-          }
-        }
-      }
-    }
-    else if (e.widget == button)
-    {
-//      Shell shell = Display.getCurrent().getActiveShell();
-//      Element element = ((XSDConcreteComponent) input).getElement();
-//      Dialog dialog = null;
-//      String property = "";
-//      Element secondaryElement = null;
-
-//      IFile currentIFile = ((IFileEditorInput) getActiveEditor().getEditorInput()).getFile();
-      
-      // issue (cs) need to move to common.ui's selection dialog
-      /*
-      XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, xsdSchema);
-      dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
-      provider.setDialog((XSDComponentSelectionDialog) dialog);
-
-      if (input instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-        Element simpleTypeElement = st.getElement();
-        if (st.getVariety() == XSDVariety.LIST_LITERAL)
-        {
-          Element listElement = (Element) itemTypeDefinition.getElement();
-          // dialog = new TypesDialog(shell, listElement,
-          // XSDConstants.ITEMTYPE_ATTRIBUTE, xsdSchema);
-          // dialog.showComplexTypes = false;
-          provider.showComplexTypes(false);
-
-          secondaryElement = listElement;
-          property = XSDConstants.ITEMTYPE_ATTRIBUTE;
-        }
-        else if (st.getVariety() == XSDVariety.ATOMIC_LITERAL)
-        {
-          Element derivedByElement = (Element) baseTypeDefinition.getElement();
-          if (derivedByElement != null)
-          {
-            // dialog = new TypesDialog(shell, derivedByElement,
-            // XSDConstants.BASE_ATTRIBUTE, xsdSchema);
-            // dialog.showComplexTypes = false;
-            provider.showComplexTypes(false);
-
-            secondaryElement = derivedByElement;
-            property = XSDConstants.BASE_ATTRIBUTE;
-          }
-          else
-          {
-            return;
-          }
-        }
-        else if (st.getVariety() == XSDVariety.UNION_LITERAL)
-        {
-          SimpleContentUnionMemberTypesDialog unionDialog = new SimpleContentUnionMemberTypesDialog(shell, st);
-          unionDialog.setBlockOnOpen(true);
-          unionDialog.create();
-
-          int result = unionDialog.open();
-          if (result == Window.OK)
-          {
-            String newValue = unionDialog.getResult();
-            // beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_CHANGE"),
-            // element); //$NON-NLS-1$
-            Element unionElement = (Element) memberTypeDefinition.getElement();
-            unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
-
-            if (newValue.length() > 0)
-            {
-              unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
-            }
-            else
-            {
-              unionElement.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-            }
-            // endRecording(unionElement);
-            refresh();
-          }
-          return;
-        }
-        else
-        {
-          property = "type";
-        }
-      }
-      else
-      {
-        property = "type";
-      }
-      // beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"),
-      // element); //$NON-NLS-1$
-      dialog.setBlockOnOpen(true);
-      dialog.create();
-      int result = dialog.open();
-
-      if (result == Window.OK)
-      {
-        if (secondaryElement == null)
-        {
-          secondaryElement = element;
-        }
-        XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, xsdSchema);
-        helper.setType(secondaryElement, property, ((XSDComponentSelectionDialog) dialog).getSelection());
-
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-        st.setElement(element);
-        updateSimpleTypeFacets();*/
-      }
-      // endRecording(element);
-    
-    refresh();
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-  // issue (cs) this method seems to be utilizing 'old' classes, can we reimplement?
-  // (e.g. ChangeElementAction, XSDDOMHelper, etc)
-  protected boolean addCreateElementActionIfNotExist(String elementTag, String label, Element parent, Node relativeNode)
-  {
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-    List attributes = new ArrayList();
-    String reuseType = null;
-
-    // beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY_CHANGE"),
-    // parent); //$NON-NLS-1$
-    if (elementTag.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
-    {
-      Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
-      if (listNode != null)
-      {
-        reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
-        XSDDOMHelper.removeNodeAndWhitespace(listNode);
-      }
-
-      Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
-      if (unionNode != null)
-      {
-        String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-        if (memberAttr != null)
-        {
-          StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
-          reuseType = stringTokenizer.nextToken();
-        }
-        XSDDOMHelper.removeNodeAndWhitespace(unionNode);
-      }
-
-      if (reuseType == null)
-      {
-        reuseType = getBuiltInStringQName();
-      }
-      attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, reuseType));
-      st.setItemTypeDefinition(null);
-    }
-    else if (elementTag.equals(XSDConstants.LIST_ELEMENT_TAG))
-    {
-      Element restrictionNode = getFirstChildNodeIfExists(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false);
-      if (restrictionNode != null)
-      {
-        reuseType = restrictionNode.getAttribute(XSDConstants.BASE_ATTRIBUTE);
-        XSDDOMHelper.removeNodeAndWhitespace(restrictionNode);
-      }
-      Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
-      if (unionNode != null)
-      {
-        String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-        if (memberAttr != null)
-        {
-          StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
-          reuseType = stringTokenizer.nextToken();
-        }
-        XSDDOMHelper.removeNodeAndWhitespace(unionNode);
-      }
-      attributes.add(new DOMAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, reuseType));
-    }
-    else if (elementTag.equals(XSDConstants.UNION_ELEMENT_TAG))
-    {
-      Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
-      if (listNode != null)
-      {
-        reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
-        XSDDOMHelper.removeNodeAndWhitespace(listNode);
-      }
-      Element restrictionNode = getFirstChildNodeIfExists(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false);
-      if (restrictionNode != null)
-      {
-        reuseType = restrictionNode.getAttribute(XSDConstants.BASE_ATTRIBUTE);
-        XSDDOMHelper.removeNodeAndWhitespace(restrictionNode);
-      }
-      attributes.add(new DOMAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, reuseType));
-      st.setItemTypeDefinition(null);
-    }
-
-    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
-    {
-      Action action = addCreateElementAction(elementTag, label, attributes, parent, relativeNode);
-      action.run();
-    }
-
-    st.setElement(parent);
-    st.updateElement();
-    // endRecording(parent);
-    return true;
-  }
-
-  protected Action addCreateElementAction(String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateElementAction action = new CreateElementAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    return action;
-  }
-
-  protected Element getFirstChildNodeIfExists(Node parent, String elementTag, boolean isRef)
-  {
-    NodeList children = parent.getChildNodes();
-    Element targetNode = null;
-    for (int i = 0; i < children.getLength(); i++)
-    {
-      Node child = children.item(i);
-      if (child != null && child instanceof Element)
-      {
-        if (XSDDOMHelper.inputEquals((Element) child, elementTag, isRef))
-        {
-          targetNode = (Element) child;
-          break;
-        }
-      }
-    }
-    return targetNode;
-  }
-
-  protected String getBuiltInStringQName()
-  {
-    String stringName = "string"; //$NON-NLS-1$
-
-    if (xsdSchema != null)
-    {
-      String schemaForSchemaPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
-      if (schemaForSchemaPrefix != null && schemaForSchemaPrefix.length() > 0)
-      {
-        String prefix = xsdSchema.getSchemaForSchemaQNamePrefix();
-        if (prefix != null && prefix.length() > 0)
-        {
-          stringName = prefix + ":" + stringName; //$NON-NLS-1$
-        }
-      }
-    }
-    return stringName;
-  }
-
-  private void updateSimpleTypeFacets()
-  {
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-    Element simpleTypeElement = st.getElement();
-    Element derivedByElement = baseTypeDefinition.getElement();
-    if (derivedByElement != null)
-    {
-      List nodesToRemove = new ArrayList();
-      NodeList childList = derivedByElement.getChildNodes();
-      int length = childList.getLength();
-      for (int i = 0; i < length; i++)
-      {
-        Node child = childList.item(i);
-        if (child instanceof Element)
-        {
-          Element elementChild = (Element) child;
-          if (!(elementChild.getLocalName().equals("pattern") || elementChild.getLocalName().equals("enumeration") || //$NON-NLS-1$
-              XSDDOMHelper.inputEquals(elementChild, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ANNOTATION_ELEMENT_TAG, false)
-              || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true)
-              || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true) || XSDDOMHelper.inputEquals(elementChild,
-              XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false)))
-          {
-            nodesToRemove.add(child);
-          }
-        }
-      }
-      Iterator iter = nodesToRemove.iterator();
-      while (iter.hasNext())
-      {
-        Element facetToRemove = (Element) iter.next();
-        String facetName = facetToRemove.getLocalName();
-        Iterator it = st.getValidFacets().iterator();
-        boolean doRemove = true;
-        while (it.hasNext())
-        {
-          String aValidFacet = (String) it.next();
-          if (aValidFacet.equals(facetName))
-          {
-            doRemove = false;
-            break;
-          }
-        }
-        if (doRemove)
-        {
-          XSDDOMHelper.removeNodeAndWhitespace(facetToRemove);
-        }
-      }
-    }
-  }
- // TODO: Common this up with element declaration
-  public void doHandleEvent(Event event) 
-  {
-    if (event.widget == nameText)
-    {
-      String newValue = nameText.getText().trim();
-      if (input instanceof XSDNamedComponent)
-      {
-        XSDNamedComponent namedComponent = (XSDNamedComponent)input;
-        if (!validateSection())
-          return;
-
-        Command command = null;
-
-        // Make sure an actual name change has taken place
-        String oldName = namedComponent.getName();
-        if (!newValue.equals(oldName))
-        {
-          command = new UpdateNameCommand("Rename", namedComponent, newValue);
-        }
-
-        if (command != null && getCommandStack() != null)
-        {
-          getCommandStack().execute(command);
-        }
-
-      }
-    }
-  }
-  
-  protected boolean validateSection()
-  {
-    if (nameText == null || nameText.isDisposed())
-      return true;
-
-    setErrorMessage(null);
-
-    String name = nameText.getText().trim();
-
-    // validate against NCName
-    if (name.length() < 1 || !XMLChar.isValidNCName(name))
-    {
-      setErrorMessage("Invalid name");
-      return false;
-    }
-
-    return true;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDTableTreeViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDTableTreeViewer.java
deleted file mode 100644
index 2738861..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/XSDTableTreeViewer.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeContentProvider;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeViewer;
-import org.w3c.dom.Element;
-
-public class XSDTableTreeViewer extends XMLTableTreeViewer
-{
-
-  String filter = "";
-
-  class XSDActionMenuListener implements IMenuListener
-  {
-    public void menuAboutToShow(IMenuManager menuManager)
-    {
-      // used to disable NodeSelection listening while running NodeAction
-      // XSDActionManager nodeActionManager = new XSDActionManager(fModel,
-      // XSDTableTreeViewer.this);
-      // nodeActionManager.setCommandStack(commandStack);
-      // nodeActionManager.fillContextMenu(menuManager, getSelection());
-
-      // used to disable NodeSelection listening while running NodeAction
-      // XMLNodeActionManager nodeActionManager = new
-      // XMLNodeActionManager(((IDOMDocument) getInput()).getModel(),
-      // XMLTableTreeViewer.this) {
-      if (getInput() != null)
-      {
-        XSDActionManager nodeActionManager = new XSDActionManager(((IDOMDocument) (((Element) getInput()).getOwnerDocument())).getModel(), XSDTableTreeViewer.this);
-        // nodeActionManager.setCommandStack(commandStack);
-        nodeActionManager.fillContextMenu(menuManager, getSelection());
-      }
-
-    }
-  }
-
-  public XSDTableTreeViewer(Composite parent)
-  {
-    super(parent);
-    // treeExtension.setCellModifier(null);
-    getTree().setLinesVisible(true);
-
-    // treeExtension = new XMLTreeExtension(getTree());
-
-    // Reassign the content provider
-    XMLTableTreeContentProvider provider = new MyContentProvider();
-    // provider.addViewer(this);
-
-    setContentProvider(provider);
-    setLabelProvider(provider);
-
-    // setViewerSelectionManager(new ViewerSelectionManagerImpl(null));
-  }
-
-  protected Object getRoot()
-  {
-    return super.getRoot();
-  }
-
-  public void setFilter(String filter)
-  {
-    this.filter = filter;
-  }
-
-  protected void createContextMenu()
-  {
-    // TODO Verify if this is okay to override the MenuManager
-    MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
-    contextMenu.add(new Separator("additions")); //$NON-NLS-1$
-    contextMenu.setRemoveAllWhenShown(true);
-
-    // This is the line we have to modify
-    contextMenu.addMenuListener(new XSDActionMenuListener());
-    Menu menu = contextMenu.createContextMenu(getControl());
-    getControl().setMenu(menu);
-  }
-
-  boolean added = false;
-
-  class MyContentProvider extends XMLTableTreeContentProvider
-  {
-
-    // public Object[] getChildren(Object element) {
-    //			
-    // if (!added) {
-    // if (element instanceof Element) {
-    // added = true;
-    // Element elem = (Element)element;
-    // System.out.println("getChildren " + elem.getLocalName());
-    // if (elem instanceof INodeNotifier) {
-    // viewerNotifyingAdapterFactory.adapt((INodeNotifier) elem);
-    // }
-    // // return new Object[] {elem};
-    // }
-    // }
-    // return super.getChildren(element);
-    // }
-
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-      added = false;
-      if (oldInput instanceof Element)
-        oldInput = ((Element) oldInput).getOwnerDocument();
-
-      if (newInput instanceof Element)
-        newInput = ((Element) newInput).getOwnerDocument();
-      super.inputChanged(viewer, oldInput, newInput);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/AddApplicationInfoDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/AddApplicationInfoDialog.java
deleted file mode 100644
index e0e7023..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/AddApplicationInfoDialog.java
+++ /dev/null
@@ -1,566 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.dom.DocumentImpl;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AddApplicationInfoDialog extends SelectionDialog implements ISelectionChangedListener, SelectionListener
-{
-  // when this dialog is created it needs to know which registry it is going to use,the WSDL or the XSD,
-  // hence we need this field
-  ApplicationInformationPropertiesRegistry registry;
-  
-  protected static final Image DEFAULT_ELEMENT_ICON = XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
-  protected static final Image DEFAULT_ATTRIBUTE_ICON = XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
-
-  /** A temporary Document in which we create temporary DOM element for each element in the
-   * Element view. (required by LabelProvider)  */ 
-  protected static Document tempDoc = new DocumentImpl();
-  
-  Button addButton, removeButton, editButton;
-
-  public AddApplicationInfoDialog(Shell parent, ApplicationInformationPropertiesRegistry registry)
-  {
-    super(parent);
-    setTitle("Add Extension Components");
-    setShellStyle(SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.CLOSE);
-    
-    this.registry = registry;
-  }
-
-  private List fInput;
-
-  private TableViewer categoryTableViewer, elementTableViewer;
-  private ArrayList existingNames;
-
-  private ViewerFilter elementTableViewerFilter;
-
-  public void setInput(List input)
-  {
-    this.fInput = input;
-  }
-
-  protected Control createDialogArea(Composite container)
-  {
-    Composite parent = (Composite) super.createDialogArea(container);
-
-    Composite categoryComposite = new Composite(parent, SWT.NONE);
-    GridLayout gl = new GridLayout();
-    gl.numColumns = 2;
-    gl.marginHeight = 0;
-    gl.marginWidth = 0;
-    GridData data = new GridData(GridData.FILL_BOTH);
-    categoryComposite.setLayoutData(data);
-    categoryComposite.setLayout(gl);
-
-    Label label = new Label(categoryComposite, SWT.LEFT);
-    label.setText("Extension Categories:");
-
-    new Label(categoryComposite, SWT.NONE);
-
-    categoryTableViewer = new TableViewer(categoryComposite, getTableStyle());
-    categoryTableViewer.setContentProvider(new CategoryContentProvider());
-    categoryTableViewer.setLabelProvider(new CategoryLabelProvider());
-    categoryTableViewer.setInput(fInput);
-    categoryTableViewer.addSelectionChangedListener(this);
-
-    GridData gd = new GridData(GridData.FILL_BOTH);
-    Table table = categoryTableViewer.getTable();
-    table.setLayoutData(gd);
-    table.setFont(container.getFont());
-
-    Composite buttonComposite = new Composite(categoryComposite, SWT.NONE);
-    gl = new GridLayout();
-    gl.makeColumnsEqualWidth = true;
-    gl.numColumns = 1;
-    data = new GridData();
-    data.horizontalAlignment = SWT.FILL;
-    buttonComposite.setLayoutData(data);
-    buttonComposite.setLayout(gl);
-
-    addButton = new Button(buttonComposite, SWT.PUSH);
-    addButton.setText("Add...");
-    addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-    addButton.addSelectionListener(this);
-
-    removeButton = new Button(buttonComposite, SWT.PUSH);
-    removeButton.setText("Remove");
-    removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-    removeButton.addSelectionListener(this);
-    
-    editButton = new Button(buttonComposite, SWT.PUSH);
-    editButton.setText("Edit");
-    editButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-    editButton.addSelectionListener(this);
-    
-    List initialSelection = getInitialElementSelections();
-    if (initialSelection != null)
-      categoryTableViewer.setSelection(new StructuredSelection(initialSelection));
-
-    Label elementLabel = new Label(categoryComposite, SWT.LEFT);
-    elementLabel.setText("Available components to Add:");
-
-    new Label(categoryComposite, SWT.NONE);
-
-    elementTableViewer = new TableViewer(categoryComposite, getTableStyle());
-    elementTableViewer.setContentProvider(new ElementContentProvider());
-    elementTableViewer.setLabelProvider(new ElementLabelProvider());
-    elementTableViewer.setInput(null);
-    elementTableViewer.addDoubleClickListener(new IDoubleClickListener()
-    {
-      public void doubleClick(DoubleClickEvent event)
-      {
-        okPressed();
-      }
-    });
-    if ( elementTableViewerFilter != null){
-      elementTableViewer.addFilter(elementTableViewerFilter);
-    }
-    
-    gd = new GridData(GridData.FILL_BOTH);
-    table = elementTableViewer.getTable();
-    table.setLayoutData(gd);
-    table.setFont(container.getFont());
-
-    elementTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-		public void selectionChanged(SelectionChangedEvent event) {
-	          getButton(IDialogConstants.OK_ID).setEnabled(true);			
-	    }        	  
-      });
-    
-    return parent;
-  }
-
-  public void create()
-  {
-    super.create();
-    if (categoryTableViewer.getTable().getItemCount() > 0)
-    {
-      categoryTableViewer.getTable().select(0);
-      categoryTableViewer.setSelection(new StructuredSelection(categoryTableViewer.getElementAt(0)));
-    }
-    
-    // Setup the list of category names that already exist
-	existingNames = new ArrayList();
-	TableItem[] categoryNames = categoryTableViewer.getTable().getItems();
-	for (int i = 0; i < categoryNames.length; i++ ){
-		existingNames.add(categoryNames[i].getText());
-	}
-	
-	getButton(IDialogConstants.OK_ID).setEnabled(false);
-  }
-  
-  public void addElementsTableFilter(ViewerFilter filter){
-	elementTableViewerFilter = filter;
-  }
-
-  protected Point getInitialSize()
-  {
-    return getShell().computeSize(400, 300);
-  }
-
-  /**
-   * Return the style flags for the table viewer.
-   * 
-   * @return int
-   */
-  protected int getTableStyle()
-  {
-    return SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
-  }
-
-  /*
-   * Overrides method from Dialog
-   */
-  protected void okPressed()
-  {
-    // Build a list of selected children.
-    getShell().setCursor(new Cursor(getShell().getDisplay(), SWT.CURSOR_WAIT));
-    IStructuredSelection elementSelection = (IStructuredSelection) elementTableViewer.getSelection();
-    IStructuredSelection categorySelection = (IStructuredSelection) categoryTableViewer.getSelection();
-    List result = new ArrayList();
-    result.add(elementSelection.getFirstElement());
-    result.add(categorySelection.getFirstElement());
-    if (elementSelection.getFirstElement() != null)
-    {
-      setResult(result);
-    }
-    else
-    {
-      setResult(null);
-    }
-    super.okPressed();
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == addButton)
-    {
-    	AddNewCategoryDialog addNewCategoryDialog
-    		= new AddNewCategoryDialog(getShell());
-    	
-    	addNewCategoryDialog.setUnavailableCategoryNames(existingNames);
-    	
-    	if ( addNewCategoryDialog.open() == Window.OK ){    		
-    		SpecificationForAppinfoSchema schemaSpec = addNewCategoryDialog.getAppinfoSpec();
-    		
-    		fInput.add(schemaSpec);
-    		existingNames.add(schemaSpec.getDisplayName());
-    		
-    		// refresh without updating labels of existing TableItems    		
-    		categoryTableViewer.refresh(false);
-    		
-    		categoryTableViewer.setSelection(new StructuredSelection(schemaSpec));
-    		getButton(IDialogConstants.OK_ID).setEnabled(false);
-    	}
-    }
-    else if (e.widget == removeButton)
-    {
-    	TableItem[] selections = categoryTableViewer.getTable().getSelection();
-    	for (int i =0; i < selections.length; i++){
-    		fInput.remove(selections[i].getData() );
-    	}
-    	categoryTableViewer.refresh(false);
-
-    	elementTableViewer.setInput(null);
-    	elementTableViewer.refresh();
-    	
-        // TODO auto select either the prev category, the next category or the first category in the Table
-    	getButton(IDialogConstants.OK_ID).setEnabled(false);
-    }
-    else if (e.widget == editButton)
-    {
-        // use this dialog not for adding but for editing purpose.
-        AddNewCategoryDialog dialog = new AddNewCategoryDialog(getShell(), "Edit Category");
-        if ( dialog.open() == Window.OK){
-        	TableItem[] selections = categoryTableViewer.getTable().getSelection();        	
-        	SpecificationForAppinfoSchema spec = (SpecificationForAppinfoSchema) selections[0].getData();
-        	
-			spec.setDisplayName(dialog.getNewCategoryName());
-        	spec.setLocation(dialog.getCategoryLocation());
-        	categoryTableViewer.update(spec, null);
-        	refreshElementsViewer(spec);
-        }
-    }
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
-   */
-  public void widgetDefaultSelected(SelectionEvent event)
-  {
-
-  }
-
-  public void selectionChanged(SelectionChangedEvent event)
-  {
-    if (event.getSource() == categoryTableViewer)
-    {
-      ISelection selection = event.getSelection();
-      if (selection instanceof StructuredSelection)
-      {
-        Object obj = ((StructuredSelection) selection).getFirstElement();
-        if (obj instanceof SpecificationForAppinfoSchema)
-        {
-          SpecificationForAppinfoSchema spec = (SpecificationForAppinfoSchema) obj;
-
-          refreshElementsViewer(spec);
-
-          if ( spec.isDefautSchema() ){
-        	editButton.setEnabled(false);
-        	removeButton.setEnabled(false);
-          }
-          else{
-        	editButton.setEnabled(true);
-        	removeButton.setEnabled(true);
-          }
-
-          getButton(IDialogConstants.OK_ID).setEnabled(false);
-        }
-      }
-    }
-  }
-  
-  private void refreshElementsViewer(SpecificationForAppinfoSchema spec) {
-	  XSDSchema xsdSchema = getASISchemaModel(spec);
-	  
-	  if (xsdSchema == null){
-		  MessageBox errDialog = new MessageBox(getShell(), SWT.ICON_ERROR);
-		  errDialog.setText("Invalid Category");
-		  errDialog.setMessage("The xsd file of the selected category cannot be parsed. \n"
-				  +"Please validate the file.");
-		  errDialog.open();
-		  return;
-	  }
-	  
-	  List allItems = buildInput(xsdSchema);
-	  elementTableViewer.setInput(allItems);
-  }
-  
-  private static List buildInput(XSDSchema xsdSchema)
-  {
-    List elements = xsdSchema.getElementDeclarations();
-    List attributes = xsdSchema.getAttributeDeclarations();
-    String targetNamespace = xsdSchema.getTargetNamespace();
-
-    // For safety purpose: We don't append 'attributes' to 'elements'
-    // ArrayStoreException(or similar one) may occur
-    List allItems = new ArrayList(attributes.size() + elements.size());
-    {
-      // getElementDeclarations returns a lot of elements from import
-      // statement, we
-      // only add non-imported elements here. (trung)
-      for (int i = 0; i < elements.size(); i++)
-      {
-        XSDElementDeclaration currentElement = (XSDElementDeclaration) elements.get(i);
-        if (currentElement.getTargetNamespace().equals(targetNamespace))
-          allItems.add(currentElement);
-      }
-      // getAttributeDeclarations also returns a lot of elements from
-      // import statement, we
-      // only add non-imported elements here. (trung)
-      for (int i = 0; i < attributes.size(); i++)
-      {
-        XSDAttributeDeclaration currentAttribute = (XSDAttributeDeclaration) attributes.get(i);
-        if (currentAttribute.isGlobal() && currentAttribute.getTargetNamespace().equals(targetNamespace))
-          allItems.add(currentAttribute);
-      }
-    }
-    return allItems;
-  }
-
-  
-  private static XSDSchema getASISchemaModel(SpecificationForAppinfoSchema appInfoSchemaSpec)
-  {
-    XSDSchema xsdSchema = XSDImpl.buildXSDModel(appInfoSchemaSpec.getLocation());
-    
-    // now that the .xsd file is read, we can retrieve the namespace of this xsd file
-    // and set the namespace for 'properties'
-    if ( appInfoSchemaSpec.getNamespaceURI() == null){
-    	appInfoSchemaSpec.setNamespaceURI( xsdSchema.getTargetNamespace());
-    }
-    
-    return xsdSchema;
-  }
-
-  class CategoryContentProvider implements IStructuredContentProvider
-  {
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
-     */
-    public Object[] getElements(Object inputElement)
-    {    
-      SpecificationForAppinfoSchema[] appInfoSchemaSpecs = null;
-      try
-      {
-        List inputList = (List) inputElement;
-        appInfoSchemaSpecs = (SpecificationForAppinfoSchema[]) inputList.toArray(new SpecificationForAppinfoSchema[0]);
-      }
-      catch (Exception e)
-      {
-        e.printStackTrace();
-      }
-      return appInfoSchemaSpecs;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.IContentProvider#dispose()
-     */
-    public void dispose()
-    {
-      // Do nothing
-
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
-     *      java.lang.Object, java.lang.Object)
-     */
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-      // Do nothing
-
-    }
-  }
-
-  class CategoryLabelProvider extends LabelProvider
-  {
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-     */
-    public Image getImage(Object element)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/appinfo_category.gif");
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-     */
-    public String getText(Object element)
-    {
-      if (element instanceof SpecificationForAppinfoSchema)
-        return ((SpecificationForAppinfoSchema) element).getDisplayName();
-
-      return super.getText(element);
-    }
-  }
-
-  class ElementContentProvider implements IStructuredContentProvider
-  {
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
-     */
-    public Object[] getElements(Object inputElement)
-    {
-      if (inputElement instanceof List)
-      {
-        return ((List) inputElement).toArray();
-      }
-      return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.IContentProvider#dispose()
-     */
-    public void dispose()
-    {
-      // Do nothing
-
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
-     *      java.lang.Object, java.lang.Object)
-     */
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-      // Do nothing
-
-    }
-  }
-
-  class ElementLabelProvider extends LabelProvider
-  {
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-     */
-    public Image getImage(Object element)
-    {
-      if ( element instanceof XSDElementDeclaration){
-    	  
-    	  // Workaround trick: (trung) we create a temporary Dom element and put it in the label provider
-    	  // to get the image.
-    	  String namespace = ((XSDElementDeclaration) element).getSchema().getTargetNamespace();
-    	  String name = ((XSDElementDeclaration) element).getName();
-    	  Element tempElement = tempDoc.createElementNS(namespace, name);
-    	  ILabelProvider lp = registry.getLabelProvider(tempElement);
-    	  if (lp != null){
-    		  Image img = lp.getImage(tempElement);
-    		  
-    		  if (img != null){
-    			  return img;
-    		  }
-    	  }
-    	  return DEFAULT_ELEMENT_ICON;
-      }
-      else if ( element instanceof XSDAttributeDeclaration){
-    	  return DEFAULT_ATTRIBUTE_ICON;
-      }
-      return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-     */
-    public String getText(Object element)
-    {
-      if (element instanceof XSDElementDeclaration)
-        return ((XSDElementDeclaration) element).getName();
-      if (element instanceof XSDAttributeDeclaration )
-        return ((XSDAttributeDeclaration) element).getName();
-      return super.getText(element);
-    }
-  }
-
-  public boolean close()
-  {
-    return super.close();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/AddNewCategoryDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/AddNewCategoryDialog.java
deleted file mode 100644
index e91237d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/AddNewCategoryDialog.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections.appinfo;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.wst.common.ui.internal.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-
-public class AddNewCategoryDialog extends Dialog
-{
-
-  private static final String SCHEMA_LABEL = "Schema:";
-  private static final String NAME_LABEL = "Name:";
-  private String dialogTitle = "Add Category";
-  private MenuManager browseMenu;
-  private Label name;
-  private Text nameText;
-  private Label schema;
-  private CLabel schemaDisplayer;
-  private ToolBar browseToolBar;
-  private ToolItem browseItem;
-
-  private List invalidNames;
-  private String appInfoSchemaLocation;
-  private String categoryName;
-  private CLabel errDisplayer;
-
-  private boolean isCategoryNameValid;
-
-  public AddNewCategoryDialog(Shell parentShell)
-  {
-    super(parentShell);
-  }
-
-  public AddNewCategoryDialog(Shell parentShell, String dialogTitle)
-  {
-    super(parentShell);
-    this.dialogTitle = dialogTitle;
-  }
-  
-  /**
-   * receive a List of names which have already been added to the category list
-   * 
-   * @param unavailNames
-   *          Array of unvailable names
-   */
-  public void setUnavailableCategoryNames(List unavailNames)
-  {
-    invalidNames = unavailNames;
-  }
-
-  public String getNewCategoryName()
-  {
-    return categoryName.trim();
-  }
-
-  public String getCategoryLocation()
-  {
-    return appInfoSchemaLocation;
-  }
-  
-  public SpecificationForAppinfoSchema getAppinfoSpec(){
-	SpecificationForAppinfoSchema schemaSpec = new SpecificationForAppinfoSchema();
-	schemaSpec.setDisplayName(getNewCategoryName());
-	schemaSpec.setLocation(getCategoryLocation());
-	
-	return schemaSpec;
-  }
-  
-  // we initially disable the Ok button
-  protected Control createButtonBar(Composite parent)
-  {
-    Control result = super.createButtonBar(parent);
-    getButton(IDialogConstants.OK_ID).setEnabled(false);
-    return result;
-  }
-
-  protected Control createDialogArea(Composite parent)
-  {
-    getShell().setText(dialogTitle);
-
-    Composite mainComposite = (Composite) super.createDialogArea(parent);
-    GridLayout layout = new GridLayout(3, false);
-    layout.marginTop = 10;
-    mainComposite.setLayout(layout);
-    mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-    GridData data = new GridData();
-    data.widthHint = 400;
-
-    mainComposite.setLayoutData(data);
-
-    // Line 1, name
-    name = new Label(mainComposite, SWT.NONE);
-    name.setText(NAME_LABEL);
-
-    nameText = new Text(mainComposite, SWT.BORDER | SWT.SINGLE);
-    nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    Button hidden = new Button(mainComposite, SWT.NONE);
-    hidden.setVisible(false);
-
-    // Line 2, schema
-    schema = new Label(mainComposite, SWT.NONE);
-    schema.setText(SCHEMA_LABEL);
-
-    schemaDisplayer = new CLabel(mainComposite, SWT.BORDER | SWT.SINGLE);
-    schemaDisplayer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    browseToolBar = new ToolBar(mainComposite, SWT.FLAT);
-    browseItem = new ToolItem(browseToolBar, SWT.NONE);
-    // TODO: Should be able to get the image from the XML plugin. Don't need
-    // to copy to XSDEditor icons folder like this.
-    browseItem.setImage(XSDEditorPlugin.getXSDImage("icons/appinfo_browse.gif"));
-
-    browseMenu = new MenuManager();
-
-    BrowseInWorkspaceAction browseInWorkspace = new BrowseInWorkspaceAction();
-    browseMenu.add(browseInWorkspace);
-
-    BrowseCatalogAction browseCatalog = new BrowseCatalogAction();
-    browseMenu.add(browseCatalog);
-
-    browseItem.addSelectionListener(new SelectionAdapter()
-    {
-      public void widgetSelected(SelectionEvent e)
-      {
-        Menu menu = browseMenu.createContextMenu(getShell());
-        Rectangle bounds = browseItem.getBounds();
-        Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
-        topLeft = browseToolBar.toDisplay(topLeft);
-        menu.setLocation(topLeft.x, topLeft.y);
-        menu.setVisible(true);
-      }
-    });
-
-    // Composite errComp = new Composite(mainComposite, SWT.NONE);
-    // errComp.setBackground(org.eclipse.draw2d.ColorConstants.white);
-    // errComp.setLayout(new GridLayout());
-    errDisplayer = new CLabel(mainComposite, SWT.FLAT);
-    // errDisplayer.setText("abd");
-    GridData gd = new GridData(GridData.FILL_BOTH);
-    gd.grabExcessHorizontalSpace = true;
-    gd.horizontalSpan = 3;
-    errDisplayer.setLayoutData(gd);
-
-    // errComp.setLayoutData(gd);
-    // errDisplayer.setLayoutData(gd);
-    // errMsgContainer.setContent(errDisplayer);
-
-    nameText.addModifyListener(new ModifyListener()
-    {
-      // track the nameText and enable/disable the OK button accordingly
-      public void modifyText(ModifyEvent e)
-      {
-        categoryName = nameText.getText();
-
-        // name is in the invalid List
-        if (invalidNames != null)
-        {
-          if (invalidNames.contains(categoryName.trim()))
-          {
-            isCategoryNameValid = false;
-
-            getButton(IDialogConstants.OK_ID).setEnabled(false);
-            errDisplayer.setText("The name is already being used.");
-            errDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/error_st_obj.gif"));
-            return;
-          }
-        }
-        // name is empty string
-        if (categoryName.equals(""))
-        {
-          isCategoryNameValid = false;
-
-          getButton(IDialogConstants.OK_ID).setEnabled(false);
-          errDisplayer.setText("");
-          errDisplayer.setImage(null);
-          return;
-        }
-
-        /*
-         * Enable the Ok button if the location field AND the name field are not
-         * empty
-         */
-        if (!categoryName.equals(""))
-        {
-          isCategoryNameValid = true;
-          errDisplayer.setText("");
-          errDisplayer.setImage(null);
-        }
-        if (!appInfoSchemaLocation.equals(""))
-        {
-          getButton(IDialogConstants.OK_ID).setEnabled(true);
-        }
-      }
-    });
-
-    return parent;
-  }
-
-  protected void okPressed()
-  {
-    super.okPressed();
-  }
-
-  protected class BrowseInWorkspaceAction extends Action
-  {
-    private static final String XSD_FILE_EXTENSION = ".xsd";
-
-    public BrowseInWorkspaceAction()
-    {
-      super("Workspace");
-    }
-
-    public void run()
-    {
-      SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true);
-      dialog.addFilterExtensions(new String[] { XSD_FILE_EXTENSION });
-      dialog.create();
-      dialog.setTitle("Select XSD file");
-      dialog.setMessage("Choose an XSD file containing schema for your extensible components");
-
-      if (dialog.open() == Window.OK)
-      {
-        IFile appInfoSchemaFile = dialog.getFile();
-        if (appInfoSchemaFile != null)
-        {
-          // remove leading slash from the value to avoid the
-          // whole leading slash ambiguity problem
-          String uri = appInfoSchemaFile.getFullPath().toString();
-          while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
-            uri = uri.substring(1);
-          }
-          appInfoSchemaLocation = uri.toString();
-
-          appInfoSchemaLocation = "file://" + Platform.getLocation().toString() + "/" + appInfoSchemaLocation;
-          // TODO... be careful how we construct the location
-          // UNIX related issues here
-
-          schemaDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/XSDFile.gif"));
-          schemaDisplayer.setText(uri);
-
-          // Enable the OK button if we should..
-          if (isCategoryNameValid)
-          {
-            getButton(IDialogConstants.OK_ID).setEnabled(true);
-            errDisplayer.setText("");
-            errDisplayer.setImage(null);
-          }
-        }
-      }
-    }
-  }
-
-  protected class BrowseCatalogAction extends Action
-  {
-    public BrowseCatalogAction()
-    {
-      super("Catalog");
-    }
-
-    public void run()
-    {
-      SelectFromCatalogDialog dialog = new SelectFromCatalogDialog(getShell());
-      // dialog.open();
-      if (dialog.open() == Window.OK)
-      {
-        appInfoSchemaLocation = dialog.getCurrentSelectionLocation();
-
-        schemaDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/xmlcatalog_obj.gif"));
-        schemaDisplayer.setText(dialog.getCurrentSelectionNamespace());
-
-        // Enable the OK button if we should..
-        if (isCategoryNameValid && !appInfoSchemaLocation.equals(""))
-        {
-          getButton(IDialogConstants.OK_ID).setEnabled(true);
-          errDisplayer.setText("");
-          errDisplayer.setImage(null);
-        }
-      }
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/ApplicationInformationPropertiesRegistry.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/ApplicationInformationPropertiesRegistry.java
deleted file mode 100644
index f0b4463..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/ApplicationInformationPropertiesRegistry.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.w3c.dom.Element;
-
-public class ApplicationInformationPropertiesRegistry
-{
-  private static final String LOCATION_PREFIX = "platform:/plugin/";
-  public static final String DESCRIPTION = "description";
-  public static final String DISPLAYNAME = "displayName";
-  public static final String NAMESPACEURI = "namespaceURI";
-  public static final String XSDFILEURL = "xsdFileURL";
-  public static final String LABELPROVIDER = "labelProviderClass";
-
-  protected String extensionId;
-
-  HashMap propertyMap;
-  ArrayList nsURIProperties;
-  private ICatalog systemCatalog;
-
-  public ApplicationInformationPropertiesRegistry(String appinfo_extensionid)
-  {
-    extensionId = appinfo_extensionid;
-  }
-
-  public List getAllApplicationSpecificSchemaProperties()
-  {
-    // If we read the registry, then let's not do it again.
-    if (nsURIProperties != null)
-    {
-      return nsURIProperties;
-    }
-    IConfigurationElement[] asiPropertiesList = Platform.getExtensionRegistry().getConfigurationElementsFor(extensionId);
-
-    nsURIProperties = new ArrayList();
-    propertyMap = new HashMap();
-
-    boolean hasASIProperties = (asiPropertiesList != null) && (asiPropertiesList.length > 0);
-
-    if (hasASIProperties)
-    {
-      for (int i = 0; i < asiPropertiesList.length; i++)
-      {
-        IConfigurationElement asiPropertiesElement = asiPropertiesList[i];
-        String description = asiPropertiesElement.getAttribute(DESCRIPTION);
-        String displayName = asiPropertiesElement.getAttribute(DISPLAYNAME);
-        String namespaceURI = asiPropertiesElement.getAttribute(NAMESPACEURI);
-        String xsdFileURL = asiPropertiesElement.getAttribute(XSDFILEURL);
-        String labelProviderClass = asiPropertiesElement.getAttribute(LABELPROVIDER);
-
-        if (displayName == null)
-        {
-          // If there is no display name, force the user
-          // to manually create a name. Therefore, we ignore entry without
-          // a display name.
-          continue;
-        }
-
-        if (xsdFileURL == null)
-        {
-          xsdFileURL = locateFileUsingCatalog(namespaceURI);
-        }
-
-        SpecificationForAppinfoSchema asiAppinfoSpec = createEntry();
-        asiAppinfoSpec.setDescription(description);
-        asiAppinfoSpec.setDisplayName(displayName);
-        asiAppinfoSpec.setNamespaceURI(namespaceURI);
-        asiAppinfoSpec.setDefautSchema();
-
-        if (labelProviderClass != null)
-        {
-          String pluginId = asiPropertiesElement.getDeclaringExtension().getContributor().getName();
-          ILabelProvider labelProvider = null;
-          try
-          {
-            Class theClass = Platform.getBundle(pluginId).loadClass(labelProviderClass);
-            if (theClass != null)
-            {
-              labelProvider = (ILabelProvider) theClass.newInstance();
-              if (labelProvider != null)
-              {
-                propertyMap.put(namespaceURI, labelProvider);
-                asiAppinfoSpec.setLabelProvider(labelProvider);
-              }
-            }
-          }
-          catch (Exception e)
-          {
-
-          }
-        }
-        String plugin = asiPropertiesElement.getDeclaringExtension().getContributor().getName();
-        asiAppinfoSpec.setLocation(LOCATION_PREFIX + plugin + "/" + xsdFileURL);
-
-        nsURIProperties.add(asiAppinfoSpec);
-      }
-
-    }
-    return nsURIProperties;
-  }
-
-  public ILabelProvider getLabelProvider(Element element)
-  {
-    String uri = element.getNamespaceURI();
-    if (uri == null)
-      uri = "";
-
-    // Didn't retrieve the config elements yet.
-    if (propertyMap == null)
-    {
-      getAllApplicationSpecificSchemaProperties();
-    }
-
-    Object object = propertyMap.get(uri);
-    if (object instanceof ILabelProvider)
-    {
-      return (ILabelProvider) object;
-    }
-    return null;
-  }
-
-  public SpecificationForAppinfoSchema createEntry()
-  {
-    return new SpecificationForAppinfoSchema();
-  }
-
-  /**
-   * Returns the String location for the schema with the given namespaceURI by
-   * looking at the XML catalog. We look only in the plugin specified entries of
-   * the catalog.
-   * 
-   * @param namespaceURI
-   * @return String representing the location of the schema.
-   */
-  private String locateFileUsingCatalog(String namespaceURI)
-  {
-    retrieveCatalog();
-
-    ICatalogEntry[] entries = systemCatalog.getCatalogEntries();
-    for (int i = 0; i < entries.length; i++)
-    {
-      if (entries[i].getKey().equals(namespaceURI))
-        return entries[i].getURI();
-    }
-
-    return null;
-  }
-
-  private void retrieveCatalog()
-  {
-    if (systemCatalog != null)
-      return;
-
-    ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-    INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
-    for (int i = 0; i < nextCatalogs.length; i++)
-    {
-      INextCatalog catalog = nextCatalogs[i];
-      ICatalog referencedCatalog = catalog.getReferencedCatalog();
-      if (referencedCatalog != null)
-      {
-        if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId()))
-        {
-          systemCatalog = referencedCatalog;
-        }
-      }
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/ApplicationInformationTableTreeViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/ApplicationInformationTableTreeViewer.java
deleted file mode 100644
index 6d4fbfb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/ApplicationInformationTableTreeViewer.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.tabletree.TreeContentHelper;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeContentProvider;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeViewer;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTreeExtension;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.common.properties.sections.XSDActionManager;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class ApplicationInformationTableTreeViewer extends XMLTableTreeViewer
-{
-  private CommandStack commandStack;
-  
-  public ApplicationInformationTableTreeViewer(Composite parent)
-  {
-    super(parent);
-
-    getTree().setLinesVisible(true);
-    
-    treeExtension.setCellModifier(null);
-    getTree().removePaintListener(treeExtension);
-    treeExtension = new MyXMLTreeExtension(getTree());
-    
-    AppInfoContentProvider provider = new AppInfoContentProvider();
-    setContentProvider(provider);
-    setLabelProvider(provider);
-  }
-  
-  public void setCommandStack(CommandStack commandStack) {
-    this.commandStack = commandStack;
-  }
-  
-  Element asiElement;
-  
-  public void setASIElement(Element asiElement)
-  {
-    this.asiElement = asiElement;
-  }
-
-  class AppInfoContentProvider extends XMLTableTreeContentProvider
-  {
-    MyTreeContentHelper treeContentHelper;
-    public AppInfoContentProvider()
-    {
-      treeContentHelper = new MyTreeContentHelper();
-    }
-
-    public Object[] getChildren(Object element)
-    {
-      if (element instanceof List)
-      {
-        return ((List) element).toArray();
-      }
-      else if (element instanceof Element)
-      {
-
-      }
-      return treeContentHelper.getChildren(element);
-      
-      //return super.getChildren(element);
-    }
-
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-      if (oldInput instanceof Element)
-        oldInput = ((Element) oldInput).getOwnerDocument();
-
-      if (newInput instanceof Element)
-        newInput = ((Element) newInput).getOwnerDocument();
-
-      super.inputChanged(viewer, oldInput, newInput);
-
-    }
-  }
-
-  class ASIActionMenuListener implements IMenuListener
-  {
-    public void menuAboutToShow(IMenuManager menuManager)
-    {
-      // used to disable NodeSelection listening while running NodeAction
-      // ASIActionManager nodeActionManager = new ASIActionManager(fModel,
-      // ASITableTreeViewer.this);
-      // nodeActionManager.setCommandStack(commandStack);
-      IDOMModel model = null;
-      try
-      {
-        if (asiElement instanceof ElementImpl)
-        {
-          model = ((ElementImpl)asiElement).getModel();
-        }
-      }
-      catch (Exception e)
-      {
-        e.printStackTrace();
-      }
-      
-      // if the model is not the XML model, then we can't support the table viewer.
-      if (model != null)
-      {
-        XSDActionManager actionManager = new XSDActionManager(model, ApplicationInformationTableTreeViewer.this);
-        actionManager.setCommandStack(commandStack);
-        
-        // add general actions
-        ActionRegistry registry = (ActionRegistry) XSDEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getAdapter(ActionRegistry.class);
-
-        if (registry != null) // an editor may not use the registry
-        {
-          // add undo, redo, revert
-          IAction undo = registry.getAction(ActionFactory.UNDO.getId());
-          if (undo != null)
-          {
-            menuManager.add(new Separator());
-            menuManager.add(undo);
-          }
-          IAction redo = registry.getAction(ActionFactory.REDO.getId());
-          if (redo != null)
-          {
-            menuManager.add(redo);
-          }
-          menuManager.add(new Separator());
-        }
-        actionManager.fillContextMenu(menuManager, getSelection());
-      }
-    }
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see com.ibm.xmleditor.internal.tabletree.XMLTableTreeViewer#createContextMenu()
-   */
-  protected void createContextMenu()
-  {
-    MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
-    contextMenu.add(new Separator("additions")); //$NON-NLS-1$
-    contextMenu.setRemoveAllWhenShown(true);
-
-    // This is the line we have to modify
-    contextMenu.addMenuListener(new ASIActionMenuListener());
-    Menu menu = contextMenu.createContextMenu(getControl());
-    getControl().setMenu(menu);
-  }
-
-  
-  
-  
-  
-  static String EMPTY_STRING = "";  //$NON-NLS-1$
-  static String XML_NS_STRING = "xmlns";  //$NON-NLS-1$
-  static String APPINFO = "appinfo"; //$NON-NLS-1$
-  
-  public class MyTreeContentHelper extends TreeContentHelper {
-    public void setNodeValue(Node node, String value) {
-      String oldValue = getNodeValue(node);
-      // The command stack was being populated with changes like an empty string to a null value
-      // So we weed those out as well
-//      if (value != null && !value.equals(oldValue) && (!(value.equals(EMPTY_STRING) && oldValue ==null))) {
-//          ModifyNodeCommand command = new ModifyNodeCommand(node, value, this);
-//          commandStack.execute(command);
-//      }
-    }
-    
-    // TODO - Remove this method when Bugzilla 6738 is fixed
-    public List getElementTextContent(Element element) {
-          List result = null;
-          if (!element.hasAttributes()) {
-             Node node = element.getFirstChild();
-
-             // TODO - Hack to workaround problem that a text cell editor appears on the first
-             // click and not the enumerated cell editor
-             if (node == null) {
-                result = new Vector();
-                Text txt = element.getOwnerDocument().createTextNode("");
-                element.appendChild(txt);
-                result.add(txt);
-             }
-             // end of workaround
-
-             for (; node != null; node = node.getNextSibling()) {
-                if (node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
-                   if (result == null) {
-                      result = new Vector();
-                   }
-                   result.add(node);
-                } else {
-                   result = null;
-                   break;
-                }
-             }
-          }
-          return result;
-       }    
-    
-    public void executeSetNodeValue(Node node, String value) {
-      super.setNodeValue(node, value);
-    }
-    
-    public boolean isEditable(Node node) {
-      int nodeType = node.getNodeType();
-      boolean result = false;
-      switch (nodeType) {
-        case Node.ATTRIBUTE_NODE :
-        {
-          // Prevent the editing of the namespace attribute
-          Attr attr = (Attr)node;
-          result = !attr.getName().startsWith(XML_NS_STRING);
-          break;
-        }
-        default:
-        {
-          result = super.isEditable(node);
-        }
-      }
-      return result;
-    } 
-    
-    // Need to override since I don't want to see the source attribute
-    public Object[] getChildren(Object element) {
-      Object[] result = null;
-
-      if (element instanceof List) {
-        result = ((List)element).toArray();
-      } else if (element instanceof Node) {
-        Node node = (Node) element;
-        List list = new ArrayList();
-        boolean textContentOnly = true;
-
-        // Don't want to see any attributes for the input element
-        if (!(element instanceof Element && (element == getInput()))) {
-          NamedNodeMap map = node.getAttributes();
-          if (map != null) {
-            int length = map.getLength();
-            for (int i = 0; i < length; i++) {
-              list.add(map.item(i));
-              textContentOnly = false;
-            }
-          }
-        }
-
-        Node prevIncludedNode = null;
-        for (Node childNode = node.getFirstChild(); childNode != null; childNode = childNode.getNextSibling()) {
-          int childNodeType = childNode.getNodeType();
-          boolean includeNode = true;
-
-          if (includeNode && hasStyleFlag(HIDE_WHITE_SPACE_TEXT_NODES)) {
-            if (isIgnorableText(childNode)) {
-              // filter out the ignorable text node
-              includeNode = false;
-            }
-          }
-
-          if (includeNode && hasStyleFlag(COMBINE_ADJACENT_TEXT_AND_ENTITY_REFERENCES)) {
-            if (isTextOrEntityReferenceNode(childNode) && prevIncludedNode != null && isTextOrEntityReferenceNode(prevIncludedNode)) {
-              // we only show the first of a list of adjacent text or entity reference node in the tree
-              // so we filter out this subsequent one
-              includeNode = false;
-            }
-          }
-
-          if (hasStyleFlag(HIDE_ELEMENT_CHILD_TEXT_NODES)) {
-            if (childNodeType != Node.TEXT_NODE && childNodeType != Node.ENTITY_REFERENCE_NODE) {
-              textContentOnly = false;
-            }
-          }
-
-          if (includeNode) {
-            list.add(childNode);
-            prevIncludedNode = childNode;
-          }
-        }
-
-        if (hasStyleFlag(HIDE_ELEMENT_CHILD_TEXT_NODES) && textContentOnly) {
-          result = new Object[0];
-        }
-        else {
-          result = list.toArray();
-        }
-      }
-      return result;
-    }
-    
-  } 
-  
-  class MyXMLTreeExtension extends XMLTreeExtension {
-    
-    public MyXMLTreeExtension(Tree tree) {
-      super(tree);
-      this.treeContentHelper = new MyTreeContentHelper();
-      this.columnPosition = 200;
-//      this.setRefreshAll(true);
-    }
-    
-    
-    // Do not wish to display any of the helper text
-    public String getElementValueHelper(Element element) {
-      return EMPTY_STRING; 
-    } 
-        
-      
-  }
-  
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/SelectFromCatalogDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/SelectFromCatalogDialog.java
deleted file mode 100644
index 2baa780..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/SelectFromCatalogDialog.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections.appinfo;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogEntriesView;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogEntryDetailsView;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogMessages;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogTreeViewer;
-
-public class SelectFromCatalogDialog extends Dialog
-{
-
-  private ICatalog workingUserCatalog;
-  private ICatalog userCatalog;
-  private ICatalog defaultCatalog;
-  private XMLCatalogEntriesView catalogEntriesView;
-  private ICatalog systemCatalog;
-
-  private String currentSelectionLocation;
-  private String currentSelectionNamespace;
-
-  public SelectFromCatalogDialog(Shell parentShell)
-  {
-    super(parentShell);
-
-    defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-    INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
-    for (int i = 0; i < nextCatalogs.length; i++)
-    {
-      INextCatalog catalog = nextCatalogs[i];
-      ICatalog referencedCatalog = catalog.getReferencedCatalog();
-      if (referencedCatalog != null)
-      {
-        if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId()))
-        {
-          systemCatalog = referencedCatalog;
-        }
-        else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId()))
-        {
-          userCatalog = referencedCatalog;
-        }
-      }
-    }
-  }
-
-  protected Control createDialogArea(Composite parent)
-  {
-    // we create a working copy of the 'User Settings' for the Catalog
-    // that we can modify
-    CatalogSet tempCatalogSet = new CatalogSet();
-    workingUserCatalog = tempCatalogSet.lookupOrCreateCatalog("working", ""); //$NON-NLS-1$ //$NON-NLS-2$
-
-    // TODO: add entries from the nested catalogs as well
-    workingUserCatalog.addEntriesFromCatalog(userCatalog);
-
-    Composite composite = new Composite(parent, SWT.NULL);
-    composite.setLayout(new GridLayout());
-    GridData gridData = new GridData(GridData.FILL_BOTH);
-    gridData.heightHint = 500;
-    composite.setLayoutData(gridData);
-    createCatalogEntriesView(composite);
-    createCatalogDetailsView(composite);
-
-    return composite;
-  }
-
-  protected void createCatalogEntriesView(Composite parent)
-  {
-    Group group = new Group(parent, SWT.NONE);
-    group.setLayout(new GridLayout());
-    GridData gridData = new GridData(GridData.FILL_BOTH);
-    gridData.widthHint = 370;
-    group.setLayoutData(gridData);
-    group.setText(XMLCatalogMessages.UI_LABEL_USER_ENTRIES);
-    group.setToolTipText(XMLCatalogMessages.UI_LABEL_USER_ENTRIES_TOOL_TIP);
-
-    /*
-     * create a subclass of XMLCatalogEntriesView which suppresses - the
-     * creation of 'Add', 'Edit', 'Delete' buttons - any method involving the
-     * above buttons
-     */
-    catalogEntriesView = new XMLCatalogEntriesView(group, workingUserCatalog, systemCatalog)
-    {
-      protected void createButtons(Composite parent)
-      {
-      }
-
-      protected void updateWidgetEnabledState()
-      {
-      }
-
-    };
-
-    // Only XML Schema entry is selectable
-    catalogEntriesView.setLayoutData(gridData);
-    XMLCatalogTreeViewer catalogTreeViewer = ((XMLCatalogTreeViewer) catalogEntriesView.getViewer());
-    catalogTreeViewer.resetFilters();
-
-    catalogTreeViewer.addFilter(new XMLCatalogTableViewerFilter(new String[] { ".xsd" }));
-  }
-
-  // Bug in the filter of the XML plugin, have to give a correct version here
-  // TODO: Waiting for the fix to be commited to XML plugin and
-  // be used by constellation
-  private class XMLCatalogTableViewerFilter extends ViewerFilter
-  {
-    private static final String W3_XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/";
-    protected String[] extensions;
-
-    public XMLCatalogTableViewerFilter(String[] extensions1)
-    {
-      this.extensions = extensions1;
-    }
-
-    public boolean isFilterProperty(Object element, Object property)
-    {
-      return false;
-    }
-
-    public boolean select(Viewer viewer, Object parent, Object element)
-    {
-      boolean result = false;
-      if (element instanceof ICatalogEntry)
-      {
-        ICatalogEntry catalogEntry = (ICatalogEntry) element;
-        for (int i = 0; i < extensions.length; i++)
-        {
-          // if the extension is correct and the namespace indicates
-          // that this entry is not the W3 XML Schema
-          if (catalogEntry.getURI().endsWith(extensions[i]) && !catalogEntry.getKey().startsWith(W3_XMLSCHEMA_NAMESPACE))
-          {
-            result = true;
-            break;
-          }
-        }
-      }
-      else if (element.equals(XMLCatalogTreeViewer.PLUGIN_SPECIFIED_ENTRIES_OBJECT) || element.equals(XMLCatalogTreeViewer.USER_SPECIFIED_ENTRIES_OBJECT))
-      {
-        return true;
-      }
-      return result;
-    }
-  }
-
-  protected void createCatalogDetailsView(Composite parent)
-  {
-    Group detailsGroup = new Group(parent, SWT.NONE);
-    detailsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    detailsGroup.setLayout(new GridLayout());
-    detailsGroup.setText(XMLCatalogMessages.UI_LABEL_DETAILS);
-    final XMLCatalogEntryDetailsView detailsView = new XMLCatalogEntryDetailsView(detailsGroup);
-    ISelectionChangedListener listener = new ISelectionChangedListener()
-    {
-      public void selectionChanged(SelectionChangedEvent event)
-      {
-        ISelection selection = event.getSelection();
-        Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-        if (selectedObject instanceof ICatalogEntry)
-        {
-          ICatalogEntry entry = (ICatalogEntry) selectedObject;
-          detailsView.setCatalogElement(entry);
-          currentSelectionLocation = entry.getURI();
-          currentSelectionNamespace = entry.getKey();
-        }
-        else
-        {
-          detailsView.setCatalogElement((ICatalogEntry) null);
-          currentSelectionLocation = "";
-          currentSelectionNamespace = "";
-        }
-      }
-    };
-    catalogEntriesView.getViewer().addSelectionChangedListener(listener);
-  }
-
-  public String getCurrentSelectionLocation()
-  {
-    return currentSelectionLocation;
-  }
-
-  public String getCurrentSelectionNamespace()
-  {
-    return currentSelectionNamespace;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/SpecificationForAppinfoSchema.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/SpecificationForAppinfoSchema.java
deleted file mode 100644
index f074b83..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/properties/sections/appinfo/SpecificationForAppinfoSchema.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.common.properties.sections.appinfo;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-
-public class SpecificationForAppinfoSchema
-{
-  private String description;
-  private String displayName;
-  private String namespaceURI;
-  private String location;
-  private ILabelProvider labelProvider;
-  private boolean isDefaultSchema = false;
-
-  public SpecificationForAppinfoSchema()
-  {
-    super();
-  }
-
-  /**
-   * @return Returns the description.
-   */
-  public String getDescription()
-  {
-    return description;
-  }
-
-  /**
-   * @param description
-   *          The description to set.
-   */
-  public void setDescription(String description)
-  {
-    this.description = description;
-  }
-
-  /**
-   * @return Returns the displayName.
-   */
-  public String getDisplayName()
-  {
-    return displayName;
-  }
-
-  /**
-   * @param name
-   *          The displayName to set.
-   */
-  public void setDisplayName(String displayName)
-  {
-    this.displayName = displayName;
-  }
-
-  /**
-   * @return Returns the namespaceURI.
-   */
-  public String getNamespaceURI()
-  {
-    return namespaceURI;
-  }
-
-  /**
-   * @param namespaceURI
-   *          The namespaceURI to set.
-   */
-  public void setNamespaceURI(String namespaceURI)
-  {
-    this.namespaceURI = namespaceURI;
-  }
-
-  /**
-   * @return Returns the location of the xsd file.
-   */
-  public String getLocation()
-  {
-    return location;
-  }
-
-  /**
-   * @param location
-   *          The location to be set
-   */
-  public void setLocation(String location)
-  {
-    this.location = location;
-  }
-
-  public ILabelProvider getLabelProvider()
-  {
-    return labelProvider;
-  }
-
-  public void setLabelProvider(ILabelProvider labelProvider)
-  {
-    this.labelProvider = labelProvider;
-  }
-  
-  public boolean isDefautSchema(){
-	  return isDefaultSchema ;
-  }
-
-  public void setDefautSchema(){
-	  isDefaultSchema = true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/util/XSDCommonUIUtils.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/util/XSDCommonUIUtils.java
deleted file mode 100644
index 0d7d869..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/common/util/XSDCommonUIUtils.java
+++ /dev/null
@@ -1,470 +0,0 @@
-package org.eclipse.wst.xsd.ui.common.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFacet;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.XSDXPathDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDCommonUIUtils
-{
-  public XSDCommonUIUtils()
-  {
-    super();
-  }
-
-  public static XSDAnnotation getInputXSDAnnotation(XSDConcreteComponent input, boolean createIfNotExist)
-  {
-    XSDAnnotation xsdAnnotation = null;
-    XSDFactory factory = XSDFactory.eINSTANCE;
-    if (input instanceof XSDAttributeDeclaration)
-    {
-      XSDAttributeDeclaration xsdComp = (XSDAttributeDeclaration) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDAttributeGroupDefinition)
-    {
-      XSDAttributeGroupDefinition xsdComp = (XSDAttributeGroupDefinition) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration xsdComp = (XSDElementDeclaration) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDNotationDeclaration)
-    {
-      XSDNotationDeclaration xsdComp = (XSDNotationDeclaration) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDXPathDefinition)
-    {
-      XSDXPathDefinition xsdComp = (XSDXPathDefinition) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDModelGroup)
-    {
-      XSDModelGroup xsdComp = (XSDModelGroup) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDModelGroupDefinition)
-    {
-      XSDModelGroupDefinition xsdComp = (XSDModelGroupDefinition) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDIdentityConstraintDefinition)
-    {
-      XSDIdentityConstraintDefinition xsdComp = (XSDIdentityConstraintDefinition) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDWildcard)
-    {
-      XSDWildcard xsdComp = (XSDWildcard) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDSchema)
-    {
-      XSDSchema xsdComp = (XSDSchema) input;
-      List list = xsdComp.getAnnotations();
-      if (list.size() > 0)
-      {
-        xsdAnnotation = (XSDAnnotation) list.get(0);
-      }
-      else
-      {
-        if (createIfNotExist && xsdAnnotation == null)
-        {
-          xsdAnnotation = factory.createXSDAnnotation();
-          if (xsdComp.getContents() != null)
-          {
-            xsdComp.getContents().add(0, xsdAnnotation);
-          }
-        }
-      }
-      return xsdAnnotation;
-    }
-    else if (input instanceof XSDFacet)
-    {
-      XSDFacet xsdComp = (XSDFacet) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDTypeDefinition)
-    {
-      XSDTypeDefinition xsdComp = (XSDTypeDefinition) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDInclude)
-    {
-      XSDInclude xsdComp = (XSDInclude) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDImport)
-    {
-      XSDImport xsdComp = (XSDImport) input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDRedefine)
-    {
-      XSDRedefine xsdComp = (XSDRedefine) input;
-      List list = xsdComp.getAnnotations();
-      if (list.size() > 0)
-      {
-        xsdAnnotation = (XSDAnnotation) list.get(0);
-      }
-      else
-      {
-        if (createIfNotExist && xsdAnnotation == null)
-        {
-          // ?
-        }
-      }
-      return xsdAnnotation;
-    }
-    else if (input instanceof XSDAnnotation)
-    {
-      xsdAnnotation = (XSDAnnotation) input;
-    }
-
-    if (createIfNotExist)
-    {
-      formatAnnotation(xsdAnnotation);
-    }
-
-    return xsdAnnotation;
-  }
-
-  private static void formatAnnotation(XSDAnnotation annotation)
-  {
-    Element element = annotation.getElement();
-    formatChild(element);
-  }
-
-  public static void formatChild(Node child)
-  {
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode) child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-
-        IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-        formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel();
-      }
-    }
-  }
-
-  public static String createUniqueElementName(String prefix, List elements)
-  {
-    ArrayList usedNames = new ArrayList();
-    for (Iterator i = elements.iterator(); i.hasNext();)
-    {
-      usedNames.add(getDisplayName((XSDNamedComponent) i.next()));
-    }
-
-    int i = 1;
-    String testName = prefix + i++;
-    while (usedNames.contains(testName))
-    {
-      testName = prefix + i++;
-    }
-    return testName;
-  }
-
-  public static String getDisplayName(XSDNamedComponent component)
-  {
-    if (component instanceof XSDTypeDefinition)
-      return getDisplayNameFromXSDType((XSDTypeDefinition) component);
-
-    if (component instanceof XSDFeature)
-    {
-      XSDFeature feature = (XSDFeature) component;
-      if (feature.getName() != null)
-        return feature.getName();
-      else if (feature.getResolvedFeature() != null && feature.getResolvedFeature().getName() != null)
-        return feature.getResolvedFeature().getName();
-    }
-
-    return component.getName();
-
-  }
-
-  public static String getDisplayNameFromXSDType(XSDTypeDefinition type)
-  {
-    return getDisplayNameFromXSDType(type, true);
-  }
-
-  public static String getDisplayNameFromXSDType(XSDTypeDefinition type, boolean returnPrimitiveParents)
-  {
-    if (type == null)
-      return null;
-
-    if (type.getName() == null || type.getName().length() == 0)
-    {
-      if (returnPrimitiveParents && isPrimitiveType(type))
-      {
-        return getDisplayNameFromXSDType(type.getBaseType());
-      }
-
-      EObject container = type.eContainer();
-
-      while (container != null)
-      {
-        if (container instanceof XSDNamedComponent && ((XSDNamedComponent) container).getName() != null)
-        {
-          return ((XSDNamedComponent) container).getName();
-        }
-        container = container.eContainer();
-      }
-      return null;
-    }
-    else
-      return type.getName();
-  }
-
-  public static boolean isPrimitiveType(XSDTypeDefinition type)
-  {
-    if (type instanceof XSDComplexTypeDefinition)
-      return false;
-
-    XSDTypeDefinition baseType = null;
-    if (type != null)
-    {
-      baseType = type.getBaseType();
-      XSDTypeDefinition origType = baseType; // KC: although invalid, we need to
-                                            // prevent cycles and to avoid an
-                                            // infinite loop
-      while (baseType != null && !XSDUtil.isAnySimpleType(baseType) && !XSDUtil.isAnyType(baseType) && origType != baseType)
-      {
-        type = baseType;
-        baseType = type.getBaseType();
-      }
-      baseType = type;
-    }
-    else
-    {
-      return false;
-    }
-
-    return (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(baseType.getTargetNamespace()));
-  }
-
-  public static XSDSimpleTypeDefinition getAnonymousSimpleType(XSDFeature input, XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
-  {
-    XSDSimpleTypeDefinition anonymousSimpleType = null;
-    XSDTypeDefinition localType = null;
-
-    if (input instanceof XSDElementDeclaration)
-    {
-      localType = ((XSDElementDeclaration) input).getAnonymousTypeDefinition();
-    }
-    else if (input instanceof XSDAttributeDeclaration)
-    {
-      localType = ((XSDAttributeDeclaration) input).getAnonymousTypeDefinition();
-    }
-
-    if (localType instanceof XSDSimpleTypeDefinition)
-    {
-      anonymousSimpleType = (XSDSimpleTypeDefinition) localType;
-    }
-    return anonymousSimpleType;
-  }
-
-  public static List getChildElements(XSDModelGroup group)
-  {
-    List children = new ArrayList();
-    for (Iterator i = group.getContents().iterator(); i.hasNext();)
-    {
-      XSDParticle next = (XSDParticle) i.next();
-      if (next.getContent() instanceof XSDFeature)
-      {
-        children.add(next.getContent());
-      }
-      else if (next.getTerm() instanceof XSDModelGroup)
-      {
-        children.addAll(getChildElements((XSDModelGroup) next.getTerm()));
-      }
-    }
-    return children;
-  }
-
-  public static List getAllAttributes(XSDComplexTypeDefinition xsdComplexType)
-  {
-    List attributes = getChildElements(xsdComplexType);
-    attributes.addAll(getChildAttributes(xsdComplexType));
-
-    return attributes;
-  }
-
-  public static List getInheritedAttributes(XSDComplexTypeDefinition ct)
-  {
-    List attrs = new ArrayList();
-    XSDTypeDefinition parent = ct.getBaseTypeDefinition();
-    if (parent != null && parent instanceof XSDComplexTypeDefinition && ct.isSetDerivationMethod())
-    {
-      attrs.addAll(getAllAttributes((XSDComplexTypeDefinition) parent));
-      attrs.addAll(getInheritedAttributes((XSDComplexTypeDefinition) parent));
-    }
-
-    return attrs;
-  }
-
-  public static List getChildElements(XSDComplexTypeDefinition ct)
-  {
-    return getChildElements(getModelGroup(ct));
-  }
-
-  public static XSDModelGroup getModelGroup(XSDComplexTypeDefinition cType)
-  {
-    XSDParticle particle = cType.getComplexType();
-
-    if (particle == null || particle.eContainer() != cType)
-      return null;
-
-    Object particleContent = particle.getContent();
-    XSDModelGroup group = null;
-
-    if (particleContent instanceof XSDModelGroupDefinition)
-      group = ((XSDModelGroupDefinition) particleContent).getResolvedModelGroupDefinition().getModelGroup();
-    else if (particleContent instanceof XSDModelGroup)
-      group = (XSDModelGroup) particleContent;
-
-    if (group == null)
-      return null;
-
-    if (group.getContents().isEmpty() || group.eResource() != cType.eResource())
-    {
-      XSDComplexTypeContent content = cType.getContent();
-      if (content instanceof XSDParticle)
-        group = (XSDModelGroup) ((XSDParticle) content).getContent();
-    }
-
-    return group;
-  }
-
-  public static List getChildAttributes(XSDComplexTypeDefinition ct)
-  {
-    EList attrContents = ct.getAttributeContents();
-    List attrs = new ArrayList();
-    for (int i = 0; i < attrContents.size(); i++)
-    {
-      Object next = attrContents.get(i);
-
-      if (next instanceof XSDAttributeUse)
-      {
-        attrs.add(((XSDAttributeUse) next).getContent().getResolvedAttributeDeclaration());
-      }
-      else if (next instanceof XSDAttributeGroupDefinition)
-      {
-        //XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) next;
-      }
-    }
-    return attrs;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
index db67a13..92a2027 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor;
 
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java
index af89666..76adc4d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java
@@ -1,14 +1,9 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
+/*
+ * Created on Feb 16, 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
 package org.eclipse.wst.xsd.ui.internal.refactor;
 
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java
index 1ff48fe..2b65694 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor;
 
 public interface IReferenceUpdating {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java
index 554bc8a..8f4dc58 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor;
 
 import org.eclipse.wst.common.core.search.pattern.QualifiedName;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Startup.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Startup.java
new file mode 100644
index 0000000..4a3fc53
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Startup.java
@@ -0,0 +1,14 @@
+package org.eclipse.wst.xsd.ui.internal.refactor;
+
+
+import org.eclipse.ui.IStartup;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+
+public class Startup implements IStartup {
+
+	public void earlyStartup() {
+		XSDEditorPlugin.getPlugin();
+
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java
index 5252362..69ff744 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor;
 
 import java.util.HashMap;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java
index ad779b1..93eac43 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor;
 
 import org.eclipse.wst.common.core.search.pattern.QualifiedName;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
index dd5ffc4..6216de7 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
@@ -15,7 +15,7 @@
 import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
 import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
 import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand;
 import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeTypeGlobalProcessor;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
index 0874e57..6b1d8b8 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
@@ -1,14 +1,4 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
+
 package org.eclipse.wst.xsd.ui.internal.refactor.actions;
 
 
@@ -17,7 +7,7 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
 
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
index e433463..7cbc3fe 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
@@ -18,7 +18,7 @@
 import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
 import org.eclipse.ui.actions.GlobalBuildAction;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
 import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
 import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
index 5cda216..722e5e9 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
@@ -16,7 +16,7 @@
 import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
 import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
 import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
index 75bf1cc..073f55d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
@@ -24,13 +24,13 @@
 	
 	private ISelection fCurrentSelection;
 
-//	private IWorkbenchPart fPart;
+	private IWorkbenchPart fPart;
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
 	 */
 	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-//		fPart = targetPart;
+		fPart = targetPart;
 	}
 	/* (non-Javadoc)
 	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java
index b6ac481..e7dac64 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java
@@ -17,7 +17,7 @@
 import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
 import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
 import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameTargetNamespaceProcessor;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java
index c8d8603..950fc6f 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.actions;
 
 import java.util.ArrayList;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
index d46aa02..965fc4e 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
@@ -1,16 +1,25 @@
 package org.eclipse.wst.xsd.ui.internal.refactor.actions;
 
-
-import org.eclipse.jface.viewers.ISelection;
+import java.io.IOException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.wst.xsd.editor.ISelectionMapper;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.XSDRefactorActionGroup;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorActionGroup;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupActionDelegate;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupSubMenu;
+import org.eclipse.xsd.XSDFactory;
 import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDResourceImpl;
 
 public class XSDRefactorGroupActionDelegate extends RefactorGroupActionDelegate {
 
@@ -32,19 +41,45 @@
 				return;
 	
 			IEditorPart editor = site.getPage().getActiveEditor();
-			if (editor != null) {              
-                XSDSchema schema = (XSDSchema)editor.getAdapter(XSDSchema.class);
-                ISelectionMapper mapper = (ISelectionMapper)editor.getAdapter(ISelectionMapper.class);
-			    if (schema != null)
-                {                
-                    ISelection selection = mapper != null ? mapper.mapSelection(fSelection) : fSelection;                    
-					RefactorActionGroup refactorMenuGroup = new XSDRefactorActionGroup(selection, schema);
+			if (editor != null) {
+				IEditorInput editorInput = editor.getEditorInput();
+				if(editorInput instanceof IFileEditorInput){
+					IFileEditorInput fileInput = (IFileEditorInput)editorInput;
+					XSDSchema schema = createXMLSchema(fileInput.getFile(), resourceSet);
+					RefactorActionGroup refactorMenuGroup = new XSDRefactorActionGroup(fSelection, schema);
 					RefactorGroupSubMenu subMenu = new RefactorGroupSubMenu(refactorMenuGroup);
 					subMenu.fill(menu, -1);
-				}				
+				}
+				
 			}
 		
 		}
 	
 	}
+	
+	public static XSDSchema createXMLSchema(IFile file, ResourceSet set)  {
+		
+		URI uri = URI.createFileURI(file.getLocation().toString());
+		XSDSchema schema = XSDFactory.eINSTANCE.createXSDSchema();
+		// we need this model to be able to get locations
+		try {
+			IStructuredModel structuredModel = StructuredModelManager.getModelManager().getModelForEdit(file);
+			IDOMModel domModel = (IDOMModel) structuredModel;
+			Resource xsdResource = new XSDResourceImpl();
+			xsdResource.setURI(uri);
+			schema = XSDFactory.eINSTANCE.createXSDSchema();
+			xsdResource.getContents().add(schema);
+			schema.setElement(domModel.getDocument().getDocumentElement());
+			if(set != null){
+				set.getResources().add(xsdResource);
+			}
+		} catch (IOException e) {
+			// do nothing
+		} catch (CoreException e) {
+			// do nothing
+		}
+		return schema;
+	}
+
+
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java
index 078f4c1..05c72d4 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.actions;
 
 import org.eclipse.jface.viewers.ISelection;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java
index ebdf3d0..f90685d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.rename;
 
 import java.util.Map;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
index 62b6ac3..fea1823 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
@@ -10,7 +10,7 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.rename;
 
-import com.ibm.icu.text.Collator;
+import java.text.Collator;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
@@ -120,7 +120,7 @@
 		CollectingSearchRequestor requestor = new CollectingSearchRequestor();
 		SearchPattern pattern = new XMLComponentDeclarationPattern(file, elementQName, typeQName);
 		SearchEngine searchEngine = new SearchEngine();
-		searchEngine.search(pattern, requestor, scope, null, new NullProgressMonitor());
+		searchEngine.search(pattern, requestor, scope, new NullProgressMonitor());
 		List results = requestor.getResults();
 		for (Iterator iter = results.iterator(); iter.hasNext();) {
 			SearchMatch match = (SearchMatch) iter.next();
@@ -150,7 +150,7 @@
 
 		SortingSearchRequestor requestor = new SortingSearchRequestor();
 		SearchPattern pattern = new XMLComponentReferencePattern(file, elementQName, typeQName);
-		searchEngine.search(pattern, requestor, new WorkspaceSearchScope(), null, new NullProgressMonitor());
+		searchEngine.search(pattern, requestor, new WorkspaceSearchScope(), new NullProgressMonitor());
 		references = requestor.getResults();
 		// for (Iterator iter = references.iterator(); iter.hasNext();) {
 		// SearchMatch match = (SearchMatch) iter.next();
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
index ecb772f..78c9932 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
@@ -53,8 +53,6 @@
 			IFile aFile = (IFile) element;
 			try {
 				IContentDescription description = aFile.getContentDescription();
-				if ( description == null )
-  				return false;
 				IContentType contentType = description.getContentType();
 				if(contentType != null){
 					if(XSD_CONTENT_TYPE_ID.equals(contentType.getId()) ||
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java
index d140a8c..25179e7 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.rename;
 
 import java.util.ArrayList;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java
index 2b2904c..cce160c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.rename;
 
 import java.util.Iterator;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java
index 3d169fd..c61fc01 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.rename;
 
 import java.util.List;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/LinkURLHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/LinkURLHelper.java
new file mode 100644
index 0000000..30274d4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/LinkURLHelper.java
@@ -0,0 +1,288 @@
+/*
+ * Created on Sep 21, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+package org.eclipse.wst.xsd.ui.internal.refactor.util;
+
+
+
+
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.eclipse.wst.common.uriresolver.internal.URI;
+import org.eclipse.wst.sse.core.internal.util.PathHelper;
+
+
+/**
+ * Hyperlink manager. Proved useful services like link conversion
+ * An utility class to help other parsre modules to convert links
+ */
+public class LinkURLHelper {
+
+	private static final String FILE_PROTOCOL_SEARCH_SIG = "file:/";//$NON-NLS-1$
+	private static final String FILE_PROTOCOL_SIG = "file:///";//$NON-NLS-1$
+	private static String RELATIVE_PATH_SIG = "..";//$NON-NLS-1$	
+	private static final String FORWARD_SLASH = "/";//$NON-NLS-1$	
+	private URL fBaseUrl = null; // base url. assumed to a absulute url
+	private String fBaseUrlString = null;
+	private URL fDocRoot = null;
+	private String fDocRootString = null;
+
+	public LinkURLHelper(String baseUrl) {
+		initialize(baseUrl, null);
+	}
+
+
+	public LinkURLHelper(String baseUrl, String docRoot) {
+		initialize(baseUrl, docRoot);
+	}
+
+	/**
+	 * Special adujust for file url
+	 */
+	public String adjustFileProtocolUrl(String url) {
+		if (url.startsWith(FILE_PROTOCOL_SEARCH_SIG)) {
+			url = FILE_PROTOCOL_SIG + url.substring(FILE_PROTOCOL_SEARCH_SIG.length());
+		}
+		return url;
+	}
+
+	private String convert(String url, URL baseUrl, String urlString) {
+		String absUrl = url;
+		if (baseUrl != null) {
+			try {
+				// do special thing file protocol
+				if (baseUrl.getProtocol().equalsIgnoreCase("file")) {//$NON-NLS-1$
+					// remove the fist
+					if (url.startsWith("/"))//$NON-NLS-1$
+						url = url.substring(1);
+					// empty string causes malformed exception	
+					String tempUrl = url;
+					if ("".equals(url))//$NON-NLS-1$
+						tempUrl = " ";//$NON-NLS-1$
+					URL newUrl = new URL(baseUrl, tempUrl);
+					// do extra math for file protocol to support ie based
+					absUrl = adjustFileProtocolUrl(newUrl.toString());
+				}
+				else {
+					URL newUrl = new URL(fBaseUrl, url);
+					absUrl = newUrl.toString();
+				}
+			}
+			catch (MalformedURLException me) {
+			}
+			// convert everything to forward slash
+			absUrl = PathHelper.switchToForwardSlashes(absUrl);
+		}
+		else {
+			// the given may be based on file
+			if (urlString != null) {
+				// swich the url to proper direction
+				url = PathHelper.removeLeadingSeparator(url);
+				File fle = new File(urlString, url);
+				absUrl = fle.getPath();
+
+			}
+			// convert everything to forward slash
+			absUrl = PathHelper.switchToForwardSlashes(absUrl);
+
+			// if the path ends with ".." we need to add a terminating slash or 
+			// else the link will not be resolved correctly.  (it will look like
+			// /url/path/to/somewhere/.. instead of /url/path/to/
+			if (absUrl.endsWith(FORWARD_SLASH + RELATIVE_PATH_SIG)) {
+				absUrl += FORWARD_SLASH;
+			}
+		}
+
+		// resolve relative path to absolute
+		absUrl = PathHelper.adjustPath(absUrl);
+		return absUrl;
+	}
+
+	private void initialize(String baseUrl, String docRoot) {
+		//
+		// Find out whether baes url is a url or file name
+		//
+		if ( URI.validScheme(baseUrl) ) {
+			try {
+				String temp = PathHelper.appendTrailingURLSlash(baseUrl);
+				fBaseUrl = new URL(temp);
+			}
+			catch (MalformedURLException mue) {
+				// it is a file based url
+				fBaseUrlString = baseUrl;
+			}
+		}
+		else {
+			// it is a file based url
+			fBaseUrlString = baseUrl;
+		}
+
+		// do the same for doc root
+		if (docRoot != null) {
+			if ( URI.validScheme(docRoot) ) {
+				try {
+					String temp = PathHelper.appendTrailingURLSlash(docRoot);
+					fDocRoot = new URL(temp);
+	
+				}
+				catch (MalformedURLException mue) {
+					// it is a file based url
+					fDocRootString = docRoot;
+				}
+			}
+			else {
+				// it is a file based url
+				fDocRootString = docRoot;
+			}
+		}
+	}
+
+	/**
+	 *  Convert the given url to a abolute url using the base url
+	 *  Input url can be of any othe following format
+	 * Absolute urls
+	 * --------------
+	 *  . http://www.foo.com/
+	 *  . http://www.foo.com
+	 *  . http://www.foo.com/folder
+	 *  . http://www.foo.com/folder/
+	 *  . http://www.foo.com/index.html
+	 *  . http://www.foo.com/folder/index.html
+	 *  . http://www.foo.com/folder/../index.html
+	 * Url relative  on document root
+	 * -------------------------
+	 *  . /
+	 *  . /folder
+	 *  . /index.html
+	 *  . /folder/index.html
+	 *  . /folder/../index.html
+	 * 
+	 * Self relative
+	 * -------------------------
+	 *  . index.html
+	 *  . ./index.html
+	 *  . ../index.html
+	 *  . folder/index.html
+	 *  . folder/../index.html
+	 *
+	 * file based url adds another dimension since it doesn't have a document root
+	 * So uses fDocRoot if provided
+	 */
+	public String toAbsolute(String url) {
+		String absUrl = url;
+
+		URL newUrl = null;
+		// try to see it is a absolute url
+		if ( URI.validScheme(url) ) {
+			try {
+				newUrl = new URL(url);
+			}
+			catch (MalformedURLException me) {
+			}
+		}
+		// if document root is provided
+		// do special case
+		if (newUrl == null) {
+			if (fDocRoot == null && fDocRootString == null) {
+				// try to check relative url
+				absUrl = convert(url, fBaseUrl, fBaseUrlString);
+			}
+			else {
+				// doc root is provided
+				// if the url is a doc root based use doc root
+
+				if (url.startsWith("/"))//$NON-NLS-1$
+					absUrl = convert(url, fDocRoot, fDocRootString);
+				else
+					absUrl = convert(url, fBaseUrl, fBaseUrlString);
+
+			}
+		}
+		return absUrl;
+	}
+
+	/**
+	 * Convert from an absolute url to relative url based on the given url
+	 * Both are assumed to be ablsute url
+	 */
+	public String toRelative(String url, String documentUrl) {
+		String output = url;
+		// assuming both urls are absolute
+		try {
+			URL inputUrl = new URL(url);
+			URL docUrl = new URL(documentUrl);
+			// filter out if the urls are not fro the same domain
+			if (!inputUrl.getProtocol().equals(docUrl.getProtocol()) || !inputUrl.getHost().equals(docUrl.getHost()) || inputUrl.getPort() != docUrl.getPort())
+				return output;
+			// both url are coming form the same place
+			// strip off the domain parts
+			String inputName = inputUrl.getFile();
+			String docName = docUrl.getFile();
+			output = PathHelper.convertToRelative(inputName, docName);
+		}
+		catch (MalformedURLException me) {
+			output = null;
+		}
+		return output;
+	}
+
+//	/*
+//	 */
+//	protected  String getScheme(String passedSpec) {
+//		if (passedSpec != null) {
+//	
+//			final String spec = passedSpec.trim();
+//			
+//			// protocol(scheme) java.net.URL can recognize is detemined
+//			// what URL.getURLStreamHandle(protocol) returns.
+//			// in Eclipse, only :
+//			//		valoader:
+//			//		file:
+//			//		jar:
+//			//		platform:
+//			//		doc:
+//			//		ftp:
+//			//		gopher:
+//			//		http:
+//			//		mailto:
+//			//		netdoc:
+//			//		systemresource:
+//			//		verbatim:
+//			// can recognize. Otherwise, it throws exception...
+//			// the following code comes from hpbcom/url.cpp, Url::parse_protocol()
+//			final int limit = spec.length();
+//			String newProtocol = null;
+//			for( int index = 0; index < limit; index++ ) {
+//				final char p = spec.charAt(index);
+//				if (p == '/') {
+//					break;
+//				}
+//				if (p == ':') {
+//					newProtocol = spec.substring(0, index);
+//					break;
+//				}
+//			}
+//			// copy end
+//		
+//			 			
+//			if (newProtocol != null && newProtocol.length() > 1 ) {
+//				for ( int i = 0; i < PROTOCOLS.length; i++ ){
+//					if (newProtocol.compareToIgnoreCase(PROTOCOLS[i]) == 0) {
+//						// matched;
+//						return newProtocol;
+//					}
+//				}
+//			}
+//		}
+//		//i don't know what is newProtocol. Ask URI class itself.
+//		//No, calling URI again is very slow. So, just give up
+//		//URI uri = new URI(spec);
+//		//return uri.getScheme();
+//		return null;//$NON-NLS-1$
+//	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java
index 04a75e8..7f93a4f 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.util;
 
 import org.eclipse.core.runtime.Assert;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java
index 29c5678..983a838 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
 
 import org.eclipse.emf.ecore.resource.ResourceSet;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java
index 77780e1..e402607 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java
@@ -1,14 +1,3 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
 
 import java.util.ArrayList;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java
new file mode 100644
index 0000000..b65703a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java
@@ -0,0 +1,18 @@
+package org.eclipse.wst.xsd.ui.internal.search;
+
+import org.eclipse.wst.common.core.search.pattern.QualifiedName;
+
+// todo ... move
+public interface IXSDSearchConstants {
+	
+	public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
+	public static String XSD_CONTENT_TYPE_ID = "org.eclipse.wst.xsd.core.xsdsource";
+	
+    public static final QualifiedName   COMPLEX_TYPE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "complexType");
+    public static final QualifiedName   SIMPLE_TYPE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "simpleType");
+    public static final QualifiedName   ELEMENT_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "element");
+	public static final QualifiedName   ATTRIBUTE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "attribute");
+	public static final QualifiedName   ATTRIBUTE_GROUP_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "attributeGroup");
+	public static final QualifiedName   GROUP_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "group");
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java
new file mode 100644
index 0000000..3fdc553
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java
@@ -0,0 +1,68 @@
+package org.eclipse.wst.xsd.ui.internal.search;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import org.eclipse.wst.common.core.search.pattern.SearchPattern;
+import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
+import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
+
+public class XSDSearchContributor extends ComponentSearchContributor  {
+ 
+	
+	protected void initializeReferences() {
+		references = new HashMap();
+		String ns = IXSDSearchConstants.XMLSCHEMA_NAMESPACE;
+
+		List patterns = new ArrayList();
+		patterns.add(new XMLSearchPattern( ns, "element", "ref"));
+		patterns.add(new XMLSearchPattern( ns, "element", "substitutionGroup"));
+		references.put(IXSDSearchConstants.ELEMENT_META_NAME, patterns);
+
+		patterns = new ArrayList();
+		patterns.add(new XMLSearchPattern( ns, "restriction", "base"));
+		patterns.add(new XMLSearchPattern( ns, "extension", "base"));
+		patterns.add(new XMLSearchPattern( ns, "element", "type"));
+		references.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, patterns);
+
+		patterns = new ArrayList();
+		patterns.add(new XMLSearchPattern( ns, "restriction", "base"));
+		patterns.add(new XMLSearchPattern( ns, "extension", "base"));
+		patterns.add(new XMLSearchPattern( ns, "attribute", "type"));
+		patterns.add(new XMLSearchPattern( ns, "union", "memberTypes"));
+
+		references.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, patterns);
+
+	}
+
+	protected void initializeDeclarations(){
+		
+		declarations = new HashMap();
+		String ns = IXSDSearchConstants.XMLSCHEMA_NAMESPACE;
+
+		SearchPattern pattern = new XMLSearchPattern( ns, "element", "name");
+		declarations.put(IXSDSearchConstants.ELEMENT_META_NAME, pattern);
+
+		pattern = new XMLSearchPattern(ns, "complexType", "name");
+		declarations.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, pattern);
+
+		pattern = new XMLSearchPattern(ns, "simpleType", "name");
+		declarations.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, pattern);
+
+		pattern = new XMLSearchPattern(ns, "attribute", "name");
+		declarations.put(IXSDSearchConstants.ATTRIBUTE_META_NAME, pattern);
+
+		pattern = new XMLSearchPattern(ns, "attributeGroup", "name");
+		declarations.put(IXSDSearchConstants.ATTRIBUTE_GROUP_META_NAME, pattern);
+
+		pattern = new XMLSearchPattern(ns, "group", "name");
+		declarations.put(IXSDSearchConstants.GROUP_META_NAME, pattern);
+
+	}
+
+	protected void initializeSupportedNamespaces() {
+		namespaces = new String[]{ IXSDSearchConstants.XMLSCHEMA_NAMESPACE};
+	}
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java
new file mode 100644
index 0000000..ae0b1a6
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java
@@ -0,0 +1,32 @@
+package org.eclipse.wst.xsd.ui.internal.search;
+
+import org.eclipse.wst.common.core.search.pattern.SearchPattern;
+import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
+import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
+import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
+
+public class XSDSearchParticipant extends XMLSearchParticipant {
+
+	private static String ID = "org.eclipse.wst.xsd.search.XSDSearchParticipant";
+
+	public  boolean initialize(SearchPattern pattern, String[] contentTypes){
+		
+		super.initialize(pattern, contentTypes);
+		id = ID;
+		if(pattern instanceof XMLComponentSearchPattern ){
+			XMLComponentSearchPattern componentPattern = (XMLComponentSearchPattern)pattern;
+			String namespace = componentPattern.getMetaName().getNamespace();
+			if(IXSDSearchConstants.XMLSCHEMA_NAMESPACE.equals(namespace)){
+				return true;
+			}
+		}
+		return false;
+	}
+
+	
+	public ComponentSearchContributor getSearchContributor() {
+		
+		return new XSDSearchContributor();
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java
deleted file mode 100644
index 5c465b3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public interface IXSDSearchConstants {
-	
-	public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
-	public static String XSD_CONTENT_TYPE_ID = "org.eclipse.wst.xsd.core.xsdsource";
-
-    public static final QualifiedName   TYPE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "type");
-    public static final QualifiedName   COMPLEX_TYPE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "complexType");
-    public static final QualifiedName   SIMPLE_TYPE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "simpleType");
-    public static final QualifiedName   ELEMENT_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "element");
-	public static final QualifiedName   ATTRIBUTE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "attribute");
-	public static final QualifiedName   ATTRIBUTE_GROUP_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "attributeGroup");
-	public static final QualifiedName   GROUP_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "group");
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java
deleted file mode 100644
index 1def0d9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSearchContributor extends ComponentSearchContributor  {
- 
-	
-	protected void initializeReferences() {
-		references = new HashMap();
-		String ns = IXSDSearchConstants.XMLSCHEMA_NAMESPACE;
-
-		List patterns = new ArrayList();
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.REF_ATTRIBUTE));
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE));
-		references.put(IXSDSearchConstants.ELEMENT_META_NAME, patterns);
-
-		patterns = new ArrayList();
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDConstants.BASE_ATTRIBUTE));
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.EXTENSION_ELEMENT_TAG, XSDConstants.BASE_ATTRIBUTE));
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.TYPE_ATTRIBUTE));
-		references.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, patterns);
-
-		patterns = new ArrayList();
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDConstants.BASE_ATTRIBUTE));
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.TYPE_ATTRIBUTE));
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDConstants.TYPE_ATTRIBUTE));
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.UNION_ELEMENT_TAG, XSDConstants.MEMBERTYPES_ATTRIBUTE));
-		patterns.add(new XMLSearchPattern( ns, XSDConstants.LIST_ELEMENT_TAG, XSDConstants.ITEMTYPE_ATTRIBUTE));
-
-		references.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, patterns);
-
-	}
-
-	protected void initializeDeclarations(){
-		
-		declarations = new HashMap();
-		String ns = IXSDSearchConstants.XMLSCHEMA_NAMESPACE;
-
-		SearchPattern pattern = new XMLSearchPattern( ns, "element", "name");
-		declarations.put(IXSDSearchConstants.ELEMENT_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "complexType", "name");
-		declarations.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "simpleType", "name");
-		declarations.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "attribute", "name");
-		declarations.put(IXSDSearchConstants.ATTRIBUTE_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "attributeGroup", "name");
-		declarations.put(IXSDSearchConstants.ATTRIBUTE_GROUP_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "group", "name");
-		declarations.put(IXSDSearchConstants.GROUP_META_NAME, pattern);
-
-	}
-
-	protected void initializeSupportedNamespaces() {
-		namespaces = new String[]{ IXSDSearchConstants.XMLSCHEMA_NAMESPACE};
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java
deleted file mode 100644
index 2051804..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search;
-
-import java.util.Map;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
-
-public class XSDSearchParticipant extends XMLSearchParticipant {
-
-	private static String ID = "org.eclipse.wst.xsd.search.XSDSearchParticipant";
-
-	public XSDSearchParticipant()
-	{
-	  super();
-      id = ID;
-	}	
-	
-	public String[] getSupportedContentTypes()
-	{
-	  String[] result = { "org.eclipse.wst.xsd.core.xsdsource" };
-	  return result;
-	}
-	
-	public boolean isApplicable(SearchPattern pattern, Map searchOptions)
-	{
-		if(pattern instanceof XMLComponentSearchPattern ){
-			XMLComponentSearchPattern componentPattern = (XMLComponentSearchPattern)pattern;
-			String namespace = componentPattern.getMetaName().getNamespace();
-			if(IXSDSearchConstants.XMLSCHEMA_NAMESPACE.equals(namespace)){
-				return true;
-			}
-		}
-		return false;
-	}
-		
-	public ComponentSearchContributor getSearchContributor() {		
-		return new XSDSearchContributor();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java
deleted file mode 100644
index 4dfefbd..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.AbstractSearchQuery;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
-
-public class XSDSearchQuery extends AbstractSearchQuery
-{   
-  public final static int LIMIT_TO_DECLARATIONS = 1;
-  public final static int LIMIT_TO_REFERENCES   = 2;  
-  
-  int fLimitTo = 0;
-  IFile fContextFile;
-  QualifiedName fElementQName;
-  QualifiedName fTypeName;
-  
-  public XSDSearchQuery(String pattern, IFile file, QualifiedName elementQName, QualifiedName typeName, int limitTo, SearchScope scope, String scopeDescription)
-  {
-    super(pattern, scope, scopeDescription);
-    fLimitTo = limitTo;
-    fContextFile = file;
-    fElementQName = elementQName;
-    fTypeName = typeName;
-  }
-
-  protected SearchPattern createSearchPattern(QualifiedName typeName)
-  {
-    if (fLimitTo == LIMIT_TO_DECLARATIONS)
-    {  
-      return new XMLComponentDeclarationPattern(fContextFile, fElementQName, fTypeName);
-    }  
-    else if (fLimitTo == LIMIT_TO_REFERENCES)
-    {
-      return new XMLComponentReferencePattern(fContextFile, fElementQName, fTypeName);
-    }  
-    return null;
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/BaseGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/BaseGroupActionDelegate.java
deleted file mode 100644
index 41a7e02..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/BaseGroupActionDelegate.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public abstract class BaseGroupActionDelegate implements IObjectActionDelegate, IEditorActionDelegate, IMenuCreator
-{
-    protected ISelection fSelection;
-    private IAction fDelegateAction;
-    // whether to re-fill the menu (reset on selection change)
-    private boolean fFillMenu = true;
-    protected IWorkbenchPart workbenchPart; 
-    
-
-    public BaseGroupActionDelegate() 
-    {
-      System.out.println("Create ActionDelegate " + this.getClass().getName());
-    }
-    
-    /*
-     * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
-     */
-    public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-        workbenchPart = targetPart;
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.action.IMenuCreator#dispose()
-     */
-    public void dispose() {
-        // nothing to do
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
-     */
-    public Menu getMenu(Control parent) {
-        // never called
-        return null;
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
-     */
-    public Menu getMenu(Menu parent) {
-        //Create the new menu. The menu will get filled when it is about to be shown. see fillMenu(Menu).
-        Menu menu = new Menu(parent);
-        /**
-         * Add listener to repopulate the menu each time
-         * it is shown because MenuManager.update(boolean, boolean) 
-         * doesn't dispose pulldown ActionContribution items for each popup menu.
-         */
-        menu.addMenuListener(new MenuAdapter() {
-            public void menuShown(MenuEvent e) {
-                if (fFillMenu) {
-                    Menu m = (Menu)e.widget;
-                    MenuItem[] items = m.getItems();
-                    for (int i=0; i < items.length; i++) {
-                        items[i].dispose();
-                    }
-                    fillMenu(m);
-                    fFillMenu = false;
-                }
-            }
-        });
-        return menu;
-    }
-
-    /*
-     * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
-     */
-    public void run(IAction action) {
-        // Never called because we become a menu.
-    }
-    
-    /*
-     * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
-     */
-    public void selectionChanged(IAction action, ISelection selection) {
-        fDelegateAction = action;
-        updateWith(selection);
-        
-    }
-
-  public void setActiveEditor(IAction action, IEditorPart targetEditor) {
-        workbenchPart = targetEditor;
-        fDelegateAction = action;
-        if (targetEditor != null && targetEditor.getEditorSite() != null && targetEditor.getEditorSite().getSelectionProvider() != null) {
-            updateWith(targetEditor.getEditorSite().getSelectionProvider().getSelection());
-        }
-        
-    }
-  
-    public void updateWith(ISelection selection) {
-        fSelection = selection;
-        if (fDelegateAction != null) {
-            boolean enable = false;
-            if (selection != null) {
-                if (selection instanceof ITextSelection) {
-                    //if (((ITextSelection) selection).getLength() > 0) {
-                        enable = true;
-                    //}
-                }
-                else if(selection instanceof IStructuredSelection ){
-                    enable = !selection.isEmpty();
-                }
-            }
-            // enable action
-            fDelegateAction.setEnabled(enable);
-            
-            // fill submenu
-            fFillMenu = true;
-            fDelegateAction.setMenuCreator(this);
-            
-            
-        }
-        
-    }
-    
-    
-  protected abstract void fillMenu(Menu menu);
-    
-   
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java
deleted file mode 100644
index 0bc530a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-// TODO... open a bugzilla to get the JDT class moved to non internal platform
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.actions.ActionGroup;
-
-public class CompositeActionGroup extends ActionGroup {
-
-    private ActionGroup[] fGroups;
-    
-    public CompositeActionGroup() {
-    }
-    
-    public CompositeActionGroup(ActionGroup[] groups) {
-        setGroups(groups);
-    }
-
-    protected void setGroups(ActionGroup[] groups) {
-        Assert.isTrue(fGroups == null);
-        Assert.isNotNull(groups);
-        fGroups= groups;        
-    }
-        
-    public ActionGroup get(int index) {
-        if (fGroups == null)
-            return null;
-        return fGroups[index];
-    }
-    
-    public void addGroup(ActionGroup group) {
-        if (fGroups == null) {
-            fGroups= new ActionGroup[] { group };
-        } else {
-            ActionGroup[] newGroups= new ActionGroup[fGroups.length + 1];
-            System.arraycopy(fGroups, 0, newGroups, 0, fGroups.length);
-            newGroups[fGroups.length]= group;
-            fGroups= newGroups;
-        }
-    }
-    
-    public void dispose() {
-        super.dispose();
-        if (fGroups == null)
-            return;
-        for (int i= 0; i < fGroups.length; i++) {
-            fGroups[i].dispose();
-        }
-    }
-
-    public void fillActionBars(IActionBars actionBars) {
-        super.fillActionBars(actionBars);
-        if (fGroups == null)
-            return;
-        for (int i= 0; i < fGroups.length; i++) {
-            fGroups[i].fillActionBars(actionBars);
-        }
-    }
-
-    public void fillContextMenu(IMenuManager menu) {
-        super.fillContextMenu(menu);
-        if (fGroups == null)
-            return;
-        for (int i= 0; i < fGroups.length; i++) {
-            fGroups[i].fillContextMenu(menu);
-        }
-    }
-
-    public void setContext(ActionContext context) {
-        super.setContext(context);
-        if (fGroups == null)
-            return;
-        for (int i= 0; i < fGroups.length; i++) {
-            fGroups[i].setContext(context);
-        }
-    }
-
-    public void updateActionBars() {
-        super.updateActionBars();
-        if (fGroups == null)
-            return;
-        for (int i= 0; i < fGroups.length; i++) {
-            fGroups[i].updateActionBars();
-        }
-    }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java
deleted file mode 100644
index 05308e2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-// TODO.. fill in the content
-public class DeclarationsSearchGroup
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindAction.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindAction.java
deleted file mode 100644
index c4d6664..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindAction.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.IEditorPart;
-public class FindAction extends Action implements ISelectionChangedListener
-{
-  IEditorPart editor;
-
-  protected FindAction(IEditorPart editor)
-  {
-    this.editor = editor;
-  }
-
-  public void selectionChanged(SelectionChangedEvent event)
-  {
-    // TODO Auto-generated method stub
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.java
deleted file mode 100644
index 095ccd5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.core.search.scope.WorkspaceSearchScope;
-import org.eclipse.wst.xsd.editor.ISelectionMapper;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-public class FindReferencesAction extends FindAction
-{
-  public FindReferencesAction(IEditorPart editor)
-  {
-    super(editor);
-  }
-
-  public void setActionDefinitionId(String string)
-  {
-  }
-
-  /**
-   * To be used by subclass in its run() Returns the file where the selection of
-   * a component (from the user) occurs ie. Returns the file that the user is
-   * currently working on.
-   * 
-   * @return The IFile representation of the current working file.
-   */
-  protected IFile getCurrentFile()
-  {
-    if (editor != null)
-    {
-      IEditorInput input = editor.getEditorInput();
-      if (input instanceof IFileEditorInput)
-      {
-        IFileEditorInput fileEditorInput = (IFileEditorInput) input;
-        return fileEditorInput.getFile();
-      }
-    }
-    return null;
-  }
-
-  /**
-   * To be used by subclass in its run().. Determines the metaName of the XSD
-   * component given to this method.
-   * 
-   * @param component
-   *          The component of which we want to determine the name
-   * @return
-   */
-  protected QualifiedName determineMetaName(XSDNamedComponent component)
-  {
-    QualifiedName metaName = null;
-    if (component instanceof XSDComplexTypeDefinition)
-    {
-      metaName = IXSDSearchConstants.COMPLEX_TYPE_META_NAME;
-    }
-    else if (component instanceof XSDSimpleTypeDefinition)
-    {
-      metaName = IXSDSearchConstants.SIMPLE_TYPE_META_NAME;
-    }
-    else if (component instanceof XSDElementDeclaration)
-    {
-      metaName = IXSDSearchConstants.ELEMENT_META_NAME;
-    }
-    return metaName;
-  }
-  
-  protected XSDNamedComponent getXSDNamedComponent()
-  {
-    if (editor != null)
-    {
-      ISelectionProvider provider = (ISelectionProvider) editor.getAdapter(ISelectionProvider.class);
-      ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
-      if (provider != null)
-      {
-        ISelection selection = provider.getSelection();
-        if (mapper != null)
-        {
-          selection = mapper.mapSelection(selection);
-        }
-        if (selection != null && selection instanceof IStructuredSelection)
-        {
-          IStructuredSelection s = (IStructuredSelection) selection;
-          Object o = s.getFirstElement();
-          if (o != null && o instanceof XSDNamedComponent)
-          {
-            return (XSDNamedComponent) o;
-          }
-        }
-      }
-    }
-    // The expected component we get from the editor does not meet
-    // our expectation
-    return null;
-  }  
-
-  public void run()
-  {
-    String pattern = "";
-    XSDNamedComponent component = getXSDNamedComponent();
-    IFile file = getCurrentFile();
-    if (file != null && component != null)
-    {
-      QualifiedName metaName = determineMetaName(component);
-      QualifiedName elementQName = new QualifiedName(component.getTargetNamespace(), component.getName());
-      SearchScope scope = new WorkspaceSearchScope();
-      String scopeDescription = "Workspace";
-      XSDSearchQuery searchQuery = new XSDSearchQuery(pattern, file, elementQName, metaName, XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
-      NewSearchUI.activateSearchResultView();
-      NewSearchUI.runQueryInBackground(searchQuery);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInProjectAction.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInProjectAction.java
deleted file mode 100644
index cab3b94..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInProjectAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.ProjectSearchScope;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-import org.eclipse.xsd.XSDNamedComponent;
-public class FindReferencesInProjectAction extends FindReferencesAction
-{
-  public FindReferencesInProjectAction(IEditorPart editor)
-  {
-    super(editor);
-  }
-
-  public void run()
-  {
-    String pattern = "";
-    XSDNamedComponent component = getXSDNamedComponent();
-    IFile file = getCurrentFile();
-    if (file != null && component != null)
-    {
-      QualifiedName metaName = determineMetaName(component);
-      QualifiedName elementQName = new QualifiedName(component.getTargetNamespace(), component.getName());
-      IPath fullPath = (IPath) file.getFullPath();
-      ProjectSearchScope scope = new ProjectSearchScope(fullPath);
-      String scopeDescription = "Workspace";
-      XSDSearchQuery searchQuery = new XSDSearchQuery(pattern, file, elementQName, metaName, XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
-      NewSearchUI.activateSearchResultView();
-      NewSearchUI.runQueryInBackground(searchQuery);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInWorkingSetAction.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInWorkingSetAction.java
deleted file mode 100644
index bfe6947..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInWorkingSetAction.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.window.Window;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.WorkingSetSearchScope;
-import org.eclipse.wst.xsd.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-import org.eclipse.xsd.XSDNamedComponent;
-
-public class FindReferencesInWorkingSetAction extends FindReferencesAction{
-
-	public FindReferencesInWorkingSetAction(IEditorPart editor) {
-		super(editor);
-	}
-	
-	public void setActionDefinitionId(String string)
-	{
-		
-	}
-
-	public void run(){
-		IWorkingSet[] workingSets = queryWorkingSets();
-		if ( workingSets == null || workingSets.length == 0)
-			// The user chooses nothing, no point to continue.
-			return;
-		String pattern = "";
-
-		XSDNamedComponent component = getXSDNamedComponent();
-		IFile file = getCurrentFile();
-		if ( file != null && component != null){
-			QualifiedName metaName = determineMetaName(component);
-
-			QualifiedName elementQName = 
-				new QualifiedName(component.getTargetNamespace(), component.getName());
-
-			// Create a scope from the selected working sets
-			WorkingSetSearchScope scope = new WorkingSetSearchScope();
-			for (int i = 0; i < workingSets.length; i++){
-				IAdaptable[] elements = workingSets[i].getElements();
-				scope.addAWorkingSetToScope(elements);
-			}
-
-			String scopeDescription = "Workspace";    
-			XSDSearchQuery searchQuery = 
-				new XSDSearchQuery(pattern, file, elementQName, metaName, XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);    
-			NewSearchUI.activateSearchResultView();
-			NewSearchUI.runQueryInBackground(searchQuery);
-		}
-	}
-
-	/**
-	 * Calls a dialog asking the user to choose the working Sets he wants
-	 * to do the search on
-	 * @return
-	 */
-	public static IWorkingSet[] queryWorkingSets(){
-		Shell shell= XSDEditorPlugin.getShell();
-		if (shell == null)
-			return null;
-		IWorkingSetSelectionDialog dialog =
-			PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true);
-		if (dialog.open() == Window.OK) {
-			IWorkingSet[] workingSets= dialog.getSelection();
-			if (workingSets.length > 0)
-				return workingSets;
-		}
-		return null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java
deleted file mode 100644
index 0efc8ff..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-// TODO... fill in the content
-public class ImplementorsSearchGroup
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java
deleted file mode 100644
index 463e241..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-// TODO... fill in the content
-public class OccurrencesSearchGroup
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ReferencesSearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ReferencesSearchGroup.java
deleted file mode 100644
index 0bbd916..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ReferencesSearchGroup.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import java.util.List;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-
-
-public class ReferencesSearchGroup extends SearchGroup  {
-
-    private static final String MENU_TEXT= "References...";//SearchMessages.group_references; 
-
-    private IWorkbenchSite fSite;
-    private IEditorPart fEditor;
-    private IActionBars fActionBars;
-    
-//    private String fGroupId;
-    
-    private FindReferencesAction fFindReferencesAction;
-    private FindReferencesInProjectAction fFindReferencesInProjectAction;
-    private FindReferencesInWorkingSetAction fFindReferencesInWorkingSetAction;
-
-
-    /**
-     * Note: This constructor is for internal use only. Clients should not call this constructor.
-     * @param editor
-     */
-    public ReferencesSearchGroup(IEditorPart editor) {
-        Assert.isNotNull(editor);
-        fEditor= editor;
-        fSite= fEditor.getSite();
-//        fGroupId= ITextEditorActionConstants.GROUP_FIND;
-
-        fFindReferencesAction= new FindReferencesAction(editor);
-        fFindReferencesAction.setText("Workspace");
-        fFindReferencesAction.setActionDefinitionId("SEARCH_REFERENCES_IN_WORKSPACE");
-        //fEditor.setAction("SearchReferencesInWorkspace", fFindReferencesAction); //$NON-NLS-1$
-
-        fFindReferencesInProjectAction= new FindReferencesInProjectAction(fEditor);
-        fFindReferencesInProjectAction.setText("Project");        
-        fFindReferencesInProjectAction.setActionDefinitionId("SEARCH_REFERENCES_IN_PROJECT");
-        //fEditor.setAction("SearchReferencesInProject", fFindReferencesInProjectAction); //$NON-NLS-1$
-    
-        fFindReferencesInWorkingSetAction= new FindReferencesInWorkingSetAction(fEditor);
-        fFindReferencesInWorkingSetAction.setText("Working Set...");         
-        fFindReferencesInWorkingSetAction.setActionDefinitionId(".SEARCH_REFERENCES_IN_WORKING_SET");
-        //fEditor.setAction("SearchReferencesInWorkingSet", fFindReferencesInWorkingSetAction); //$NON-NLS-1$
-    }
-
-    /*
-    private void registerAction(SelectionDispatchAction action, ISelectionProvider provider, ISelection selection) {
-        action.update(selection);
-        provider.addSelectionChangedListener(action);
-    }*/
-
-    /**
-     * Note: this method is for internal use only. Clients should not call this method.
-     * 
-     * @return the menu label
-     */
-    protected String getName() {
-        return MENU_TEXT;
-    }
-    
-    public void fillActions(List list)
-    {
-      list.add(fFindReferencesAction);
-      //list.add(fFindReferencesInHierarchyAction);
-      list.add(fFindReferencesInProjectAction);
-      list.add(new Separator());
-      list.add(fFindReferencesInWorkingSetAction);
-    }
-    
-    /* (non-Javadoc)
-     * Method declared in ActionGroup
-     */
-    public void fillActionBars(IActionBars actionBars) {
-        Assert.isNotNull(actionBars);
-        super.fillActionBars(actionBars);
-        fActionBars= actionBars;
-        updateGlobalActionHandlers();
-    }
-
-    
-//    private void addAction(IAction action, IMenuManager manager) {
-//        if (action.isEnabled()) {
-//            manager.add(action);
-//        }
-//    }
-
-    /*
-    private void addWorkingSetAction(IWorkingSet[] workingSets, IMenuManager manager) {
-        FindAction action;
-        if (fEditor != null)
-            action= new WorkingSetFindAction(fEditor, new FindReferencesInWorkingSetAction(fEditor, workingSets), SearchUtil.toString(workingSets));
-        else
-            action= new WorkingSetFindAction(fSite, new FindReferencesInWorkingSetAction(fSite, workingSets), SearchUtil.toString(workingSets));
-        action.update(getContext().getSelection());
-        addAction(action, manager);
-    }
-    */
-    
-    /* (non-Javadoc)
-     * Method declared on ActionGroup.
-     */
-    public void fillContextMenu(IMenuManager manager) {
-      /*
-        MenuManager javaSearchMM= new MenuManager(getName(), IContextMenuConstants.GROUP_SEARCH);
-        addAction(fFindReferencesAction, javaSearchMM);
-        addAction(fFindReferencesInProjectAction, javaSearchMM);
-        addAction(fFindReferencesInHierarchyAction, javaSearchMM);
-        
-        javaSearchMM.add(new Separator());
-        
-        Iterator iter= SearchUtil.getLRUWorkingSets().sortedIterator();
-        while (iter.hasNext()) {
-            addWorkingSetAction((IWorkingSet[]) iter.next(), javaSearchMM);
-        }
-        addAction(fFindReferencesInWorkingSetAction, javaSearchMM);
-
-        if (!javaSearchMM.isEmpty())
-            manager.appendToGroup(fGroupId, javaSearchMM);
-        */    
-    }
-    
-    /* 
-     * Overrides method declared in ActionGroup
-     */
-    public void dispose() {
-        ISelectionProvider provider= fSite.getSelectionProvider();
-        if (provider != null) {
-            disposeAction(fFindReferencesAction, provider);
-            disposeAction(fFindReferencesInProjectAction, provider);
-          //  disposeAction(fFindReferencesInHierarchyAction, provider);
-            disposeAction(fFindReferencesInWorkingSetAction, provider);
-        }
-        fFindReferencesAction= null;
-        fFindReferencesInProjectAction= null;
-        //fFindReferencesInHierarchyAction= null;
-        fFindReferencesInWorkingSetAction= null;
-        updateGlobalActionHandlers();
-        super.dispose();
-    }
-
-    private void updateGlobalActionHandlers() {
-        if (fActionBars != null) {
-//            fActionBars.setGlobalActionHandler(JdtActionConstants.FIND_REFERENCES_IN_WORKSPACE, fFindReferencesAction);
-//            fActionBars.setGlobalActionHandler(JdtActionConstants.FIND_REFERENCES_IN_PROJECT, fFindReferencesInProjectAction);
-//            fActionBars.setGlobalActionHandler(JdtActionConstants.FIND_REFERENCES_IN_HIERARCHY, fFindReferencesInHierarchyAction);
-//            fActionBars.setGlobalActionHandler(JdtActionConstants.FIND_REFERENCES_IN_WORKING_SET, fFindReferencesInWorkingSetAction);
-        }
-    }
-
-    private void disposeAction(ISelectionChangedListener action, ISelectionProvider provider) {
-        if (action != null)
-            provider.removeSelectionChangedListener(action);
-    }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.java
deleted file mode 100644
index 18071ba..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import java.util.List;
-import org.eclipse.ui.actions.ActionGroup;
-
-public abstract class SearchGroup extends ActionGroup
-{
-  public abstract void fillActions(List list);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java
deleted file mode 100644
index ec6846d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionGroup;
-
-public class XSDSearchActionGroup extends ActionGroup
-{
-//  private ReferencesSearchGroup fReferencesGroup;
-//  private DeclarationsSearchGroup fDeclarationsGroup;
-//  private ImplementorsSearchGroup fImplementorsGroup;
-//  private OccurrencesSearchGroup fOccurrencesGroup;
-//  private IEditorPart fEditor;
-
-  public XSDSearchActionGroup(IEditorPart editor)
-  {
-    Assert.isNotNull(editor);
-//    fEditor = editor;
-//    fReferencesGroup = new ReferencesSearchGroup(editor);
-//    fDeclarationsGroup = new DeclarationsSearchGroup();
-//    fImplementorsGroup = new ImplementorsSearchGroup();
-//    fOccurrencesGroup = new OccurrencesSearchGroup();
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java
deleted file mode 100644
index 91c55c6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import org.eclipse.swt.widgets.Menu;
-
-//org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchGroupActionDelegate
-public class XSDSearchDeclarationsGroupActionDelegate extends BaseGroupActionDelegate
-{
-    protected void fillMenu(Menu menu) {
-
-    }             
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchGroupSubMenu.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchGroupSubMenu.java
deleted file mode 100644
index 65d6ff4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchGroupSubMenu.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-public class XSDSearchGroupSubMenu extends CompoundContributionItem
-{
-  SearchGroup searchActionGroup;
-
-  public XSDSearchGroupSubMenu(SearchGroup refactorMenuGroup)
-  {
-    super();
-    searchActionGroup = refactorMenuGroup;
-  }
-
-  public XSDSearchGroupSubMenu(String id)
-  {
-    super(id);
-  }
-
-  protected IContributionItem[] getContributionItems()
-  {
-    ArrayList actionsList = new ArrayList();
-    ArrayList contribList = new ArrayList();
-    searchActionGroup.fillActions(actionsList);
-    if (actionsList != null && !actionsList.isEmpty())
-    {
-      for (Iterator iter = actionsList.iterator(); iter.hasNext();)
-      {
-        Object o = iter.next();
-        if (o instanceof IAction)
-        {  
-          IAction action = (IAction)o;
-          contribList.add(new ActionContributionItem(action));
-        }
-        else if (o instanceof Separator)
-        {
-          Separator separator = (Separator)o;
-          contribList.add(separator);
-        }  
-      }
-    }
-    else
-    {
-      Action dummyAction = new Action("XSDSeachActionGroup_no_refactoring_available")
-      {
-        // dummy inner class; no methods
-      };
-      dummyAction.setEnabled(false);
-      contribList.add(new ActionContributionItem(dummyAction));
-    }
-    return (IContributionItem[]) contribList.toArray(new IContributionItem[contribList.size()]);        
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java
deleted file mode 100644
index 6466896..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorPart;
-
-//org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchGroupActionDelegate
-public class XSDSearchReferencesGroupActionDelegate extends BaseGroupActionDelegate
-{
-    protected void fillMenu(Menu menu) {
-      try
-      {
-        if (fSelection == null) {
-            return;
-        }  
-        if (workbenchPart instanceof IEditorPart)
-        {            
-          ReferencesSearchGroup referencesGroup = new ReferencesSearchGroup((IEditorPart)workbenchPart);
-          XSDSearchGroupSubMenu subMenu = new XSDSearchGroupSubMenu(referencesGroup);
-          subMenu.fill(menu, -1);
-        }  
-      }
-      catch (Exception e)
-      {
-        e.printStackTrace();
-      }
-    }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateAction.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateAction.java
new file mode 100644
index 0000000..f6f85a1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateAction.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.validation;
+
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
+
+
+
+/**
+ * This class manages the 'UI' related details of validation. Here's a quick
+ * overview of the details : 
+ * - manages Marker creation based on the results of the validation 
+ * - (optionally) displays dialog to summarize the results of validation 
+ * 
+ * @author Lawrence Mandel, IBM
+ * @author Keith Chong, IBM
+ */
+public class ValidateAction extends org.eclipse.wst.xml.ui.internal.validation.core.ValidateAction
+{ 
+  // Property file strings.
+  private static final String _UI_DIALOG_XML_SCHEMA_INVALID_TEXT = "_UI_DIALOG_XML_SCHEMA_INVALID_TEXT";
+  private static final String _UI_DIALOG_XML_SCHEMA_INVALID_TITLE = "_UI_DIALOG_XML_SCHEMA_INVALID_TITLE";
+  private static final String _UI_DIALOG_XML_SCHEMA_VALID_TITLE = "_UI_DIALOG_XML_SCHEMA_VALID_TITLE";
+  private static final String _UI_DIALOG_XML_SCHEMA_VALID_TEXT = "_UI_DIALOG_XML_SCHEMA_VALID_TEXT";
+  private static final String _UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS = "_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS";
+
+  private InputStream inputStream;
+  
+  /**
+   * Constructor.
+   * 
+   * @param file The file to validate.
+   * @param showDialog Whether or not to show a dialog when validation is complete.
+   */
+  public ValidateAction(IFile file, boolean showDialog)
+  {
+    super(file, showDialog);
+  }
+  
+  /*
+   * Store additional information in the message parameters
+   * param[0] = the column number of the error
+   * param[1] = the 'squiggle selection strategy' for which DOM part to squiggle
+   * param[2] = the name or value of what is to be squiggled
+   */
+  protected void addInfoToMessage (ValidationMessage validationMessage, IMessage message)
+  {   
+    if (inputStream != null)
+    {
+      XSDMessageInfoHelper messageInfoHelper = new XSDMessageInfoHelper();
+	  String[] messageInfo = messageInfoHelper.createMessageInfo(validationMessage.getMessage(), validationMessage.getKey());
+
+	  message.setAttribute(COLUMN_NUMBER_ATTRIBUTE, new Integer(validationMessage.getColumnNumber()));
+	  message.setAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE, messageInfo[0]);
+	  message.setAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE, messageInfo[1]);
+    }  
+  }
+  
+  protected void validate(final IFile file)
+  {
+    final ValidationOutcome valoutcome = new ValidationOutcome();
+    IPath path = file.getLocation();
+    final String uri = createURIForFilePath(path.toString());
+    
+    IWorkspaceRunnable op = new IWorkspaceRunnable()
+    {
+
+      public void run(IProgressMonitor progressMonitor) throws CoreException
+      {
+        clearMarkers(file);
+        XSDValidator validator = XSDValidator.getInstance();
+        ValidationReport valreport = validator.validate(uri, inputStream);
+        valoutcome.isValid = valreport.isValid();
+        if(valreport.getValidationMessages().length == 0)
+        {
+          valoutcome.hasMessages = false;
+        }
+        else
+        {
+          valoutcome.hasMessages = true;
+        }
+        createMarkers(file, valreport.getValidationMessages());
+
+        file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
+      }
+    };
+
+    try
+    {
+      ResourcesPlugin.getWorkspace().run(op, null);
+      String internalErrorMessage = null;
+
+      if (showDialog)
+      {
+        if (!valoutcome.isValid)
+        {
+          String message = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_INVALID_TEXT);
+          String title = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_INVALID_TITLE);
+          if (internalErrorMessage != null)
+          {
+            message = message + "\n" + internalErrorMessage;
+          }
+          openErrorDialog(title, message);
+        } 
+        else if (valoutcome.isValid && valoutcome.hasMessages)
+        {
+          String message = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS);
+          String title = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_VALID_TITLE);
+          openWarningDialog(title, message);
+        } 
+        else
+        {
+          String message = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_VALID_TEXT);
+          String title = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_VALID_TITLE);
+          //String message = validator.isGrammarEncountered() ?
+          //                 XSDValidatorManager.getString("_UI_THE_XML_FILE_IS_VALID") :
+          //                XSDValidatorManager.getString("_UI_THE_XML_FILE_IS_WELL_FORMED") +
+          //                 XSDValidatorManager.getString("_UI_NO_GRAMMAR_WARNING");
+          openValidDialog(title, message);
+        }
+      }
+    } 
+
+	catch (CoreException e)
+    {
+    }
+  }
+  public void setInputStream(InputStream inputStream)
+  { this.inputStream = inputStream;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateSchemaActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateSchemaActionDelegate.java
new file mode 100644
index 0000000..5dce0fe
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateSchemaActionDelegate.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IActionDelegate;
+
+/**
+ * Validate schema - from popup
+ */
+public class ValidateSchemaActionDelegate
+       implements IActionDelegate
+{
+  protected ISelection selection;
+
+  public void run(IAction action)
+  {
+  	try {
+  		// CS.. for now the following line tests to ensure the user has xerces jars installed
+        // so that we can perform some 'fail fast' behaviour
+        //
+        Class theClass = Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader());
+        if (theClass == null)
+        {
+         throw(new Exception("Missing Xerces jars in plugin's 'jars' folder"));       
+        }
+
+	    IFile fileResource = null;
+	    if (!selection.isEmpty() && selection instanceof IStructuredSelection)
+	    {
+	      IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+	      Object element = structuredSelection.getFirstElement();
+	
+	      if (element instanceof IFile)
+	      {
+	        fileResource = (IFile) element;
+	      }
+	      else
+	      {
+	        return;
+	      }
+	    }
+	    ValidateAction validateaction = new ValidateAction(fileResource, true);
+	    validateaction.setValidator(new Validator());
+	    validateaction.run();
+  	}
+  	catch (Exception e) {
+        // CS..here's where we need to pop up a dialog to tell the user that xerces is not available
+        //
+        String xercesLine1 = "Required files xercesImpl.jar and xmlParserAPIs.jar cannot be found.\n\n";
+        String xercesLine2 = "Download Xerces 2.6.2 and place xercesImpl.jar and xmlParserAPIs.jar in a folder entitled jars in the org.eclipse.wst.xml.validation plugin.\n\n";
+        String xercesLine3 = "For more information see www.eclipse.org/webtools/wst/components/xml/xercesInfo.xml.";
+        MessageDialog.openError(Display.getDefault().getActiveShell(), "Missing Xerces", xercesLine1 + xercesLine2 + xercesLine3);
+  	}
+  }
+
+  public void selectionChanged(IAction action, ISelection selection)
+  {
+    this.selection = selection;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/Validator.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/Validator.java
new file mode 100644
index 0000000..b14ec14
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/Validator.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.validation;
+
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.IRuleGroup;
+import org.eclipse.wst.validation.internal.operations.ValidatorManager;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+
+
+public class Validator implements IValidator
+{
+  private final String GET_FILE = "getFile";
+  public final String GET_PROJECT_FILES = "getAllFiles";
+
+  public void validate(IFile file)
+  {
+    ValidateAction validateAction = new ValidateAction(file, false);
+    validateAction.setValidator(this);
+    validateAction.run();	
+  }
+  /**
+   * This is the method which performs the validation on the MOF model.
+   * <br><br>
+   * <code>helper</code> and <code>reporter</code> may not be null. <code>changedFiles</code> may be null, if a full
+   * build is desired.
+   * <br><br>
+   * <code>helper</code> returns the ifile for the given information in the IFileDelta array
+   * <br><br>
+   * <code>reporter</code> is an instance of an IReporter interface, which is used for interaction with the user.
+   * <br><br>
+   * <code>changedFiles</code> is an array of file names which have changed since the last validation. 
+   * If <code>changedFiles</code> is null, or if it is an empty array, then a full build
+   * is performed. Otherwise, validation on just the files listed in the Vector is performed.
+   */
+  public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
+	 String[] changedFiles = helper.getURIs();
+     if (changedFiles != null && changedFiles.length > 0) 
+    {
+      for (int i = 0; i < changedFiles.length; i++) 
+      {
+        String fileName = changedFiles[i];
+        if (fileName != null)
+        {
+          Object []parms = {fileName};
+
+          IFile file = (IFile) helper.loadModel(GET_FILE, parms);
+          if (file != null && shouldValidate(file)) 
+          {            
+            //the helper might not have the file stored in it. could have an InputStream          
+            if (helper.loadModel("inputStream") instanceof InputStream)
+            {
+              validate(file, (InputStream)helper.loadModel("inputStream"), reporter); //do we need the fileName?  what is int ruleGroup?
+            }                    
+            else
+            {  
+              //if (((Helper)helper).isInJavaBuildPath(file) &&
+              //    !((AWorkbenchHelper)helper).isInJavaSourcePath(file))
+              //{
+              //  continue;
+              //}
+              validateIfNeeded(file, helper, reporter);
+            }
+          }
+        }
+      }
+    }
+    else 
+    {
+      Object []parms = {this.getClass().getName()};
+      Collection files = (Collection) helper.loadModel(GET_PROJECT_FILES, parms);
+      Iterator iter = files.iterator();
+      while (iter.hasNext()) 
+      {
+        IFile file = (IFile) iter.next();
+        if(shouldValidate(file))
+        {
+          validateIfNeeded(file, helper, reporter);
+        }
+      }
+    }
+  }
+  
+ 
+  private void validate(IFile file, InputStream inputStream, IReporter reporter)
+  {  
+    ValidateAction validateAction = new ValidateAction(file, false);
+    validateAction.setValidator(this);
+    if (inputStream != null)
+    {
+      validateAction.setInputStream(inputStream);
+      validateAction.setReporter(reporter);
+    }
+    validateAction.run();    
+  }
+  
+  protected void validateIfNeeded(IFile file, IValidationContext helper, IReporter reporter)
+  {
+    ValidatorManager mgr = ValidatorManager.getManager();
+ 
+    Integer ruleGroupInt = (Integer)helper.loadModel(IRuleGroup.PASS_LEVEL, null); // pass in a "null" so that loadModel doesn't attempt to cast the result into a RefObject
+    int ruleGroup = (ruleGroupInt == null) ? IRuleGroup.PASS_FULL : ruleGroupInt.intValue();
+
+    Object stream = helper.loadModel("inputStream");
+    if (stream instanceof InputStream)
+    {
+      validate(file, (InputStream)stream, reporter);      
+    } 
+    else
+    {  
+      validate(file, null, reporter);
+    }  
+  }
+  
+  /**
+   * Unpacks the fileModelPair and returns an IFile object.
+   */
+  //protected IFile getFile(Object object)
+  //{
+  //  IFile result = null;
+  //  if (object instanceof List)
+  //  {
+  //    List fileModelPair = (List)object;
+  //    if (fileModelPair.size()>0)
+  //    {
+  //      Object file = fileModelPair.get(0);
+  //      if (file instanceof IFile)
+  //      {
+  ///        result = (IFile)file;
+  //      }
+  //    }
+  //  }
+  //  return result;
+ // } 
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wtp.validation.core.IValidator#cleanup(org.eclipse.wtp.validation.core.IReporter)
+   */
+  public void cleanup(IReporter reporter)
+  {
+  }
+
+  boolean shouldValidate(IFile file) {
+    IResource resource = file;
+    do {
+      if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
+        return false;
+      }
+      resource = resource.getParent();
+    }
+	while ((resource.getType() & IResource.PROJECT) == 0 && (resource.getType() & IResource.ROOT) == 0);
+	return true;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDMessageInfoHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDMessageInfoHelper.java
new file mode 100644
index 0000000..3c7307a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDMessageInfoHelper.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.validation;
+
+
+/**
+ * @author Mark Hutchinson
+ * 
+ * The XSDMessageInfoHelper creates a string with the
+ */
+public class XSDMessageInfoHelper
+{
+  public XSDMessageInfoHelper()
+  { super();
+  }
+
+  public String[] createMessageInfo(String errorMessage, String errorKey)
+  { 
+    //Now map the error key to what we would want to underline:
+    String nameOrValue = "";
+    String selectionStrategy = "";
+    if (errorKey.equals("s4s-elt-invalid-content.1") || errorKey.equals("s4s-elt-must-match.1") || errorKey.equals("s4s-att-must-appear") || errorKey.equals("s4s-elt-invalid-content.2"))
+    { selectionStrategy = "START_TAG";
+    }
+    else if (errorKey.equals("s4s-att-not-allowed"))
+    { selectionStrategy = "ATTRIBUTE_NAME";
+      nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
+    }
+    else if (errorKey.equals("s4s-att-invalid-value"))
+    { selectionStrategy = "ATTRIBUTE_VALUE";
+      nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
+    }
+    else if (errorKey.equals("s4s-elt-character"))
+    { selectionStrategy = "TEXT";
+    }
+    else if (errorKey.equals("src-resolve.4.2") || errorKey.equals("src-resolve"))
+    { selectionStrategy = "VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE";
+      nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
+    }
+    String messageInfo[] = new String[2];
+    messageInfo[0] = selectionStrategy;
+    messageInfo[1] = nameOrValue;
+    return messageInfo;    
+  }
+
+  /*
+   * Mark Hutchinson
+   * 
+   * This method is used to get the value between the first pair of single quotes
+   * It is used to extract information from the error Message (for example
+   * an attribute name)
+   */
+  private String getFirstStringBetweenSingleQuotes(String s)
+  {
+    int first = s.indexOf("'");
+    int second = s.indexOf("'", first + 1);
+    String betweenQuotes = null;
+    if (first != -1 && second != -1)
+    { betweenQuotes = s.substring(first + 1, second);
+    }
+    return betweenQuotes;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidator.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidator.java
new file mode 100644
index 0000000..899f21d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidator.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.validation;
+
+import java.io.InputStream;
+
+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
+
+
+/**
+ * An XSD validator specific to Eclipse. This validator will wrap the internal
+ * XSD validator an provide automatic URI resolver support.
+ * Using this class is equivalent to using the internal XSD validator and registering
+ * the URI resolver.
+ */
+public class XSDValidator
+{
+  private static XSDValidator instance = null;
+  private org.eclipse.wst.xsd.core.internal.validation.XSDValidator validator = null;
+  
+  /**
+   * Return the one and only instance of the XSD validator. The validator
+   * can be reused and cannot be customized so there should only be one instance of it.
+   * 
+   * @return The one and only instance of the XSD validator.
+   */
+  public static XSDValidator getInstance()
+  {
+    if(instance == null)
+    {
+      instance = new XSDValidator();
+    }
+    return instance;
+  }
+  /**
+   * Constructor. Create the XSD validator and set the URI resolver.
+   */
+  protected XSDValidator()
+  {
+    validator = new org.eclipse.wst.xsd.core.internal.validation.XSDValidator();
+    validator.setURIResolver(URIResolverPlugin.createResolver());
+  }
+  /**
+   * Validate the file at the given URI.
+   * 
+   * @param uri The URI of the file to validate.
+   */
+  /*public ValidationReport validate(String uri)
+  {
+    return validator.validate(uri);
+  }*/
+  public ValidationReport validate(String uri, InputStream inputStream)
+  {
+    return validator.validate(uri, inputStream);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidatorManager.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidatorManager.java
new file mode 100644
index 0000000..d19ad1c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidatorManager.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.validation;
+
+import java.io.IOException;
+import java.net.URL;
+import java.text.MessageFormat;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.wst.xsd.core.internal.XSDCorePlugin;
+
+public class XSDValidatorManager extends AbstractUIPlugin 
+{
+  protected static XSDValidatorManager plugin;
+ 
+  public XSDValidatorManager(IPluginDescriptor descriptor) 
+  {
+    super(descriptor);
+    plugin = this;
+
+  }
+
+  /**
+   * Copy the w3c XMLSchema.dtd and datatypes.dtd into the plugin metadata directory
+   * for validation purposes
+   */
+  public void startup()
+  {
+    //ModelManagerPlugin plugin = (ModelManagerPlugin) Platform.getPlugin(ModelManagerPlugin.ID);
+    //modelManager = plugin.getModelManager();
+  }
+
+  //private static ModelManager modelManager;
+  //public static ModelManager getModelManager()
+  //{
+  //  return modelManager;
+  //}
+
+  /**
+   * Get the Install URL
+   */
+  public static URL getInstallURL()
+  {
+    return XSDCorePlugin.getDefault().getDescriptor().getInstallURL();
+  }
+
+  /**
+   * Return the plugin physical directory location
+   */
+  public static IPath getPluginLocation()
+  {
+    try 
+    {
+      IPath installPath = new Path(getInstallURL().toExternalForm()).removeTrailingSeparator();
+      String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile();
+      return new Path(installStr);
+    } 
+    catch (IOException e) 
+    {
+
+    }
+    return null;
+  }
+
+  /**
+   * Get the metadata directory for this plugin
+   */
+  //public static String getMetaDataDirectory()
+  //{
+  //  return getPlugin().getStateLocation().toOSString();
+  //}
+
+  /** 
+   *  Get the one xmlschema package.
+   */
+//   public XMLSchemaPackage getXMLSchemaPackage()
+//   {
+//     return xmlschemaPackage;
+//   }
+
+//   /** 
+//    *  Get the one xmlschema factory.
+//    */
+//   public XMLSchemaFactory getXMLSchemaFactory()
+//   {
+//     return (XMLSchemaFactory)xmlschemaPackage.getEFactoryInstance();
+//   }
+
+  /**
+   * Get the singleton instance.
+   */
+  public static XSDValidatorManager getInstance()
+  {
+    return plugin;
+  }
+
+
+  //public static Image getXSDImage(String iconName)
+  //{
+  //  return getPlugin().getImage(iconName);
+  //}
+
+  /**
+   * Get resource string
+   */
+  public static String getString(String key)
+  {
+    return XSDCorePlugin.getDefault().getDescriptor().getResourceBundle().getString(key);
+  }
+
+  /**
+   * Get resource string
+   */
+  public static String getString(String key, String arg0)
+  {
+    return MessageFormat.format(getString(key), new Object [] { arg0 });
+  }
+  
+  /**
+   * Get resource string
+   */
+  public static String getString(String key, String arg0, String arg1)
+  {
+    return MessageFormat.format(getString(key), new Object [] { arg0, arg1 });
+  }
+  public IWorkspace getWorkspace()
+  {
+    return ResourcesPlugin.getWorkspace();
+  }
+
+  //public static Shell getShell() 
+  //{	
+  //  return getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell();
+  //}
+
+  /**
+   * Get the xml schema default namespace prefix
+   */
+  //public String getXMLSchemaPrefix()
+  //{
+  //  return getPreferenceStore().getString(CONST_XSD_DEFAULT_PREFIX_TEXT);
+  //}
+
+  /**
+   * Get the xml schema language qualification
+   */
+  //public boolean isQualifyXMLSchemaLanguage()
+  //{
+  //  return getPreferenceStore().getBoolean(CONST_XSD_LANGUAGE_QUALIFY);
+  //}
+  
+
+  
+  public static final String CONST_XSD_DEFAULT_PREFIX_TEXT = "org.eclipse.wst.xmlschema.xsdDefaultPrefixText";
+  public static final String CONST_XSD_LANGUAGE_QUALIFY = "org.eclipse.wst.xmlschema.xsdQualify";
+  
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/Logger.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/Logger.java
new file mode 100644
index 0000000..3ba5a01
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/Logger.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.Bundle;
+
+/**
+ * Small convenience class to log messages to plugin's log file and also, if
+ * desired, the console. This class should only be used by classes in this
+ * plugin. Other plugins should make their own copy, with appropriate ID.
+ */
+public class Logger {
+	private static final String PLUGIN_ID = "org.eclipse.wst.xsd.ui"; //$NON-NLS-1$
+	
+	public static final int ERROR = IStatus.ERROR; // 4
+	public static final int ERROR_DEBUG = 200 + ERROR;
+	public static final int INFO = IStatus.INFO; // 1
+	public static final int INFO_DEBUG = 200 + INFO;
+
+	public static final int OK = IStatus.OK; // 0
+
+	public static final int OK_DEBUG = 200 + OK;
+
+	private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
+	public static final int WARNING = IStatus.WARNING; // 2
+	public static final int WARNING_DEBUG = 200 + WARNING;
+
+	/**
+	 * Adds message to log.
+	 * 
+	 * @param level
+	 *            severity level of the message (OK, INFO, WARNING, ERROR,
+	 *            OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
+	 * @param message
+	 *            text to add to the log
+	 * @param exception
+	 *            exception thrown
+	 */
+	protected static void _log(int level, String message, Throwable exception) {
+		if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
+			if (!isDebugging())
+				return;
+		}
+
+		int severity = IStatus.OK;
+		switch (level) {
+			case INFO_DEBUG :
+			case INFO :
+				severity = IStatus.INFO;
+				break;
+			case WARNING_DEBUG :
+			case WARNING :
+				severity = IStatus.WARNING;
+				break;
+			case ERROR_DEBUG :
+			case ERROR :
+				severity = IStatus.ERROR;
+		}
+		message = (message != null) ? message : "null"; //$NON-NLS-1$
+		Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
+		Bundle bundle = Platform.getBundle(PLUGIN_ID);
+		if (bundle != null) 
+			Platform.getLog(bundle).log(statusObj);
+	}
+
+	/**
+	 * Prints message to log if category matches /debug/tracefilter option.
+	 * 
+	 * @param message
+	 *            text to print
+	 * @param category
+	 *            category of the message, to be compared with
+	 *            /debug/tracefilter
+	 */
+	protected static void _trace(String category, String message, Throwable exception) {
+		if (isTracing(category)) {
+			message = (message != null) ? message : "null"; //$NON-NLS-1$
+			Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
+			Bundle bundle = Platform.getBundle(PLUGIN_ID);
+			if (bundle != null) 
+				Platform.getLog(bundle).log(statusObj);
+		}
+	}
+
+	/**
+	 * @return true if the platform is debugging
+	 */
+	public static boolean isDebugging() {
+		return Platform.inDebugMode();
+	}
+
+	/**
+	 * Determines if currently tracing a category
+	 * 
+	 * @param category
+	 * @return true if tracing category, false otherwise
+	 */
+	public static boolean isTracing(String category) {
+		if (!isDebugging())
+			return false;
+
+		String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
+		if (traceFilter != null) {
+			StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
+			while (tokenizer.hasMoreTokens()) {
+				String cat = tokenizer.nextToken().trim();
+				if (category.equals(cat)) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	public static void log(int level, String message) {
+		_log(level, message, null);
+	}
+
+	public static void log(int level, String message, Throwable exception) {
+		_log(level, message, exception);
+	}
+
+	public static void logException(String message, Throwable exception) {
+		_log(ERROR, message, exception);
+	}
+
+	public static void logException(Throwable exception) {
+		_log(ERROR, exception.getMessage(), exception);
+	}
+
+	public static void trace(String category, String message) {
+		_trace(category, message, null);
+	}
+
+	public static void traceException(String category, String message, Throwable exception) {
+		_trace(category, message, exception);
+	}
+
+	public static void traceException(String category, Throwable exception) {
+		_trace(category, exception.getMessage(), exception);
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/StructuredTextViewerConfigurationXSD.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/StructuredTextViewerConfigurationXSD.java
new file mode 100644
index 0000000..1b68b13
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/StructuredTextViewerConfigurationXSD.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
+import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
+
+/**
+ * Configuration for editing XSD content type
+ */
+public class StructuredTextViewerConfigurationXSD extends StructuredTextViewerConfigurationXML {
+	public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
+		if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
+			return null;
+
+		List allDetectors = new ArrayList(0);
+		// add XSD Hyperlink detector
+		allDetectors.add(new XSDHyperlinkDetector());
+
+		IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
+		for (int m = 0; m < superDetectors.length; m++) {
+			IHyperlinkDetector detector = superDetectors[m];
+			if (!allDetectors.contains(detector)) {
+				allDetectors.add(detector);
+			}
+		}
+		return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java
new file mode 100644
index 0000000..3c90b21
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java
@@ -0,0 +1,250 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorActionBarContributor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.RetargetAction;
+import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+import org.eclipse.ui.texteditor.RetargetTextEditorAction;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
+import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
+import org.eclipse.wst.xsd.ui.internal.actions.ISchemaEditorActionConstants;
+import org.eclipse.wst.xsd.ui.internal.actions.ReloadDependenciesAction;
+import org.eclipse.wst.xsd.ui.internal.actions.SourcePageActionContributor;
+import org.eclipse.wst.xsd.ui.internal.refactor.actions.RefactorActionGroup;
+
+public class XSDActionBarContributor extends MultiPageEditorActionBarContributor
+{
+  protected XSDEditor xsdEditor;
+  protected ITextEditor textEditor;
+  protected IEditorActionBarContributor sourceViewerActionContributor = null;
+  
+  protected ReloadDependenciesAction reloadDependenciesAction;
+  
+  protected List fPartListeners= new ArrayList();
+
+  protected RetargetAction retargetReloadDependenciesAction;
+  private RetargetTextEditorAction renameElementAction = null;
+  private IMenuManager refactorMenu = null;
+ 
+  /**
+   * Constructor for XSDActionBarContributor.
+   */
+  public XSDActionBarContributor()
+  {
+    super();
+    
+    sourceViewerActionContributor = new SourcePageActionContributor();
+
+    // Reload Dependencies
+    reloadDependenciesAction = new ReloadDependenciesAction(XSDEditorPlugin.getXSDString("_UI_MENU_RELOAD_DEPENDENCIES"));
+    retargetReloadDependenciesAction = new RetargetAction(ISchemaEditorActionConstants.RETARGET_RELOAD_DEPENDENCIES_ACTION_ID, XSDEditorPlugin.getXSDString("_UI_MENU_RELOAD_DEPENDENCIES"));
+    retargetReloadDependenciesAction.setToolTipText(XSDEditorPlugin.getXSDString("_UI_MENU_RELOAD_DEPENDENCIES_TOOLTIP"));
+    retargetReloadDependenciesAction.setImageDescriptor(
+        ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin().getClass(), "icons/reloadgrammar.gif"));
+    fPartListeners.add(retargetReloadDependenciesAction);
+    
+    ResourceBundle bundle = Platform.getResourceBundle(XSDEditorPlugin.getPlugin().getBundle());
+	renameElementAction = new RetargetTextEditorAction(bundle, ISchemaEditorActionConstants.RETARGET_RENAME_ELEMENT_ACTION_ID + StructuredTextEditorActionConstants.DOT);
+	renameElementAction.setActionDefinitionId("org.eclipse.wst.xsd.ui.refactor.rename.element"); // TODO: add to contstants command id
+		
+	// the refactor menu, add the menu itself to add all refactor actions
+	refactorMenu = new MenuManager(XSDEditorPlugin.getXSDString("refactoring.menu.label"), RefactorActionGroup.MENU_ID); //TODO: externalize string
+	refactorMenu.add(this.renameElementAction);
+  }
+
+  protected void updateActions()
+  {
+    if (xsdEditor != null && xsdEditor.getCurrentPageType().equals(XSDEditorPlugin.GRAPH_PAGE))
+    {
+      IAction deleteAction = xsdEditor.getGraphViewer().getComponentViewer().getMenuListener().getDeleteAction();
+      getActionBars().setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
+
+      IAction printGraphAction = xsdEditor.getGraphViewer().getPrintGraphAction();
+      getActionBars().setGlobalActionHandler(ActionFactory.PRINT.getId(), printGraphAction);
+    }
+    else
+    {
+      getActionBars().setGlobalActionHandler(ActionFactory.DELETE.getId(), null);      
+      // always enable print regardless of whether we are on source or design
+      updateAction(ActionFactory.PRINT.getId(), ITextEditorActionConstants.PRINT, true);
+    }
+  }
+      
+  public void setActivePage(IEditorPart activeEditor)
+  {
+    updateActions();
+    
+    if (activeEditor != null && activeEditor instanceof StructuredTextEditor)
+    {
+      activateSourcePage(activeEditor, true);
+    }
+    else
+    {
+      activateSourcePage(xsdEditor, false);
+    }
+
+    IActionBars actionBars = getActionBars();
+    if (actionBars != null) {
+      // update menu bar and tool bar
+      actionBars.updateActionBars();
+    }
+    
+    updateAction(IWorkbenchActionConstants.UNDO, ITextEditorActionConstants.UNDO, true);
+    updateAction(IWorkbenchActionConstants.REDO, ITextEditorActionConstants.REDO, true);
+
+    getActionBars().updateActionBars();
+  }
+  
+  protected void activateSourcePage(IEditorPart activeEditor, boolean state)
+  {
+    if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)
+    {
+      sourceViewerActionContributor.setActiveEditor(activeEditor);
+      ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(state);
+    }
+  }
+
+  protected void updateAction(String globalActionId, String textEditorActionId, boolean enable)
+  {
+    getActionBars().setGlobalActionHandler(globalActionId,
+                                      enable ? getAction(textEditor, textEditorActionId) :
+                                               null);
+  }
+
+  /**
+   * Returns the action registed with the given text editor.
+   * @return IAction or null if editor is null.
+   */
+  protected IAction getAction(ITextEditor editor, String actionID)
+  {
+    try
+    {
+      return (editor == null ? null : editor.getAction(actionID));
+    }
+    catch (Exception e)
+    {
+      return null;
+    }
+  }
+
+  public void addToMenu(IMenuManager menuManager)
+  {
+    MenuManager treeMenu = new MenuManager(XSDEditorPlugin.getXSDString("_UI_MENU_XSD_EDITOR"));
+    menuManager.insertAfter(IWorkbenchActionConstants.MB_ADDITIONS, treeMenu);
+
+    treeMenu.add(new Separator("group1"));
+//  Add retarget actions
+
+    treeMenu.add(retargetReloadDependenciesAction);
+
+    treeMenu.add(new Separator("group2"));
+  }
+
+
+public void addToToolBar(IToolBarManager toolBarManager)
+  {
+    toolBarManager.add(new Separator("XMLSchema.2"));
+//  Add retarget actions
+    toolBarManager.add(retargetReloadDependenciesAction);
+
+    toolBarManager.add(new Separator("XMLSchema.1"));
+
+    toolBarManager.add(new Separator());
+  }
+  
+  public void contributeToToolBar(IToolBarManager toolBarManager)
+  {
+    addToToolBar(toolBarManager);
+  }
+  
+  public void contributeToMenu(IMenuManager menuManager)
+  {
+    addToMenu(menuManager);
+  }
+  
+  /**
+   * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(IEditorPart)
+   */
+  public void setActiveEditor(IEditorPart targetEditor)
+  {
+    if (targetEditor instanceof XSDEditor)
+    {
+      xsdEditor = (XSDEditor) targetEditor;
+      reloadDependenciesAction.setEditor((XSDEditor)targetEditor);
+
+      textEditor = ((XSDEditor)targetEditor).getTextEditor();
+      if (textEditor != null)
+      {      
+         
+        renameElementAction.setAction(getAction(textEditor, ISchemaEditorActionConstants.RETARGET_RENAME_ELEMENT_ACTION_ID));
+        updateActions();  
+        getActionBars().updateActionBars();
+      }
+    }
+    super.setActiveEditor(targetEditor);
+    
+    updateAction(IWorkbenchActionConstants.UNDO, ITextEditorActionConstants.UNDO, true);
+    updateAction(IWorkbenchActionConstants.REDO, ITextEditorActionConstants.REDO, true);
+  }
+
+  public void init(IActionBars bars, IWorkbenchPage page)
+  {
+    Iterator e = fPartListeners.iterator();
+    while (e.hasNext())
+    {
+      page.addPartListener((RetargetAction) e.next());
+    }
+
+    // register actions that have a dynamic editor. 
+
+    bars.setGlobalActionHandler(ISchemaEditorActionConstants.RETARGET_RELOAD_DEPENDENCIES_ACTION_ID, reloadDependenciesAction);
+    
+    initSourceViewerActionContributor(bars);
+    
+    super.init(bars, page);
+  }
+  
+  protected void initSourceViewerActionContributor(IActionBars actionBars) {
+    if (sourceViewerActionContributor != null)
+      sourceViewerActionContributor.init(actionBars, getPage());
+  }
+
+  
+  public void dispose()
+  {
+    super.dispose();
+    
+    if (sourceViewerActionContributor != null)
+      sourceViewerActionContributor.dispose();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlineConfiguration.java
new file mode 100644
index 0000000..09e105e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlineConfiguration.java
@@ -0,0 +1,354 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
+import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
+import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xsd.ui.internal.actions.OpenSchemaAction;
+import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDContentProvider;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
+import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Outline configuration for XSD
+ */
+public class XSDContentOutlineConfiguration extends ContentOutlineConfiguration {
+	private XSDContentProvider fContentProvider;
+	private ILabelProvider fLabelProvider;
+	private KeyListener[] fKeyListeners = null;
+	private IMenuListener fMenuListener = null;
+	private XSDEditor fEditor = null;
+	private TreeViewer treeViewer;
+	protected SelectionManagerSelectionChangeListener selectionManagerSelectionChangeListener = new SelectionManagerSelectionChangeListener();
+	
+	public XSDContentOutlineConfiguration()
+	{
+		super();
+	}
+
+	public IContentProvider getContentProvider(TreeViewer viewer) {
+		if (fContentProvider == null) {
+			fContentProvider = new XSDContentProvider(XSDModelAdapterFactoryImpl.getInstance());
+		}
+		this.treeViewer = viewer;
+		getXSDEditor().getSelectionManager().addSelectionChangedListener(selectionManagerSelectionChangeListener);
+		return fContentProvider;
+	}
+
+	public ILabelProvider getLabelProvider(TreeViewer viewer) {
+		if (fLabelProvider == null) {
+			fLabelProvider = new XSDAdapterFactoryLabelProvider(XSDModelAdapterFactoryImpl.getInstance());
+		}
+		return fLabelProvider;
+	}
+
+	public IMenuListener getMenuListener(TreeViewer viewer) {
+		if (fMenuListener == null) {
+			// ISSUE: what happens if cannot get XSD Editor? (See
+			// getXSDEditor comment)
+			if (getXSDEditor() != null)
+				fMenuListener = new XSDMenuListener(getXSDEditor().getSelectionManager());
+		}
+		return fMenuListener;
+	}
+
+	public KeyListener[] getKeyListeners(TreeViewer viewer) {
+		if (fKeyListeners == null) {
+			final TreeViewer finalViewer = viewer;
+			KeyAdapter keyListener = new KeyAdapter() {
+				public void keyReleased(KeyEvent e) {
+					if (e.character == SWT.DEL) {
+						IMenuListener menuListener = getMenuListener(finalViewer);
+						if (menuListener instanceof XSDMenuListener)
+							((XSDMenuListener) menuListener).getDeleteAction().run();
+					}
+					else if (e.keyCode == SWT.F3) // open editor on any
+					// include/import/redefine
+					{
+						if (e.widget instanceof Tree) {
+							Tree tree = (Tree) e.widget;
+							TreeItem[] selection = tree.getSelection();
+							if (selection.length > 0) {
+								if (selection[0].getData() instanceof XSDSchemaDirective) {
+									XSDSchemaDirective comp = (XSDSchemaDirective) selection[0].getData();
+									OpenSchemaAction openSchema = new OpenSchemaAction(XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), comp);
+									openSchema.run();
+								}
+							}
+						}
+					}
+				}
+			};
+			fKeyListeners = new KeyListener[]{keyListener};
+		}
+
+		return fKeyListeners;
+	}
+
+	public ISelection getSelection(TreeViewer viewer, ISelection selection) {
+		ISelection sel = selection;
+
+		if (selection instanceof IStructuredSelection) {
+			List xsdSelections = new ArrayList();
+			for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) {
+				Object domNode = i.next();
+				Object xsdNode = getXSDNode(domNode, viewer);
+				if (xsdNode != null) {
+					xsdSelections.add(xsdNode);
+				}
+			}
+
+			if (!xsdSelections.isEmpty()) {
+				sel = new StructuredSelection(xsdSelections);
+			}
+		}
+		return sel;
+	}
+
+	/**
+	 * Determines XSD node based on object (DOM node)
+	 * 
+	 * @param object
+	 * @return
+	 */
+	private Object getXSDNode(Object object, TreeViewer viewer) {
+		// get the element node
+		Element element = null;
+		if (object instanceof Node) {
+			Node node = (Node) object;
+			if (node != null) {
+				if (node.getNodeType() == Node.ELEMENT_NODE) {
+					element = (Element) node;
+				}
+				else if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
+					element = ((Attr) node).getOwnerElement();
+				}
+			}
+		}
+		Object o = element;
+		if (element != null) {
+			Object modelObject = getXSDSchema(viewer).getCorrespondingComponent(element);
+			if (modelObject != null) {
+				o = modelObject;
+			}
+		}
+		return o;
+	}
+
+	/**
+	 * Gets the xsd schema from treeviewer's input
+	 * 
+	 * @param model
+	 *            (of type Object but really should be IStructuredModel)
+	 * @return Definition
+	 */
+	private XSDSchema getXSDSchema(TreeViewer viewer) {
+		XSDSchema xsdSchema = null;
+		Object model = null;
+		if (viewer != null)
+			model = viewer.getInput();
+
+		if (model instanceof IDOMModel) {
+			IDOMDocument domDoc = ((IDOMModel) model).getDocument();
+			if (domDoc != null) {
+				XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
+				/*
+				 * ISSUE: Didn't want to go through initializing schema if it
+				 * does not already exist, so just attempted to get existing
+				 * adapter. If doesn't exist, just don't bother working.
+				 */
+				if (modelAdapter != null)
+					xsdSchema = modelAdapter.getSchema();
+			}
+		}
+		return xsdSchema;
+	}
+
+	// ISSUE: There are some cases where outline comes up before editor
+	private XSDEditor getXSDEditor() {
+		if (fEditor == null) {
+			IWorkbench workbench = PlatformUI.getWorkbench();
+			if (workbench != null) {
+				IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+				if (window != null) {
+					IWorkbenchPage page = window.getActivePage();
+					if (page != null) {
+						IEditorPart editor = page.getActiveEditor();
+						if (editor instanceof XSDEditor)
+							fEditor = (XSDEditor) editor;
+					}
+				}
+			}
+		}
+		return fEditor;
+	}
+
+	protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
+       IContributionItem[] items = super.createMenuContributions(viewer);
+		
+	   referenceAction = new FilterAction(XSDEditorPlugin.getPlugin().getPreferenceStore(), "referenceContentAction", new ReferenceFilter("Reference Content"), XSDEditorPlugin.getXSDString("_UI_OUTLINE_SHOW_REFERENCES"), ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin().getClass(), "icons/XSDElementRef.gif"));
+       boolean initialRef = getXSDEditor().getXSDModelAdapterFactory().getShowReferences();
+       referenceAction.setChecked(initialRef);
+
+       inheritedAction = new FilterAction(XSDEditorPlugin.getPlugin().getPreferenceStore(), "inheritedContentAction", new ReferenceFilter("Inherited Content"), XSDEditorPlugin.getXSDString("_UI_OUTLINE_SHOW_INHERITED"), ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin().getClass(), "icons/XSDComplexContent.gif"));
+		
+	   IContributionItem toggleReferenceItem = new PropertyChangeUpdateActionContributionItem(referenceAction);
+	   IContributionItem toggleInheritedItem = new PropertyChangeUpdateActionContributionItem(inheritedAction);
+	    
+	   List list = new ArrayList();
+	   list.addAll(Arrays.asList(items));
+	   list.add(toggleReferenceItem);
+	   list.add(toggleInheritedItem);
+	   
+	   int length = list.size();
+	   IContributionItem[] newItems = new IContributionItem[length];
+	   int i = 0;
+	   for (Iterator iter = list.iterator(); iter.hasNext(); i++)
+	   {
+	     newItems[i] = (IContributionItem)iter.next();
+	   }
+	   
+	   return newItems;
+	}
+	
+	  // expose
+	  public TreeViewer getTreeViewer()
+	  {
+	    return treeViewer;
+	  }
+
+	  FilterAction referenceAction, inheritedAction;
+	  
+	  private void updateActions(Action current)
+	  {
+	    if (referenceAction.isChecked())
+	    {
+	      getXSDEditor().getXSDModelAdapterFactory().setShowReferences(true);
+	    }
+	    else
+	    {
+	      getXSDEditor().getXSDModelAdapterFactory().setShowReferences(false);
+	    }
+	    if (inheritedAction.isChecked())
+	    {
+	      getXSDEditor().getXSDModelAdapterFactory().setShowInherited(true);
+	    }
+	    else
+	    {
+	      getXSDEditor().getXSDModelAdapterFactory().setShowInherited(false);
+	    }
+	    getTreeViewer().refresh();
+	  }
+
+	  public class FilterAction extends PropertyChangeUpdateAction
+	  {
+	    ViewerFilter filter;
+
+	    public FilterAction(IPreferenceStore store, String preference, ViewerFilter filter, String label, ImageDescriptor image)
+	    {
+	      super(label, store, preference, true);
+	      setImageDescriptor(image);
+	      setUpdateFromPropertyChange(false);
+	      this.filter = filter;
+	      setChecked(false);
+	    }
+
+	    public void update()
+	    {
+	      super.update();
+	      updateActions(this);
+	    }
+	  }
+	  
+	  class ReferenceFilter extends ViewerFilter // Dummy filter
+	  {
+	    public ReferenceFilter(String elementTag)
+	    {
+	      this.elementTag = elementTag;
+	    }
+	    protected String elementTag;
+
+	    public boolean select(Viewer viewer, Object parentElement, Object element)
+	    {
+	      return true;
+	    }
+	  }
+	
+	  class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
+	  {
+	    public void selectionChanged(SelectionChangedEvent event)
+	    {
+	      if (event.getSelectionProvider() != getTreeViewer())
+	      {
+	    	StructuredSelection selection = (StructuredSelection)event.getSelection();
+	    	if (selection.getFirstElement() instanceof XSDSchema)
+	    	{
+	    	   StructuredSelection s = (StructuredSelection)getTreeViewer().getSelection();
+	    	   if (!(s.getFirstElement() instanceof CategoryAdapter))
+	    	   {
+	    		 getTreeViewer().setSelection(event.getSelection(), true);
+	    	   }
+	    	}
+	    	else
+	    	{
+	          getTreeViewer().setSelection(event.getSelection(), true);
+	    	}
+	      }
+	    }
+	  }
+
+	  public void unconfigure(TreeViewer viewer) {
+		  super.unconfigure(viewer);
+		  getXSDEditor().getSelectionManager().removeSelectionChangedListener(selectionManagerSelectionChangeListener);
+	  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlinePage.java
new file mode 100644
index 0000000..f6ab990
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlinePage.java
@@ -0,0 +1,561 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.ListenerList;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IPostSelectionProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.IPageSite;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.wst.xsd.ui.internal.actions.OpenSchemaAction;
+import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.w3c.dom.Element;
+
+/**
+ * @deprecated Using SSE's ConfiguratbleContentOutlinePage 
+ * instead via XSDContentOutlineCOnfiguration
+ */
+public class XSDContentOutlinePage extends ContentOutlinePage implements ISelectionListener
+{
+  protected XSDEditor xsdEditor;
+  protected int level = 0;
+  protected Object model;
+  protected ITreeContentProvider contentProvider;
+  protected ILabelProvider labelProvider;
+  protected XSDSelectionManager selectionManager;
+  protected SelectionManagerSelectionChangeListener selectionManagerSelectionChangeListener = new SelectionManagerSelectionChangeListener();
+  protected TreeSelectionChangeListener treeSelectionChangeListener = new TreeSelectionChangeListener();
+  XSDEditor xsdTextEditor;
+  XSDMenuListener menuListener;
+  SelectionProvider fSelectionProvider = null;
+  
+  /**
+   *  
+   */
+  public XSDContentOutlinePage(XSDEditor xsdTextEditor)
+  {
+    super();
+    this.xsdTextEditor = xsdTextEditor;
+    fSelectionProvider = new SelectionProvider();
+  }
+
+  public void init(IPageSite pageSite)
+  {
+  	super.init(pageSite);
+  	getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(this);
+  	getSite().setSelectionProvider(fSelectionProvider);
+  }
+  
+  public void dispose()
+  {
+  	super.dispose();
+  	getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(this);
+  }
+  
+  public void setModel(Object newModel)
+  {
+    model = newModel;
+  }
+
+  public void setContentProvider(ITreeContentProvider contentProvider)
+  {
+    this.contentProvider = contentProvider;
+  }
+
+  public void setLabelProvider(ILabelProvider labelProvider)
+  {
+    this.labelProvider = labelProvider;
+  }
+
+  // expose
+  public TreeViewer getTreeViewer()
+  {
+    return super.getTreeViewer();
+  }
+
+  public void createControl(Composite parent)
+  {
+    super.createControl(parent);
+    getTreeViewer().setContentProvider(contentProvider);
+    getTreeViewer().setLabelProvider(labelProvider);
+    getTreeViewer().setInput(model);
+//    getTreeViewer().addSelectionChangedListener(this);
+    MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
+    menuManager.setRemoveAllWhenShown(true);
+    Menu menu = menuManager.createContextMenu(getTreeViewer().getControl());
+    getTreeViewer().getControl().setMenu(menu);
+    menuListener = new XSDMenuListener(xsdTextEditor.getSelectionManager());
+//  menuListener.setSelectionProvider(getTreeViewer());
+    menuManager.addMenuListener(menuListener);
+    
+    // enable popupMenus extension
+    getSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.outline", menuManager, xsdTextEditor.getSelectionManager());
+
+    setSelectionManager(xsdTextEditor.getSelectionManager());
+    // cs... why are we doing this from the outline view?
+    //
+    //xsdTextEditor.getXSDEditor().getSelectionManager().setSelection(new
+    // StructuredSelection(xsdTextEditor.getXSDSchema()));
+    XSDKeyListener keyListener = new XSDKeyListener(getTreeViewer(), menuListener);
+    getTreeViewer().getControl().addKeyListener(keyListener);
+    // drill down from outline view
+    getTreeViewer().getControl().addMouseListener(new MouseAdapter()
+    {
+      public void mouseDoubleClick(MouseEvent e)
+      {
+        ISelection iSelection = getTreeViewer().getSelection();
+        if (iSelection instanceof StructuredSelection)
+        {
+          StructuredSelection selection = (StructuredSelection)iSelection;
+          Object obj = selection.getFirstElement();
+          if (obj instanceof XSDConcreteComponent)
+          {
+            XSDConcreteComponent comp = (XSDConcreteComponent)obj;
+            if (comp.getContainer() instanceof XSDSchema)
+            {
+              xsdTextEditor.getGraphViewer().setInput(obj);
+            }
+          }
+        }
+
+      }
+    });
+    
+    
+		getTreeViewer().addPostSelectionChangedListener(fSelectionProvider.getPostSelectionChangedListener());
+		getTreeViewer().addSelectionChangedListener(fSelectionProvider.getSelectionChangedListener());
+
+  }
+  class XSDKeyListener extends KeyAdapter
+  {
+    TreeViewer viewer;
+    XSDMenuListener menuListener;
+
+    public XSDKeyListener(TreeViewer viewer, XSDMenuListener menuListener)
+    {
+      super();
+      this.viewer = viewer;
+      this.menuListener = menuListener;
+    }
+
+    /**
+     * @see org.eclipse.swt.events.KeyAdapter#keyReleased(KeyEvent)
+     */
+    public void keyReleased(KeyEvent e)
+    {
+      if (e.character == SWT.DEL)
+      {
+        menuListener.getDeleteAction().run();
+      }
+      else if (e.keyCode == SWT.F3) // open editor on any
+                                    // include/import/redefine
+      {
+        if (e.widget instanceof Tree)
+        {
+          Tree tree = (Tree) e.widget;
+          TreeItem[] selection = tree.getSelection();
+          if (selection.length > 0)
+          {
+            if (selection[0].getData() instanceof XSDSchemaDirective)
+            {
+              XSDSchemaDirective comp = (XSDSchemaDirective) selection[0].getData();
+              OpenSchemaAction openSchema = new OpenSchemaAction(XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), comp);
+              openSchema.run();
+            }
+          }
+        }
+      }
+    }
+  }
+
+  public void setExpandToLevel(int i)
+  {
+    level = i;
+  }
+
+  public void setInput(Object value)
+  {
+    getTreeViewer().setInput(value);
+    getTreeViewer().expandToLevel(level);
+  }
+
+  public void selectionChanged(IWorkbenchPart part, ISelection selection)
+  {
+    if (selectionManager != null)
+    {
+      if (selection instanceof IStructuredSelection)
+      {
+        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+        Object o = structuredSelection.getFirstElement();
+        // TODO ...
+        // we need to implement a selectionManagerMapping extension point
+        // so that extensions can specify how they'd like to map view objects
+        // to selection objects
+        //                                        
+        if (o instanceof Element)
+        {
+          try
+          {
+            Object modelObject = xsdTextEditor.getXSDSchema().getCorrespondingComponent((Element) o);
+            if (modelObject != null)
+            {
+              o = modelObject;
+            }
+          }
+          catch (Exception e)
+          {
+          }
+        }
+        else if (o instanceof CategoryAdapter)
+        {
+          // todo... we need to ensure we eliminate the propagation 
+          // of 'view' specific objects into the SelectionManager.                     
+          // We need to do some work to ensure all views utilize the 'Category' model object  
+          // so we can get rid of this CategoryAdapter class.
+//           CategoryAdapter adapter = (CategoryAdapter) o;
+//           o = adapter.getXSDSchema();
+        }
+        if (o != null)
+        {
+    			if (getControl() != null && !getControl().isDisposed() && !getControl().isFocusControl() && getControl().isVisible()) {
+    				/*
+    				 * Do not allow selection from other parts to affect selection
+    				 * in the tree widget if it has focus. Selection events
+    				 * "bouncing" off of other parts are all that we can receive
+    				 * if we have focus (since we forward selection to the
+    				 * service), and only the user should affect selection if we
+    				 * have focus.
+    				 */
+            getTreeViewer().setSelection(new StructuredSelection(o), true);
+    			}
+          selectionManager.setSelection(new StructuredSelection(o), getTreeViewer());
+//        selectionManager.selectionChanged(new SelectionChangedEvent(getTreeViewer(),new StructuredSelection(o)));
+        }
+        else
+        {
+          // selectionManager.setSelection(new StructuredSelection(),
+          // getTreeViewer());
+        }
+      }
+    }
+  }
+  
+  public void setSelectionManager(XSDSelectionManager newSelectionManager)
+  {
+    TreeViewer treeViewer = getTreeViewer();
+    // disconnect from old one
+    if (selectionManager != null)
+    {
+      selectionManager.removeSelectionChangedListener(selectionManagerSelectionChangeListener);
+      treeViewer.removeSelectionChangedListener(treeSelectionChangeListener);
+    }
+    selectionManager = newSelectionManager;
+    // connect to new one
+    if (selectionManager != null)
+    {
+      selectionManager.addSelectionChangedListener(selectionManagerSelectionChangeListener);
+      treeViewer.addSelectionChangedListener(treeSelectionChangeListener);
+    }
+  }
+  
+  class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
+  {
+    public void selectionChanged(SelectionChangedEvent event)
+    {
+      if (event.getSelectionProvider() != getTreeViewer())
+      {
+        getTreeViewer().setSelection(event.getSelection(), true);
+      }
+    }
+  }
+  class TreeSelectionChangeListener implements ISelectionChangedListener
+  {
+    public void selectionChanged(SelectionChangedEvent event)
+    {
+      if (selectionManager != null)
+      {
+        ISelection selection = event.getSelection();
+        if (selection instanceof IStructuredSelection)
+        {
+          IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+          Object o = structuredSelection.getFirstElement();
+          // TODO ...
+          // we need to implement a selectionManagerMapping extension point
+          // so that extensions can specify how they'd like to map view objects
+          // to selection objects
+          //                                        
+          if (o instanceof Element)
+          {
+            try
+            {
+              Object modelObject = xsdTextEditor.getXSDSchema().getCorrespondingComponent((Element) o);
+              if (modelObject != null)
+              {
+                o = modelObject;
+              }
+            }
+            catch (Exception e)
+            {
+            }
+          }
+          else if (o instanceof CategoryAdapter)
+          {
+            // todo... we need to ensure we eliminate the propagation 
+            // of 'view' specific objects into the SelectionManager.                     
+            // We need to do some work to ensure all views utilize the 'Category' model object  
+            // so we can get rid of this CategoryAdapter class.
+//             CategoryAdapter adapter = (CategoryAdapter) o;
+//             o = adapter.getXSDSchema();
+          }
+          if (o != null)
+          {
+            selectionManager.setSelection(new StructuredSelection(o), getTreeViewer());
+//          selectionManager.selectionChanged(new SelectionChangedEvent(getTreeViewer(),new StructuredSelection(o)));
+          }
+        }
+      }
+    }
+  }
+  FilterAction referenceAction, inheritedAction;
+
+  public void setActionBars(IActionBars actionBars)
+  {
+    super.setActionBars(actionBars);
+    // Uncomment to add sort action
+    //    SortAction sortAction = new SortAction();
+    //
+    //    actionBars.getToolBarManager().add(sortAction);
+    //    sortAction.setChecked(false);
+    referenceAction = new FilterAction(new ReferenceFilter("Reference Content"), XSDEditorPlugin.getXSDString("_UI_OUTLINE_SHOW_REFERENCES"), ImageDescriptor.createFromFile(XSDEditorPlugin
+        .getPlugin().getClass(), "icons/XSDElementRef.gif"));
+    boolean initialRef = xsdTextEditor.getXSDModelAdapterFactory().getShowReferences();
+    referenceAction.setChecked(initialRef);
+    inheritedAction = new FilterAction(new ReferenceFilter("Inherited Content"), XSDEditorPlugin.getXSDString("_UI_OUTLINE_SHOW_INHERITED"), ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin()
+        .getClass(), "icons/XSDComplexContent.gif"));
+    IMenuManager menu = actionBars.getMenuManager();
+    menu.add(referenceAction);
+    menu.add(inheritedAction);
+  }
+
+  private void updateActions(Action current)
+  {
+    if (referenceAction.isChecked())
+    {
+      xsdTextEditor.getXSDModelAdapterFactory().setShowReferences(true);
+    }
+    else
+    {
+      xsdTextEditor.getXSDModelAdapterFactory().setShowReferences(false);
+    }
+    if (inheritedAction.isChecked())
+    {
+      xsdTextEditor.getXSDModelAdapterFactory().setShowInherited(true);
+    }
+    else
+    {
+      xsdTextEditor.getXSDModelAdapterFactory().setShowInherited(false);
+    }
+  }
+  private Sorter sorter = new Sorter();
+  public class Sorter extends org.eclipse.jface.viewers.ViewerSorter
+  {
+  }
+  public class SortAction extends Action
+  {
+    public SortAction()
+    {
+      super("Sort", ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin().getClass(), "icons/sort.gif"));
+    }
+
+    public void run()
+    {
+      getTreeViewer().getControl().setVisible(false);
+      Object[] expandedElements = getTreeViewer().getExpandedElements();
+      getTreeViewer().setSorter(isChecked() ? sorter : null);
+      Object input = getTreeViewer().getInput();
+      getTreeViewer().setInput(input);
+      getTreeViewer().setExpandedElements(expandedElements);
+      getTreeViewer().getControl().setVisible(true);
+    }
+
+    public void setChecked(boolean checked)
+    {
+      super.setChecked(checked);
+      setToolTipText(checked ? XSDEditorPlugin.getXSDString("_UI_OUTLINE_DO_NOT_SORT") : XSDEditorPlugin.getXSDString("_UI_OUTLINE_SORT"));
+    }
+  }
+  public class FilterAction extends Action
+  {
+    ViewerFilter filter;
+
+    public FilterAction(ViewerFilter filter, String label, ImageDescriptor image)
+    {
+      super(label, image);
+      this.filter = filter;
+      setChecked(false);
+    }
+
+    public void run()
+    {
+      updateActions(this);
+      if (isChecked())
+      {
+        getTreeViewer().resetFilters();
+        getTreeViewer().addFilter(filter);
+      }
+      else
+      {
+        getTreeViewer().removeFilter(filter);
+      }
+    }
+  }
+  class ReferenceFilter extends ViewerFilter // Dummy filter
+  {
+    public ReferenceFilter(String elementTag)
+    {
+      this.elementTag = elementTag;
+    }
+    protected String elementTag;
+
+    public boolean select(Viewer viewer, Object parentElement, Object element)
+    {
+      return true;
+    }
+  }
+  
+	/**
+	 * Forwards post-selection from the tree viewer to the listeners while
+	 * acting as this page's selection provider.
+	 */
+	private class SelectionProvider implements IPostSelectionProvider {
+		private class PostSelectionChangedListener implements ISelectionChangedListener {
+			public void selectionChanged(SelectionChangedEvent event) {
+				if (!isFiringSelection()) {
+					fireSelectionChanged(event, postListeners);
+				}
+			}
+		}
+
+		private class SelectionChangedListener implements ISelectionChangedListener {
+			public void selectionChanged(SelectionChangedEvent event) {
+				if (!isFiringSelection()) {
+					fireSelectionChanged(event, listeners);
+				}
+			}
+		}
+
+		private boolean isFiringSelection = false;
+		private ListenerList listeners = new ListenerList();
+		private ListenerList postListeners = new ListenerList();
+		private ISelectionChangedListener postSelectionChangedListener = new PostSelectionChangedListener();
+		private ISelectionChangedListener selectionChangedListener = new SelectionChangedListener();
+
+		public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
+			postListeners.add(listener);
+		}
+
+		public void addSelectionChangedListener(ISelectionChangedListener listener) {
+			listeners.add(listener);
+		}
+
+		public void fireSelectionChanged(final SelectionChangedEvent event, ListenerList listenerList) {
+			isFiringSelection = true;
+			Object[] listeners = listenerList.getListeners();
+			for (int i = 0; i < listeners.length; ++i) {
+				final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
+				Platform.run(new SafeRunnable() {
+					public void run() {
+						l.selectionChanged(event);
+					}
+				});
+			}
+			isFiringSelection = false;
+		}
+
+		public void fireSelectionChanged(final SelectionChangedEvent event) {
+			isFiringSelection = true;
+			Object[] listeners = postListeners.getListeners();
+			for (int i = 0; i < listeners.length; ++i) {
+				final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
+				Platform.run(new SafeRunnable() {
+					public void run() {
+						l.selectionChanged(event);
+					}
+				});
+			}
+			isFiringSelection = false;
+		}
+
+		public ISelectionChangedListener getPostSelectionChangedListener() {
+			return postSelectionChangedListener;
+		}
+
+		public ISelection getSelection() {
+			if (getTreeViewer() != null) {
+				return getTreeViewer().getSelection();
+			}
+			return StructuredSelection.EMPTY;
+		}
+
+		public ISelectionChangedListener getSelectionChangedListener() {
+			return selectionChangedListener;
+		}
+
+		public boolean isFiringSelection() {
+			return isFiringSelection;
+		}
+
+		public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
+			postListeners.remove(listener);
+		}
+
+		public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+			listeners.remove(listener);
+		};
+
+		public void setSelection(ISelection selection) {
+			if (isFiringSelection) {
+				getTreeViewer().setSelection(selection);
+			}
+		};
+	}
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditor.java
new file mode 100644
index 0000000..c8ec401
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditor.java
@@ -0,0 +1,867 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IPostSelectionProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.editors.text.ILocationProvider;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
+import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphViewer;
+import org.eclipse.wst.xsd.ui.internal.properties.section.XSDTabbedPropertySheetPage;
+import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
+import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
+import org.eclipse.wst.xsd.ui.internal.util.OpenOnSelectionHelper;
+import org.eclipse.xsd.XSDComponent;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.ProcessingInstruction;
+
+// public class XSDEditor extends StructuredTextMultiPageEditorPart
+public class XSDEditor extends XSDMultiPageEditorPart implements ITabbedPropertySheetPageContributor {
+	protected StructuredTextEditor textEditor;
+	IFile resourceFile;
+	XSDSelectionManager xsdSelectionManager;
+	XSDModelAdapter schemalNodeAdapter;
+
+	private IStructuredModel result;
+
+	/**
+	 * Listener on SSE's outline page's selections that converts DOM
+	 * selections into wsdl selections and notifies WSDL selection manager
+	 */
+	class OutlineTreeSelectionChangeListener implements ISelectionChangedListener, IDoubleClickListener {
+		public OutlineTreeSelectionChangeListener() {
+		}
+
+		private ISelection getXSDSelection(ISelection selection) {
+			ISelection sel = null;
+			if (selection instanceof IStructuredSelection) {
+				IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+				Object o = structuredSelection.getFirstElement();
+				if (o != null)
+					sel = new StructuredSelection(o);
+			}
+			return sel;
+		}
+
+		/**
+		 * Determines DOM node based on object (xsd node)
+		 * 
+		 * @param object
+		 * @return
+		 */
+		private Object getObjectForOtherModel(Object object) {
+			Node node = null;
+
+			if (object instanceof Node) {
+				node = (Node) object;
+			}
+			else if (object instanceof XSDComponent) {
+				node = ((XSDComponent) object).getElement();
+			}
+			else if (object instanceof CategoryAdapter) {
+				node = ((CategoryAdapter) object).getXSDSchema().getElement();
+			}
+
+			// the text editor can only accept sed nodes!
+			//
+			if (!(node instanceof IDOMNode)) {
+				node = null;
+			}
+			return node;
+		}
+
+		public void doubleClick(DoubleClickEvent event) {
+			/*
+			 * Selection in outline tree changed so set outline tree's
+			 * selection into editor's selection and say it came from outline
+			 * tree
+			 */
+			if (getSelectionManager() != null && getSelectionManager().enableNotify) {
+				ISelection selection = getXSDSelection(event.getSelection());
+				if (selection != null) {
+					getSelectionManager().setSelection(selection, fOutlinePage);
+				}
+
+				if (getTextEditor() != null && selection instanceof IStructuredSelection) {
+					int start = -1;
+					int length = 0;
+					Object o = ((IStructuredSelection) selection).getFirstElement();
+					if (o != null)
+						o = getObjectForOtherModel(o);
+					if (o instanceof IndexedRegion) {
+						start = ((IndexedRegion) o).getStartOffset();
+						length = ((IndexedRegion) o).getEndOffset() - start;
+					}
+					if (start > -1) {
+						getTextEditor().selectAndReveal(start, length);
+					}
+				}
+			}
+		}
+
+		public void selectionChanged(SelectionChangedEvent event) {
+			/*
+			 * Selection in outline tree changed so set outline tree's
+			 * selection into editor's selection and say it came from outline
+			 * tree
+			 */
+			if (getSelectionManager() != null) { // && getSelectionManager().enableNotify) {
+				
+				ISelection selection = getXSDSelection(event.getSelection());
+				if (selection != null) {
+					getSelectionManager().setSelection(selection, fOutlinePage);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Listener on SSE's source editor's selections that converts DOM
+	 * selections into xsd selections and notifies XSD selection manager
+	 */
+	private class SourceEditorSelectionListener implements ISelectionChangedListener {
+		/**
+		 * Determines XSD node based on object (DOM node)
+		 * 
+		 * @param object
+		 * @return
+		 */
+		private Object getXSDNode(Object object) {
+			// get the element node
+			Element element = null;
+			if (object instanceof Node) {
+				Node node = (Node) object;
+				if (node != null) {
+					if (node.getNodeType() == Node.ELEMENT_NODE) {
+						element = (Element) node;
+					}
+					else if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
+						element = ((Attr) node).getOwnerElement();
+					}
+				}
+			}
+			Object o = element;
+			if (element != null) {
+				Object modelObject = getXSDSchema().getCorrespondingComponent(element);
+				if (modelObject != null) {
+					o = modelObject;
+				}
+			}
+			return o;
+		}
+
+		public void selectionChanged(SelectionChangedEvent event) {
+			ISelection selection = event.getSelection();
+			if (selection instanceof IStructuredSelection) {
+				List xsdSelections = new ArrayList();
+				for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) {
+					Object domNode = i.next();
+					Object xsdNode = getXSDNode(domNode);
+					if (xsdNode != null) {
+						xsdSelections.add(xsdNode);
+					}
+				}
+
+				if (!xsdSelections.isEmpty()) {
+					StructuredSelection xsdSelection = new StructuredSelection(xsdSelections);
+					getSelectionManager().setSelection(xsdSelection, getTextEditor().getSelectionProvider());
+				}
+			}
+		}
+	}
+
+	/**
+	 * Listener on XSD's selection manager's selections that converts XSD
+	 * selections into DOM selections and notifies SSE's selection provider
+	 */
+	private class XSDSelectionManagerSelectionListener implements ISelectionChangedListener {
+		/**
+		 * Determines DOM node based on object (xsd node)
+		 * 
+		 * @param object
+		 * @return
+		 */
+		private Object getObjectForOtherModel(Object object) {
+			Node node = null;
+
+			if (object instanceof Node) {
+				node = (Node) object;
+			}
+			else if (object instanceof XSDComponent) {
+				node = ((XSDComponent) object).getElement();
+			}
+			else if (object instanceof CategoryAdapter) {
+				node = ((CategoryAdapter) object).getXSDSchema().getElement();
+			}
+
+			// the text editor can only accept sed nodes!
+			//
+			if (!(node instanceof IDOMNode)) {
+				node = null;
+			}
+			return node;
+		}
+
+		public void selectionChanged(SelectionChangedEvent event) {
+			// do not fire selection in source editor if selection event came
+			// from source editor
+			if (event.getSource() != getTextEditor().getSelectionProvider()) {
+				ISelection selection = event.getSelection();
+				if (selection instanceof IStructuredSelection) {
+					List otherModelObjectList = new ArrayList();
+					for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) {
+						Object modelObject = i.next();
+						Object otherModelObject = getObjectForOtherModel(modelObject);
+						if (otherModelObject != null) {
+							otherModelObjectList.add(otherModelObject);
+						}
+					}
+					if (!otherModelObjectList.isEmpty()) {
+						StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
+						getTextEditor().getSelectionProvider().setSelection(nodeSelection);
+					}
+				}
+			}
+		}
+	}
+
+	public XSDEditor() {
+		super();
+		xsdSelectionManager = new XSDSelectionManager();
+	}
+
+	InternalPartListener partListener = new InternalPartListener(this);
+
+	// show outline view - defect 266116
+	public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
+		super.init(site, editorInput);
+		IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		IWorkbenchPage page = dw.getActivePage();
+		getSite().getPage().addPartListener(partListener);
+		try {
+			if (page != null) {
+				// page.showView("org.eclipse.ui.views.ContentOutline");
+				page.showView("org.eclipse.ui.views.PropertySheet");
+			}
+		}
+		catch (PartInitException e) {
+			// e.printStackTrace();
+		}
+	}
+
+	// For team support
+	// protected PropertyDirtyChangeListener propertyChangeListener;
+
+	/**
+	 * Creates the pages of this multi-page editor.
+	 * <p>
+	 * Subclasses of <code>MultiPageEditor</code> must implement this
+	 * method.
+	 * </p>
+	 */
+	protected void createPages() {
+		try {
+			if (!loadFile())
+				return;
+
+			xsdModelAdapterFactory = XSDModelAdapterFactoryImpl.getInstance();
+			adapterFactoryLabelProvider = new XSDAdapterFactoryLabelProvider(xsdModelAdapterFactory);
+
+			// source page MUST be created before design page, now
+			createSourcePage();
+
+			addSourcePage();
+			buildXSDModel();
+
+			// comment this line out to hide the graph page
+			// 
+			createAndAddGraphPage();
+
+			int pageIndexToShow = getDefaultPageTypeIndex();
+			setActivePage(pageIndexToShow);
+
+			openOnSelectionHelper = new OpenOnSelectionHelper(textEditor, getXSDSchema());
+			// added selection listeners after setting selection to avoid
+			// navigation exception
+			ISelectionProvider provider = getTextEditor().getSelectionProvider();
+			fSourceEditorSelectionListener = new SourceEditorSelectionListener();
+			if (provider instanceof IPostSelectionProvider) {
+				((IPostSelectionProvider) provider).addPostSelectionChangedListener(fSourceEditorSelectionListener);
+			}
+			else {
+				provider.addSelectionChangedListener(fSourceEditorSelectionListener);
+			}
+			fXSDSelectionListener = new XSDSelectionManagerSelectionListener();
+			getSelectionManager().addSelectionChangedListener(fXSDSelectionListener);
+			
+			addCommandStackListener();
+
+			XSDEditorPlugin.getPlugin().getPreferenceStore().addPropertyChangeListener(preferenceStoreListener);
+		}
+		catch (PartInitException e) {
+			// log for now, unless we find reason not to
+			Logger.log(Logger.INFO, e.getMessage());
+		}
+	}
+
+
+	public void buildXSDModel() {
+		try {
+			Document document = ((IDOMModel) getModel()).getDocument();
+
+			boolean schemaNodeExists = document.getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "schema").getLength() == 1;
+
+			if (document.getChildNodes().getLength() == 0 || !schemaNodeExists) {
+				createDefaultSchemaNode(document);
+			}
+
+			if (document instanceof INodeNotifier) {
+				INodeNotifier notifier = (INodeNotifier) document;
+				schemalNodeAdapter = (XSDModelAdapter) notifier.getAdapterFor(XSDModelAdapter.class);
+				if (schemalNodeAdapter == null) {
+					schemalNodeAdapter = new XSDModelAdapter();
+					notifier.addAdapter(schemalNodeAdapter);
+					schemalNodeAdapter.createSchema(document.getDocumentElement());
+				}
+			}
+		}
+		catch (Exception e) {
+			// XSDEditorPlugin.getPlugin().getMsgLogger().write("Failed to
+			// create Model");
+			// XSDEditorPlugin.getPlugin().getMsgLogger().write(e);
+			// e.printStackTrace();
+		}
+
+
+
+		// XSDResourceFactoryImpl.validate(xsdSchema,
+		// input.getFile().getContents(true));
+	}
+
+	public String[] getPropertyCategories() {
+		return new String[]{"general", "namespace", "other", "attributes", "documentation", "facets"}; //$NON-NLS-1$
+	}
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor#getContributorId()
+	 */
+	public String getContributorId() {
+		return "org.eclipse.wst.xsd.ui.internal.XSDEditor";
+		// return getSite().getId();
+	}
+
+	protected CommandStackListener commandStackListener;
+
+	protected void addCommandStackListener() {
+		if (commandStackListener == null) {
+			IStructuredTextUndoManager undoManager = getModel().getUndoManager();
+			commandStackListener = new CommandStackListener() {
+				/**
+				 * @see org.eclipse.emf.common.command.CommandStackListener#commandStackChanged(EventObject)
+				 */
+				public void commandStackChanged(EventObject event) {
+					Object obj = event.getSource();
+					if (obj instanceof BasicCommandStack) {
+						BasicCommandStack stack = (BasicCommandStack) obj;
+						Command recentCommand = stack.getMostRecentCommand();
+						Command redoCommand = stack.getRedoCommand();
+						Command undoCommand = stack.getUndoCommand();
+						if (recentCommand == redoCommand) {
+							// there must have been an undo reset info tasks
+							resetInformationTasks();
+						}
+					}
+				}
+			};
+
+			// TODO WTP Port
+			// undoManager.getCommandStack().addCommandStackListener(commandStackListener);
+
+		}
+	}
+
+	protected void pageChange(int arg) {
+		super.pageChange(arg);
+	}
+
+	protected void removeCommandStackListener() {
+		if (commandStackListener != null) {
+			IStructuredTextUndoManager undoManager = getModel().getUndoManager();
+			// TODO WTP Port
+			// undoManager.getCommandStack().removeCommandStackListener(commandStackListener);
+		}
+	}
+
+	// This is from the IValidateEditEditor interface
+	/*
+	 * public void undoChange() { StructuredTextUndoManager undoManager =
+	 * textEditor.getModel().getUndoManager(); undoManager.undo(); // Make the
+	 * editor clean textEditor.getModel().setDirtyState(false); }
+	 */
+
+	private class PreferenceStoreListener implements IPropertyChangeListener {
+		/**
+		 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(PropertyChangeEvent)
+		 */
+		public void propertyChange(PropertyChangeEvent event) {
+		}
+	}
+
+	protected IPropertyChangeListener preferenceStoreListener = new PreferenceStoreListener();
+
+	protected int getDefaultPageTypeIndex() {
+		int pageIndex = sourcePageIndex;
+
+		if (XSDEditorPlugin.getPlugin().getDefaultPage().equals(XSDEditorPlugin.GRAPH_PAGE)) {
+			if (graphPageIndex != -1)
+				pageIndex = graphPageIndex;
+		}
+
+		return pageIndex;
+	}
+
+	int currentPage = -1;
+
+	public String getCurrentPageType() {
+		// should update pref. for valid pages
+		if (getActivePage() != -1) {
+			currentPage = getActivePage();
+		}
+		if (currentPage == graphPageIndex) {
+			return XSDEditorPlugin.GRAPH_PAGE;
+		}
+		else {
+			return XSDEditorPlugin.SOURCE_PAGE;
+		}
+	}
+
+	public Object getActivePart() {
+		return getSite().getWorkbenchWindow().getActivePage().getActivePart();
+	}
+
+	public void dispose() {
+		// some things in the configuration need to clean
+		// up after themselves
+		if (fOutlinePage != null) {
+			if (fOutlinePage instanceof ConfigurableContentOutlinePage && fOutlineListener != null) {
+				((ConfigurableContentOutlinePage) fOutlinePage).removeDoubleClickListener(fOutlineListener);
+			}
+			if (fOutlineListener != null) {
+				fOutlinePage.removeSelectionChangedListener(fOutlineListener);
+			}
+		}
+		ISelectionProvider provider = getTextEditor().getSelectionProvider();
+		if (provider instanceof IPostSelectionProvider) {
+			((IPostSelectionProvider) provider).removePostSelectionChangedListener(fSourceEditorSelectionListener);
+		}
+		else {
+			provider.removeSelectionChangedListener(fSourceEditorSelectionListener);
+		}
+		getSelectionManager().removeSelectionChangedListener(fXSDSelectionListener);
+		
+		// propertyChangeListener.dispose();
+		removeCommandStackListener();
+
+		XSDEditorPlugin.getPlugin().setDefaultPage(getCurrentPageType());
+		XSDEditorPlugin.getPlugin().getPreferenceStore().removePropertyChangeListener(preferenceStoreListener);
+
+		getSite().getPage().removePartListener(partListener);
+
+		// KB: Temporary solution for bug 99468
+		IStructuredModel myModel = textEditor.getModel();
+		if (myModel != null && myModel instanceof IStructuredDocumentListener)
+			myModel.getStructuredDocument().removeDocumentChangingListener((IStructuredDocumentListener) myModel);
+
+		textEditor = null;
+		resourceFile = null;
+		xsdSelectionManager = null;
+		schemalNodeAdapter = null;
+		result = null;
+		partListener = null;
+		commandStackListener = null;
+		preferenceStoreListener = null;
+		openOnSelectionHelper = null;
+		graphViewer = null;
+
+		super.dispose();
+
+		// release the schema model
+		//
+		if (schemalNodeAdapter != null) {
+			schemalNodeAdapter.clear();
+			schemalNodeAdapter = null;
+		}
+	}
+
+	protected boolean loadFile() {
+		Object input = getEditorInput();
+
+		if (input instanceof IFileEditorInput) {
+			resourceFile = ((IFileEditorInput) input).getFile();
+		}
+		else if (input instanceof ILocationProvider) {
+			IPath path = ((ILocationProvider) input).getPath(input);
+			String ext = path.getFileExtension();
+			if (ext != null && ext.equals("xsd")) {
+				return true;
+			}
+			return false;
+		}
+		else {
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Method openOnGlobalReference. The comp argument is a resolved xsd
+	 * schema object from another file. This is created and called from
+	 * another schema model to allow F3 navigation to open a new editor and
+	 * choose the referenced object within that editor context
+	 * 
+	 * @param comp
+	 */
+	public void openOnGlobalReference(XSDConcreteComponent comp) {
+		openOnSelectionHelper.openOnGlobalReference(comp);
+	}
+
+	protected OpenOnSelectionHelper openOnSelectionHelper;
+
+	public OpenOnSelectionHelper getOpenOnSelectionHelper() {
+		return openOnSelectionHelper;
+	}
+
+	/**
+	 * @see org.eclipse.wst.xsd.ui.internal.XSDMultiPageEditorPart#createTextEditor()
+	 */
+	protected StructuredTextEditor createTextEditor() {
+		textEditor = new StructuredTextEditor();
+		return textEditor;
+	}
+
+	/*
+	 * @see StructuredTextMultiPageEditorPart#createSourcePage()
+	 */
+	protected void createSourcePage() throws PartInitException {
+		super.createSourcePage();
+	}
+
+	int sourcePageIndex = -1;
+
+	/**
+	 * Adds the source page of the multi-page editor.
+	 */
+	protected void addSourcePage() throws PartInitException {
+
+		sourcePageIndex = addPage(textEditor, getEditorInput());
+		setPageText(sourcePageIndex, XSDEditorPlugin.getXSDString("_UI_TAB_SOURCE"));
+
+		// the update's critical, to get viewer selection manager and
+		// highlighting to work
+		textEditor.update();
+		firePropertyChange(PROP_TITLE);
+	}
+
+	int graphPageIndex = -1;
+	XSDGraphViewer graphViewer;
+
+	/**
+	 * Creates the graph page and adds it to the multi-page editor.
+	 */
+	protected void createAndAddGraphPage() throws PartInitException {
+		graphViewer = new XSDGraphViewer(this);
+		graphViewer.setSchema(getXSDSchema());
+		Control graphControl = graphViewer.createControl(getContainer());
+		graphPageIndex = addPage(graphControl);
+		setPageText(graphPageIndex, XSDEditorPlugin.getXSDString("_UI_TAB_GRAPH"));
+
+		// graphViewer.setViewerSelectionManager(textEditor.getViewerSelectionManager());
+		graphViewer.setSelectionManager(getSelectionManager());
+
+		// this forces the editor to initially select the top level schema
+		// object
+		//
+		if (getXSDSchema() != null) {
+			getSelectionManager().setSelection(new StructuredSelection(getXSDSchema()));
+		}
+	}
+
+	protected XSDModelAdapterFactoryImpl xsdModelAdapterFactory;
+	protected XSDAdapterFactoryLabelProvider adapterFactoryLabelProvider;
+	private IPropertySheetPage fPropertySheetPage;
+	private IContentOutlinePage fOutlinePage;
+	private OutlineTreeSelectionChangeListener fOutlineListener;
+	private SourceEditorSelectionListener fSourceEditorSelectionListener;
+	private XSDSelectionManagerSelectionListener fXSDSelectionListener;
+
+	/*
+	 * @see IAdaptable#getAdapter(Class)
+	 */
+	public Object getAdapter(Class key) {
+		Object result = null;
+		if (key == ISelectionProvider.class) {
+			result = xsdSelectionManager;
+		}
+		if (IPropertySheetPage.class.equals(key)) {
+			fPropertySheetPage = new XSDTabbedPropertySheetPage(this);
+
+			((XSDTabbedPropertySheetPage) fPropertySheetPage).setXSDModelAdapterFactory(xsdModelAdapterFactory);
+			((XSDTabbedPropertySheetPage) fPropertySheetPage).setSelectionManager(getSelectionManager());
+			((XSDTabbedPropertySheetPage) fPropertySheetPage).setXSDSchema(getXSDSchema());
+
+			return fPropertySheetPage;
+		}
+		else if (IContentOutlinePage.class.equals(key)) {
+			if (fOutlinePage == null || fOutlinePage.getControl() == null || fOutlinePage.getControl().isDisposed()) {
+				IContentOutlinePage page = (IContentOutlinePage) super.getAdapter(key);
+				if (page != null) {
+					fOutlineListener = new OutlineTreeSelectionChangeListener();
+					page.addSelectionChangedListener(fOutlineListener);
+					if (page instanceof ConfigurableContentOutlinePage) {
+						((ConfigurableContentOutlinePage) page).addDoubleClickListener(fOutlineListener);
+					}
+				}
+				fOutlinePage = page;
+				// XSDContentOutlinePage outlinePage = new
+				// XSDContentOutlinePage(this);
+				// XSDContentProvider xsdContentProvider = new
+				// XSDContentProvider(xsdModelAdapterFactory);
+				// xsdContentProvider.setXSDSchema(getXSDSchema());
+				// outlinePage.setContentProvider(xsdContentProvider);
+				// outlinePage.setLabelProvider(adapterFactoryLabelProvider);
+				// outlinePage.setModel(getXSDSchema().getDocument());
+				//
+				// fOutlinePage = outlinePage;
+			}
+			return fOutlinePage;
+		}
+		else {
+			result = super.getAdapter(key);
+		}
+		return result;
+	}
+
+
+	public XSDModelAdapterFactoryImpl getXSDModelAdapterFactory() {
+		return xsdModelAdapterFactory;
+	}
+
+	public XSDAdapterFactoryLabelProvider getLabelProvider() {
+		return adapterFactoryLabelProvider;
+	}
+
+
+	public XSDSelectionManager getSelectionManager() {
+		return xsdSelectionManager;
+	}
+
+	/**
+	 * @see org.eclipse.wst.xsd.ui.internal.XSDMultiPageEditorPart#doSaveAs()
+	 */
+	public void doSaveAs() {
+		super.doSaveAs();
+	}
+
+	public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor) {
+		super.doSave(monitor);
+	}
+
+	public void reparseSchema() {
+		// TODO cs : Are there no better ways to make the model
+		// reload it's dependencies? This seems rather extreme.
+		//
+		Document document = ((IDOMModel) getModel()).getDocument();
+		if (schemalNodeAdapter != null) {
+			schemalNodeAdapter.createSchema(document.getDocumentElement());
+		}
+	}
+
+	/**
+	 * Returns the xsdSchema.
+	 * 
+	 * @return XSDSchema
+	 */
+	public XSDSchema getXSDSchema() {
+		return schemalNodeAdapter != null ? schemalNodeAdapter.getSchema() : null;
+	}
+
+
+	/**
+	 * Returns the resourceFile.
+	 * 
+	 * @return IFile
+	 */
+	public IFile getFileResource() {
+		return resourceFile;
+	}
+
+	/**
+	 * Get the IDocument from the text viewer
+	 */
+	public IDocument getEditorIDocument() {
+		IDocument document = textEditor.getTextViewer().getDocument();
+		return document;
+	}
+
+	/**
+	 * Create ref integrity tasks in task list
+	 */
+	public void createTasksInTaskList(ArrayList messages) {
+		// DisplayErrorInTaskList tasks = new
+		// DisplayErrorInTaskList(getEditorIDocument(), getFileResource(),
+		// messages);
+		// tasks.run();
+	}
+
+	public void resetInformationTasks() {
+		// DisplayErrorInTaskList.removeInfoMarkers(getFileResource());
+	}
+
+	public XSDGraphViewer getGraphViewer() {
+		return graphViewer;
+	}
+
+	public IEditorPart getActiveEditorPage() {
+		return getActiveEditor();
+	}
+
+	public StructuredTextEditor getTextEditor() {
+		return textEditor;
+	}
+
+	class InternalPartListener implements IPartListener {
+		XSDEditor editor;
+
+		public InternalPartListener(XSDEditor editor) {
+			this.editor = editor;
+		}
+
+		public void partActivated(IWorkbenchPart part) {
+			if (part == editor) {
+				ISelection selection = getSelectionManager().getSelection();
+				if (selection != null) {
+					if (getCurrentPageType().equals(XSDEditorPlugin.GRAPH_PAGE)) {
+						getSelectionManager().selectionChanged(new SelectionChangedEvent(editor.getGraphViewer().getComponentViewer(), selection));
+					}
+					else if (getCurrentPageType().equals(XSDEditorPlugin.SOURCE_PAGE)) {
+						getSelectionManager().setSelection(selection);
+					}
+				}
+			}
+		}
+
+		public void partBroughtToTop(IWorkbenchPart part) {
+		}
+
+		public void partClosed(IWorkbenchPart part) {
+		}
+
+		public void partDeactivated(IWorkbenchPart part) {
+		}
+
+		public void partOpened(IWorkbenchPart part) {
+		}
+	}
+
+
+	/**
+	 * Method createDefaultSchemaNode. Should only be called to insert a
+	 * schema node into an empty document
+	 */
+	public void createDefaultSchemaNode(Document document) {
+		if (document.getChildNodes().getLength() == 0) {
+			// if it is a completely empty file, then add the encoding and
+			// version processing instruction
+			// TODO String encoding = EncodingHelper.getDefaultEncodingTag();
+			String encoding = "UTF-8";
+			ProcessingInstruction instr = document.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + encoding + "\"");
+			document.appendChild(instr);
+		}
+
+		// Create a default schema tag now
+
+		// String defaultPrefixForTargetNamespace =
+		// getFileResource().getProjectRelativePath().removeFileExtension().lastSegment();
+		String defaultPrefixForTargetNamespace = "tns";
+		String prefixForSchemaNamespace = "";
+		String schemaNamespaceAttribute = "xmlns";
+		if (XSDEditorPlugin.getPlugin().isQualifyXMLSchemaLanguage()) {
+			// Added this if check before disallowing blank prefixes in the
+			// preferences...
+			// Can take this out. See also NewXSDWizard
+			if (XSDEditorPlugin.getPlugin().getXMLSchemaPrefix().trim().length() > 0) {
+				prefixForSchemaNamespace = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix() + ":";
+				schemaNamespaceAttribute += ":" + XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
+			}
+		}
+
+		document.appendChild(document.createTextNode("\n"));
+		Element element = document.createElement(prefixForSchemaNamespace + XSDConstants.SCHEMA_ELEMENT_TAG);
+
+		element.setAttribute(schemaNamespaceAttribute, "http://www.w3.org/2001/XMLSchema");
+
+		String defaultTargetURI = XSDEditorPlugin.getPlugin().getXMLSchemaTargetNamespace();
+		element.setAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE, defaultTargetURI);
+		element.setAttribute("xmlns:" + defaultPrefixForTargetNamespace, defaultTargetURI);
+
+		document.appendChild(element);
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorAdapter.java
new file mode 100644
index 0000000..7591376
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorAdapter.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IDocument;
+
+public interface XSDEditorAdapter
+{
+  public IFile getFileResource();
+
+  public IDocument getEditorIDocument();
+
+  public void createTasksInTaskList(ArrayList messages);
+
+  public void resetInformationTasks();
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorContextIds.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorContextIds.java
new file mode 100644
index 0000000..8f95f5c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorContextIds.java
@@ -0,0 +1,460 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+/**
+ * Context help id constants.
+ */
+public interface XSDEditorContextIds 
+{
+  public static final String PLUGIN_NAME = "org.eclipse.wst.xsd.ui.internal";
+
+  /* CONTEXT_IDs New XSD Wizard uses the WizardNewFileCreationPage from org.eclipse.ui.dialogs */
+ 
+  /* CONTEXT_IDs for XSDEditor follow the xsdexxx context IDs */
+
+  /* CONTEXT_ID xsde0010 for XSD Editor Design View */
+  public static final String XSDE_SCHEMA_DESIGN_VIEW      = PLUGIN_NAME + ".xsde0010";
+  /* no CONTEXT_ID for File Name Text Edit (not editable) */
+  /* CONTEXT_ID xsde0020 for Version Text Edit */
+  public static final String XSDE_SCHEMA_VERSION          = PLUGIN_NAME + ".xsde0020";
+  /* CONTEXT_ID xsde0030 for Language Text Edit */
+  public static final String XSDE_SCHEMA_LANGUAGE         = PLUGIN_NAME + ".xsde0030";
+  /* CONTEXT_ID xsde0040 for Namespace Group */
+  public static final String XSDE_SCHEMA_NAMESPACE_GROUP  = PLUGIN_NAME + ".xsde0040";
+  /* CONTEXT_ID xsde0050 for Prefix Text Edit */
+  public static final String XSDE_SCHEMA_PREFIX           = PLUGIN_NAME + ".xsde0050";
+  /* CONTEXT_ID xsde0060 for Target namespace Text Edit */
+  public static final String XSDE_SCHEMA_TARGET_NAMESPACE = PLUGIN_NAME + ".xsde0060";
+  /* CONTEXT_ID xsde0070 for Apply Push Button */
+  public static final String XSDE_SCHEMA_APPLY            = PLUGIN_NAME + ".xsde0070";
+  /* CONTEXT_ID xsde0080 for Attribute form default Combo Box */
+  public static final String XSDE_SCHEMA_ATTRIBUTE        = PLUGIN_NAME + ".xsde0080";
+  /* CONTEXT_ID xsde0090 for Element form default Combo Box */
+  public static final String XSDE_SCHEMA_ELEMENT          = PLUGIN_NAME + ".xsde0090";
+  /* CONTEXT_ID xsde0100 for Block default Combo Box */
+  public static final String XSDE_SCHEMA_BLOCK            = PLUGIN_NAME + ".xsde0100";
+  /* CONTEXT_ID xsde0110 for Final Default Combo Box */
+  public static final String XSDE_SCHEMA_FINAL            = PLUGIN_NAME + ".xsde0110";
+
+  
+  /* CONTEXT_ID xsde0200 for Annotations Comment Group - only used generically */
+  /* CONTEXT_ID      - used in Documentation Design View */
+  /* CONTEXT_ID      - used in App Info Design View */
+  public static final String XSDE_ANNOTATION_COMMENT_GROUP = PLUGIN_NAME + ".xsde0200";
+  /* CONTEXT_ID xsde0210 for Annotations Comment Group - only used generically */
+  /* CONTEXT_ID      - used in Documentation Design View */
+  /* CONTEXT_ID      - used in App Info Design View */
+  public static final String XSDE_ANNOTATION_COMMENT       = PLUGIN_NAME + ".xsde0210";
+  
+  /* CONTEXT_ID xsde0300 for Documentation Design View */
+  public static final String XSDE_DOCUMENTATION_DESIGN_VIEW   = PLUGIN_NAME + ".xsde0300";
+  /* CONTEXT_ID xsde0310 for Source Text Edit */
+  public static final String XSDE_DOCUMENTATION_SOURCE        = PLUGIN_NAME + ".xsde0310";
+  /* CONTEXT_ID xsde0320 for Language Text Edit */
+  public static final String XSDE_DOCUMENTATION_LANGUAGE      = PLUGIN_NAME + ".xsde0320";
+  /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
+  /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
+
+  /* CONTEXT_ID xsde0400 for App Info Design View */
+  public static final String XSDE_APP_INFO_DESIGN_VIEW = PLUGIN_NAME + ".xsde0400";
+  /* CONTEXT_ID xsde0410 for App Info Source Text Edit */
+  public static final String XSDE_APP_INFO_SOURCE = PLUGIN_NAME + ".xsde0410";
+  /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
+  /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
+
+  /* CONTEXT_ID xsde0500 for Complex Type Design View */
+  public static final String XSDE_COMPLEX_DESIGN_VIEW = PLUGIN_NAME + ".xsde0500";
+  /* CONTEXT_ID xsde0510 for Name Text Edit */
+  public static final String XSDE_COMPLEX_NAME        = PLUGIN_NAME + ".xsde0510";
+  /* CONTEXT_ID xsde0520 for Abstract Combo Box */
+  public static final String XSDE_COMPLEX_ABSTRACT    = PLUGIN_NAME + ".xsde0520";
+  /* CONTEXT_ID xsde0530 for Mixed Combo Box */
+  public static final String XSDE_COMPLEX_MIXED       = PLUGIN_NAME + ".xsde0530";
+  /* CONTEXT_ID xsde0540 for Block Combo Box */
+  public static final String XSDE_COMPLEX_BLOCK       = PLUGIN_NAME + ".xsde0540";
+  /* CONTEXT_ID xsde0550 for Final Combo Box */
+  public static final String XSDE_COMPLEX_FINAL       = PLUGIN_NAME + ".xsde0550";
+
+  /* CONTEXT_ID xsde0600 for Simple Type Design View */
+  public static final String XSDE_SIMPLE_DESIGN_VIEW = PLUGIN_NAME + ".xsde0600";
+  /* CONTEXT_ID xsde0610 for Name Text Edit */
+  public static final String XSDE_SIMPLE_NAME        = PLUGIN_NAME + ".xsde0610";
+
+  /* CONTEXT_ID for Global Element and Element Design Views are the same */
+  /* CONTEXT_ID xsde0700 for Element Design View */
+  public static final String XSDE_ELEMENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde0700";
+  /* CONTEXT_ID xsde0710 for Element Name Text Edit */
+  public static final String XSDE_ELEMENT_NAME         = PLUGIN_NAME + ".xsde0710";
+  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
+  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
+  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
+  /* CONTEXT_ID User-defined complex type Radio Button is from Type Helper xsde0940 */
+  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
+  /* CONTEXT_ID xsde0720 for Abstract Check Box */
+  public static final String XSDE_ELEMENT_ABSTRACT     = PLUGIN_NAME + ".xsde0720";
+  /* CONTEXT_ID xsde0730 for Nillable Check Box */
+  public static final String XSDE_ELEMENT_NILLABLE     = PLUGIN_NAME + ".xsde0730";
+  /* CONTEXT_ID xsde0740 for Value Group */
+  public static final String XSDE_ELEMENT_VALUE        = PLUGIN_NAME + ".xsde0740";
+  /* CONTEXT_ID xsde0750 for Fixed Radio Button */
+  public static final String XSDE_ELEMENT_FIXED        = PLUGIN_NAME + ".xsde0750";
+  /* CONTEXT_ID xsde0760 for Default Radio Button */
+  public static final String XSDE_ELEMENT_DEFAULT      = PLUGIN_NAME + ".xsde0760";
+  /* CONTEXT_ID xsde0770 for Value Group */
+  public static final String XSDE_ELEMENT_VALUE_GROUP  = PLUGIN_NAME + ".xsde0770";
+  /* CONTEXT_ID xsde0780 for Minimum Text Edit */
+  public static final String XSDE_ELEMENT_MINIMUM      = PLUGIN_NAME + ".xsde0780";
+  /* CONTEXT_ID xsde0790 for Maximum Text Edit */
+  public static final String XSDE_ELEMENT_MAXIMUM      = PLUGIN_NAME + ".xsde0790";
+  /* CONTEXT_ID xsde0800 for Block Combo Box */
+  public static final String XSDE_ELEMENT_BLOCK        = PLUGIN_NAME + ".xsde0800";
+  /* CONTEXT_ID xsde0810 for Final Combo Box */
+  public static final String XSDE_ELEMENT_FINAL        = PLUGIN_NAME + ".xsde0810";
+  /* CONTEXT_ID xsde0820 for Substitution Group Combo Box */
+  public static final String XSDE_ELEMENT_SUBSTITUTION = PLUGIN_NAME + ".xsde0820";
+  /* CONTEXT_ID xsde0830 for Form Qualification Combo Box */                    
+  public static final String XSDE_ELEMENT_FORM         = PLUGIN_NAME + ".xsde0830";
+
+  /* CONTEXT_ID xsde0900 for Type Helper Group - only used generically */
+  /* CONTEXT_ID      - used in Global Element Design View */
+  /* CONTEXT_ID      - used in Global Attribute Design View */
+  /* CONTEXT_ID      - used in Simple Content Design View */
+  /* CONTEXT_ID      - used in Restriction Design View */
+  /* CONTEXT_ID      - used in List Design View */
+  /* CONTEXT_ID      - used in Union Design View */
+  public static final String XSDE_TYPE_HELPER_GROUP    = PLUGIN_NAME + ".xsde0900";
+  /* CONTEXT_ID xsde0910 for None Radio Button - only used generically */
+  /* CONTEXT_ID      - used in Simple Content Design View */
+  /* CONTEXT_ID      - used in Restriction Design View */
+  /* CONTEXT_ID      - used in List Design View */
+  /* CONTEXT_ID      - used in Union Design View */
+  public static final String XSDE_TYPE_HELPER_NONE     = PLUGIN_NAME + ".xsde0910";
+  /* CONTEXT_ID xsde0920 for Built-in simple type Radio Button - only used generically */
+  /* CONTEXT_ID      - used in Global Element Design View */
+  /* CONTEXT_ID      - used in Global Attribute Design View */
+  /* CONTEXT_ID      - used in Simple Content Design View */
+  /* CONTEXT_ID      - used in Restriction Design View */
+  /* CONTEXT_ID      - used in List Design View */
+  /* CONTEXT_ID      - used in Union Design View */
+  public static final String XSDE_TYPE_HELPER_BUILT_IN = PLUGIN_NAME + ".xsde0920";
+  /* CONTEXT_ID xsde0930 for User-defined simple type Radio Button - only used generically */
+  /* CONTEXT_ID      - used in Global Element Design View */
+  /* CONTEXT_ID      - used in Global Attribute Design View */
+  /* CONTEXT_ID      - used in Simple Content Design View */
+  /* CONTEXT_ID      - used in Restriction Design View */
+  /* CONTEXT_ID      - used in List Design View */
+  /* CONTEXT_ID      - used in Union Design View */
+  public static final String XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE = PLUGIN_NAME + ".xsde0930";
+  /* CONTEXT_ID xsde0940 for User-defined complex type Radio Button - only used generically */
+  /* CONTEXT_ID      - used in Global Element Design View */
+  public static final String XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX = PLUGIN_NAME + ".xsde0940";
+  /* CONTEXT_ID xsde0950 for Type information Combo Box - only used generically */
+  /* CONTEXT_ID      - used in Global Element Design View */
+  /* CONTEXT_ID      - used in Global Attribute Design View */
+  /* CONTEXT_ID      - used in Simple Content Design View */
+  /* CONTEXT_ID      - used in Restriction Design View */
+  /* CONTEXT_ID      - used in List Design View */
+  public static final String XSDE_TYPE_HELPER_TYPE = PLUGIN_NAME + ".xsde0950";
+
+  /* CONTEXT_ID xsde1000 for Attribute Design View */
+  public static final String XSDE_ATTRIBUTE_DESIGN_VIEW = PLUGIN_NAME + ".xsde1000";
+  /* CONTEXT_ID xsde1010 for Attribute Name Text Edit */
+  public static final String XSDE_ATTRIBUTE_NAME        = PLUGIN_NAME + ".xsde1010";
+  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
+  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
+  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
+  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
+  /* CONTEXT_ID xsde1020 for Value Group */
+  public static final String XSDE_ATTRIBUTE_VALUE_GROUP = PLUGIN_NAME + ".xsde1020";
+  /* CONTEXT_ID xsde1030 for Fixed Radio Button */
+  public static final String XSDE_ATTRIBUTE_FIXED       = PLUGIN_NAME + ".xsde1030";
+  /* CONTEXT_ID xsde1040 for Default Radio Button */
+  public static final String XSDE_ATTRIBUTE_DEFAULT     = PLUGIN_NAME + ".xsde1040";
+  /* CONTEXT_ID xsde1050 for Value Text Edit */
+  public static final String XSDE_ATTRIBUTE_VALUE       = PLUGIN_NAME + ".xsde1050";
+  /* CONTEXT_ID xsde1060 for Usage Combo Box */
+  public static final String XSDE_ATTRIBUTE_USAGE       = PLUGIN_NAME + ".xsde1060";
+  /* CONTEXT_ID xsde1070 for Form qualificaiton Combo Box */
+  public static final String XSDE_ATTRIBUTE_FORM        = PLUGIN_NAME + ".xsde1070";
+
+  /* CONTEXT_ID xsde1100 for Element Ref Window Design View */
+  public static final String XSDE_ELEMENT_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1100";
+  /* CONTEXT_ID xsde1110 for Reference Name Combo Box */
+  public static final String XSDE_ELEMENT_REF_REFERENCE   = PLUGIN_NAME + ".xsde1110";
+  /* CONTEXT_ID xsde1120 for Minimum Text Edit */
+  public static final String XSDE_ELEMENT_REF_MINIMUM     = PLUGIN_NAME + ".xsde1120";
+  /* CONTEXT_ID xsde1130 for Maximum Text Edit */
+  public static final String XSDE_ELEMENT_REF_MAXIMUM     = PLUGIN_NAME + ".xsde1130";
+  
+  /* CONTEXT_ID xsde1200 for Simple Content Design View - used generically */
+  /* CONTEXT_ID      - used in Simple Content Design View */ 
+  /* CONTEXT_ID      - used in Complex Content Design View */
+    public static final String XSDE_SIMPLE_CONTENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde1200";
+  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
+  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
+  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
+  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
+  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
+  /* CONTEXT_ID xsde1210 for Derived by Combo Box - used generically */
+  /* CONTEXT_ID      - used in Simple Content Design View */ 
+  /* CONTEXT_ID      - used in Complex Content Design View */
+  public static final String XSDE_SIMPLE_CONTENT_DERIVED = PLUGIN_NAME + ".xsde1210";
+
+  /* CONTEXT_ID xsde1300 for Restriction Design View */
+  public static final String XSDE_RESTRICTION_DESIGN_VIEW  = PLUGIN_NAME + ".xsde1300";
+  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
+  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
+  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
+  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
+  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
+  /* CONTEXT_ID xsde1310 for Facets Group */
+  public static final String XSDE_RESTRICTION_FACETS_GROUP = PLUGIN_NAME + ".xsde1310";
+  /* CONTEXT_ID xsde1320 for Facets Table */
+  public static final String XSDE_RESTRICTION_FACETS       = PLUGIN_NAME + ".xsde1320";
+
+  /* CONTEXT_ID xsde1400 for List Design View */
+  public static final String XSDE_LIST_DESIGN_VIEW  = PLUGIN_NAME + ".xsde1400";
+  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
+  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
+  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
+  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
+  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
+
+  /* CONTEXT_ID xsde1500 for Attribute Group Design View */
+  public static final String XSDE_ATTRIBUTE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde1500";
+  /* CONTEXT_ID xsde1510 for Name Text Edit */
+  public static final String XSDE_ATTRIBUTE_GROUP_NAME = PLUGIN_NAME + ".xsde1510";
+
+  /* CONTEXT_ID for Global Attribute and Attribute Design Views are the same */
+  /* CONTEXT_ID xsde1600 for Attribute Group Reference Design View */
+  public static final String XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1600";
+  /* CONTEXT_ID xsde1610 for Reference Name Combo Box */
+  public static final String XSDE_ATTRIBUTE_GROUP_REF_NAME = PLUGIN_NAME + ".xsde1610";
+
+  /* CONTEXT_ID xsde1700 for Attribute Reference Design View */
+  public static final String XSDE_ATTRIBUTE_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1700";
+  /* CONTEXT_ID xsde1710 for Reference Name Combo Box */
+  public static final String XSDE_ATTRIBUTE_REF_NAME = PLUGIN_NAME + ".xsde1710";
+
+  /* CONTEXT_ID xsde1800 for Pattern Design View */
+  public static final String XSDE_PATTERN_DESIGN_VIEW = PLUGIN_NAME + ".xsde1800";
+  /* CONTEXT_ID xsde1810 for Value Text Edit */
+  public static final String XSDE_PATTERN_VALUE   = PLUGIN_NAME + ".xsde1810";
+  /* CONTEXT_ID xsde1820 for Create Regular Expression Push Button */
+  public static final String XSDE_PATTERN_REGULAR = PLUGIN_NAME + ".xsde1820";
+
+  /* CONTEXT_ID xsde1900 for Enum Design View */
+  public static final String XSDE_ENUM_DESIGN_VIEW = PLUGIN_NAME + ".xsde1900";
+  /* CONTEXT_ID xsde1910 for Value Text Edit */
+  public static final String XSDE_ENUM_VALUE       = PLUGIN_NAME + ".xsde1910";
+  
+  /* CONTEXT_ID xsde2000 for Include Design Page */
+  public static final String XSDE_INCLUDE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2000";
+  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
+  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */ 
+  
+  /* CONTEXT_ID xsde2100 for Include Helper Select Push Button - used generically */
+  /* CONTEXT_ID      - used in Include Design View */
+  /* CONTEXT_ID      - used in Import Design View */
+  public static final String XSDE_INCLUDE_HELPER_SELECT = PLUGIN_NAME + ".xsde2100";
+
+  /* CONTEXT_ID xsde2200 for Import Design Page */
+  public static final String XSDE_IMPORT_DESIGN_VIEW = PLUGIN_NAME + ".xsde2200";
+  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
+  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
+  /* CONTEXT_ID xsde2210 for Prefix Text Edit */
+  public static final String XSDE_IMPORT_PREFIX      = PLUGIN_NAME + ".xsde2210";
+  /* no CONTEXT_ID for Namespace Text Edit (not editable) */
+
+  /* CONTEXT_ID xsde2300 for Redefine Design View */
+  public static final String XSDE_REDEFINE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2300";
+  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
+  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
+
+  /* CONTEXT_ID xsde2400 for Group Design View */
+  public static final String XSDE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde2400";
+  /* CONTEXT_ID xsde2410 for Name Text Edit */
+  public static final String XSDE_GROUP_NAME        = PLUGIN_NAME + ".xsde2410";
+
+  /* CONTEXT_ID xsde2500 for Group Scope Design View */
+  public static final String XSDE_GROUP_SCOPE_DESIGN_VIEW   = PLUGIN_NAME + ".xsde2500";
+  /* CONTEXT_ID xsde2510 for Content model Group */
+  public static final String XSDE_GROUP_SCOPE_CONTENT_GROUP = PLUGIN_NAME + ".xsde2510";
+  /* CONTEXT_ID xsde2520 for Sequence Radio Button */
+  public static final String XSDE_GROUP_SCOPE_SEQUENCE = PLUGIN_NAME + ".xsde2520";
+  /* CONTEXT_ID xsde2530 for Choice Radio Button */
+  public static final String XSDE_GROUP_SCOPE_CHOICE   = PLUGIN_NAME + ".xsde2530";
+  /* CONTEXT_ID xsde2540 for All Radio Button */
+  public static final String XSDE_GROUP_SCOPE_ALL      = PLUGIN_NAME + ".xsde2540";
+  /* CONTEXT_ID xsde2550 for Minimum Text Edit */
+  public static final String XSDE_GROUP_SCOPE_MINIMUM  = PLUGIN_NAME + ".xsde2550";
+  /* CONTEXT_ID xsde2560 for Maximum Text Edit*/
+  public static final String XSDE_GROUP_SCOPE_MAXIMUM  = PLUGIN_NAME + ".xsde2560";
+
+  /* CONTEXT_ID xsde2600 for Group Ref Design View */
+  public static final String XSDE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2600";
+  /* CONTEXT_ID xsde2610 for Reference name Combo Box */
+  public static final String XSDE_GROUP_REF_REFERENCE   = PLUGIN_NAME + ".xsde2610";
+  /* CONTEXT_ID xsde2620 for Minimum Text Edit */
+  public static final String XSDE_GROUP_REF_MINIMUM     = PLUGIN_NAME + ".xsde2620";
+  /* CONTEXT_ID xsde2630 for Maximum Text Edit */
+  public static final String XSDE_GROUP_REF_MAXIMUM     = PLUGIN_NAME + ".xsde2630";
+
+  /* CONTEXT_ID xsde2700 for Unique Design View */
+  public static final String XSDE_UNIQUE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2700";
+  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
+  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
+  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
+  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
+  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
+  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
+  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
+  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
+  
+  /* CONTEXT_ID xsde2800 for Unique Base Name Text Edit - used generically */
+  /* CONTEXT_ID      - used in Unique Design View */
+  /* CONTEXT_ID      - used in Key Design View */
+  /* CONTEXT_ID      - used in Key Ref Design View */
+  public static final String XSDE_UNIQUE_BASE_NAME = PLUGIN_NAME + ".xsde2800";
+  /* CONTEXT_ID xsde2810 for Selector Group - used generically */
+  /* CONTEXT_ID      - used in Unique Design View */
+  /* CONTEXT_ID      - used in Key Design View */
+  /* CONTEXT_ID      - used in Key Ref Design View */
+  public static final String XSDE_UNIQUE_BASE_SELECTOR_GROUP = PLUGIN_NAME + ".xsde2810";
+  /* CONTEXT_ID xsde2820 for Selector Multi-line Edit - used generically */
+  /* CONTEXT_ID      - used in Unique Design View */
+  /* CONTEXT_ID      - used in Key Design View */
+  /* CONTEXT_ID      - used in Key Ref Design View */
+  public static final String XSDE_UNIQUE_BASE_SELECTOR       = PLUGIN_NAME + ".xsde2820";
+  /* CONTEXT_ID xsde2830 for Fields Group - used generically */
+  /* CONTEXT_ID      - used in Unique Design View */
+  /* CONTEXT_ID      - used in Key Design View */
+  /* CONTEXT_ID      - used in Key Ref Design View */
+  public static final String XSDE_UNIQUE_BASE_FIELDS_GROUP   = PLUGIN_NAME + ".xsde2830";
+  /* CONTEXT_ID xsde2840 for Source Text Edit - used generically */
+  /* CONTEXT_ID      - used in Unique Design View */
+  /* CONTEXT_ID      - used in Key Design View */
+  /* CONTEXT_ID      - used in Key Ref Design View */
+  public static final String XSDE_UNIQUE_BASE_SOURCE         = PLUGIN_NAME + ".xsde2840";
+  /* CONTEXT_ID xsde2850 for Add Push Button - used generically */
+  /* CONTEXT_ID      - used in Unique Design View */
+  /* CONTEXT_ID      - used in Key Design View */
+  /* CONTEXT_ID      - used in Key Ref Design View */
+  public static final String XSDE_UNIQUE_BASE_ADD            = PLUGIN_NAME + ".xsde2850";
+  /* CONTEXT_ID xsde2860 for Remove Push Button - used generically */
+  /* CONTEXT_ID      - used in Unique Design View */
+  /* CONTEXT_ID      - used in Key Design View */
+  /* CONTEXT_ID      - used in Key Ref Design View */
+  public static final String XSDE_UNIQUE_BASE_REMOVE         = PLUGIN_NAME + ".xsde2860";
+  /* CONTEXT_ID xsde2870 for Target List Box - used generically */
+  /* CONTEXT_ID      - used in Unique Design View */
+  /* CONTEXT_ID      - used in Key Design View */
+  /* CONTEXT_ID      - used in Key Ref Design View */
+  public static final String XSDE_UNIQUE_BASE_TARGET         = PLUGIN_NAME + ".xsde2870";
+
+  /* CONTEXT_ID xsde2900 for Key Design View */
+  public static final String XSDE_KEY_DESIGN_VIEW = PLUGIN_NAME + ".xsde2900";
+  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
+  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
+  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
+  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
+  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
+  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
+  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
+  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
+  /* CONTEXT_ID xsde2900 for Key Design View */
+  
+  /* CONTEXT_ID xsde2950 for Key Ref Design View */
+  public static final String XSDE_KEY_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2950";
+  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
+  /* CONTEXT_ID xsde2960 for Reference Key Combo Box */
+  public static final String XSDE_KEY_REF_REFERENCE = PLUGIN_NAME + ".xsde2960";
+  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
+  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
+  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
+  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
+  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
+  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
+  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
+
+  /* CONTEXT_ID xsde3000 for Any Element Design View */
+  public static final String XSDE_ANY_ELEMENT_VIEW = PLUGIN_NAME + ".xsde3000";
+  /* CONTEXT_ID xsde3010 for Namespace Text Edit */
+  public static final String XSDE_ANY_ELEMENT_NAMESPACE = PLUGIN_NAME + ".xsde3010";
+  /* CONTEXT_ID xsde3020 for Process Contents Combo Box */
+  public static final String XSDE_ANY_ELEMENT_PROCESS   = PLUGIN_NAME + ".xsde3020";
+  /* CONTEXT_ID xsde3030 for Minimum Text Edit */
+  public static final String XSDE_ANY_ELEMENT_MINIMUM   = PLUGIN_NAME + ".xsde3030";
+  /* CONTEXT_ID xsde3040 for Maximum Text Edit */
+  public static final String XSDE_ANY_ELEMENT_MAXIMUM   = PLUGIN_NAME + ".xsde3040";
+
+  /* CONTEXT_ID xsde3100 for Any Attribute Design View */
+  public static final String XSDE_ANY_ATTRIBUTE_VIEW = PLUGIN_NAME + ".xsde3100";
+  /* CONTEXT_ID xsde3110 for Namespace Text Edit */
+  public static final String XSDE_ANY_ATTRIBUTE_NAMESPACE = PLUGIN_NAME + ".xsde3110";
+  /* CONTEXT_ID xsde3120 for Process Contents Combo Box */
+  public static final String XSDE_ANY_ATTRIBUTE_PROCESS   = PLUGIN_NAME + ".xsde3120";
+
+  /* no CONTEXT_ID for Union Design View - uses a generic interface */
+  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
+  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
+  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
+  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
+
+  /* CONTEXT_ID xsde3200 for Notation Design View */
+  public static final String XSDE_NOTATION_VIEW = PLUGIN_NAME + ".xsde3200";
+
+  /* CONTEXT_ID xsde4000 for Source View */
+  public static final String XSDE_SOURCE_VIEW = PLUGIN_NAME + ".xsde4000";
+
+  /* CONTEXT_IDs for Regular Expression Wizard follow the xsdrxxx context IDs */
+  
+  /* CONTEXT_ID xsdr0010 for Compose Regular Expression Page */
+  public static final String XSDR_COMPOSITION_PAGE         = PLUGIN_NAME + ".xsdr0010";
+  /* CONTEXT_ID xsdr0015 for Token Contents Combo Box */
+  public static final String XSDR_COMPOSITION_TOKEN = PLUGIN_NAME + ".xsdr0015";
+  /* CONTEXT_ID xsdr0020 for Occurrece Group */
+  public static final String XSDR_COMPOSITION_OCCURRENCE_GROUP = PLUGIN_NAME + ".xsdr0020";
+  /* CONTEXT_ID xsdr0030 for Just once Radio Button */
+  public static final String XSDR_COMPOSITION_JUST_ONCE    = PLUGIN_NAME + ".xsdr0030";
+  /* CONTEXT_ID xsdr0040 for Zero or more Radio Button */
+  public static final String XSDR_COMPOSITION_ZERO_OR_MORE = PLUGIN_NAME + ".xsdr0040";
+  /* CONTEXT_ID xsdr0050 for One or more Radio Button */
+  public static final String XSDR_COMPOSITION_ONE_OR_MORE  = PLUGIN_NAME + ".xsdr0050";
+  /* CONTEXT_ID xsdr0060 for Optional Radio Button */
+  public static final String XSDR_COMPOSITION_OPTIONAL     = PLUGIN_NAME + ".xsdr0060";
+  /* CONTEXT_ID xsdr0070 for Repeat Radio Button */
+  public static final String XSDR_COMPOSITION_REPEAT       = PLUGIN_NAME + ".xsdr0070";
+  /* CONTEXT_ID xsdr0080 for Range Radio Button */
+  public static final String XSDR_COMPOSITION_RANGE        = PLUGIN_NAME + ".xsdr0080";
+  /* CONTEXT_ID xsdr0090 for Repeat Text Edit */
+  public static final String XSDR_COMPOSITION_REPEAT_TEXT  = PLUGIN_NAME + ".xsdr0090";
+  /* CONTEXT_ID xsdr0100 for Range Minimum Text Edit */
+  public static final String XSDR_COMPOSITION_RANGE_MIN    = PLUGIN_NAME + ".xsdr0100";
+  /* CONTEXT_ID xsdr0110 for Range Maximum Text Edit */
+  public static final String XSDR_COMPOSITION_RANGE_MAX    = PLUGIN_NAME + ".xsdr0110";
+  /* CONTEXT_ID xsdr0120 for Add Push Button */
+  public static final String XSDR_COMPOSITION_ADD          = PLUGIN_NAME + ".xsdr0120";
+  /* CONTEXT_ID xsdr0130 for Current Regular Expression Text Edit */
+  public static final String XSDR_COMPOSITION_CURRENT      = PLUGIN_NAME + ".xsdr0130";
+
+  /* CONTEXT_ID xsdr0200 for Test Regular Expression Page */
+  public static final String XSDR_TEST_PAGE   = PLUGIN_NAME + ".xsdr0200";
+  /* no CONTEXT_ID for Regular Expression Text Edit (not editable) */
+  /* CONTEXT_ID xsdr0210 for Sample Text Text Edit */
+  public static final String XSDR_TEST_SAMPLE = PLUGIN_NAME + ".xsdr0210";
+
+  /* CONTEXT_IDs for Preferences Page follows the xsdpxxx context IDs */
+  
+  /* CONTEXT_ID xsdp0010 for XML Schema Preferences Page */
+  public static final String XSDP_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0010";
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorPlugin.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorPlugin.java
new file mode 100644
index 0000000..8c334f8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorPlugin.java
@@ -0,0 +1,326 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+
+
+public class XSDEditorPlugin extends AbstractUIPlugin {
+	public final static String PLUGIN_ID = "org.eclipse.wst.xsd.ui";
+	public final static String XSD_EDITOR_ID = "org.eclipse.wst.xsd.ui.XSDEditor";
+
+	public final static String DEFAULT_TARGET_NAMESPACE = "http://www.example.org";
+
+	protected static XSDEditorPlugin plugin;
+
+	// protected XMLSchemaPackage xmlschemaPackage;
+	// KCPort private static MsgLogger myMsgLogger;
+
+	public XSDEditorPlugin(IPluginDescriptor descriptor) {
+		super(descriptor);
+		plugin = this;
+		// KCPort myMsgLogger = getMsgLogger();
+		// myMsgLogger.write(Level.CONFIG, new BuildInfo());
+		// myMsgLogger.write(Level.CONFIG, BuildInfo.getWSABuildLevel());
+	}
+
+	/**
+	 * Copy the w3c XMLSchema.dtd and datatypes.dtd into the plugin metadata
+	 * directory for validation purposes
+	 * 
+	 * @throws CoreException
+	 * 
+	 * ISSUE: should be removed.
+	 */
+	public void startup() throws CoreException {
+		super.startup();
+	}
+
+
+	/**
+	 * @deprecated use StructuredModelManager.getModelManager(); instead.
+	 */
+	public static IModelManager getModelManager() {
+		return StructuredModelManager.getModelManager();
+	}
+
+
+	/**
+	 * Get the Install URL
+	 */
+	public static URL getInstallURL() {
+		return getPlugin().getDescriptor().getInstallURL();
+	}
+
+	/**
+	 * Return the plugin physical directory location
+	 */
+	public static IPath getPluginLocation() {
+		try {
+			IPath installPath = new Path(getInstallURL().toExternalForm()).removeTrailingSeparator();
+			String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile();
+			return new Path(installStr);
+		}
+		catch (IOException e) {
+
+		}
+		return null;
+	}
+
+	/**
+	 * Get the metadata directory for this plugin
+	 */
+	public static String getMetaDataDirectory() {
+		return getPlugin().getStateLocation().toOSString();
+	}
+
+	/**
+	 * Get the one xmlschema package.
+	 */
+	// public XMLSchemaPackage getXMLSchemaPackage()
+	// {
+	// return xmlschemaPackage;
+	// }
+	// /**
+	// * Get the one xmlschema factory.
+	// */
+	// public XMLSchemaFactory getXMLSchemaFactory()
+	// {
+	// return (XMLSchemaFactory)xmlschemaPackage.getEFactoryInstance();
+	// }
+	/**
+	 * Get the singleton instance.
+	 */
+	public static XSDEditorPlugin getPlugin() {
+		return plugin;
+	}
+
+	public static Image getXSDImage(String iconName) {
+		return getPlugin().getImage(iconName);
+	}
+
+	public Image getImage(String iconName) {
+		ImageRegistry imageRegistry = getImageRegistry();
+
+		if (imageRegistry.get(iconName) != null) {
+			return imageRegistry.get(iconName);
+		}
+		else {
+			imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
+			return imageRegistry.get(iconName);
+		}
+	}
+
+	public static String getXSDString(String key) {
+		return Platform.getResourceBundle(plugin.getBundle()).getString(key);
+	}
+
+	/**
+	 * This gets the string resource and does one substitution.
+	 */
+	public String getString(String key, Object s1) {
+		return MessageFormat.format(Platform.getResourceBundle(getBundle()).getString(key), new Object[]{s1});
+	}
+
+	// public IWorkspace getWorkspace()
+	// {
+	// return ResourcesPlugin.getWorkspace();
+	// }
+
+	public static Shell getShell() {
+		return getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell();
+	}
+
+	/**
+	 * Get the xml schema default namespace prefix
+	 */
+	public String getXMLSchemaPrefix() {
+		return getPreferenceStore().getString(CONST_XSD_DEFAULT_PREFIX_TEXT);
+	}
+
+	/**
+	 * Get the xml schema default target namespace
+	 */
+	public String getXMLSchemaTargetNamespace() {
+		String targetNamespace = getPreferenceStore().getString(CONST_DEFAULT_TARGET_NAMESPACE);
+		if (!targetNamespace.endsWith("/")) {
+			targetNamespace = targetNamespace + "/";
+		}
+		return targetNamespace;
+	}
+
+	/**
+	 * Get the xml schema language qualification
+	 */
+	public boolean isQualifyXMLSchemaLanguage() {
+		return getPreferenceStore().getBoolean(CONST_XSD_LANGUAGE_QUALIFY);
+	}
+
+	/**
+	 * Method isCombinedDesignAndSourceView.
+	 * 
+	 * @return boolean if the editor should have a single page that is a
+	 *         combined design and source page
+	 */
+	public boolean isCombinedDesignAndSourceView() {
+		return COMBINED_LAYOUT.equals(getPreferenceStore().getString(EDITOR_LAYOUT));
+	}
+
+	public int getDesignLayout() {
+		if (TOP_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
+			return SWT.VERTICAL;
+		}
+		else if (BOTTOM_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
+			return SWT.VERTICAL;
+		}
+		else if (LEFT_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
+			return SWT.HORIZONTAL;
+		}
+		else if (RIGHT_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
+			return SWT.HORIZONTAL;
+		}
+		return SWT.HORIZONTAL;
+	}
+
+	public String getDesignLayoutPosition() {
+		if (TOP_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
+			return TOP_LAYOUT;
+		}
+		else if (BOTTOM_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
+			return BOTTOM_LAYOUT;
+		}
+		else if (LEFT_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
+			return LEFT_LAYOUT;
+		}
+		else if (RIGHT_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
+			return RIGHT_LAYOUT;
+		}
+		return RIGHT_LAYOUT;
+	}
+
+	/*---------------------------------------------------------------------------*/
+	/* the following methods are impls for the IPluginHelper interface */
+	/*---------------------------------------------------------------------------*/
+	// public void setMsgLoggerConfig(Hashtable msgLoggerConfig)
+	// {
+	// getMsgLogger().setMsgLoggerConfig(msgLoggerConfig);
+	// }
+	//
+	// public Hashtable getMsgLoggerConfig(Plugin plugin)
+	// {
+	// return (new PluginHelperImpl().getMsgLoggerConfig(plugin));
+	// }
+	//
+	// public Hashtable getMsgLoggerConfig()
+	// {
+	// return (getMsgLoggerConfig(this));
+	// }
+	//
+	// /**
+	// * XSDEditor and XSDModel use the same logger. See plugin.xml
+	// */
+	// public MsgLogger getMsgLogger()
+	// {
+	// if (myMsgLogger == null)
+	// {
+	// myMsgLogger = (MsgLogger) MsgLogger.getFactory().getLogger(new
+	// PluginHelperImpl().getMsgLoggerName(this), this);
+	// }
+	// return (myMsgLogger);
+	// }
+	public static final String CONST_XSD_DEFAULT_PREFIX_TEXT = "org.eclipse.wst.xmlschema.xsdDefaultPrefixText";
+	public static final String CONST_XSD_LANGUAGE_QUALIFY = "org.eclipse.wst.xmlschema.xsdQualify";
+	public static final String CONST_DEFAULT_TARGET_NAMESPACE = "org.eclipse.wst.xmlschema.defaultTargetnamespaceText";
+
+	// Preference to store which page should come up as the default page in
+	// the editor. This setting is based
+	// on the page that was left showing the last time the editor was closed.
+	public static String DEFAULT_PAGE = "org.eclipse.wst.xsd.ui.internal.defaultPage";
+	public static String DESIGN_PAGE = "org.eclipse.wst.xsd.ui.internal.designPage";
+	public static String SOURCE_PAGE = "org.eclipse.wst.xsd.ui.internal.sourcePage";
+	public static String GRAPH_PAGE = "org.eclipse.wst.xsd.ui.internal.graphPage";
+
+	public static String EDITOR_LAYOUT = "org.eclipse.wst.xsd.ui.internal.editorlayout";
+	public static String COMBINED_LAYOUT = "org.eclipse.wst.xsd.ui.internal.combined";
+	public static String SEPARATE_LAYOUT = "org.eclipse.wst.xsd.ui.internal.separate";
+
+	public static String DESIGN_LAYOUT = "org.eclipse.wst.xsd.ui.internal.designlayout";
+	public static String TOP_LAYOUT = "org.eclipse.wst.xsd.ui.internal.top";
+	public static String BOTTOM_LAYOUT = "org.eclipse.wst.xsd.ui.internal.bottom";
+	public static String LEFT_LAYOUT = "org.eclipse.wst.xsd.ui.internal.left";
+	public static String RIGHT_LAYOUT = "org.eclipse.wst.xsd.ui.internal.right";
+
+	/**
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(IPreferenceStore)
+	 */
+	protected void initializeDefaultPreferences(IPreferenceStore store) {
+		super.initializeDefaultPreferences(store);
+
+		store.setDefault(CONST_XSD_DEFAULT_PREFIX_TEXT, "xsd");
+		store.setDefault(CONST_XSD_LANGUAGE_QUALIFY, false);
+
+		store.setDefault(DEFAULT_PAGE, DESIGN_PAGE);
+		store.setDefault(EDITOR_LAYOUT, COMBINED_LAYOUT);
+		store.setDefault(DESIGN_LAYOUT, RIGHT_LAYOUT);
+
+		store.setDefault(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE, DEFAULT_TARGET_NAMESPACE);
+	}
+
+	public void setDefaultPage(String page) {
+		getPreferenceStore().setValue(DEFAULT_PAGE, page);
+	}
+
+	/**
+	 * Method getDefaultPage.
+	 * 
+	 * @return String value of the string constant that is the default page
+	 *         the editor should turn to when first opened. Changes to the
+	 *         last visible page when the editor was closed
+	 */
+	public String getDefaultPage() {
+		return getPreferenceStore().getString(DEFAULT_PAGE);
+	}
+
+	protected URL baseURL;
+
+	public URL getBaseURL() {
+		return getDescriptor().getInstallURL();
+	}
+
+	public Image getIconImage(String object) {
+		try {
+			return ExtendedImageRegistry.getInstance().getImage(new URL(getBaseURL() + "icons/" + object + ".gif"));
+		}
+		catch (MalformedURLException exception) {
+			System.out.println("Failed to load image for '" + object + "'");
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlink.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlink.java
new file mode 100644
index 0000000..eb1f306
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlink.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+/**
+ * WSDL Hyperlink that knows how to open links from wsdl files
+ */
+public class XSDHyperlink implements IHyperlink {
+	private IRegion fRegion;
+	private XSDConcreteComponent fComponent;
+
+	public XSDHyperlink(IRegion region, XSDConcreteComponent component) {
+		fRegion = region;
+		fComponent = component;
+	}
+
+	public IRegion getHyperlinkRegion() {
+		return fRegion;
+	}
+
+	public String getTypeLabel() {
+		return null;
+	}
+
+	public String getHyperlinkText() {
+		return null;
+	}
+
+	public void open() {
+		// if hyperlink points to schema already in editor, select the correct
+		// node
+		// if (fComponent.getRootContainer().equals(xsdSchema)) {
+		// Node element = fComponent.getElement();
+		// if (element instanceof IndexedRegion) {
+		// IndexedRegion indexNode = (IndexedRegion) element;
+		// textEditor.getTextViewer().setRangeIndication(indexNode.getStartOffset(),
+		// indexNode.getEndOffset() - indexNode.getStartOffset(), true);
+		// }
+		// }
+		// else {
+		if (fComponent.getSchema() != null) {
+			String schemaLocation = URIHelper.removePlatformResourceProtocol(fComponent.getSchema().getSchemaLocation());
+			IPath schemaPath = new Path(schemaLocation);
+			IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
+			if (schemaFile != null && schemaFile.exists()) {
+				IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+				if (workbenchWindow != null) {
+					IWorkbenchPage page = workbenchWindow.getActivePage();
+					try {
+						IEditorPart editorPart = IDE.openEditor(page, schemaFile, true);
+						if (editorPart instanceof XSDEditor) {
+							((XSDEditor) editorPart).openOnGlobalReference(fComponent);
+						}
+					}
+					catch (PartInitException pie) {
+						Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlinkDetector.java
new file mode 100644
index 0000000..133e612
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlinkDetector.java
@@ -0,0 +1,251 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+
+/**
+ * Detects hyperlinks for XSD files
+ */
+public class XSDHyperlinkDetector implements IHyperlinkDetector {
+	/**
+	 * Gets the xsd schema from document
+	 * 
+	 * @param document
+	 * @return XSDSchema or null of one does not exist yet for document
+	 */
+	private XSDSchema getXSDSchema(IDocument document) {
+		XSDSchema schema = null;
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+		if (model != null) {
+			try {
+				if (model instanceof IDOMModel) {
+					IDOMDocument domDoc = ((IDOMModel) model).getDocument();
+					if (domDoc != null) {
+						XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
+						/*
+						 * ISSUE: Didn't want to go through initializing
+						 * schema if it does not already exist, so just
+						 * attempted to get existing adapter. If doesn't
+						 * exist, just don't bother working.
+						 */
+						if (modelAdapter != null)
+							schema = modelAdapter.getSchema();
+					}
+				}
+			}
+			finally {
+				model.releaseFromRead();
+			}
+		}
+		return schema;
+	}
+
+	/**
+	 * 
+	 * @param xsdSchema
+	 *            cannot be null
+	 * @param node
+	 *            cannot be null
+	 * @return XSDConcreteComponent
+	 */
+	private XSDConcreteComponent getXSDComponent(XSDSchema xsdSchema, Node node) {
+		XSDConcreteComponent objectToReveal = null;
+
+		XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent((Node) node);
+		if (xsdComp instanceof XSDElementDeclaration) {
+			XSDElementDeclaration elementDecl = (XSDElementDeclaration) xsdComp;
+			if (elementDecl.isElementDeclarationReference()) {
+				objectToReveal = elementDecl.getResolvedElementDeclaration();
+			}
+			else {
+				XSDConcreteComponent typeDef = null;
+				if (elementDecl.getAnonymousTypeDefinition() == null) {
+					typeDef = elementDecl.getTypeDefinition();
+				}
+
+				XSDConcreteComponent subGroupAffiliation = elementDecl.getSubstitutionGroupAffiliation();
+
+				if (typeDef != null && subGroupAffiliation != null) {
+					// we have 2 things we can navigate to, if the
+					// cursor is anywhere on the substitution
+					// attribute
+					// then jump to that, otherwise just go to the
+					// typeDef.
+					if (node instanceof Attr && ((Attr) node).getLocalName().equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE)) {
+						objectToReveal = subGroupAffiliation;
+					}
+					else {
+						// try to reveal the type now. On success,
+						// then we return true.
+						// if we fail, set the substitution group
+						// as
+						// the object to reveal as a backup plan.
+						// ISSUE: how to set backup?
+						// if (revealObject(typeDef)) {
+						objectToReveal = typeDef;
+						// }
+						// else {
+						// objectToReveal = subGroupAffiliation;
+						// }
+					}
+				}
+				else {
+					// one or more of these is null. If the
+					// typeDef is
+					// non-null, use it. Otherwise
+					// try and use the substitution group
+					objectToReveal = typeDef != null ? typeDef : subGroupAffiliation;
+				}
+			}
+		}
+		else if (xsdComp instanceof XSDModelGroupDefinition) {
+			XSDModelGroupDefinition elementDecl = (XSDModelGroupDefinition) xsdComp;
+			if (elementDecl.isModelGroupDefinitionReference()) {
+				objectToReveal = elementDecl.getResolvedModelGroupDefinition();
+			}
+		}
+		else if (xsdComp instanceof XSDAttributeDeclaration) {
+			XSDAttributeDeclaration attrDecl = (XSDAttributeDeclaration) xsdComp;
+			if (attrDecl.isAttributeDeclarationReference()) {
+				objectToReveal = attrDecl.getResolvedAttributeDeclaration();
+			}
+			else if (attrDecl.getAnonymousTypeDefinition() == null) {
+				objectToReveal = attrDecl.getTypeDefinition();
+			}
+		}
+		else if (xsdComp instanceof XSDAttributeGroupDefinition) {
+			XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) xsdComp;
+			if (attrGroupDef.isAttributeGroupDefinitionReference()) {
+				objectToReveal = attrGroupDef.getResolvedAttributeGroupDefinition();
+			}
+		}
+		else if (xsdComp instanceof XSDIdentityConstraintDefinition) {
+			XSDIdentityConstraintDefinition idConstraintDef = (XSDIdentityConstraintDefinition) xsdComp;
+			if (idConstraintDef.getReferencedKey() != null) {
+				objectToReveal = idConstraintDef.getReferencedKey();
+			}
+		}
+		else if (xsdComp instanceof XSDSimpleTypeDefinition) {
+			XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComp;
+			objectToReveal = typeDef.getItemTypeDefinition();
+			if (objectToReveal == null) {
+				// if itemType attribute is not set, then check
+				// for memberType
+				List memberTypes = typeDef.getMemberTypeDefinitions();
+				if (memberTypes != null && memberTypes.size() > 0) {
+					objectToReveal = (XSDConcreteComponent) memberTypes.get(0);
+				}
+			}
+		}
+		else if (xsdComp instanceof XSDTypeDefinition) {
+			XSDTypeDefinition typeDef = (XSDTypeDefinition) xsdComp;
+			objectToReveal = typeDef.getBaseType();
+		}
+		else if (xsdComp instanceof XSDSchemaDirective) {
+			XSDSchemaDirective directive = (XSDSchemaDirective) xsdComp;
+			// String schemaLocation =
+			// URIHelper.removePlatformResourceProtocol(directive.getResolvedSchema().getSchemaLocation());
+			// openXSDEditor(schemaLocation);
+			// return false;
+			objectToReveal = directive.getResolvedSchema();
+		}
+		return objectToReveal;
+	}
+
+	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
+		// for now, only capable of creating 1 hyperlink
+		List hyperlinks = new ArrayList(0);
+
+		if (region != null && textViewer != null) {
+			IDocument document = textViewer.getDocument();
+			Node node = getCurrentNode(document, region.getOffset());
+			if (node != null) {
+				XSDSchema xsdSchema = getXSDSchema(textViewer.getDocument());
+				if (xsdSchema != null) {
+					XSDConcreteComponent objectToReveal = getXSDComponent(xsdSchema, node);
+					// now reveal the object if this isn't null
+					if (objectToReveal != null) {
+						IRegion nodeRegion = region;
+						if (node instanceof IndexedRegion) {
+							IndexedRegion indexed = (IndexedRegion) node;
+							int start = indexed.getStartOffset();
+							int end = indexed.getEndOffset();
+							nodeRegion = new Region(start, end - start);
+						}
+						hyperlinks.add(new XSDHyperlink(nodeRegion, objectToReveal));
+					}
+				}
+			}
+		}
+
+		if (hyperlinks.size() == 0)
+			return null;
+		return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
+	}
+
+	/**
+	 * Returns the node the cursor is currently on in the document. null if no
+	 * node is selected
+	 * 
+	 * @param offset
+	 * @return Node either element, doctype, text, or null
+	 */
+	private Node getCurrentNode(IDocument document, int offset) {
+		// get the current node at the offset (returns either: element,
+		// doctype, text)
+		IndexedRegion inode = null;
+		IStructuredModel sModel = null;
+		try {
+			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+			inode = sModel.getIndexedRegion(offset);
+			if (inode == null)
+				inode = sModel.getIndexedRegion(offset - 1);
+		}
+		finally {
+			if (sModel != null)
+				sModel.releaseFromRead();
+		}
+
+		if (inode instanceof Node) {
+			return (Node) inode;
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMenuListener.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMenuListener.java
new file mode 100644
index 0000000..61093be
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMenuListener.java
@@ -0,0 +1,1762 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionContext;
+import org.eclipse.wst.xsd.ui.internal.actions.AddEnumsAction;
+import org.eclipse.wst.xsd.ui.internal.actions.AddModelGroupAction;
+import org.eclipse.wst.xsd.ui.internal.actions.BackAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateAnnotationAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateGroupAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateIdentityConstraintsAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateLocalComplexTypeAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateLocalSimpleTypeAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateSimpleContentAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateSimpleTypeAction;
+import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
+import org.eclipse.wst.xsd.ui.internal.actions.DeleteAction;
+import org.eclipse.wst.xsd.ui.internal.actions.OpenSchemaAction;
+import org.eclipse.wst.xsd.ui.internal.actions.SetBaseTypeAction;
+import org.eclipse.wst.xsd.ui.internal.actions.SetMultiplicityAction;
+import org.eclipse.wst.xsd.ui.internal.actions.SetTypeAction;
+import org.eclipse.wst.xsd.ui.internal.actions.XSDEditNamespacesAction;
+import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
+import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.refactor.actions.RefactorActionGroup;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class XSDMenuListener implements IMenuListener
+{
+  protected ISelectionProvider selectionProvider;
+  protected DeleteAction deleteAction;
+  protected CreateElementAction addComplexTypeAction;
+  protected XSDSchema xsdSchema;
+  protected boolean isReadOnly;
+  protected Object sourceContext;
+  private RefactorActionGroup fRefactorMenuGroup;
+
+  /**
+   * Constructor for XSDMenuListener.
+   */
+  public XSDMenuListener(ISelectionProvider selectionProvider)
+  {
+    super();
+    this.selectionProvider = selectionProvider;
+
+    deleteAction = new DeleteAction(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE"), null, getXSDSchema());
+    deleteAction.setSelectionProvider(selectionProvider);
+    selectionProvider.addSelectionChangedListener(deleteAction);
+  }
+
+  public void setSourceContext(Object sourceContext)
+  {
+    this.sourceContext = sourceContext;
+  }
+
+  public void setSelectionProvider(ISelectionProvider selectionProvider)
+  {
+    this.selectionProvider = selectionProvider;
+  }
+
+  protected XSDSchema getXSDSchema()
+  {
+    return xsdSchema;
+  }
+
+  protected Object getSelectedElement()
+  {
+    ISelection selection = selectionProvider.getSelection();
+    if (selection.isEmpty())
+    {
+      return null;
+    }
+    return ((IStructuredSelection) selection).getFirstElement();
+  }
+  
+  protected boolean isSchemaReadOnly()
+  {
+	  XSDSchema editorSchema = ((XSDEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getXSDSchema();
+	  if (editorSchema == xsdSchema) {
+		  return false;
+	  }
+
+	  return true; 
+  }
+  
+  protected XSDSchema getCurrentSchemaInEditor()
+  {
+    return ((XSDEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getXSDSchema();
+  }
+    
+  protected void updateXSDSchema()
+  {
+    isReadOnly = false;
+
+    Object object = getSelectedElement();
+    if (object instanceof XSDConcreteComponent)
+    {
+      xsdSchema = ((XSDConcreteComponent) object).getSchema();
+      isReadOnly = isSchemaReadOnly();
+    }
+    else if (object instanceof Category)
+    {
+      Category cg = (Category) object;
+      xsdSchema = cg.getXSDSchema();
+    }
+    else if (object instanceof CategoryAdapter)
+    {
+      CategoryAdapter category = (CategoryAdapter) object;
+      xsdSchema = category.getXSDSchema();
+    }
+  }
+  
+  /*
+   * @see IMenuListener#menuAboutToShow(IMenuManager)
+   */
+  public void menuAboutToShow(IMenuManager manager)
+  {
+    isReadOnly = false;
+    updateXSDSchema();
+    if (xsdSchema == null)
+    {
+      manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+      return;
+    }
+    
+    deleteAction.setXSDSchema(xsdSchema);
+    deleteAction.setEnabled(!isReadOnly);
+    
+    BackAction backAction = new BackAction(XSDEditorPlugin.getXSDString("_UI_ACTION_BACK_TO_SCHEMA_VIEW")); //$NON-NLS-1$
+    backAction.setXSDSchema(getCurrentSchemaInEditor());
+    backAction.setSelectionProvider(selectionProvider);
+    
+    Object selectedElementObj = getSelectedElement();
+    
+    if (selectedElementObj instanceof XSDSchema || selectedElementObj instanceof Category || selectedElementObj instanceof CategoryAdapter)
+    {
+      backAction.setEnabled(false);
+    }
+    manager.add(backAction);
+    manager.add(new Separator());
+//    if (undoAction == null && textEditor != null)
+//    {
+//      undoAction = textEditor.getAction(org.eclipse.ui.texteditor.ITextEditorActionConstants.UNDO);
+//      redoAction = textEditor.getAction(org.eclipse.ui.texteditor.ITextEditorActionConstants.REDO);
+//    }
+    //    Element selectedElement = getSelectedElement();
+
+    Element selectedElement = null;
+    
+    if (selectedElementObj instanceof Element)
+    {
+      selectedElement = (Element) selectedElementObj;
+    }
+    else if (selectedElementObj instanceof XSDConcreteComponent)
+    {
+      selectedElement = ((XSDConcreteComponent) selectedElementObj).getElement();
+    }
+    else if (selectedElementObj instanceof Category || selectedElementObj instanceof CategoryAdapter)
+    {
+      int groupType = -1;
+      if (selectedElementObj instanceof Category)
+      {
+        Category category = (Category) selectedElementObj;
+        groupType = category.getGroupType();
+      }
+      // todo... We need to ensure we eliminate the need for
+      // this case. The XSDMenuListener class should not have
+      // view dependant code. We need to do some work to ensure all
+      // views utilize the 'Category' model object
+      else if (selectedElementObj instanceof CategoryAdapter)
+      {
+        CategoryAdapter categoryAdapter = (CategoryAdapter) selectedElementObj;
+        groupType = categoryAdapter.getGroupType();
+      }
+      ArrayList attributes = null;
+      Element parent = getXSDSchema().getElement();
+      
+      if (parent == null)
+      {
+        return;
+      }
+      
+      Node relativeNode = null;
+      switch (groupType)
+      {
+        case Category.TYPES : {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
+          Action action = addCreateElementAction(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_COMPLEX_TYPE"), attributes, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
+          Action action2 = addCreateSimpleTypeAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SIMPLE_TYPE"), attributes, parent, relativeNode);
+          ((CreateElementAction) action2).setIsGlobal(true);
+          break;
+        }
+        case Category.ELEMENTS : {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ELEMENT_ELEMENT_TAG, "GlobalElement")));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          Action action = addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT"), attributes, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          break;
+        }
+        case Category.GROUPS : {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.GROUP_ELEMENT_TAG, "Group")));
+          CreateGroupAction groupAction = addCreateGroupAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GROUP"), attributes, parent, relativeNode);
+          groupAction.setIsGlobal(true);
+          break;
+        }
+        case Category.ATTRIBUTES : {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ATTRIBUTE_ELEMENT_TAG, "GlobalAttribute")));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          Action action = addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GLOBAL_ATTRIBUTE"), attributes, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          break;
+        }
+        case Category.ATTRIBUTE_GROUPS : {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, "AttributeGroup")));
+          Action action = addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP"), attributes, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          break;
+        }
+        case Category.NOTATIONS : {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.NOTATION_ELEMENT_TAG, "Notation")));
+          attributes.add(new DOMAttribute(XSDConstants.PUBLIC_ATTRIBUTE, ""));
+          Action action = addCreateElementAction(manager, XSDConstants.NOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_NOTATION"), attributes, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          break;
+        }
+        case Category.DIRECTIVES : {
+          boolean b = true;
+          NodeList children = parent.getChildNodes();
+          int length = children.getLength();
+          Node effectiveRelativeNode = parent.getFirstChild();
+          for (int i = 0; i < length && b; i++)
+          {
+            Node child = children.item(i);
+            if (child != null && child instanceof Element)
+            {
+              if (XSDDOMHelper.inputEquals((Element) child, XSDConstants.INCLUDE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.IMPORT_ELEMENT_TAG, false)
+                  || XSDDOMHelper.inputEquals((Element) child, XSDConstants.REDEFINE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
+              {
+                effectiveRelativeNode = child;
+              }
+              else
+              {
+                b = false;
+              }
+            }
+          }
+          relativeNode = effectiveRelativeNode != null ? XSDDOMHelper.getNextElementNode(effectiveRelativeNode) : null;
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, ""));
+          Action action = addCreateElementAction(manager, XSDConstants.INCLUDE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_INCLUDE"), attributes, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          action = addCreateElementAction(manager, XSDConstants.IMPORT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_IMPORT"), null, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          action = addCreateElementAction(manager, XSDConstants.REDEFINE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_REDEFINE"), attributes, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          break;
+        }
+        case Category.ANNOTATIONS : {
+          Action action = addCreateElementAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), null, parent, relativeNode);
+          ((CreateElementAction) action).setIsGlobal(true);
+          break;
+        }
+      }
+//      manager.add(new Separator());
+//      if (undoAction != null)
+//      {
+//        manager.add(undoAction);
+//        manager.add(redoAction);
+//      }
+      
+      // insertion point for popupMenus extension
+      manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));    
+
+      return;
+    }
+    if (selectedElement != null)
+    {
+      addContextItems(manager, selectedElement, null);
+      manager.add(new Separator());
+    }
+    
+    manager.add(new Separator());
+    if (deleteAction != null)
+    {
+      manager.add(deleteAction);
+    }
+    
+    // insertion point for popupMenus extension
+    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));    
+  }
+
+  protected String getBuiltInStringQName()
+  {
+    String stringName = "string";
+    if (getXSDSchema() != null)
+    {
+      String schemaForSchemaPrefix = getXSDSchema().getSchemaForSchemaQNamePrefix();
+      if (schemaForSchemaPrefix != null && schemaForSchemaPrefix.length() > 0)
+      {
+        String prefix = getXSDSchema().getSchemaForSchemaQNamePrefix();
+        if (prefix != null && prefix.length() > 0)
+        {
+          stringName = prefix + ":" + stringName;
+        }
+      }
+    }
+    return stringName;
+  }
+
+  /**
+   * Method addContextItems.
+   * 
+   * @param manager
+   * @param parent -
+   *          menu items should be context sensitive to this node
+   * @param relativeNode -
+   *          anything inserted, should be inserted before this node (which is a
+   *          child of the parent node. A value of null means add to the end
+   */
+  protected void addContextItems(IMenuManager manager, Element parent, Node relativeNode)
+  {
+    ArrayList attributes = null;
+    if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+    { //
+      addSchemaElementItems(manager, parent, relativeNode);
+      manager.add(new Separator());
+      boolean b = true;
+      NodeList children = parent.getChildNodes();
+      Node effectiveRelativeNode = parent.getFirstChild();
+      for (int i = 0; i < children.getLength() && b; i++)
+      {
+        Node child = children.item(i);
+        if (child != null && child instanceof Element)
+        {
+          if (XSDDOMHelper.inputEquals((Element) child, XSDConstants.INCLUDE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.IMPORT_ELEMENT_TAG, false)
+              || XSDDOMHelper.inputEquals((Element) child, XSDConstants.REDEFINE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
+          {
+            effectiveRelativeNode = child;
+          }
+          else
+          {
+            b = false;
+          }
+        }
+      }
+      relativeNode = effectiveRelativeNode != null ? effectiveRelativeNode.getNextSibling() : null;
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, ""));
+      addCreateElementAction(manager, XSDConstants.INCLUDE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_INCLUDE"), attributes, parent, relativeNode);
+      addCreateElementAction(manager, XSDConstants.IMPORT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_IMPORT"), null, parent, relativeNode);
+      addCreateElementAction(manager, XSDConstants.REDEFINE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_REDEFINE"), attributes, parent, relativeNode);
+      attributes = null;
+      addCreateAnnotationAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), null, parent, relativeNode);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
+    { //
+      addCreateElementAction(manager, XSDConstants.DOCUMENTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_DOC"), attributes, parent, null);
+      addCreateElementAction(manager, XSDConstants.APPINFO_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_APP_INFO"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+    {
+      XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
+      Element parentNode = (Element) parent.getParentNode();
+      boolean isGlobalElement = false;
+      if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        isGlobalElement = true;
+      }
+      boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      boolean simpleTypeExists = elementExists(XSDConstants.SIMPLETYPE_ELEMENT_TAG, parent);
+      boolean complexTypeExists = elementExists(XSDConstants.COMPLEXTYPE_ELEMENT_TAG, parent);
+      manager.add(new Separator());
+      if (annotationExists)
+      {
+        Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+        if (!(simpleTypeExists || complexTypeExists) && annotationNode != null)
+        {
+          manager.add(new Separator());
+        }
+      }
+      else
+      {
+        if (concreteComponent != null)
+        {
+          AddModelGroupAction addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.SEQUENCE_LITERAL);
+          addModelGroupAction.setEnabled(!isReadOnly);
+          manager.add(addModelGroupAction);
+          
+          addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.CHOICE_LITERAL);
+          addModelGroupAction.setEnabled(!isReadOnly);
+          manager.add(addModelGroupAction);
+          
+          addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.ALL_LITERAL);
+          addModelGroupAction.setEnabled(!isReadOnly);
+          manager.add(addModelGroupAction);
+          
+          manager.add(new Separator());
+        }
+      }
+      XSDDOMHelper domHelper = new XSDDOMHelper();
+      Element anonymousType = (Element) domHelper.getChildNode(parent, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      if (anonymousType != null)
+      {
+        manager.add(new Separator());
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
+        addMoveAnonymousGlobal(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, anonymousType, null);
+        attributes = null;
+      }
+      anonymousType = (Element) domHelper.getChildNode(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      if (anonymousType != null)
+      {
+        manager.add(new Separator());
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
+        addMoveAnonymousGlobal(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, anonymousType, null);
+        attributes = null;
+      }
+      
+      manager.add(new Separator());
+      MenuManager setTypeCascadeMenu = new MenuManager(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"));
+      manager.add(setTypeCascadeMenu);
+
+      SetTypeAction setNewComplexTypeAction = new SetTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_NEW_COMPLEX_TYPE"), ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDComplexType.gif"), concreteComponent);
+      setNewComplexTypeAction.setTypeKind(XSDConstants.COMPLEXTYPE_ELEMENT);
+      setNewComplexTypeAction.setEnabled(!isReadOnly);
+      setTypeCascadeMenu.add(setNewComplexTypeAction);
+
+      SetTypeAction setNewSimpleTypeAction = new SetTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_NEW_SIMPLE_TYPE"), ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleType.gif"), concreteComponent);
+      setNewSimpleTypeAction.setTypeKind(XSDConstants.SIMPLETYPE_ELEMENT);
+      setNewSimpleTypeAction.setEnabled(!isReadOnly);
+      setTypeCascadeMenu.add(setNewSimpleTypeAction);
+      
+      SetTypeAction setExistingTypeAction = new SetTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_EXISTING_TYPE"), concreteComponent);
+      setExistingTypeAction.setTypeKind(0);
+      setExistingTypeAction.setEnabled(!isReadOnly);
+      setTypeCascadeMenu.add(setExistingTypeAction);
+      manager.add(new Separator());
+
+      if (!isGlobalElement)
+      {
+        addMultiplicityMenu(concreteComponent, manager);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.SEQUENCE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(parent, XSDConstants.CHOICE_ELEMENT_TAG, false))
+    { //
+      XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
+      
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      manager.add(new Separator());
+      addCreateElementAction(manager, XSDConstants.CHOICE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CHOICE"), attributes, parent, null);
+      addCreateElementAction(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SEQUENCE"), attributes, parent, null);
+      addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, null);
+      manager.add(new Separator());
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ELEMENT_ELEMENT_TAG, "Element", false)));
+      attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+      addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT"), attributes, parent, null);
+      addCreateElementRefAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT_REF"), parent, null);
+      manager.add(new Separator());
+      attributes = null;
+      addCreateElementAction(manager, XSDConstants.ANY_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ELEMENT"), attributes, parent, null);
+      
+      if (concreteComponent.getContainer() instanceof XSDParticle)
+      {
+        addMultiplicityMenu(concreteComponent, manager);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ALL_ELEMENT_TAG, false))
+    { //
+      XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
+      
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      manager.add(new Separator());
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ELEMENT_ELEMENT_TAG, "Element", false)));
+      attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+      addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT"), attributes, parent, null);
+      addCreateElementRefAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT_REF"), parent, null);
+
+      if (concreteComponent.getContainer() instanceof XSDParticle)
+      {
+        addMultiplicityMenu(concreteComponent, manager);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
+    { //
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      boolean anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
+      Node anyAttributeNode = null;
+      manager.add(new Separator());
+      if (anyAttributeExists)
+      {
+        anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+        attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+        addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
+        attributes = null;
+        addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
+        addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
+      }
+      else
+      {
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+        attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+        addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+        attributes = null;
+        addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
+        addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
+      }
+      attributes = null;
+      addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.NOTATION_ELEMENT_TAG, false))
+    { //
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+    { //
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      boolean restrictionExists = elementExists(XSDConstants.RESTRICTION_ELEMENT_TAG, parent);
+      boolean unionExists = elementExists(XSDConstants.UNION_ELEMENT_TAG, parent);
+      boolean listExists = elementExists(XSDConstants.LIST_ELEMENT_TAG, parent);
+      if (!(restrictionExists || unionExists || listExists))
+      {
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, getBuiltInStringQName()));
+        addCreateElementActionIfNotExist(manager, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), attributes, parent, null);
+        attributes = null;
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, getBuiltInStringQName()));
+        addCreateElementActionIfNotExist(manager, XSDConstants.UNION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_UNION"), attributes, parent, null);
+        attributes = null;
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, getBuiltInStringQName()));
+        addCreateElementActionIfNotExist(manager, XSDConstants.LIST_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LIST"), attributes, parent, null);
+        attributes = null;
+      }
+      if (XSDDOMHelper.inputEquals(parent.getParentNode(), XSDConstants.ELEMENT_ELEMENT_TAG, false))
+      {
+        manager.add(new Separator());
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
+        addMoveAnonymousGlobal(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, parent, null);
+        attributes = null;
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.GROUP_ELEMENT_TAG, false))
+    { //
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+    { //
+      boolean annotationExists = false;
+      boolean contentExists = false;
+      Node annotationNode = null;
+      NodeList children = parent.getChildNodes();
+      for (int i = 0; i < children.getLength(); i++)
+      {
+        Node child = children.item(i);
+        if (child != null && child instanceof Element)
+        {
+          if (XSDDOMHelper.inputEquals((Element) child, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
+          {
+            annotationNode = child;
+            annotationExists = true;
+          }
+          else if (XSDDOMHelper.inputEquals((Element) child, XSDConstants.SEQUENCE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.ALL_ELEMENT_TAG, false)
+              || XSDDOMHelper.inputEquals((Element) child, XSDConstants.CHOICE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.GROUP_ELEMENT_TAG, true)
+              || XSDDOMHelper.inputEquals((Element) child, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+          {
+            contentExists = true;
+          }
+        }
+      }
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      manager.add(new Separator());
+      addSetBaseTypeAction(manager, parent);
+      XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
+      if (annotationExists)
+      {
+        if (!contentExists)
+        {
+          if (concreteComponent != null)
+          {
+            AddModelGroupAction addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.SEQUENCE_LITERAL);
+            addModelGroupAction.setEnabled(!isReadOnly);
+            manager.add(addModelGroupAction);
+            
+            addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.CHOICE_LITERAL);
+            addModelGroupAction.setEnabled(!isReadOnly);
+            manager.add(addModelGroupAction);
+            
+            addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.ALL_LITERAL);
+            addModelGroupAction.setEnabled(!isReadOnly);
+            manager.add(addModelGroupAction);
+
+          }
+          addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, annotationNode.getNextSibling());
+          attributes = null;
+        }
+      }
+      else
+      {
+        if (!contentExists)
+        {
+          if (concreteComponent != null)
+          {
+            AddModelGroupAction addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.SEQUENCE_LITERAL);
+            addModelGroupAction.setEnabled(!isReadOnly);
+            manager.add(addModelGroupAction);
+            
+            addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.CHOICE_LITERAL);
+            addModelGroupAction.setEnabled(!isReadOnly);
+            manager.add(addModelGroupAction);
+            
+            addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.ALL_LITERAL);
+            addModelGroupAction.setEnabled(!isReadOnly);
+            manager.add(addModelGroupAction);
+
+          }
+          addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, parent.getFirstChild());
+          attributes = null;
+        }
+      }
+      manager.add(new Separator());
+      if (XSDDOMHelper.inputEquals(parent.getParentNode(), XSDConstants.ELEMENT_ELEMENT_TAG, false))
+      {
+        manager.add(new Separator());
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
+        addMoveAnonymousGlobal(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, parent, null);
+        attributes = null;
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+    { //
+      XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
+      Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      manager.add(new Separator());
+      if (derivedByNode == null)
+      {
+        TypesHelper typesHelper = new TypesHelper(getXSDSchema());
+        String firstType = "";
+        List listOfCT = typesHelper.getUserComplexTypeNamesList();
+        if (listOfCT.size() > 0)
+        {
+          firstType = (String) (listOfCT).get(0);
+        }
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, firstType));
+        addCreateElementActionIfNotExist(manager, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), attributes, parent, null);
+        addCreateElementActionIfNotExist(manager, XSDConstants.EXTENSION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_EXTENSION"), attributes, parent, null);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+    { //
+      XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
+      Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      manager.add(new Separator());
+      if (derivedByNode == null)
+      {
+        TypesHelper typesHelper = new TypesHelper(getXSDSchema());
+        String firstType = "";
+        List listOfCT = typesHelper.getUserComplexTypeNamesList();
+        if (listOfCT.size() > 0)
+        {
+          firstType = (String) (listOfCT).get(0);
+        }
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, firstType));
+        addCreateElementActionIfNotExist(manager, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), attributes, parent, null);
+        addCreateElementActionIfNotExist(manager, XSDConstants.EXTENSION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_EXTENSION"), attributes, parent, null);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
+    {
+      Element parentNode = (Element) parent.getParentNode();
+      // <simpleContent>
+      //    <restriction>
+      //      ...
+      if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+      {
+        boolean annotationExists = false;
+        boolean anyAttributeExists = false;
+        Node anyAttributeNode = null;
+        anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
+        annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
+            .getFirstChild());
+        if (annotationExists)
+        {
+          getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+        }
+
+        manager.add(new Separator());
+        if (anyAttributeExists)
+        {
+          anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
+          attributes = null;
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
+        }
+        else
+        {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+          attributes = null;
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
+        }
+        attributes = null;
+        addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+      }
+      // <simpleType>
+      //    <restriction>
+      //      ...
+      else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+      {
+        boolean annotationExists = false;
+        attributes = null;
+        annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
+            .getFirstChild());
+        if (annotationExists)
+        {
+          Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+          addCreateLocalSimpleTypeActionIfNotExist(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, annotationNode
+              .getNextSibling());
+        }
+        else
+        {
+          addCreateLocalSimpleTypeActionIfNotExist(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, parent
+              .getFirstChild());
+        }
+        manager.add(new Separator());
+        addCreateElementAction(manager, XSDConstants.PATTERN_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_PATTERN"), attributes, parent, null);
+        addCreateElementAction(manager, XSDConstants.ENUMERATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUM"), attributes, parent, null);
+        addEnumsAction(manager, XSDConstants.ENUMERATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUMS"), attributes, parent, null);
+      }
+      // <complexContent>
+      //    <restriction>
+      //      ...
+      else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+      {
+        boolean annotationExists = false;
+        boolean anyAttributeExists = false;
+        Node anyAttributeNode = null;
+        boolean sequenceExists = elementExists(XSDConstants.SEQUENCE_ELEMENT_TAG, parent);
+        boolean choiceExists = elementExists(XSDConstants.CHOICE_ELEMENT_TAG, parent);
+        boolean allExists = elementExists(XSDConstants.ALL_ELEMENT_TAG, parent);
+        boolean groupExists = elementExists(XSDConstants.GROUP_ELEMENT_TAG, parent);
+        anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
+        annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
+            .getFirstChild());
+        manager.add(new Separator());
+        if (annotationExists)
+        {
+          if (!(sequenceExists || choiceExists || allExists || groupExists))
+          {
+            Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+            addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, annotationNode
+                .getNextSibling());
+            addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, annotationNode.getNextSibling());
+          }
+        }
+        else
+        {
+          if (!(sequenceExists || choiceExists || allExists || groupExists))
+          {
+            addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, parent.getFirstChild());
+            addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, parent.getFirstChild());
+          }
+        }
+        manager.add(new Separator());
+        if (anyAttributeExists)
+        {
+          anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
+          attributes = null;
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
+        }
+        else
+        {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+          attributes = null;
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
+        }
+        attributes = null;
+        addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.EXTENSION_ELEMENT_TAG, false))
+    {
+      Element parentNode = (Element) parent.getParentNode();
+      // <simpleContent>
+      //    <extension>
+      //      ...
+      if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+      {
+        boolean anyAttributeExists = false;
+        Node anyAttributeNode = null;
+        anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
+        addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
+            .getFirstChild());
+        manager.add(new Separator());
+        if (anyAttributeExists)
+        {
+          anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
+          attributes = null;
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
+        }
+        else
+        {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+          attributes = null;
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
+        }
+        attributes = null;
+        addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+      }
+      // <complexContent>
+      //    <extension>
+      //      ...
+      else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+      {
+        boolean annotationExists = false;
+        boolean anyAttributeExists = false;
+        Node anyAttributeNode = null;
+        boolean sequenceExists = elementExists(XSDConstants.SEQUENCE_ELEMENT_TAG, parent);
+        boolean choiceExists = elementExists(XSDConstants.CHOICE_ELEMENT_TAG, parent);
+        boolean allExists = elementExists(XSDConstants.ALL_ELEMENT_TAG, parent);
+        boolean groupExists = elementExists(XSDConstants.GROUP_ELEMENT_TAG, parent);
+        anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
+        annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
+            .getFirstChild());
+        manager.add(new Separator());
+        if (annotationExists)
+        {
+          if (!(sequenceExists || choiceExists || allExists || groupExists))
+          {
+            Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+            addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, annotationNode
+                .getNextSibling());
+            addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, annotationNode.getNextSibling());
+          }
+        }
+        else
+        {
+          if (!(sequenceExists || choiceExists || allExists || groupExists))
+          {
+            addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, parent.getFirstChild());
+            addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, parent.getFirstChild());
+          }
+        }
+        manager.add(new Separator());
+        if (anyAttributeExists)
+        {
+          anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
+          attributes = null;
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
+        }
+        else
+        {
+          attributes = new ArrayList();
+          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+          attributes = null;
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
+          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
+        }
+        attributes = null;
+        addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.REDEFINE_ELEMENT_TAG, false))
+    { //
+      addCreateElementAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, null);
+      addCreateElementAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SIMPLE_TYPE"), attributes, parent, null);
+      addCreateElementAction(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_COMPLEX_TYPE"), attributes, parent, null);
+      addCreateGroupAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GROUP"), attributes, parent, null);
+      addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP"), attributes, parent, null);
+      manager.add(new Separator());
+      addOpenSchemaAction(manager, XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), parent);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.LIST_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      manager.add(new Separator());
+      addCreateLocalSimpleTypeActionIfNotExist(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.UNION_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      manager.add(new Separator());
+      addCreateLocalSimpleTypeAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.UNIQUE_ELEMENT_TAG, false))
+    {
+      boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      manager.add(new Separator());
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
+      if (annotationExists)
+      {
+        Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, annotationNode.getNextSibling());
+      }
+      else
+      {
+        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, parent.getFirstChild());
+      }
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
+      addCreateElementAction(manager, XSDConstants.FIELD_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_FIELD"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.KEYREF_ELEMENT_TAG, false))
+    {
+      boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      manager.add(new Separator());
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
+      if (annotationExists)
+      {
+        Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, annotationNode.getNextSibling());
+      }
+      else
+      {
+        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, parent.getFirstChild());
+      }
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
+      addCreateElementAction(manager, XSDConstants.FIELD_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_FIELD"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.KEY_ELEMENT_TAG, false))
+    {
+      boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+          parent.getFirstChild());
+      manager.add(new Separator());
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
+      if (annotationExists)
+      {
+        Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, annotationNode.getNextSibling());
+      }
+      else
+      {
+        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, parent.getFirstChild());
+      }
+      attributes = new ArrayList();
+      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
+      addCreateElementAction(manager, XSDConstants.FIELD_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_FIELD"), attributes, parent, null);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.IMPORT_ELEMENT_TAG, false))
+    {
+      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      manager.add(new Separator());
+      addOpenSchemaAction(manager, XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), parent);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.SELECTOR_ELEMENT_TAG, false))
+    {
+      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.FIELD_ELEMENT_TAG, false))
+    {
+      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.INCLUDE_ELEMENT_TAG, false))
+    {
+      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      manager.add(new Separator());
+      addOpenSchemaAction(manager, XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), parent);
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ANY_ELEMENT_TAG, false))
+    {
+      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      // need to add adapters for the ANY element.  I'd rather not provide this menu
+      // and let users see that the graph view doesn't update
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
+    {
+      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+    {
+      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+      addCreateLocalSimpleTypeActionIfNotExist(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, null);
+    }
+    // Facets all have optional annotation nodes
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MINEXCLUSIVE_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MININCLUSIVE_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MAXINCLUSIVE_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.TOTALDIGITS_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.FRACTIONDIGITS_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.LENGTH_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MINLENGTH_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MAXLENGTH_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ENUMERATION_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.WHITESPACE_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.PATTERN_ELEMENT_TAG, false))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
+    {
+      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
+    }
+    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ELEMENT_ELEMENT_TAG, true))
+    {
+      XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)getXSDSchema().getCorrespondingComponent(parent);
+      if (xsdConcreteComponent instanceof XSDElementDeclaration)
+      {
+        XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)xsdConcreteComponent;
+        XSDElementDeclaration resolvedElementDeclaration = xsdElementDeclaration.getResolvedElementDeclaration();
+        if (resolvedElementDeclaration.getRootContainer() == xsdSchema)
+        {
+          parent = resolvedElementDeclaration.getElement(); 
+        
+          boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
+              parent.getFirstChild());
+          boolean simpleTypeExists = elementExists(XSDConstants.SIMPLETYPE_ELEMENT_TAG, parent);
+          boolean complexTypeExists = elementExists(XSDConstants.COMPLEXTYPE_ELEMENT_TAG, parent);
+          manager.add(new Separator());
+          if (annotationExists)
+          {
+            Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
+            if (!(simpleTypeExists || complexTypeExists) && annotationNode != null)
+            {
+              manager.add(new Separator());
+            }
+          }
+          else
+          {
+            XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
+            if (concreteComponent != null)
+            {
+              AddModelGroupAction addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.SEQUENCE_LITERAL);
+              addModelGroupAction.setEnabled(!isReadOnly);
+              manager.add(addModelGroupAction);
+              
+              addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.CHOICE_LITERAL);
+              addModelGroupAction.setEnabled(!isReadOnly);
+              manager.add(addModelGroupAction);
+              
+              addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.ALL_LITERAL);
+              addModelGroupAction.setEnabled(!isReadOnly);
+              manager.add(addModelGroupAction);
+              
+              manager.add(new Separator());
+            }
+          }
+          XSDDOMHelper domHelper = new XSDDOMHelper();
+          Element anonymousType = (Element) domHelper.getChildNode(parent, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+          if (anonymousType != null)
+          {
+            manager.add(new Separator());
+            attributes = new ArrayList();
+            attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
+            addMoveAnonymousGlobal(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, anonymousType, null);
+            attributes = null;
+          }
+          anonymousType = (Element) domHelper.getChildNode(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+          if (anonymousType != null)
+          {
+            manager.add(new Separator());
+            attributes = new ArrayList();
+            attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
+            addMoveAnonymousGlobal(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, anonymousType, null);
+            attributes = null;
+          }
+        }
+        addMultiplicityMenu(xsdConcreteComponent, manager);
+      }
+    }
+   
+    XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
+    if (concreteComponent instanceof XSDNamedComponent)
+    {
+      addRefactorMenuGroup(manager);
+    }
+  }
+
+  protected void addContextInsertItems(IMenuManager manager, Element parent, Element currentElement, Node relativeNode)
+  {
+    ArrayList attributes = null;
+    if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.INCLUDE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(currentElement, XSDConstants.IMPORT_ELEMENT_TAG, false)
+        || XSDDOMHelper.inputEquals(currentElement, XSDConstants.REDEFINE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(currentElement, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
+    {
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        attributes = new ArrayList();
+        attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, ""));
+        addCreateElementAction(manager, XSDConstants.INCLUDE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_INCLUDE"), attributes, parent, relativeNode);
+        addCreateElementAction(manager, XSDConstants.IMPORT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_IMPORT"), null, parent, relativeNode);
+        addCreateElementAction(manager, XSDConstants.REDEFINE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_REDEFINE"), attributes, parent, relativeNode);
+        attributes = null;
+        addCreateElementAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), null, parent, relativeNode);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+    {
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        addSchemaElementItems(manager, parent, relativeNode);
+      }
+      else if (XSDDOMHelper.inputEquals(parent, XSDConstants.UNION_ELEMENT_TAG, false))
+      {
+        addCreateLocalSimpleTypeAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, relativeNode);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+    {
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        addSchemaElementItems(manager, parent, relativeNode);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.GROUP_ELEMENT_TAG, false))
+    {
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        addSchemaElementItems(manager, parent, relativeNode);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
+    {
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        addSchemaElementItems(manager, parent, relativeNode);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+    {
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        addSchemaElementItems(manager, parent, relativeNode);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+    {
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        addSchemaElementItems(manager, parent, relativeNode);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.NOTATION_ELEMENT_TAG, false))
+    {
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        addSchemaElementItems(manager, parent, relativeNode);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.DOCUMENTATION_ELEMENT_TAG, false))
+    {
+      addCreateElementAction(manager, XSDConstants.DOCUMENTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_DOC"), attributes, parent, relativeNode);
+      addCreateElementAction(manager, XSDConstants.APPINFO_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_APP_INFO"), attributes, parent, relativeNode);
+    }
+    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.APPINFO_ELEMENT_TAG, false))
+    {
+      addCreateElementAction(manager, XSDConstants.DOCUMENTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_DOC"), attributes, parent, relativeNode);
+      addCreateElementAction(manager, XSDConstants.APPINFO_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_APP_INFO"), attributes, parent, relativeNode);
+    }
+  }
+
+  protected String getNewGlobalName(String elementTag, String description)
+  {
+    return getNewGlobalName(elementTag, description, false);
+  }
+
+  protected String getNewGlobalTypeName(String description)
+  {
+    return getNewGlobalName(null, description, true);
+  }
+
+  protected String getNewGlobalName(String elementTag, String description, boolean isSimpleOrComplexType)
+  {  
+     return getNewName(getXSDSchema().getDocument(), elementTag, description, isSimpleOrComplexType);
+  }
+
+  // TODO.. .we need to rewrite this code to me model driven... not document driven
+  //
+  protected String getNewName(Node parentNode, String elementTag, String description, boolean isSimpleOrComplexType)
+  {
+    NodeList list = null;
+    NodeList typeList2 = null;
+    // if the global name is for a simple or complex type, we ignore the
+    // elementTag and populate 2 lists
+    // one to look for all simple types and the other to look for all complex
+    // types
+    if (isSimpleOrComplexType)
+    {
+      if (parentNode instanceof Document)
+      {
+        list = ((Document) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+        typeList2 = ((Document) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      }
+      else if (parentNode instanceof Element)
+      {
+        list = ((Element) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+        typeList2 = ((Element) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      }
+    }
+    else
+    {
+      if (parentNode instanceof Document)
+      {
+        list = ((Document) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, elementTag);
+      }
+      else if (parentNode instanceof Element)
+      {
+        list = ((Element) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, elementTag);
+      }
+    }
+    String name = "New" + description;
+    if (list == null || list.getLength() == 0 && (typeList2 != null && typeList2.getLength() == 0))
+    {
+      return name;
+    }
+    for (int i = 1; i < 100; i++)
+    {
+      boolean newName = false;
+      for (int j = 0; j < list.getLength(); j++)
+      {
+        String currName = ((Element) list.item(j)).getAttribute(XSDConstants.NAME_ATTRIBUTE);
+        if (currName == null || currName.length() == 0)
+        {
+          continue;
+        }
+        if (currName.equals(name))
+        {
+          name = "New" + description + String.valueOf(i);
+          newName = true;
+          break;
+        }
+      }
+      // if there is another type list and we haven't created a new name, then
+      // check the type list
+      if (typeList2 != null && !newName)
+      {
+        for (int j = 0; j < typeList2.getLength(); j++)
+        {
+          String currName = ((Element) typeList2.item(j)).getAttribute(XSDConstants.NAME_ATTRIBUTE);
+          if (currName == null || currName.length() == 0)
+          {
+            continue;
+          }
+          if (currName.equals(name))
+          {
+            name = "New" + description + String.valueOf(i);
+            break;
+          }
+        }
+      }
+    }
+    return name;
+  }
+
+  protected String getFirstGlobalElementTagName(String elementTag)
+  {
+    //XMLModel model = getXMLModel();
+    //if (model != null)
+    {
+      XSDSchema schema = getXSDSchema();
+      TypesHelper helper = new TypesHelper(schema);
+      String prefix = "";
+      if (schema != null)
+      {
+        prefix = helper.getPrefix(schema.getTargetNamespace(), true);
+      }
+      // get the schema node
+      NodeList slist = schema.getDocument().getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.SCHEMA_ELEMENT_TAG);
+      Node schemaNode = null;
+      if (slist != null && slist.getLength() > 0)
+      {
+        schemaNode = slist.item(0);
+      }
+      NodeList list = null;
+      // get the schema's direct children - hence, globals
+      if (schemaNode != null)
+      {
+        list = schemaNode.getChildNodes();
+      }
+      String name = null;
+      if (list != null)
+      {
+        for (int i = 0; i < list.getLength(); i++)
+        {
+          if (list.item(i) instanceof Element)
+          {
+            if (list.item(i).getLocalName().equals(elementTag))
+            {
+              name = ((Element) list.item(i)).getAttribute(XSDConstants.NAME_ATTRIBUTE);
+              if (name != null && name.length() > 0)
+              {
+                return prefix + name;
+              }
+            }
+          }
+        }
+      }
+      if (elementTag.equals(XSDConstants.ELEMENT_ELEMENT_TAG))
+      {
+        return helper.getGlobalElement(schema);
+      }
+      else if (elementTag.equals(XSDConstants.ATTRIBUTE_ELEMENT_TAG))
+      {
+        return helper.getGlobalAttribute(schema);
+      }
+      else if (elementTag.equals(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG))
+      {
+        return helper.getGlobalAttributeGroup(schema);
+      }
+      else if (elementTag.equals(XSDConstants.GROUP_ELEMENT_TAG))
+      {
+        return helper.getModelGroup(schema);
+      }
+    }
+    return null;
+  }
+
+  protected void addSchemaElementItems(IMenuManager manager, Element parent, Node relativeNode)
+  {
+    ArrayList attributes = null;
+    // Add Edit Namespaces menu action
+    XSDEditNamespacesAction nsAction = new XSDEditNamespacesAction(XSDEditorPlugin.getXSDString("_UI_ACTION_EDIT_NAMESPACES"), parent, relativeNode, getXSDSchema());
+    manager.add(nsAction);
+    manager.add(new Separator());
+    DOMAttribute nameAttribute = new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType"));
+    attributes = new ArrayList();
+    attributes.add(nameAttribute);
+    Action action = addCreateElementAction(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_COMPLEX_TYPE"), attributes, parent, relativeNode);
+    ((CreateElementAction) action).setIsGlobal(true);
+    attributes = new ArrayList();
+    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
+    action = addCreateElementAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SIMPLE_TYPE"), attributes, parent, relativeNode);
+    ((CreateElementAction) action).setIsGlobal(true);
+    attributes = new ArrayList();
+    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ELEMENT_ELEMENT_TAG, "GlobalElement")));
+    attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+    action = addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GLOBAL_ELEMENT"), attributes, parent, relativeNode);
+    ((CreateElementAction) action).setIsGlobal(true);
+    attributes = new ArrayList();
+    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ATTRIBUTE_ELEMENT_TAG, "GlobalAttribute")));
+    attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+    action = addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GLOBAL_ATTRIBUTE"), attributes, parent, relativeNode);
+    ((CreateElementAction) action).setIsGlobal(true);
+    attributes = new ArrayList();
+    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, "AttributeGroup")));
+    action = addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP"), attributes, parent, relativeNode);
+    ((CreateElementAction) action).setIsGlobal(true);
+    attributes = new ArrayList();
+    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.GROUP_ELEMENT_TAG, "Group")));
+    CreateGroupAction groupAction = addCreateGroupAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GROUP"), attributes, parent, relativeNode);
+    groupAction.setIsGlobal(true);
+    attributes = new ArrayList();
+    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.NOTATION_ELEMENT_TAG, "Notation")));
+    attributes.add(new DOMAttribute(XSDConstants.PUBLIC_ATTRIBUTE, ""));
+    action = addCreateElementAction(manager, XSDConstants.NOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_NOTATION"), attributes, parent, relativeNode);
+    ((CreateElementAction) action).setIsGlobal(true);
+    action = addCreateElementAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), null, parent, relativeNode);
+    ((CreateElementAction) action).setIsGlobal(true);
+  }
+
+  // returns whether element exists already
+  protected boolean addCreateElementActionIfNotExist(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
+    {
+      addCreateElementAction(manager, elementTag, label, attributes, parent, relativeNode);
+      return false;
+    }
+    return true;
+  }
+
+  protected Action addCreateElementAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateElementAction action = new CreateElementAction(label);
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setXSDSchema(getXSDSchema());
+    action.setSelectionProvider(selectionProvider);
+    action.setEnabled(!isReadOnly);
+    action.setSourceContext(sourceContext);
+    manager.add(action);
+    return action;
+  }
+
+  protected void addCreateElementAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode, boolean isEnabled)
+  {
+    Action action = addCreateElementAction(manager, elementTag, label, attributes, parent, relativeNode);
+    action.setEnabled(isEnabled);
+  }
+
+  protected void addCreateElementRefAction(IMenuManager manager, String elementTag, String label, Element parent, Node relativeNode)
+  {
+    ArrayList attributes = new ArrayList();
+    String ref = getFirstGlobalElementTagName(elementTag);
+    attributes.add(new DOMAttribute(XSDConstants.REF_ATTRIBUTE, ref));
+    Action action = addCreateElementAction(manager, elementTag, label, attributes, parent, relativeNode);
+    action.setEnabled(ref != null && !isReadOnly);
+  }
+
+  protected void addCreateSimpleContentAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
+    {
+      CreateSimpleContentAction action = new CreateSimpleContentAction(label, getXSDSchema());
+      action.setElementTag(elementTag);
+      action.setAttributes(attributes);
+      action.setParentNode(parent);
+      action.setRelativeNode(relativeNode);
+      action.setEnabled(!isReadOnly);
+      manager.add(action);
+    }
+  }
+
+  protected CreateGroupAction addCreateGroupAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateGroupAction action = new CreateGroupAction(label, getXSDSchema());
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setXSDSchema(getXSDSchema());
+    action.setSelectionProvider(selectionProvider);
+    action.setEnabled(!isReadOnly);
+    action.setSourceContext(sourceContext);
+    manager.add(action);
+    return action;
+  }
+
+  protected void addCreateIdentityConstraintsAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateIdentityConstraintsAction action = new CreateIdentityConstraintsAction(label, getXSDSchema());
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setXSDSchema(getXSDSchema());
+    action.setSelectionProvider(selectionProvider);
+    action.setEnabled(!isReadOnly);
+    manager.add(action);
+  }
+
+  protected void addEnumsAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    AddEnumsAction action = new AddEnumsAction(label);
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setDescription(XSDEditorPlugin.getXSDString("_UI_ENUMERATIONS_DIALOG_TITLE"));
+    action.setEnabled(!isReadOnly);
+    manager.add(action);
+  }
+
+  protected Action addCreateSimpleTypeAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateSimpleTypeAction action = new CreateSimpleTypeAction(label);
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setXSDSchema(getXSDSchema());
+    action.setSelectionProvider(selectionProvider);
+    action.setEnabled(!isReadOnly);
+    action.setSourceContext(sourceContext);
+    manager.add(action);
+    return action;
+  }
+
+  protected boolean addCreateLocalSimpleTypeActionIfNotExist(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
+    {
+      addCreateLocalSimpleTypeAction(manager, elementTag, label, attributes, parent, relativeNode);
+      return false;
+    }
+    return true;
+  }
+
+  protected void addSetBaseTypeAction(IMenuManager manager, Element element)
+  {
+    SetBaseTypeAction action = new SetBaseTypeAction(XSDEditorPlugin.getXSDString("_UI_ACTION_SET_BASE_TYPE"));// +
+    // "...");
+    action.setComplexTypeElement(element);
+    action.setXSDSchema(getXSDSchema());
+    action.setEnabled(!isReadOnly);
+    manager.add(action);
+  }
+
+  protected void addCreateLocalSimpleTypeAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateLocalSimpleTypeAction action = new CreateLocalSimpleTypeAction(label);
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setXSDSchema(getXSDSchema());
+    action.setSelectionProvider(selectionProvider);
+    action.setEnabled(!isReadOnly);
+    manager.add(action);
+  }
+
+  protected boolean addCreateLocalComplexTypeActionIfNotExist(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
+    {
+      addCreateLocalComplexTypeAction(manager, elementTag, label, attributes, parent, relativeNode);
+      return false;
+    }
+    return true;
+  }
+
+  protected void addCreateLocalComplexTypeAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateLocalComplexTypeAction action = new CreateLocalComplexTypeAction(label);
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setXSDSchema(getXSDSchema());
+    action.setSelectionProvider(selectionProvider);
+    action.setEnabled(!isReadOnly);
+    manager.add(action);
+  }
+
+  protected boolean addCreateAnnotationActionIfNotExist(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    return false;
+  }
+
+  protected void addOpenSchemaAction(IMenuManager manager, String label, Element parent)
+  {
+    OpenSchemaAction openAction = new OpenSchemaAction(label, getXSDSchema().getCorrespondingComponent(parent));
+    manager.add(openAction);
+  }
+
+  protected void addMoveAnonymousGlobal(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+//    MakeAnonymousGlobal action = new MakeAnonymousGlobal(label, parent, getXSDSchema());
+//    action.setElementTag(elementTag);
+//    action.setAttributes(attributes);
+//    action.setParentNode(getXSDSchema().getElement());
+//    action.setRelativeNode(relativeNode);
+//    action.setEnabled(!isReadOnly);
+//    //manager.add(action);
+//    addRefactorMenuGroup(manager);
+//    fRefactorMenuGroup.addAction(action);
+  }
+  
+  protected void addRefactorMenuGroup(IMenuManager manager){
+	  	fRefactorMenuGroup = new RefactorActionGroup(selectionProvider, getXSDSchema());
+     	ActionContext context= new ActionContext(selectionProvider.getSelection());
+    	fRefactorMenuGroup.setContext(context);
+    	fRefactorMenuGroup.fillContextMenu(manager);
+    	fRefactorMenuGroup.setContext(null);
+  }
+
+  protected void addCreateAnnotationAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateAnnotationAction action = new CreateAnnotationAction(label);
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setEnabled(!isReadOnly);
+    manager.add(action);
+  }
+
+  protected Node getFirstChildNodeIfExists(Node parent, String elementTag, boolean isRef)
+  {
+    if (parent == null)
+      return null;
+    NodeList children = parent.getChildNodes();
+    Node targetNode = null;
+    for (int i = 0; i < children.getLength(); i++)
+    {
+      Node child = children.item(i);
+      if (child != null && child instanceof Element)
+      {
+        if (XSDDOMHelper.inputEquals((Element) child, elementTag, isRef))
+        {
+          targetNode = child;
+          break;
+        }
+      }
+    }
+    return targetNode;
+  }
+
+  protected boolean elementExists(String elementTag, Element parent)
+  {
+    if (!(parent.getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, elementTag).getLength() > 0))
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Returns the deleteAction.
+   * 
+   * @return DeleteAction
+   */
+  public DeleteAction getDeleteAction()
+  {
+    return deleteAction;
+  }
+  
+  protected void addMultiplicityMenu(XSDConcreteComponent concreteComponent, IMenuManager manager)
+  {
+    SetMultiplicityAction oneMultiplicity = new SetMultiplicityAction(concreteComponent, "1");
+    oneMultiplicity.setMaxOccurs(1);
+    oneMultiplicity.setMinOccurs(1);
+    oneMultiplicity.setEnabled(!isReadOnly);
+    SetMultiplicityAction zeroOrMoreMultiplicity = new SetMultiplicityAction(concreteComponent, "0..* (" + XSDEditorPlugin.getXSDString("_ZERO_OR_MORE") + ")");
+    zeroOrMoreMultiplicity.setMaxOccurs(-1);
+    zeroOrMoreMultiplicity.setMinOccurs(0);
+    zeroOrMoreMultiplicity.setEnabled(!isReadOnly);
+    SetMultiplicityAction zeroOrOneMultiplicity = new SetMultiplicityAction(concreteComponent, "0..1 (" + XSDEditorPlugin.getXSDString("_ZERO_OR_ONE") + ")");
+    zeroOrOneMultiplicity.setMaxOccurs(1);
+    zeroOrOneMultiplicity.setMinOccurs(0);
+    zeroOrOneMultiplicity.setEnabled(!isReadOnly);
+    SetMultiplicityAction oneOrMoreMultiplicity = new SetMultiplicityAction(concreteComponent, "1..* (" + XSDEditorPlugin.getXSDString("_ONE_OR_MORE") + ")");
+    oneOrMoreMultiplicity.setMaxOccurs(-1);
+    oneOrMoreMultiplicity.setMinOccurs(1);
+    oneOrMoreMultiplicity.setEnabled(!isReadOnly);
+    
+    MenuManager multiplicityMenu = new MenuManager(XSDEditorPlugin.getXSDString("_UI_ACTION_SET_MULTIPLICITY"));
+    manager.add(multiplicityMenu);
+    multiplicityMenu.add(oneMultiplicity);
+    multiplicityMenu.add(zeroOrOneMultiplicity);
+    multiplicityMenu.add(zeroOrMoreMultiplicity);
+    multiplicityMenu.add(oneOrMoreMultiplicity);    
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMultiPageEditorPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMultiPageEditorPart.java
new file mode 100644
index 0000000..009efb1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMultiPageEditorPart.java
@@ -0,0 +1,645 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextInputListener;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorActionBarContributor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.wst.common.ui.provisional.editors.PostMultiPageEditorSite;
+import org.eclipse.wst.common.ui.provisional.editors.PostSelectionMultiPageEditorPart;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
+import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
+import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
+import org.eclipse.wst.xml.ui.internal.provisional.IDOMSourceEditingTextTools;
+import org.eclipse.wst.xml.ui.internal.tabletree.XMLEditorMessages;
+import org.w3c.dom.Document;
+
+public class XSDMultiPageEditorPart extends PostSelectionMultiPageEditorPart implements IPropertyListener
+{
+
+  /**
+   * 
+   */
+  public XSDMultiPageEditorPart()
+  {
+    super();
+  }
+  
+  /**
+   * Internal part activation listener
+   */
+  class PartListener extends ShellAdapter implements IPartListener {
+    private IWorkbenchPart fActivePart;
+    private boolean fIsHandlingActivation = false;
+
+    private void handleActivation() {
+
+      if (fIsHandlingActivation)
+        return;
+
+      if (fActivePart == XSDMultiPageEditorPart.this) {
+        fIsHandlingActivation = true;
+        try {
+          safelySanityCheckState();
+        }
+        finally {
+          fIsHandlingActivation = false;
+        }
+      }
+    }
+
+    /**
+     * @see IPartListener#partActivated(IWorkbenchPart)
+     */
+    public void partActivated(IWorkbenchPart part) {
+      fActivePart = part;
+      handleActivation();
+    }
+
+    /**
+     * @see IPartListener#partBroughtToTop(IWorkbenchPart)
+     */
+    public void partBroughtToTop(IWorkbenchPart part) {
+    }
+
+    /**
+     * @see IPartListener#partClosed(IWorkbenchPart)
+     */
+    public void partClosed(IWorkbenchPart part) {
+    }
+
+    /**
+     * @see IPartListener#partDeactivated(IWorkbenchPart)
+     */
+    public void partDeactivated(IWorkbenchPart part) {
+      fActivePart = null;
+    }
+
+    /**
+     * @see IPartListener#partOpened(IWorkbenchPart)
+     */
+    public void partOpened(IWorkbenchPart part) {
+    }
+
+    /*
+     * @see ShellListener#shellActivated(ShellEvent)
+     */
+    public void shellActivated(ShellEvent e) {
+      handleActivation();
+    }
+  }
+
+  class TextInputListener implements ITextInputListener {
+    public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
+    }
+
+    public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
+    }
+  }
+
+  /** The source page index. */
+  private int fSourcePageIndex;
+  /** The text editor. */
+  private StructuredTextEditor fTextEditor;
+
+  private PartListener partListener;
+
+
+  /*
+   * This method is just to make firePropertyChanged accessbible from some
+   * (anonomous) inner classes.
+   */
+  protected void _firePropertyChange(int property) {
+    super.firePropertyChange(property);
+  }
+
+  /**
+   * Adds the source page of the multi-page editor.
+   */
+  protected void addSourcePage() throws PartInitException {
+    try {
+      fSourcePageIndex = addPage(fTextEditor, getEditorInput());
+      setPageText(fSourcePageIndex, XSDEditorPlugin.getXSDString("_UI_TAB_SOURCE")); //$NON-NLS-1$
+      // the update's critical, to get viewer selection manager and
+      // highlighting to work
+      fTextEditor.update();
+  
+      firePropertyChange(PROP_TITLE);
+  
+      // Changes to the Text Viewer's document instance should also force an
+      // input refresh
+      fTextEditor.getTextViewer().addTextInputListener(new TextInputListener());
+    }
+    catch (PartInitException e) {
+      // dispose editor
+      dispose();
+
+		// log for now, unless we find reason not to
+		Logger.log(Logger.INFO, e.getMessage());
+    }
+  }
+
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.part.MultiPageEditorPart#createPages()
+   */
+  protected void createPages()
+  {
+    try
+    {
+      // source page MUST be created before design page, now
+      createSourcePage();
+      addSourcePage();
+      setActivePage();
+
+    // future_TODO: add a catch block here for any exception the design
+    // page throws and convert it into a more informative message.
+    }
+    catch (PartInitException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  /**
+   * @see org.eclipse.ui.part.MultiPageEditorPart#createSite(org.eclipse.ui.IEditorPart)
+   */
+  protected IEditorSite createSite(IEditorPart editor) {
+    IEditorSite site = null;
+    if (editor == fTextEditor) {
+			site = new PostMultiPageEditorSite(this, editor) {
+				public IEditorActionBarContributor getActionBarContributor() {
+					IEditorActionBarContributor contributor = super.getActionBarContributor();
+					XSDMultiPageEditorPart.this.getEditorSite().getActionBarContributor();
+					return contributor;
+				}
+				
+				public String getId() {
+					// sets this id so nested editor is considered xml source
+					// page
+					return ContentTypeIdForXML.ContentTypeID_XML + ".source"; //$NON-NLS-1$;
+				}
+			};
+		}
+    else {
+      site = super.createSite(editor);
+    }
+    return site;
+  }
+
+  /**
+   * Creates the source page of the multi-page editor.
+   */
+  protected void createSourcePage() throws PartInitException {
+    fTextEditor = createTextEditor();
+    fTextEditor.setEditorPart(this);
+
+    // Set the SourceViewerConfiguration now so the text editor won't use
+    // the default configuration first
+    // and switch to the StructuredTextViewerConfiguration later.
+    // DMW removed setSourceViewerConfiguration 3/26/2003 since added
+    // createPartControl to our text editor.
+    // fTextEditor.setSourceViewerConfiguration();
+    fTextEditor.addPropertyListener(this);
+  }
+
+  /**
+   * Method createTextEditor.
+   * 
+   * @return StructuredTextEditor
+   */
+  protected StructuredTextEditor createTextEditor() {
+    return new StructuredTextEditor();
+  }
+
+  public void dispose()
+  {
+    IWorkbenchWindow window = getSite().getWorkbenchWindow();
+    window.getPartService().removePartListener(partListener);
+    window.getShell().removeShellListener(partListener);
+
+    getSite().getPage().removePartListener(partListener);
+    if (fTextEditor != null) {
+      fTextEditor.removePropertyListener(this);
+    }
+    fTextEditor = null;
+
+    // moved to last when added window ... seems like
+    // we'd be in danger of losing some data, like site,
+    // or something.
+    super.dispose();
+  }
+
+  /*
+   * (non-Javadoc) Saves the contents of this editor. <p> Subclasses must
+   * override this method to implement the open-save-close lifecycle for an
+   * editor. For greater details, see <code> IEditorPart </code></p>
+   * 
+   * @see IEditorPart
+   */
+  public void doSave(IProgressMonitor monitor) {
+    fTextEditor.doSave(monitor);
+    //    // this is a temporary way to force validation.
+    //    // when the validator is a workbench builder, the following lines
+    // can be removed
+    //    if (fDesignViewer != null)
+    //      fDesignViewer.saveOccurred();
+
+  }
+
+  /*
+   * (non-Javadoc) Saves the contents of this editor to another object. <p>
+   * Subclasses must override this method to implement the open-save-close
+   * lifecycle for an editor. For greater details, see <code> IEditorPart
+   * </code></p>
+   * 
+   * @see IEditorPart
+   */
+  public void doSaveAs() {
+    fTextEditor.doSaveAs();
+    // 253619
+    // following used to be executed here, but is
+    // now called "back" from text editor (since
+    // mulitiple paths to the performSaveAs in StructuredTextEditor.
+    //doSaveAsForStructuredTextMulitPagePart();
+  }
+
+	private void editorInputIsAcceptable(IEditorInput input) throws PartInitException {
+		if (input instanceof IFileEditorInput) {
+			// verify that it can be opened
+			CoreException[] coreExceptionArray = new CoreException[1];
+			if (fileDoesNotExist((IFileEditorInput) input, coreExceptionArray)) {
+				CoreException coreException = coreExceptionArray[0];
+				if (coreException.getStatus().getCode() == IResourceStatus.FAILED_READ_LOCAL) {
+					// I'm assuming this is always 'does not exist'
+					// we'll refresh local go mimic behavior of default
+					// editor, where the
+					// troublesome file is refreshed (and will cause it to
+					// 'disappear' from Navigator.
+					try {
+						((IFileEditorInput) input).getFile().refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
+					} catch (CoreException ce) {
+						// very unlikely
+						Logger.logException(ce);
+					}
+					throw new PartInitException(NLS.bind(XMLEditorMessages.Resource__does_not_exist, (new Object[]{input.getName()})));
+				} else {
+					throw new PartInitException(NLS.bind(XMLEditorMessages.Editor_could_not_be_open, (new Object[]{input.getName()})));
+				}
+			}
+		} else if (input instanceof IStorageEditorInput) {
+			InputStream contents = null;
+			try {
+				contents = ((IStorageEditorInput) input).getStorage().getContents();
+			} catch (CoreException noStorageExc) {
+			}
+			if (contents == null) {
+				throw new PartInitException(NLS.bind(XMLEditorMessages.Editor_could_not_be_open, (new Object[]{input.getName()})));
+			} else {
+				try {
+					contents.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+	}
+
+  //  void doSaveAsForStructuredTextMulitPagePart() {
+  //    setPageText(getActivePage(), fTextEditor.getTitle());
+  //    setInput(fTextEditor.getEditorInput());
+  //    if (fDesignViewer != null) {
+  //      //fDesignViewer.setEditorInput(fTextEditor.getEditorInput());
+  //      fDesignViewer.setModel(getModel());
+  //      fDesignViewer.saveAsOccurred();
+  //    }
+  //    // even though we've set title etc., several times already!
+  //    // only now is all prepared for it.
+  //    firePropertyChange(IWorkbenchPart.PROP_TITLE);
+  //    firePropertyChange(PROP_DIRTY);
+  //  }
+  /*
+   * (non-Javadoc) Initializes the editor part with a site and input. <p>
+   * Subclasses of <code> EditorPart </code> must implement this method.
+   * Within the implementation subclasses should verify that the input type
+   * is acceptable and then save the site and input. Here is sample code:
+   * </p><pre> if (!(input instanceof IFileEditorInput)) throw new
+   * PartInitException("Invalid Input: Must be IFileEditorInput");
+   * setSite(site); setInput(editorInput); </pre>
+   */
+  protected boolean fileDoesNotExist(IFileEditorInput input, Throwable[] coreException) {
+    boolean result = false;
+    InputStream inStream = null;
+    if ((!(input.exists())) || (!(input.getFile().exists()))) {
+      result = true;
+    }
+    else {
+      try {
+        inStream = input.getFile().getContents(true);
+      }
+      catch (CoreException e) {
+        // very likely to be file not found
+        result = true;
+        coreException[0] = e;
+      }
+      finally {
+        if (input != null) {
+          try {
+            if (inStream != null) {
+              inStream.close();
+            }
+          }
+          catch (IOException e) {
+
+          }
+        }
+      }
+    }
+    return result;
+  }
+
+  public Object getAdapter(Class key) {
+    Object result = null;
+
+      // DMW: I'm bullet-proofing this because
+      // its been reported (on 4.03 version) a null pointer sometimes
+      // happens here on startup, when an editor has been left
+      // open when workbench shutdown.
+      if (fTextEditor != null) {
+        result = fTextEditor.getAdapter(key);
+      }
+    return result;
+  }
+
+  public Document getDOMDocument() {
+    if (getTextEditor() == null)
+      return null;
+
+    ISourceEditingTextTools tools = (ISourceEditingTextTools) getAdapter(ISourceEditingTextTools.class);
+    if(tools != null && tools instanceof IDOMSourceEditingTextTools) {
+    	return ((IDOMSourceEditingTextTools)tools).getDOMDocument();
+    }
+    return null;
+  }
+
+  protected IStructuredModel getModel() {
+    IStructuredModel model = null;
+    if (fTextEditor != null)
+      model = fTextEditor.getModel();
+    return model;
+  }
+
+  protected IPreferenceStore getPreferenceStore() {
+    return XSDEditorPlugin.getPlugin().getPreferenceStore();
+  }
+
+  public StructuredTextEditor getTextEditor() {
+    return fTextEditor;
+  }
+
+  /*
+   * (non-Javadoc) Method declared on IWorkbenchPart.
+   */
+  public String getTitle() {
+    String title = null;
+    if (getTextEditor() == null) {
+      if (getEditorInput() != null) {
+        title = getEditorInput().getName();
+      }
+    }
+    else {
+      title = getTextEditor().getTitle();
+    }
+    if (title == null) {
+      title = getPartName();
+    }
+    return title;
+  }
+
+  /*
+   * (non-Javadoc) Sets the cursor and selection state for this editor to
+   * the passage defined by the given marker. <p> Subclasses may override.
+   * For greater details, see <code> IEditorPart </code></p>
+   * 
+   * @see IEditorPart
+   */
+  public void gotoMarker(IMarker marker) {
+    // (pa) 20020217 this was null when opening an editor that was
+    // already open
+    if (fTextEditor != null) {
+      IGotoMarker markerGotoer = (IGotoMarker) fTextEditor.getAdapter(IGotoMarker.class);
+      markerGotoer.gotoMarker(marker);
+    }
+  }
+
+  public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+//    editorInputIsAcceptable(input);
+    try {
+      super.init(site, input);
+      if (partListener == null) {
+        partListener = new PartListener();
+      }
+      //getSite().getPage().addPartListener(partListner);
+      // we want to listen for our own activation
+      IWorkbenchWindow window = getSite().getWorkbenchWindow();
+      window.getPartService().addPartListener(partListener);
+      window.getShell().addShellListener(partListener);
+    }
+    catch (Exception e) {
+		// log for now, unless we find reason not to
+		Logger.log(Logger.INFO, e.getMessage());
+    }
+    setPartName(input.getName());
+  }
+
+  /*
+   * (non-Javadoc) Returns whether the "save as" operation is supported by
+   * this editor. <p> Subclasses must override this method to implement the
+   * open-save-close lifecycle for an editor. For greater details, see
+   * <code> IEditorPart </code></p>
+   * 
+   * @see IEditorPart
+   */
+  public boolean isSaveAsAllowed() {
+    return fTextEditor != null && fTextEditor.isSaveAsAllowed();
+  }
+
+  /*
+   * (non-Javadoc) Returns whether the contents of this editor should be
+   * saved when the editor is closed. <p> This method returns <code> true
+   * </code> if and only if the editor is dirty ( <code> isDirty </code> ).
+   * </p>
+   */
+  public boolean isSaveOnCloseNeeded() {
+    // overriding super class since it does a lowly isDirty!
+    if (fTextEditor != null)
+      return fTextEditor.isSaveOnCloseNeeded();
+    return isDirty();
+  }
+
+  /**
+   * Notifies this multi-page editor that the page with the given id has
+   * been activated. This method is called when the user selects a different
+   * tab.
+   * 
+   * @param newPageIndex
+   *            the index of the activated page
+   */
+  protected void pageChange(int newPageIndex) {
+    super.pageChange(newPageIndex);
+
+    saveLastActivePageIndex(newPageIndex);
+  }
+
+  /**
+   * Posts the update code "behind" the running operation.
+   */
+  protected void postOnDisplayQue(Runnable runnable) {
+    IWorkbench workbench = PlatformUI.getWorkbench();
+    IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
+    if (windows != null && windows.length > 0) {
+      Display display = windows[0].getShell().getDisplay();
+      display.asyncExec(runnable);
+    }
+    else
+      runnable.run();
+  }
+
+  /**
+   * Indicates that a property has changed.
+   * 
+   * @param source
+   *            the object whose property has changed
+   * @param propId
+   *            the id of the property which has changed; property ids are
+   *            generally defined as constants on the source class
+   */
+  public void propertyChanged(Object source, int propId) {
+    switch (propId) {
+      // had to implement input changed "listener" so that
+      // strucutedText could tell it containing editor that
+      // the input has change, when a 'resource moved' event is
+      // found.
+      case IEditorPart.PROP_INPUT :
+      case IEditorPart.PROP_DIRTY : {
+        if (source == fTextEditor) {
+          if (fTextEditor.getEditorInput() != getEditorInput()) {
+            setInput(fTextEditor.getEditorInput());
+            // title should always change when input changes.
+            // create runnable for following post call
+            Runnable runnable = new Runnable() {
+              public void run() {
+                _firePropertyChange(IWorkbenchPart.PROP_TITLE);
+              }
+            };
+            // Update is just to post things on the display queue
+            // (thread). We have to do this to get the dirty
+            // property to get updated after other things on the
+            // queue are executed.
+            postOnDisplayQue(runnable);
+          }
+        }
+        break;
+      }
+      case IWorkbenchPart.PROP_TITLE : {
+        // update the input if the title is changed
+        if (source == fTextEditor) {
+          if (fTextEditor.getEditorInput() != getEditorInput()) {
+            setInput(fTextEditor.getEditorInput());
+          }
+        }
+        break;
+      }
+      default : {
+        // propagate changes. Is this needed? Answer: Yes.
+        if (source == fTextEditor) {
+          firePropertyChange(propId);
+        }
+        break;
+      }
+    }
+
+  }
+
+  protected void safelySanityCheckState() {
+    // If we're called before editor is created, simply ignore since we
+    // delegate this function to our embedded TextEditor
+    if (getTextEditor() == null)
+      return;
+
+    getTextEditor().safelySanityCheckState(getEditorInput());
+
+  }
+
+  protected void saveLastActivePageIndex(int newPageIndex) {
+    // save the last active page index to preference manager
+    getPreferenceStore().setValue(IXMLPreferenceNames.LAST_ACTIVE_PAGE, newPageIndex);
+  }
+
+  /**
+   * Sets the currently active page.
+   */
+  protected void setActivePage() {
+    // retrieve the last active page index from preference manager
+    int activePageIndex = getPreferenceStore().getInt(IXMLPreferenceNames.LAST_ACTIVE_PAGE);
+
+    // We check this range since someone could hand edit the XML
+    // preference file to an invalid value ... which I know from
+    // experience :( ... if they do, we'll reset to default and continue
+    // rather than throw an assertion error in the setActivePage(int)
+    // method.
+    if (activePageIndex < 0 || activePageIndex >= getPageCount()) {
+      activePageIndex = fSourcePageIndex;
+    }
+    setActivePage(activePageIndex);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
+   */
+  protected void setInput(IEditorInput input) {
+    // If driven from the Source page, it's "model" may not be up to date
+    // with the input just yet. We'll rely on later notification from the
+    // TextViewer to set us straight
+    super.setInput(input);
+    setPartName(input.getName());
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDSelectionManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDSelectionManager.java
new file mode 100644
index 0000000..22f0354
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDSelectionManager.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+
+public class XSDSelectionManager implements ISelectionProvider, ISelectionChangedListener
+{
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+   */
+  public void addSelectionChangedListener(ISelectionChangedListener listener)
+  {
+    listenerList.add(listener);
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
+   */
+  public ISelection getSelection()
+  {
+    return currentSelection;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+   */
+  public void removeSelectionChangedListener(ISelectionChangedListener listener)
+  {
+    listenerList.remove(listener);
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
+   */
+  public void setSelection(ISelection selection)
+  {
+    setSelection(selection, this);
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+   */
+  public void selectionChanged(SelectionChangedEvent event)
+  {
+    if (enableNotify)
+    {
+      setSelection(event.getSelection(), event.getSelectionProvider());
+    }
+  }
+
+  
+  protected List listenerList = new ArrayList();
+  protected ISelection currentSelection;
+  protected boolean enableNotify = true;
+
+  public void setSelection(ISelection selection, ISelectionProvider source)
+  {  
+//	  System.out.println("SelectionManager.setSelection() " + selection + ", " + source);
+    if (enableNotify)
+    {
+      currentSelection = selection;
+      enableNotify = false;
+      try
+      {
+        SelectionChangedEvent event = new SelectionChangedEvent(source, selection);
+        List copyOfListenerList = new ArrayList(listenerList);
+        for (Iterator i = copyOfListenerList.iterator(); i.hasNext(); )
+        {
+          ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
+          listener.selectionChanged(event);
+        }
+      }
+      finally
+      {
+        enableNotify = true;
+      }
+    }
+  }      
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AbstractAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AbstractAction.java
new file mode 100644
index 0000000..b421416
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AbstractAction.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+public class AbstractAction extends Action
+{
+  XSDConcreteComponent xsdConcreteComponent;
+
+  /**
+   * @param text
+   */
+  public AbstractAction(String text, XSDConcreteComponent xsdConcreteComponent)
+  {
+    super(text);
+    this.xsdConcreteComponent = xsdConcreteComponent;
+  }
+
+  /**
+   * @param text
+   * @param image
+   */
+  public AbstractAction(String text, ImageDescriptor image, XSDConcreteComponent xsdConcreteComponent)
+  {
+    super(text, image);
+    this.xsdConcreteComponent = xsdConcreteComponent;
+  }
+
+  /**
+   * @param text
+   * @param style
+   */
+  public AbstractAction(String text, int style)
+  {
+    super(text, style);
+  }
+  
+  public DocumentImpl getDocument()
+  {
+    return (DocumentImpl) xsdConcreteComponent.getElement().getOwnerDocument();
+  }
+    
+  public void beginRecording(String description)
+  {
+    getDocument().getModel().beginRecording(this, description);
+  }
+  
+  public void endRecording()
+  {
+    DocumentImpl doc = (DocumentImpl) getDocument();
+    
+    doc.getModel().endRecording(this);    
+  }
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddAttributeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddAttributeAction.java
new file mode 100644
index 0000000..f1a9f3f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddAttributeAction.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.xsd.ui.internal.commands.AddAttributeDeclarationCommand;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+public class AddAttributeAction extends AbstractAction
+{
+  protected AddAttributeDeclarationCommand command;
+  
+  public AddAttributeAction(String text, XSDConcreteComponent parent)
+  {
+    super(text, parent);
+    command = new AddAttributeDeclarationCommand(parent);
+  }
+
+  public AddAttributeAction(String text, ImageDescriptor image, XSDConcreteComponent parent)
+  {
+    super(text, image, parent);
+    command = new AddAttributeDeclarationCommand(parent);
+  }
+
+  public void run()
+  {
+    beginRecording(getText());
+    command.run();
+    
+    endRecording();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddEnumsAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddEnumsAction.java
new file mode 100644
index 0000000..ecc2f4b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddEnumsAction.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.xsd.ui.internal.widgets.EnumerationsDialog;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+/**
+ * Pattern is scoped to Enum Type
+ */
+public class AddEnumsAction extends CreateElementAction
+{
+  public AddEnumsAction(String label)
+  {
+  	super(label);
+  }
+ 
+  public Element createAndAddNewChildElement(String token)
+  {
+    String prefix = parentNode.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    Element childNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + elementTag);
+    if (getAttributes() != null)
+    {
+      List attributes = getAttributes();
+      for (int i = 0; i < attributes.size(); i++)
+      {
+        DOMAttribute attr = (DOMAttribute) attributes.get(i);
+        childNode.setAttribute(attr.getName(), attr.getValue());
+      }
+    }
+    if (getRelativeNode() == null)
+    {
+      parentNode.appendChild(childNode);
+    }
+    else
+    {
+      ((Element)parentNode).insertBefore(childNode,getRelativeNode());
+    }
+    childNode.setAttribute("value", token);
+    return childNode;
+  }    
+  
+  public void run()
+  {
+    Display display = Display.getCurrent();
+    // if it is null, get the default one
+    display = display == null ? Display.getDefault() : display;
+    Shell parentShell = display.getActiveShell();
+    EnumerationsDialog dialog = new EnumerationsDialog(parentShell);
+    dialog.setBlockOnOpen(true);
+    int result = dialog.open();
+
+    if (result == Window.OK) 
+    {
+      beginRecording(getDescription());
+
+      String text = dialog.getText();
+      String delimiter = dialog.getDelimiter();
+      StringTokenizer tokenizer = new StringTokenizer(text, delimiter);
+      while (tokenizer.hasMoreTokens()) 
+      {
+        String token = tokenizer.nextToken();
+        if (dialog.isPreserveWhitespace() == false) 
+        {
+          token = token.trim();
+        }
+
+        Element child = createAndAddNewChildElement(token);
+        formatChild(child);        
+      }
+      endRecording();
+    }
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddModelGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddModelGroupAction.java
new file mode 100644
index 0000000..fcfdc77
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddModelGroupAction.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.commands.AddModelGroupCommand;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+
+public class AddModelGroupAction extends Action
+{
+   protected AddModelGroupCommand command;
+   protected XSDConcreteComponent parent;
+  
+   public static String getLabel(XSDCompositor compositor)
+   {
+     String result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SEQUENCE"); //$NON-NLS-1$
+     if (compositor != null)
+     {
+       if (compositor == XSDCompositor.CHOICE_LITERAL)
+       {
+         result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CHOICE");  //$NON-NLS-1$
+       }
+       else if (compositor == XSDCompositor.ALL_LITERAL)
+       {
+         result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ALL");//$NON-NLS-1$
+       }  
+     }
+     return result;
+   }
+  
+   public AddModelGroupAction(XSDConcreteComponent parent, XSDCompositor compositor)
+   {
+     command = new AddModelGroupCommand(parent, compositor);
+     this.parent = parent;
+     setText(getLabel(compositor));     
+   }   
+   
+   public void run()
+   {
+     DocumentImpl doc = (DocumentImpl) parent.getElement().getOwnerDocument();
+     doc.getModel().beginRecording(this, getText());
+     command.run();
+     doc.getModel().endRecording(this);
+   }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddSchemaNodeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddSchemaNodeAction.java
new file mode 100644
index 0000000..d890af0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddSchemaNodeAction.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+
+
+public class AddSchemaNodeAction extends Action
+{
+  /**
+   * Constructor for AddSchemaNodeAction.
+   */
+  public AddSchemaNodeAction()
+  {
+    super();
+  }
+
+  /**
+   * Constructor for AddSchemaNodeAction.
+   * @param text
+   */
+  public AddSchemaNodeAction(String text)
+  {
+    super(text);
+  }
+
+  /**
+   * Constructor for AddSchemaNodeAction.
+   * @param text
+   * @param image
+   */
+  public AddSchemaNodeAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public void setEditor(XSDEditor editor)
+  {
+    this.editor = editor;
+  }
+  
+  protected XSDEditor editor;
+  
+  /**
+   * @see org.eclipse.jface.action.IAction#run()
+   */
+  public void run()
+  {
+    editor.createDefaultSchemaNode(editor.getDOMDocument());
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/BackAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/BackAction.java
new file mode 100644
index 0000000..0ab518d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/BackAction.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphViewer;
+import org.eclipse.xsd.XSDSchema;
+
+/**
+ * @author kchong
+ *
+ * <a href="mailto:kchong@ca.ibm.com">kchong@ca.ibm.com</a>
+ *
+ */
+public class BackAction extends Action
+{
+  ISelectionProvider selectionProvider;
+  XSDGraphViewer xsdGraphViewer;
+  XSDSchema xsdSchema;
+  
+  /**
+   * 
+   */
+  public BackAction()
+  {
+    super();
+  }
+
+  /**
+   * @param text
+   */
+  public BackAction(String text)
+  {
+    super(text);
+  }
+
+  public BackAction(String text, XSDGraphViewer viewer)
+  {
+    super(text);
+    xsdGraphViewer = viewer;
+  }
+  
+  /**
+   * @param text
+   * @param image
+   */
+  public BackAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  /**
+   * @param text
+   * @param style
+   */
+  public BackAction(String text, int style)
+  {
+    super(text, style);
+  }
+
+  public void setSelectionProvider(ISelectionProvider selectionProvider)
+  {
+    this.selectionProvider = selectionProvider;
+  }
+
+  public void setXSDSchema(XSDSchema xsdSchema)
+  {
+    this.xsdSchema = xsdSchema;
+  }
+  
+  /*
+   * @see IAction#run()
+   */
+  public void run()
+  {
+    StructuredSelection selection = new StructuredSelection(xsdSchema);
+    selectionProvider.setSelection(selection);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAnnotationAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAnnotationAction.java
new file mode 100644
index 0000000..698d433
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAnnotationAction.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class CreateAnnotationAction extends CreateElementAction
+{
+  XSDSchema xsdSchema;
+  Element documentationNode;
+
+  public CreateAnnotationAction()
+  {
+    super();
+  }
+
+  public CreateAnnotationAction(String text)
+  {
+    super(text);
+  }
+
+  public CreateAnnotationAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public Element createAndAddNewChildElement()
+  {
+    Element childNode = super.createAndAddNewChildElement();
+
+    String prefix = parentNode.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    documentationNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.DOCUMENTATION_ELEMENT_TAG);
+    childNode.appendChild(documentationNode);
+
+    formatChild(childNode);
+    formatChild(documentationNode);
+    formatChild(childNode);
+    
+    return childNode;
+  }
+  
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAttributeAndRequired.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAttributeAndRequired.java
new file mode 100644
index 0000000..155577b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAttributeAndRequired.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Element;
+
+/*
+ * Class which creates an Attribute and necessary Elements required before
+ * an Attribute can be added.  For example, if we wish to add an Attribute
+ * to a GlobalElement without a ComplexType, a ComplexType will be created.
+ */
+public class CreateAttributeAndRequired extends Action {
+	String elementTag;
+	String label;
+	List attributes;
+	XSDSchema xsdSchema;
+	ISelectionProvider selectionProvider;
+	Object parent;
+	
+	public CreateAttributeAndRequired(String elementTag, String label, List attributes, XSDSchema xsdSchema, ISelectionProvider selProvider, Object parent) {
+		super(label);
+		
+		this.elementTag = elementTag;
+		this.label = label;
+		this.attributes = attributes;
+		this.xsdSchema = xsdSchema;
+		this.selectionProvider = selProvider;
+		this.parent = parent;
+	}
+
+	public void run() {
+		if (parent instanceof XSDElementDeclaration) {
+			XSDElementDeclaration ed = (XSDElementDeclaration) parent;
+			beginRecording(ed.getElement());
+	        ed.setTypeDefinition(null);
+	      	XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
+	        ed.setAnonymousTypeDefinition(td);
+			
+		    CreateElementAction action = new CreateElementAction(label);		    
+		    action.setElementTag(elementTag);
+		    action.setAttributes(attributes);
+		    action.setParentNode(td.getElement());
+		    action.setRelativeNode(null);
+		    action.setXSDSchema(xsdSchema);
+		    action.setSelectionProvider(selectionProvider);
+		    action.run();
+		    
+		    formatChild(td.getElement());
+        if (td.getAttributeContents().size() > 0)
+        {
+		      selectObject(td.getAttributeContents().get(0));
+        }
+		    endRecording(ed.getElement());
+		}
+	}
+
+	protected void beginRecording(Element element) {
+		((DocumentImpl) element.getOwnerDocument()).getModel().beginRecording(this, getText());
+	}
+	
+	protected void endRecording(Element element) {
+		((DocumentImpl) element.getOwnerDocument()).getModel().endRecording(this);
+	}
+	
+	public void selectObject(Object object) {
+	    if (selectionProvider != null)
+	    {
+	        selectionProvider.setSelection(new StructuredSelection(object));
+	    }
+	}
+	
+	  protected void formatChild(Element child)
+	  {
+	    if (child instanceof IDOMNode)
+	    {
+	      IDOMModel model = ((IDOMNode)child).getModel();
+	      try
+	      {
+	        // tell the model that we are about to make a big model change
+	        model.aboutToChangeModel();
+	        
+		      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
+			    formatProcessor.formatNode(child);
+	      }
+	      finally
+	      {
+	        // tell the model that we are done with the big model change
+	        model.changedModel(); 
+	      }
+	    }
+	  }
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
new file mode 100644
index 0000000..0dacfb6
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
@@ -0,0 +1,365 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+import java.util.List;
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ComplexTypeDefinitionEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ElementDeclarationEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ModelGroupDefinitionEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+public class CreateElementAction extends Action
+{
+  protected String description;
+  protected Element parentNode;
+
+  protected ISelectionProvider selectionProvider;
+  protected XSDSchema xsdSchema;
+
+  protected Object sourceContext;
+
+  /**
+   * Constructor for CreateElementAction.
+   */
+  public CreateElementAction()
+  {
+    super();
+  }
+  /**
+   * Constructor for CreateElementAction.
+   * @param text
+   */
+  public CreateElementAction(String text)
+  {
+    super(text);
+  }
+  /**
+   * Constructor for CreateElementAction.
+   * @param text
+   * @param image
+   */
+  public CreateElementAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public void setXSDSchema(XSDSchema xsdSchema)
+  {
+    this.xsdSchema = xsdSchema;
+  }
+  
+  public void setSelectionProvider(ISelectionProvider selectionProvider)
+  {
+    this.selectionProvider = selectionProvider;
+  }
+
+  public void setSourceContext(Object sourceContext)
+  {
+    this.sourceContext = sourceContext;
+  }
+  
+  /**
+   * Gets the parentNode.
+   * @return Returns a Element
+   */
+  public Element getParentNode()
+  {
+    return parentNode;
+  }
+
+  /**
+   * Sets the parentNode.
+   * @param parentNode The parentNode to set
+   */
+  public void setParentNode(Element parentNode)
+  {
+    this.parentNode = parentNode;
+  }
+
+  boolean isGlobal = false;
+  
+  public void setIsGlobal(boolean isGlobal)
+  {
+    this.isGlobal = isGlobal;
+  }
+  
+  public boolean getIsGlobal()
+  {
+    return isGlobal;
+  }
+
+  protected Node relativeNode;
+  protected String elementTag;
+  public void setElementTag(String elementTag)
+  {
+    this.elementTag = elementTag;
+  }
+  
+  public DocumentImpl getDocument()
+  {
+    return (DocumentImpl) getParentNode().getOwnerDocument();
+  }
+    
+  public void beginRecording(String description)
+  {
+    getDocument().getModel().beginRecording(this, description);
+  }
+  
+  public void endRecording()
+  {
+    DocumentImpl doc = (DocumentImpl) getDocument();
+    
+    doc.getModel().endRecording(this);    
+  }
+  
+  public Element createAndAddNewChildElement()
+  {
+    String prefix = parentNode.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    Element childNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + elementTag);
+    if (getAttributes() != null)
+    {
+      List attributes = getAttributes();
+      for (int i = 0; i < attributes.size(); i++)
+      {
+        DOMAttribute attr = (DOMAttribute) attributes.get(i);
+        childNode.setAttribute(attr.getName(), attr.getValue());
+      }
+    }
+    if (getRelativeNode() == null)
+    {
+      parentNode.appendChild(childNode);
+    }
+    else
+    {
+      ((Element)parentNode).insertBefore(childNode,getRelativeNode());
+    }
+    
+    if (isGlobal && getRelativeNode() == null)
+    {
+      Text textNode = getDocument().createTextNode("\n\n");
+      parentNode.appendChild(textNode);
+    }
+    else if (isGlobal && getRelativeNode() != null)
+    {
+      Text textNode = getDocument().createTextNode("\n\n");
+      parentNode.insertBefore(textNode, getRelativeNode());
+    }
+
+    formatChild(childNode);
+    
+    return childNode;
+  }    
+    
+  protected void formatChild(Element child)
+  {
+    if (child instanceof IDOMNode)
+    {
+      IDOMModel model = ((IDOMNode)child).getModel();
+      try
+      {
+        // tell the model that we are about to make a big model change
+        model.aboutToChangeModel();
+        
+	      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
+		    formatProcessor.formatNode(child);
+      }
+      finally
+      {
+        // tell the model that we are done with the big model change
+        model.changedModel(); 
+      }
+    }
+  }
+  /*
+   * @see IAction#run()
+   */
+  public void run()
+  {
+    beginRecording(getDescription());
+    final Element child = createAndAddNewChildElement();
+    endRecording();
+
+    if (selectionProvider != null)
+    {
+      final XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(child);
+//      selectionProvider.setSelection(new StructuredSelection(comp));
+      
+    Runnable runnable = new Runnable()
+    {
+      public void run()
+      {
+        if (comp instanceof XSDAttributeDeclaration)
+        {
+          if (((XSDAttributeDeclaration)comp).getContainer() instanceof XSDAttributeUse)
+          {
+            if (comp.getContainer().getContainer() instanceof XSDAttributeGroupDefinition)
+            {
+              selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
+            }
+            else if (comp.getContainer().getContainer() instanceof XSDComplexTypeDefinition)
+            {
+              if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
+              {
+                selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
+              }
+              else
+              {
+                selectionProvider.setSelection(new StructuredSelection(comp));
+              }
+            }
+            else
+            {
+              selectionProvider.setSelection(new StructuredSelection(comp));
+            }
+          }
+          else
+          {
+            selectionProvider.setSelection(new StructuredSelection(comp));
+          }
+        }
+        else
+        {
+          selectionProvider.setSelection(new StructuredSelection(comp));
+        }
+        if (comp instanceof XSDNamedComponent)
+        {
+          if (sourceContext instanceof AbstractEditPartViewer)
+          {
+            AbstractEditPartViewer viewer = (AbstractEditPartViewer)sourceContext;
+          
+            Object obj = viewer.getSelectedEditParts().get(0);
+            
+            if (obj instanceof GraphicalEditPart)
+            {
+              if (obj instanceof ElementDeclarationEditPart)
+              {
+                XSDElementDeclaration elem = ((ElementDeclarationEditPart)obj).getXSDElementDeclaration();
+                if (!elem.isElementDeclarationReference())
+                {
+                  ((ElementDeclarationEditPart)obj).doEditName();
+                }
+              }
+              else if (obj instanceof ModelGroupDefinitionEditPart)
+              {
+                XSDModelGroupDefinition group = ((ModelGroupDefinitionEditPart)obj).getXSDModelGroupDefinition();
+                if (!group.isModelGroupDefinitionReference())
+                {
+                  ((ModelGroupDefinitionEditPart)obj).doEditName();
+                }
+              }
+              else if (obj instanceof ComplexTypeDefinitionEditPart)
+              {
+                XSDComplexTypeDefinition ct = ((ComplexTypeDefinitionEditPart)obj).getXSDComplexTypeDefinition();
+                if (ct.getName() != null)
+                {
+                  ((ComplexTypeDefinitionEditPart)obj).doEditName();
+                }
+              }
+              else if (obj instanceof TopLevelComponentEditPart)
+              {
+                ((TopLevelComponentEditPart)obj).doEditName();
+              }
+            }
+
+          }
+        }
+      }
+    };
+    Display.getDefault().timerExec(50,runnable);
+    }
+  }
+
+  /**
+   * Gets the relativeNode.
+   * @return Returns a Element
+   */
+  public Node getRelativeNode()
+  {
+    return relativeNode;
+  }
+
+  /**
+   * Sets the relativeNode.
+   * @param relativeNode The relativeNode to set
+   */
+  public void setRelativeNode(Node relativeNode)
+  {
+    this.relativeNode = relativeNode;
+  }
+
+  /**
+   * Gets the description.
+   * @return Returns a String
+   */
+  public String getDescription()
+  {
+    if (description == null)
+    {
+      return getText();
+    }
+    return description;
+  }
+
+  /**
+   * Sets the description.
+   * @param description The description to set
+   */
+  public void setDescription(String description)
+  {
+    this.description = description;
+  }
+
+  protected List attributes;
+  /**
+   * Gets the nameAttribute.
+   * @return Returns a String
+   */
+  public List getAttributes()
+  {
+    return attributes;
+  }
+
+  /**
+   * Sets the attributes.
+   * @param attributes The attributes to set
+   */
+  public void setAttributes(List attributes)
+  {
+    this.attributes = attributes;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateGroupAction.java
new file mode 100644
index 0000000..f9eadae
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateGroupAction.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class CreateGroupAction extends CreateElementAction
+{
+  XSDSchema xsdSchema;
+
+  /**
+   * Constructor for CreateGroupAction.
+   */
+  public CreateGroupAction()
+  {
+    super();
+  }
+  /**
+   * Constructor for CreateGroupAction.
+   * @param text
+   */
+  public CreateGroupAction(String text)
+  {
+    super(text);
+  }
+  /**
+   * Constructor for CreateGroupAction.
+   * @param text
+   * @param XSDSchema
+   */
+  public CreateGroupAction(String text, XSDSchema xsdSchema)
+  {
+    super(text);
+    this.xsdSchema = xsdSchema;
+  }
+  /**
+   * Constructor for CreateGroupAction.
+   * @param text
+   * @param image
+   */
+  public CreateGroupAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public Element createAndAddNewChildElement()
+  {
+    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent(parentNode);
+    Element childNode = super.createAndAddNewChildElement();
+
+    String prefix = parentNode.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    Element contentModelNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SEQUENCE_ELEMENT_TAG);
+    childNode.appendChild(contentModelNode);
+
+    formatChild(childNode);
+    
+    xsdComp.setElement(parentNode);
+    
+    return childNode;
+  }
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateIdentityConstraintsAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateIdentityConstraintsAction.java
new file mode 100644
index 0000000..ca933f3
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateIdentityConstraintsAction.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class CreateIdentityConstraintsAction extends CreateElementAction
+{
+  XSDSchema xsdSchema;
+
+  /**
+   * Constructor for CreateIdentityConstraintsAction.
+   */
+  public CreateIdentityConstraintsAction()
+  {
+    super();
+  }
+  /**
+   * Constructor for CreateIdentityConstraintsAction.
+   * @param text
+   */
+  public CreateIdentityConstraintsAction(String text)
+  {
+    super(text);
+  }
+  /**
+   * Constructor for CreateIdentityConstraintsAction.
+   * @param text
+   * @param XSDSchema
+   */
+  public CreateIdentityConstraintsAction(String text, XSDSchema xsdSchema)
+  {
+    super(text);
+    this.xsdSchema = xsdSchema;
+  }
+  /**
+   * Constructor for CreateIdentityConstraintsAction.
+   * @param text
+   * @param image
+   */
+  public CreateIdentityConstraintsAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public Element createAndAddNewChildElement()
+  {
+    Element childNode = super.createAndAddNewChildElement();
+
+    String prefix = parentNode.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    Element selectorNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SELECTOR_ELEMENT_TAG);
+
+    DOMAttribute attr = new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, "");
+    selectorNode.setAttribute(attr.getName(), attr.getValue());
+
+    childNode.appendChild(selectorNode);
+
+    return childNode;
+  }
+	
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalComplexTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalComplexTypeAction.java
new file mode 100644
index 0000000..e8b0cd0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalComplexTypeAction.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class CreateLocalComplexTypeAction extends CreateElementAction
+{
+  /**
+   * Constructor for CreateLocalComplexTypeAction.
+   */
+  public CreateLocalComplexTypeAction()
+  {
+    super();
+  }
+  /**
+   * Constructor for CreateLocalComplexTypeAction.
+   * @param text
+   */
+  public CreateLocalComplexTypeAction(String text)
+  {
+    super(text);
+  }
+  /**
+   * Constructor for CreateLocalComplexTypeAction.
+   * @param text
+   * @param image
+   */
+  public CreateLocalComplexTypeAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public Element createAndAddNewChildElement()
+  {  
+    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent(parentNode);
+    
+    Element childNode = super.createAndAddNewChildElement();
+  
+    if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.ELEMENT_ELEMENT_TAG, false))  
+    {  
+      parentNode.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);  
+    }  
+                                                      
+    String prefix = parentNode.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    childNode.appendChild(getDocument().createElement(prefix + XSDConstants.SEQUENCE_ELEMENT_TAG));
+    
+    formatChild(childNode);
+    
+    xsdComp.setElement(parentNode);
+
+    return childNode;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalSimpleTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalSimpleTypeAction.java
new file mode 100644
index 0000000..d2e1065
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalSimpleTypeAction.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class CreateLocalSimpleTypeAction extends CreateElementAction
+{
+  XSDSchema xsdSchema;
+
+  /**
+   * Constructor for CreateLocalSimpleTypeAction.
+   */
+  public CreateLocalSimpleTypeAction()
+  {
+    super();
+  }
+  /**
+   * Constructor for CreateLocalSimpleTypeAction.
+   * @param text
+   */
+  public CreateLocalSimpleTypeAction(String text)
+  {
+    super(text);
+  }
+
+  /**
+   * Constructor for CreateLocalSimpleTypeAction.
+   * @param text
+   * @param image
+   */
+  public CreateLocalSimpleTypeAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public Element createAndAddNewChildElement()
+  {
+    Element childNode = super.createAndAddNewChildElement();
+
+    if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.UNION_ELEMENT_TAG, false))
+    {
+//      parentNode.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
+    }
+    else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.LIST_ELEMENT_TAG, false))
+    {
+      parentNode.removeAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
+    }
+    else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+    {
+      parentNode.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
+    }
+    else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
+    {
+      Node parent = parentNode.getParentNode();
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+      {
+        parentNode.removeAttribute(XSDConstants.BASE_ATTRIBUTE);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+    {
+      parentNode.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
+    }
+    
+    formatChild(childNode);
+    
+    return childNode;
+  }
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleContentAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleContentAction.java
new file mode 100644
index 0000000..d9d9eb7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleContentAction.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+import java.util.List;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+/**
+ * @version   1.0
+ * @author
+ */
+public class CreateSimpleContentAction extends CreateElementAction
+{
+  XSDSchema xsdSchema;
+  //IDocument document;
+
+  /**
+   * Constructor for CreateSimpleContentAction.
+   */
+  public CreateSimpleContentAction()
+  {
+    super();
+  }
+  /**
+   * Constructor for CreateSimpleContentAction.
+   * @param text
+   */
+  public CreateSimpleContentAction(String text)
+  {
+    super(text);
+  }
+  /**
+   * Constructor for CreateSimpleContentAction.
+   * @param text
+   * @param XSDSchema
+   */
+  public CreateSimpleContentAction(String text, XSDSchema xsdSchema)
+  {
+    super(text);
+    this.xsdSchema = xsdSchema;
+  }
+  /**
+   * Constructor for CreateSimpleContentAction.
+   * @param text
+   * @param image
+   */
+  public CreateSimpleContentAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public Element createAndAddNewChildElement()
+  {
+    Element childNode = super.createAndAddNewChildElement();
+
+    String prefix = parentNode.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    Element derivedByNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + "restriction");
+    childNode.appendChild(derivedByNode);
+    Element sequence = null;
+
+    if (XSDDOMHelper.inputEquals(childNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+    {
+      sequence = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + "sequence");
+      derivedByNode.appendChild(sequence);
+    }
+
+    // now add the required base attribute for the derived by node
+    TypesHelper typesHelper = new TypesHelper(xsdSchema);
+    List listOfCT = typesHelper.getUserComplexTypeNamesList();
+    String firstType = "";
+    if (listOfCT.size() > 0)
+    {
+      firstType = (String)(listOfCT).get(0);
+    }
+    DOMAttribute attr = new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, firstType);
+    derivedByNode.setAttribute(attr.getName(), attr.getValue());
+
+    formatChild(derivedByNode);
+    if (sequence != null)
+    {
+      formatChild(sequence);
+      formatChild(derivedByNode);
+    }
+    formatChild(childNode);
+
+    
+    return childNode;
+  }
+
+  /*
+   * @see IAction#run()
+   */
+  public void run()
+  {
+    beginRecording(getDescription());
+
+    createAndAddNewChildElement();
+    endRecording();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleTypeAction.java
new file mode 100644
index 0000000..5e5c29c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleTypeAction.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+public class CreateSimpleTypeAction extends CreateElementAction
+{
+  /**
+   * 
+   */
+  public CreateSimpleTypeAction()
+  {
+    super();
+  }
+
+  /**
+   * @param text
+   */
+  public CreateSimpleTypeAction(String text)
+  {
+    super(text);
+  }
+  
+  public CreateSimpleTypeAction(String text, XSDSchema xsdSchema)
+  {
+    super(text);
+    this.xsdSchema = xsdSchema;
+  }
+
+  /**
+   * @param text
+   * @param image
+   */
+  public CreateSimpleTypeAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+  
+  public Element createAndAddNewChildElement()
+  {
+    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent(parentNode);
+    Element childNode = super.createAndAddNewChildElement();
+
+    String prefix = parentNode.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    Element contentModelNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
+    contentModelNode.setAttribute(XSDConstants.BASE_ATTRIBUTE, prefix + "string");
+    childNode.appendChild(contentModelNode);
+
+    formatChild(childNode);
+    
+    xsdComp.setElement(parentNode);
+    
+    return childNode;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
new file mode 100644
index 0000000..5580b40
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+// TODO Remove this
+
+/**
+ * @version 	1.0
+ * @author
+ */
+public class DOMAttribute
+{
+  /**
+   * Constructor for DOMAttribute.
+   */
+  public DOMAttribute()
+  {
+    super();
+  }
+  
+  /**
+   * Constructor for DOMAttribute.
+   */
+  public DOMAttribute(String name, String value)
+  {
+    super();
+    this.name = name;
+    this.value = value;
+  }
+  
+  protected String name, value;
+  /**
+   * Gets the value.
+   * @return Returns a String
+   */
+  public String getValue()
+  {
+    return value;
+  }
+
+  /**
+   * Sets the value.
+   * @param value The value to set
+   */
+  public void setValue(String value)
+  {
+    this.value = value;
+  }
+
+  /**
+   * Gets the name.
+   * @return Returns a String
+   */
+  public String getName()
+  {
+    return name;
+  }
+
+  /**
+   * Sets the name.
+   * @param name The name to set
+   */
+  public void setName(String name)
+  {
+    this.name = name;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DeleteAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DeleteAction.java
new file mode 100644
index 0000000..d2e4c23
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DeleteAction.java
@@ -0,0 +1,234 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import java.util.Iterator;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.SelectionListenerAction;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.BaseGlobalCleanup;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalAttributeCleanup;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalAttributeGroupCleanup;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalElementCleanup;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalGroupCleanup;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalSimpleOrComplexTypeCleanup;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Node;
+
+
+public class DeleteAction extends SelectionListenerAction
+{
+  protected IEditorPart editor;
+  protected XSDSchema xsdSchema;
+  protected ISelectionProvider selectionProvider;
+  protected XSDConcreteComponent parentXSDComponent;
+  
+  /**
+   * Constructor for DeleteAction.
+   * @param text
+   */
+  public DeleteAction(String text, IEditorPart editor, XSDSchema xsdSchema)
+  {
+    super(text);
+    this.editor = editor;
+    this.xsdSchema = xsdSchema;
+  }
+  
+  public void setSelectionProvider(ISelectionProvider selectionProvider)
+  {
+    this.selectionProvider = selectionProvider;
+  }
+  
+  public IEditorPart getEditor()
+  {
+    return editor;
+  }
+  
+  public XSDSchema getSchema()
+  {
+    return xsdSchema;
+  }
+  
+  public void setXSDSchema(XSDSchema xsdSchema)
+  {
+    this.xsdSchema = xsdSchema;
+  }
+  
+  /*
+   * @see IAction#run()
+   */
+  public void run()
+  {
+    IStructuredSelection selection = getStructuredSelection();
+    
+    if (selection.isEmpty())
+    {
+      return;
+    }
+    
+    Iterator iter = selection.iterator();
+    DocumentImpl doc = null;
+    while (iter.hasNext())
+    {
+      Object obj = iter.next();
+      Node node = null;
+      if (obj instanceof Node)
+      {
+        node = (Node)obj;
+      }
+      else if (obj instanceof XSDConcreteComponent)
+      {
+        xsdSchema = ((XSDConcreteComponent)obj).getSchema();
+        
+        node = ((XSDConcreteComponent)obj).getElement();
+        if (node instanceof IDOMNode)
+        {
+          parentXSDComponent = ((XSDConcreteComponent)obj).getContainer();
+        
+          if (parentXSDComponent instanceof XSDParticle)
+          {
+            // need to get the modelGroup
+            parentXSDComponent = parentXSDComponent.getContainer();
+          }
+        }
+
+      }
+      if (!XSDDOMHelper.inputEquals(node, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+      {
+        if (node instanceof IDOMNode)
+        {
+          if (doc == null)
+          {
+            doc = (DocumentImpl) node.getOwnerDocument();
+            doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_NODES"));
+          }
+    
+          boolean refresh = cleanupReferences(node);
+          if (node != null)
+          {
+            XSDDOMHelper.removeNodeAndWhitespace(node);
+          }
+          
+          // Workaround to reset included elements in XSD model
+          if (refresh)
+          {
+  //          getEditor().reparseSchema();
+  //          getEditor().getGraphViewer().setSchema(getEditor().getXSDSchema());
+          }
+        }
+      }
+    }
+    
+    if (parentXSDComponent != null && selectionProvider != null)
+    {
+      selectionProvider.setSelection(new StructuredSelection(parentXSDComponent));
+    }
+    
+    if (doc != null)
+    {
+      doc.getModel().endRecording(this);
+    }
+  }
+
+  protected boolean cleanupReferences(Node deletedNode)
+  {
+    boolean refresh = false;
+    XSDConcreteComponent comp = getSchema().getCorrespondingComponent(deletedNode);
+    
+    if (comp instanceof XSDInclude ||
+        comp instanceof XSDImport ||
+        comp instanceof XSDRedefine)
+    {
+      XSDSchema referencedSchema = null;
+      if (comp instanceof XSDInclude)
+      {
+        referencedSchema = ((XSDInclude)comp).getIncorporatedSchema();
+        refresh = true;
+      }
+      else if (comp instanceof XSDRedefine)
+      {
+        referencedSchema = ((XSDRedefine)comp).getIncorporatedSchema();
+        refresh = true;
+      }
+      else if (comp instanceof XSDImport)
+      {
+        referencedSchema = ((XSDImport)comp).getResolvedSchema();
+        refresh = true;
+      }
+
+      if (referencedSchema != null)
+      {
+        XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
+        cleanHelper.visitSchema(getSchema());
+        // populate messages
+// TODO        getEditor().createTasksInTaskList(cleanHelper.getMessages());
+      }
+      if (comp instanceof XSDImport)
+      {
+        TypesHelper typesHelper = new TypesHelper(getSchema());
+        typesHelper.updateMapAfterDelete((XSDImport)comp);
+      }
+    }
+    else if (getSchema().equals(comp.getContainer()))
+    {
+      BaseGlobalCleanup cleanHelper = null;
+      // Only need to clean up references if the component being deleted is global scoped
+      if (comp instanceof XSDElementDeclaration)
+      {
+        cleanHelper = new GlobalElementCleanup(comp);
+      }
+      else if (comp instanceof XSDModelGroupDefinition)
+      {
+        cleanHelper = new GlobalGroupCleanup(comp);
+      }
+      else if (comp instanceof XSDTypeDefinition)
+      {
+        cleanHelper = new GlobalSimpleOrComplexTypeCleanup(comp);
+      }
+      else if (comp instanceof XSDAttributeDeclaration)
+      {
+        cleanHelper = new GlobalAttributeCleanup(comp);
+      }
+      else if (comp instanceof XSDAttributeGroupDefinition)
+      {
+        cleanHelper = new GlobalAttributeGroupCleanup(comp);
+      }
+      
+      
+      if (cleanHelper != null)
+      {
+        cleanHelper.visitSchema(getSchema());
+      }
+    }
+    return refresh;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/GraphRenameAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/GraphRenameAction.java
new file mode 100644
index 0000000..cea3fd9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/GraphRenameAction.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2004, 2005 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
+* http://www.eclipse.org/legal/epl-v10.html
+* 
+* Contributors:
+*     IBM Corporation - Initial API and implementation
+*******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.jface.action.Action;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.commands.RenameCommand;
+import org.eclipse.xsd.XSDNamedComponent;
+
+
+public class GraphRenameAction extends Action
+{
+  protected RenameCommand command;
+  
+  public GraphRenameAction(XSDNamedComponent namedComponent, GraphicalEditPart editPart)
+  {
+    command = new RenameCommand(namedComponent, editPart);
+    setText(XSDEditorPlugin.getXSDString("_UI_LABEL_RENAME"));
+  }
+
+  public void run()
+  {
+    command.run();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ISchemaEditorActionConstants.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ISchemaEditorActionConstants.java
new file mode 100644
index 0000000..39836ff
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ISchemaEditorActionConstants.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+public interface ISchemaEditorActionConstants
+{
+  public static final String RETARGET_VALIDATE_SCHEMA_ACTION_ID = "retargetValidateSchemaAction"; //$NON-NLS-1$
+  public static final String RETARGET_RELOAD_DEPENDENCIES_ACTION_ID = "retargetReloadDependenciesAction"; //$NON-NLS-1$
+  public static final String RETARGET_GENERATE_JAVA_ACTION_ID = "retargetGenerateJavaAction"; //$NON-NLS-1$
+  public static final String RETARGET_GENERATE_DTD_ACTION_ID = "retargetGenerateDtdAction"; //$NON-NLS-1$
+  public static final String RETARGET_GENERATE_XML_ACTION_ID = "retargetGenerateXMLAction"; //$NON-NLS-1$
+  public static final String RETARGET_RENAME_ELEMENT_ACTION_ID = "RenameElement"; //$NON-NLS-1$
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MakeAnonymousGlobal.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MakeAnonymousGlobal.java
new file mode 100644
index 0000000..9a9638a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MakeAnonymousGlobal.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class MakeAnonymousGlobal extends CreateElementAction
+{
+	XSDSchema xsdSchema;
+	Element type;
+	
+	public MakeAnonymousGlobal(String text, Element type, XSDSchema xsdSchema)
+	{
+		super(text);
+		this.xsdSchema = xsdSchema;
+		this.type = type;
+		isGlobal = true;
+	}
+
+	public Element createAndAddNewChildElement()
+	{
+		// create the new global type
+		Element childNode = super.createAndAddNewChildElement();
+    // add the anonymous type's children to the new global type
+		if (type.hasChildNodes())
+		{        
+			NodeList nodes = type.getChildNodes();
+			// use clones so we don't have a refresh problem
+			for (int i = 0; i < nodes.getLength(); i++)
+			{
+				Node node = nodes.item(i);       
+				childNode.appendChild(node.cloneNode(true));
+			}
+		}
+
+    // clean up the element whose type was anonymous
+    // and set its type attribute to the new global type
+		TypesHelper helper = new TypesHelper(xsdSchema);
+		String prefix = helper.getPrefix(xsdSchema.getTargetNamespace(), true);
+		helper = null;
+		
+		Element parentElementOfAnonymousType = (Element)type.getParentNode();
+
+		parentElementOfAnonymousType.removeChild(type);
+		parentElementOfAnonymousType.setAttribute(XSDConstants.TYPE_ATTRIBUTE, prefix + childNode.getAttribute(XSDConstants.NAME_ATTRIBUTE));
+
+		formatChild(childNode);
+		
+    return childNode;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ModelMessage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ModelMessage.java
new file mode 100644
index 0000000..aa30618
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ModelMessage.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.w3c.dom.Node;
+
+public class ModelMessage
+{
+  protected String message;
+  protected Node node;
+
+  public ModelMessage(String message, Node node)
+  {
+    this.message = message;
+    this.node = node;
+  }
+
+  public String getMessage()
+  {
+    return message;
+  }
+
+  public Node getNode()
+  {
+    return node;
+  }
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java
new file mode 100644
index 0000000..e3606c9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+public class MoveAction extends Action
+{
+  protected List selectedNodes;
+  protected Node parentNode;
+  protected Node refChild;
+
+  /**
+   * Constructor for DeleteAction.
+   * @param text
+   */
+  public MoveAction(Node parentNode, List selectedNodes, Node refChild)
+  {
+    this.parentNode = parentNode;
+    this.selectedNodes = selectedNodes;
+    this.refChild = refChild;
+  }    
+
+  public MoveAction(XSDConcreteComponent parentComponent, List selectedComponents, XSDConcreteComponent refChildComponent)
+  {
+    selectedNodes = new ArrayList(selectedComponents.size());
+    for (Iterator i = selectedComponents.iterator(); i.hasNext(); )
+    {
+      XSDConcreteComponent concreteComponent = (XSDConcreteComponent)i.next();
+      selectedNodes.add(concreteComponent.getElement());
+    }
+    parentNode = parentComponent.getElement();
+    refChild = refChildComponent != null ? refChildComponent.getElement() : null;
+  }
+                   
+  public boolean canMove()
+  {                           
+    // TODO... there are likely more restriction to consider here
+    boolean result = true;
+    for (Iterator i = selectedNodes.iterator(); i.hasNext(); )
+    {
+      Node child = (Node)i.next();
+      if (isDecendantOrSelf(child, parentNode)) 
+      {
+        result = false;
+        break;
+      }
+    }   
+    return result;
+  }           
+                  
+  protected boolean isDecendantOrSelf(Node potentialParent, Node node)
+  { 
+    boolean result = false;
+    while (node != null)
+    {
+      if (node == potentialParent)    
+      {
+        result = true;
+        break;
+      }           
+      node = node.getParentNode();
+    }
+    return result;
+  }
+
+
+  protected void beginRecording()
+  {
+    IDOMModel model = getModel();      
+    if (model != null)
+    {
+      model.beginRecording(this, XSDEditorPlugin.getXSDString("_UI_LABEL_MOVE"));
+    }
+  }
+  
+  protected void endRecording()
+  {
+    IDOMModel model = getModel();      
+    if (model != null)
+    {
+      model.endRecording(this);    
+    }
+  }
+
+  protected IDOMModel getModel()
+  {
+    IDOMModel model = null;
+    if (parentNode instanceof IDOMNode)
+    {                            
+      model = ((IDOMNode)parentNode).getModel();
+    }
+    return model;
+  }
+  
+
+     
+  /*
+   * @see IAction#run()
+   */
+  public void run()
+  {                            
+    beginRecording();
+    try
+    {
+      for (Iterator i = selectedNodes.iterator(); i.hasNext(); )
+      {
+        Node child = (Node)i.next();
+        repositionBefore(parentNode, child, refChild);
+      }   
+    }
+    catch (Exception e)
+    {         
+      e.printStackTrace();
+    }
+    endRecording();
+  }
+
+
+  public void repositionBefore(Node parent, Node child, Node refChild)
+  {   
+    // TODO... when the refChild (inserting as the last element) we need to
+    // special case the way we preserve indentation 
+    Node oldParent = child.getParentNode();
+    if (oldParent != null && refChild != child)
+    {  
+      // consider any indentation text node that preceeds the child
+      //      
+      Node textNode = isWhitespaceTextNode(child.getPreviousSibling()) ? child.getPreviousSibling() : null;
+
+      // remove the child
+      //
+      oldParent.removeChild(child);
+      
+      // Instead of inserting the child immediatlely infront of the refChild, we first check to see if there
+      // is an indentation text node preceeding the refChild.  If we find such a node, we perform the insertion
+      // so that the child is inserted before the indentation text node.
+      Node adjustedRefChild = refChild;
+      if (refChild != null && isWhitespaceTextNode(refChild.getPreviousSibling()))
+      {
+        adjustedRefChild = refChild.getPreviousSibling();
+      }
+          
+      // reposition the child and any indentation text node 
+      //
+      parent.insertBefore(child, adjustedRefChild);
+      if (textNode != null)
+      {
+        oldParent.removeChild(textNode);
+        parent.insertBefore(textNode, child);
+      }
+    }
+  }     
+    
+
+  protected static boolean isWhitespaceTextNode(Node node)
+  {
+    boolean result = false;
+    if (node != null && node.getNodeType() == Node.TEXT_NODE)
+    {
+      String data = ((Text)node).getData();
+      result = (data == null || data.trim().length() == 0);
+    }   
+    return result;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/OpenSchemaAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/OpenSchemaAction.java
new file mode 100644
index 0000000..ce9216f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/OpenSchemaAction.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.util.OpenOnSelectionHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.impl.XSDImportImpl;
+
+
+public class OpenSchemaAction extends Action
+{
+  XSDConcreteComponent component;
+  public OpenSchemaAction(String label, XSDConcreteComponent component)
+  {
+    super(label);
+    this.component = component;
+  }
+
+  public void run()
+  {
+    if (component != null)
+    {
+      revealObject();
+    }
+  }
+
+  boolean lastResult = false;
+  protected boolean revealObject()
+  {
+    String schemaLocation = "";
+    XSDSchemaDirective dir;
+    if (component instanceof XSDSchemaDirective)
+    {
+      dir = (XSDSchemaDirective)component;
+      // force load of imported schema
+      if (dir instanceof XSDImportImpl)
+      {
+        ((XSDImportImpl)dir).importSchema();
+      }
+      if (dir.getResolvedSchema() != null)
+      {
+        schemaLocation = URIHelper.removePlatformResourceProtocol(dir.getResolvedSchema().getSchemaLocation());
+        if (schemaLocation != null)
+        {
+          OpenOnSelectionHelper.openXSDEditor(schemaLocation);
+        }
+      }
+    }
+    return lastResult;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ReloadDependenciesAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ReloadDependenciesAction.java
new file mode 100644
index 0000000..73e239f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ReloadDependenciesAction.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+
+
+public class ReloadDependenciesAction extends Action
+{
+  /**
+   * Constructor for ReloadDependenciesAction.
+   */
+  public ReloadDependenciesAction()
+  {
+    super();
+  }
+
+  /**
+   * Constructor for ReloadDependenciesAction.
+   * @param text
+   */
+  public ReloadDependenciesAction(String text)
+  {
+    super(text);
+  }
+
+  /**
+   * Constructor for ReloadDependenciesAction.
+   * @param text
+   * @param image
+   */
+  public ReloadDependenciesAction(String text, ImageDescriptor image)
+  {
+    super(text, image);
+  }
+
+  public void setEditor(XSDEditor editor)
+  {
+    this.editor = editor;
+  }
+  
+  protected XSDEditor editor;
+  
+  public void run()
+  {
+    editor.reparseSchema();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetBaseTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetBaseTypeAction.java
new file mode 100644
index 0000000..31d9753
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetBaseTypeAction.java
@@ -0,0 +1,383 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.wst.xsd.ui.internal.widgets.SetBaseTypeDialog;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class SetBaseTypeAction extends Action
+{
+  XSDSchema xsdSchema;
+  Element element;
+  String type = "";
+  String derivedByString = "";
+  XSDDOMHelper domHelper;
+  
+  /**
+   * Constructor for SetBaseTypeAction.
+   */
+  public SetBaseTypeAction()
+  {
+    super();
+    domHelper = new XSDDOMHelper();
+  }
+  /**
+   * Constructor for SetBaseTypeAction.
+   * @param arg0
+   */
+  public SetBaseTypeAction(String arg0)
+  {
+    super(arg0);
+    domHelper = new XSDDOMHelper();
+  }
+  /**
+   * Constructor for SetBaseTypeAction.
+   * @param arg0
+   * @param arg1
+   */
+  public SetBaseTypeAction(String arg0, ImageDescriptor arg1)
+  {
+    super(arg0, arg1);
+    domHelper = new XSDDOMHelper();
+  }
+  /**
+   * Constructor for SetBaseTypeAction.
+   * @param arg0
+   * @param arg1
+   */
+  public SetBaseTypeAction(String arg0, int arg1)
+  {
+    super(arg0, arg1);
+    domHelper = new XSDDOMHelper();
+  }
+
+  
+  public void setXSDSchema(XSDSchema schema)
+  {
+    this.xsdSchema = schema;    
+  }
+
+  public void setComplexTypeElement(Element element)
+  {
+    this.element = element;
+  }
+  
+  public void setType(String type)
+  {
+    this.type = type; 
+  }
+
+  public void setDerivedBy(String derivedByString)
+  {
+    this.derivedByString = derivedByString;
+  }
+
+  public void run()
+  {
+    Display display = Display.getCurrent();
+    // if it is null, get the default one
+    display = display == null ? Display.getDefault() : display;
+    Shell parentShell = display.getActiveShell();
+
+    SetBaseTypeDialog dialog = new SetBaseTypeDialog(parentShell, xsdSchema, element);
+    dialog.setBlockOnOpen(true);
+
+    Element contentModelElement = domHelper.getContentModelFromParent(element);    
+    if (contentModelElement != null)
+    {
+      // to set the current values to show in the dialog
+      if (XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false) ||
+          XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+      {
+        Element derivedByElement = domHelper.getDerivedByElementFromComplexType(element);
+        if (derivedByElement != null)
+        {
+          String currentBaseType = derivedByElement.getAttribute(XSDConstants.BASE_ATTRIBUTE);
+          dialog.setCurrentBaseType(currentBaseType);
+          dialog.setCurrentDerivedBy(derivedByElement.getLocalName());
+        }
+        else
+        {
+          dialog.setCurrentBaseType("");
+          dialog.setCurrentDerivedBy("");
+        }
+      }
+    }
+
+    int result = dialog.open();
+    
+    if (result == Window.OK) 
+    {
+      type = dialog.getBaseType();
+      derivedByString = dialog.getDerivedBy();
+      performAction();
+    }
+  }
+
+  XSDTypeDefinition newTypeDefinition = null;
+  public XSDTypeDefinition getXSDTypeDefinition()
+  {
+    return newTypeDefinition;
+  }
+
+  public void performAction()
+  {
+    TypesHelper helper = new TypesHelper(xsdSchema);
+
+    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent(element);
+    
+    Element contentModelElement = domHelper.getContentModelFromParent(element);
+    boolean contentModelExists = true;
+    if (contentModelElement == null)
+    {
+      contentModelExists = false;
+    }
+
+//  get XSD component of the new type chosen
+    newTypeDefinition = null;
+    for (Iterator i = xsdSchema.getTypeDefinitions().iterator(); i.hasNext(); )
+    {
+      XSDTypeDefinition typeDef = (XSDTypeDefinition)i.next();
+      if (typeDef.getQName().equals(type))
+      {
+        newTypeDefinition = typeDef;
+        break;
+      }
+    }
+   
+    boolean needsComplexContent = false;
+    boolean needsSimpleContent = false;
+
+    if (helper.getBuiltInTypeNamesList().contains(type) ||
+       helper.getUserSimpleTypeNamesList().contains(type))
+//    if (newTypeDefinition instanceof XSDSimpleTypeDefinition)
+    {
+      needsSimpleContent = true; 
+    }        
+    else if (newTypeDefinition instanceof XSDComplexTypeDefinition)
+    {
+      needsComplexContent = true;
+//      XSDComplexTypeDefinition newCTObj = (XSDComplexTypeDefinition)newTypeDefinition;
+//      XSDContentTypeCategory category = newCTObj.getContentTypeCategory();
+    }
+    
+    beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_BASE_TYPE"), element);
+    String prefix = element.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+
+    DOMAttribute attr = new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, type);
+    if (!contentModelExists) // if no content model exists, then add the new nodes
+    {
+      if (helper.getBuiltInTypeNamesList().contains(type) ||
+          helper.getUserSimpleTypeNamesList().contains(type))
+      {
+        updateModelAndDerivedByKind(prefix + XSDConstants.SIMPLECONTENT_ELEMENT_TAG, prefix + XSDConstants.EXTENSION_ELEMENT_TAG, attr);
+      }
+      else if (helper.getUserComplexTypeNamesList().contains(type))
+      {
+        if (derivedByString.equals("")) // default
+        {
+          derivedByString = XSDConstants.EXTENSION_ELEMENT_TAG;
+        }
+        Element derivedByElement = updateModelAndDerivedByKind(prefix + XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, prefix + derivedByString, attr);
+        Element newModelGroupElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SEQUENCE_ELEMENT_TAG);
+        derivedByElement.appendChild(newModelGroupElement);
+        formatChild(derivedByElement);
+      }
+    }
+    else  // else there is a content model
+    {
+      if (type.equals(""))  // the chosen type is blank, ie. there is no base type
+      {
+        Element derivedByElement = domHelper.getDerivedByElementFromComplexType(element);
+        Element sourceContentModelElement = domHelper.getContentModelFromParent(derivedByElement);
+        // Retain the content model if there is one from the complex or simple content derive by element
+        if (XSDDOMHelper.inputEquals(sourceContentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
+            XSDDOMHelper.inputEquals(sourceContentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
+            XSDDOMHelper.inputEquals(sourceContentModelElement, XSDConstants.ALL_ELEMENT_TAG, false))
+        {      
+          Element newNode = domHelper.cloneElement(element, sourceContentModelElement);
+          element.replaceChild(newNode, contentModelElement);
+          formatChild(element); 
+        }
+        else // otherwise just add the nodes
+        {
+          XSDDOMHelper.removeNodeAndWhitespace(contentModelElement);
+          Element newSequenceElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SEQUENCE_ELEMENT_TAG);
+          element.appendChild(newSequenceElement);
+          formatChild(newSequenceElement);
+        }
+      }           
+      else // a base type is specified
+      {
+        Element sequenceChoiceOrAllElement = null;  // copy the model to reposition it off of the new derived by element
+        if (XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
+            XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
+            XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.ALL_ELEMENT_TAG, false))
+        {
+           sequenceChoiceOrAllElement = domHelper.cloneElement(element, contentModelElement);
+        }
+
+        if (needsComplexContent)
+        {
+          if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false)))
+          {
+            domHelper.changeContentModel(element, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, sequenceChoiceOrAllElement);
+            contentModelElement = domHelper.getContentModelFromParent(element);
+          }          
+        }
+        if (needsSimpleContent)
+        {
+          if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false)))
+          {
+            // we don't want to append the element content to a simple content
+            sequenceChoiceOrAllElement = null;
+            domHelper.changeContentModel(element, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, sequenceChoiceOrAllElement);
+            contentModelElement = domHelper.getContentModelFromParent(element);
+          }
+        }
+
+        Element derivedByElement = domHelper.getDerivedByElementFromComplexType(element);        
+        if (derivedByElement == null)
+        {
+          if (derivedByString == null || (derivedByString != null && derivedByString.equals("")))
+          {
+            derivedByString = XSDConstants.EXTENSION_ELEMENT_TAG;  // since there is no derivedByElement
+          }
+          derivedByElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, derivedByString);
+          contentModelElement.appendChild(derivedByElement);
+          formatChild(contentModelElement);
+          if (sequenceChoiceOrAllElement != null)
+          {
+            derivedByElement.appendChild(sequenceChoiceOrAllElement);
+            formatChild(derivedByElement);
+          }
+        }
+        else
+        {
+          if (helper.getBuiltInTypeNamesList().contains(type) ||
+              helper.getUserSimpleTypeNamesList().contains(type))
+          {
+            derivedByString = XSDConstants.EXTENSION_ELEMENT_TAG;
+            Element aContentModelElement = domHelper.getContentModelFromParent(derivedByElement);
+            if (aContentModelElement != null)
+            {
+              XSDDOMHelper.removeNodeAndWhitespace(aContentModelElement);
+            }
+          }
+          domHelper.changeDerivedByType(contentModelElement, derivedByString, type);
+        }
+        derivedByElement.setAttribute(attr.getName(), attr.getValue());
+      }
+    }
+    
+    xsdComp.setElement(element);
+    endRecording(element);
+  }
+
+  private Element updateModelAndDerivedByKind(String modelType, String derivedByKind, DOMAttribute attr)
+  {
+    Element newContentModelElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, modelType);
+    element.appendChild(newContentModelElement);
+
+    Element newDerivedByElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, derivedByKind);
+    newContentModelElement.appendChild(newDerivedByElement);
+
+    newDerivedByElement.setAttribute(attr.getName(), attr.getValue());
+    
+    NodeList children = element.getChildNodes();
+    int length = children.getLength();
+    ArrayList nodesToRemove = new ArrayList();
+    for (int i = 0; i < length; i++)
+    {
+      Node node = children.item(i);
+      if (XSDDOMHelper.inputEquals(node, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) ||
+          XSDDOMHelper.inputEquals(node, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true) ||
+          XSDDOMHelper.inputEquals(node, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true) ||
+          XSDDOMHelper.inputEquals(node, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
+      {
+        newDerivedByElement.appendChild(node.cloneNode(true));
+        nodesToRemove.add(node);
+      }
+    }
+    for (Iterator i = nodesToRemove.iterator(); i.hasNext(); )
+    {
+      XSDDOMHelper.removeNodeAndWhitespace((Node)i.next());
+    }
+    
+    formatChild(newContentModelElement);
+
+    return newDerivedByElement;
+  }
+
+  protected void formatChild(Element child)
+  {
+    if (child instanceof IDOMNode)
+    {
+      IDOMModel model = ((IDOMNode)child).getModel();
+      try
+      {
+        // tell the model that we are about to make a big model change
+        model.aboutToChangeModel();
+        
+        IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
+        formatProcessor.formatNode(child);
+      }
+      finally
+      {
+        // tell the model that we are done with the big model change
+        model.changedModel(); 
+      }
+    }
+
+  }
+
+  public DocumentImpl getDocument(Element element)
+  {
+    return (DocumentImpl) element.getOwnerDocument();
+  }
+
+  public void beginRecording(String description, Element element)
+  {
+    getDocument(element).getModel().beginRecording(this, description);
+  }
+  
+  public void endRecording(Element element)
+  {
+    DocumentImpl doc = (DocumentImpl) getDocument(element);
+    
+    doc.getModel().endRecording(this);    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetMultiplicityAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetMultiplicityAction.java
new file mode 100644
index 0000000..7de436d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetMultiplicityAction.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.wst.xsd.ui.internal.commands.SetMultiplicityCommand;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+public class SetMultiplicityAction extends AbstractAction
+{
+  SetMultiplicityCommand command;
+  
+  public SetMultiplicityAction(XSDConcreteComponent parent, String multiplicity)
+  {
+    super(multiplicity, parent);
+    command = new SetMultiplicityCommand(parent);
+  }
+  
+  public void setMaxOccurs(int i)
+  {
+    command.setMaxOccurs(i);
+  }
+
+  public void setMinOccurs(int i)
+  {
+    command.setMinOccurs(i);
+  }
+
+  public void run()
+  {
+    beginRecording(getText());
+    command.run();
+    endRecording();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetTypeAction.java
new file mode 100644
index 0000000..b913398
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetTypeAction.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+* Copyright (c) 2004, 2005 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
+* http://www.eclipse.org/legal/epl-v10.html
+* 
+* Contributors:
+*     IBM Corporation - Initial API and implementation
+*******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.xsd.ui.internal.commands.SetTypeCommand;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+public class SetTypeAction extends AbstractAction
+{
+  int typeKind;
+  SetTypeCommand command;
+  
+  public SetTypeAction(String text, ImageDescriptor image, XSDConcreteComponent xsdConcreteComponent)
+  {
+    super(text, image, xsdConcreteComponent);
+    command = new SetTypeCommand(xsdConcreteComponent);
+  }
+  
+  public SetTypeAction(String text, XSDConcreteComponent xsdConcreteComponent)
+  {
+    super(text, xsdConcreteComponent);
+    command = new SetTypeCommand(xsdConcreteComponent);
+  }
+  
+  public void setTypeKind(int type)
+  {
+    this.typeKind = type;
+    command.setTypeKind(type);
+  }
+  
+  public void run()
+  {
+    beginRecording(getText());
+    command.run();
+    endRecording();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SourcePageActionContributor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SourcePageActionContributor.java
new file mode 100644
index 0000000..8bc62ca
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SourcePageActionContributor.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
+
+
+/**
+ * SourcePageActionContributor
+ * 
+ * This class is for multi page editor's source page contributor.
+ *
+ * 
+ */
+public class SourcePageActionContributor extends ActionContributorXML {
+
+	private IActionBars fBars;
+
+	/**
+	 * This method calls:
+	 * <ul>
+	 *  <li><code>contributeToMenu</code> with <code>bars</code>' menu manager</li>
+	 *  <li><code>contributeToToolBar</code> with <code>bars</code>' tool bar
+	 *    manager</li>
+	 *  <li><code>contributeToStatusLine</code> with <code>bars</code>' status line
+	 *    manager</li>
+	 * </ul>
+	 * The given action bars are also remembered and made accessible via 
+	 * <code>getActionBars</code>.
+	 * 
+	 * @param bars the action bars
+	 * 
+	 */
+	public void init(IActionBars bars) {
+		fBars = bars;
+		contributeToMenu(bars.getMenuManager());
+		contributeToToolBar(bars.getToolBarManager());
+		contributeToStatusLine(bars.getStatusLineManager());
+	}
+
+	/**
+	 * Returns this contributor's action bars.
+	 *
+	 * @return the action bars
+	 */
+	public IActionBars getActionBars() {
+		return fBars;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
new file mode 100644
index 0000000..736beca
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.actions;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xml.ui.internal.actions.ReplacePrefixAction;
+import org.eclipse.wst.xml.ui.internal.util.XMLCommonResources;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.SchemaPrefixChangeHandler;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.TargetNamespaceChangeHandler;
+import org.eclipse.wst.xsd.ui.internal.widgets.XSDEditSchemaInfoDialog;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class XSDEditNamespacesAction extends Action {
+	private Element element;
+	private String resourceLocation;
+	private XSDSchema xsdSchema;
+    private DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
+	
+	public XSDEditNamespacesAction(String label, Element element, Node node) {
+		super();
+		setText(label);
+		
+		this.element = element;
+		///////////////////// This needs to be changed....
+		this.resourceLocation = "dummy";		
+	}
+	
+	public XSDEditNamespacesAction(String label, Element element, Node node, XSDSchema schema) {
+		this (label, element, node);
+		xsdSchema = schema;
+	}
+	
+	public void run() {
+		if (element != null)
+		{   
+		      Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
+		      String targetNamespace = null;
+		      if (xsdSchema != null) {
+		      	targetNamespace = xsdSchema.getTargetNamespace();
+		      }
+		      XSDEditSchemaInfoDialog dialog = new XSDEditSchemaInfoDialog(shell, new Path(resourceLocation), targetNamespace); 
+
+		      List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
+		      List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
+
+		      // here we store a copy of the old info for each NamespaceInfo
+		      // this info will be used in createPrefixMapping() to figure out how to update the document 
+		      // in response to these changes
+		      for (Iterator i = namespaceInfoList.iterator(); i.hasNext(); )
+		      {
+		        NamespaceInfo info = (NamespaceInfo)i.next();
+		        NamespaceInfo oldCopy = new NamespaceInfo(info);
+		        info.setProperty("oldCopy", oldCopy);
+		      }
+		                              
+		      dialog.setNamespaceInfoList(namespaceInfoList);   
+		      dialog.create();      
+		      //dialog.getShell().setSize(500, 300);
+		      dialog.getShell().setText(XMLCommonResources.getInstance().getString("_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE"));
+		      dialog.setBlockOnOpen(true);                                 
+		      dialog.open();
+          String xsdPrefix = "";    
+
+		      if (dialog.getReturnCode() == Window.OK)
+		      {
+            Element xsdSchemaElement = xsdSchema.getElement();
+            DocumentImpl doc = (DocumentImpl) xsdSchemaElement.getOwnerDocument();
+            
+            List newInfoList = dialog.getNamespaceInfoList();
+
+		        // see if we need to rename any prefixes
+		        Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
+            
+            Map map2 = new Hashtable();
+            for (Iterator iter = newInfoList.iterator(); iter.hasNext(); )
+            {
+              NamespaceInfo ni = (NamespaceInfo)iter.next();
+              String pref = ni.prefix;
+              String uri = ni.uri;
+              if (pref == null) pref = "";
+              if (uri == null) uri = "";
+              if (XSDConstants.isSchemaForSchemaNamespace(uri))
+              {
+                xsdPrefix = pref;
+              }
+              map2.put(pref, uri);
+            }
+           
+		        if (map2.size() > 0)
+		        {
+		        	try {
+                
+                doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"));
+
+                if (xsdPrefix != null && xsdPrefix.length() == 0)
+                {
+                  xsdSchema.setSchemaForSchemaQNamePrefix(null);
+                }
+                else
+                {
+                  xsdSchema.setSchemaForSchemaQNamePrefix(xsdPrefix);
+                }
+
+                xsdSchema.setTargetNamespace(dialog.getTargetNamespace());
+                xsdSchema.update();
+                
+                SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, xsdPrefix);
+                spch.resolve();
+                xsdSchema.update();
+                
+                xsdSchema.setIncrementalUpdate(false);
+                namespaceInfoManager.removeNamespaceInfo(element);
+                namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
+                xsdSchema.setIncrementalUpdate(true);
+
+                // don't need these any more?
+			          ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(null, element, prefixMapping);
+			          replacePrefixAction.run();
+                
+                TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, targetNamespace, dialog.getTargetNamespace());
+                targetNamespaceChangeHandler.resolve();
+				    	}
+              catch (Exception e)
+              { 
+//                e.printStackTrace();
+              }
+              finally
+              {
+                xsdSchema.update();
+                doc.getModel().endRecording(this);
+			     		}
+		        }
+		   }      
+          
+		}
+	}
+	
+	 protected Map createPrefixMapping(List oldList, List newList)
+	  {          
+	    Map map = new Hashtable();
+
+	    Hashtable oldURIToPrefixTable = new Hashtable();
+	    for (Iterator i = oldList.iterator(); i.hasNext(); )
+	    {    
+	      NamespaceInfo oldInfo = (NamespaceInfo)i.next();                    
+	      oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
+	    }
+	    
+	    for (Iterator i = newList.iterator(); i.hasNext(); )
+	    {
+	      NamespaceInfo newInfo = (NamespaceInfo)i.next();
+	      NamespaceInfo oldInfo = (NamespaceInfo)oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); 
+
+
+	      // if oldInfo is non null ... there's a matching URI in the old set
+	      // we can use its prefix to detemine out mapping
+	      //
+	      // if oldInfo is null ...  we use the 'oldCopy' we stashed away 
+	      // assuming that the user changed the URI and the prefix
+	      if (oldInfo == null)                                            
+	      {
+	        oldInfo = (NamespaceInfo)newInfo.getProperty("oldCopy");           
+	      } 
+
+	      if (oldInfo != null)
+	      {
+	        String newPrefix = newInfo.prefix != null ? newInfo.prefix : "";
+	        String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : "";
+	        if (!oldPrefix.equals(newPrefix))
+	        {
+	          map.put(oldPrefix, newPrefix);    
+	        }
+	      }      
+	    }        
+	    return map;
+	  }
+   
+//    private void updateAllNodes(Element element, String prefix)
+//    {
+//      element.setPrefix(prefix);
+//      NodeList list = element.getChildNodes();
+//      if (list != null)
+//      {
+//        for (int i=0; i < list.getLength(); i++)
+//        {
+//          Node child = list.item(i);
+//          if (child != null && child instanceof Element)
+//          {
+//            child.setPrefix(prefix);
+//            if (child.hasChildNodes())
+//            {
+//              updateAllNodes((Element)child, prefix);
+//            }
+//          }
+//        }
+//      }   
+//    }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AbstractCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AbstractCommand.java
new file mode 100644
index 0000000..3c0ae25
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AbstractCommand.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.w3c.dom.Element;
+
+public abstract class AbstractCommand 
+{
+  private XSDConcreteComponent parent;
+  private XSDConcreteComponent model;
+
+  protected AbstractCommand(XSDConcreteComponent parent)
+  {
+    this.parent = parent;
+  }
+  
+  public abstract void run();
+
+  protected XSDConcreteComponent getParent()
+  {
+    return parent;
+  }
+  
+  public XSDConcreteComponent getModelObject()
+  {
+    return model;
+  }
+  
+  protected void setModelObject(XSDConcreteComponent model)
+  {
+    this.model = model;
+  }
+  
+  // Establish part-whole relationship
+  protected abstract boolean adopt(XSDConcreteComponent model);
+
+  protected void formatChild(Element child)
+  {
+    if (child instanceof IDOMNode)
+    {
+      IDOMModel model = ((IDOMNode)child).getModel();
+      try
+      {
+        // tell the model that we are about to make a big model change
+        model.aboutToChangeModel();
+        
+        IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
+        formatProcessor.formatNode(child);
+      }
+      finally
+      {
+        // tell the model that we are done with the big model change
+        model.changedModel(); 
+      }
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddAttributeDeclarationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddAttributeDeclarationCommand.java
new file mode 100644
index 0000000..0430149
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddAttributeDeclarationCommand.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+public class AddAttributeDeclarationCommand extends AbstractCommand
+{
+  XSDAttributeDeclaration refAttribute = null;
+  /**
+   * @param parent
+   */
+  public AddAttributeDeclarationCommand(XSDConcreteComponent parent)
+  {
+    super(parent);
+  }
+
+  public AddAttributeDeclarationCommand(XSDConcreteComponent parent, XSDAttributeDeclaration ref)
+  {
+    super(parent);
+    this.refAttribute = ref;
+  }
+
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#run()
+   */
+  public void run()
+  {
+    XSDConcreteComponent parent = getParent();
+    if (parent instanceof XSDComplexTypeDefinition)
+    {
+      XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)parent;
+
+      XSDAttributeDeclaration attribute = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
+      attribute.setName(getNewName("Attribute")); //$NON-NLS-1$
+      attribute.setTypeDefinition(ct.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$
+      
+      XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
+      attributeUse.setAttributeDeclaration(attribute);
+      attributeUse.setContent(attribute);
+      
+      if (ct.getAttributeContents() != null)
+      {
+        ct.getAttributeContents().add(attributeUse);
+        formatChild(attribute.getElement());
+      }
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
+   */
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+    return false;
+  }
+  
+  ArrayList names;
+  
+  protected String getNewName(String description)
+  {
+    String candidateName = "New" + description; //$NON-NLS-1$
+    XSDConcreteComponent parent = getParent();
+    names = new ArrayList();
+    int i = 1;
+    if (parent instanceof XSDComplexTypeDefinition)
+    {
+      XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)parent;
+      walkUpInheritance(ct);
+
+      boolean ready = false;
+      while (!ready)
+      {
+        ready = true;
+        for (Iterator iter = names.iterator(); iter.hasNext(); )
+        {
+          String attrName = (String)iter.next();
+          if (candidateName.equals(attrName))
+          {
+            ready = false;
+            candidateName = "New" + description + String.valueOf(i); //$NON-NLS-1$
+            i++;
+          }
+        }
+      }
+    }
+    return candidateName;
+  }
+  
+  private void walkUpInheritance(XSDComplexTypeDefinition ct)
+  {
+    updateNames(ct);
+    XSDTypeDefinition typeDef = ct.getBaseTypeDefinition();
+    if (ct != ct.getRootType())
+    {
+      if (typeDef instanceof XSDComplexTypeDefinition)
+      {
+        XSDComplexTypeDefinition ct2 = (XSDComplexTypeDefinition)typeDef;
+        walkUpInheritance(ct2);
+      }
+    }
+  }
+
+  private void updateNames(XSDComplexTypeDefinition ct)
+  {
+    Iterator iter = ct.getAttributeContents().iterator();
+    while (iter.hasNext())
+    {
+      Object obj = iter.next();
+      if (obj instanceof XSDAttributeUse)
+      {
+        XSDAttributeUse use = (XSDAttributeUse)obj;
+        XSDAttributeDeclaration attr = use.getAttributeDeclaration();
+        String attrName = attr.getName();
+        if (attrName != null)
+        {
+          names.add(attrName);
+        }
+      }
+    }
+
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddComplexTypeDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddComplexTypeDefinitionCommand.java
new file mode 100644
index 0000000..72da36a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddComplexTypeDefinitionCommand.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDSchema;
+
+public final class AddComplexTypeDefinitionCommand extends AbstractCommand
+{
+  private String name;
+  
+  public AddComplexTypeDefinitionCommand
+    (XSDConcreteComponent parent,
+     String name)
+  {
+    super(parent);
+    this.name = name; // this may be null for anonymous type
+  }
+	  
+  public void run()
+  {
+  	XSDComplexTypeDefinition typeDef = 
+      XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
+    typeDef.setName(name);
+    	
+    if (adopt(typeDef))
+      setModelObject(typeDef);
+  }
+  
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+  	XSDConcreteComponent parent = getParent();
+    if (parent instanceof XSDSchema)
+      ((XSDSchema)parent).getTypeDefinitions().add(model);
+    else if (parent instanceof XSDElementDeclaration)
+      ((XSDElementDeclaration)parent).setAnonymousTypeDefinition((XSDComplexTypeDefinition)model);
+    else
+      return false; // invalid parent
+    
+    return true;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddElementDeclarationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddElementDeclarationCommand.java
new file mode 100644
index 0000000..fa087dd
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddElementDeclarationCommand.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+
+public final class AddElementDeclarationCommand extends AbstractCommand
+{
+  private String name; // element name
+  
+  public AddElementDeclarationCommand
+    (XSDConcreteComponent parent,
+     String name)
+  {
+    super(parent);
+    this.name = name;
+  }
+  
+  public void run()
+  {
+    XSDElementDeclaration elementDecl = 
+      XSDFactory.eINSTANCE.createXSDElementDeclaration();
+    elementDecl.setName(name);
+
+    adopt(elementDecl);
+    setModelObject(elementDecl);
+  }
+
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+  	XSDConcreteComponent parent = getParent();
+    if (parent instanceof XSDSchema)
+      ((XSDSchema)parent).getElementDeclarations().add(model);
+    else if (parent instanceof XSDParticle)
+      ((XSDParticle)parent).setContent((XSDElementDeclaration)model);
+    else
+      return false; // invalid parent
+    
+    return true;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddModelGroupCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddModelGroupCommand.java
new file mode 100644
index 0000000..f5518e2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddModelGroupCommand.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+public class AddModelGroupCommand extends AbstractCommand
+{
+  protected XSDCompositor compositor;
+
+  public AddModelGroupCommand(XSDConcreteComponent parent, XSDCompositor compositor)
+  {
+    super(parent);
+    this.compositor = compositor;
+  }
+
+  public void run()
+  {
+    XSDConcreteComponent parent = getParent();
+    XSDConcreteComponent owner = null;
+    if (parent instanceof XSDElementDeclaration)
+    {
+      XSDElementDeclaration ed = (XSDElementDeclaration)parent;      
+      if (ed.getTypeDefinition() != null) 
+      {
+        if (ed.getAnonymousTypeDefinition() == null)
+        {
+          ed.setTypeDefinition(null);
+          XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
+          ed.setAnonymousTypeDefinition(td);
+          owner = ed.getTypeDefinition();
+        }
+        else
+        {
+          XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
+          ed.setAnonymousTypeDefinition(td);
+          owner = td;        
+        }
+      }        
+      else if (ed.getAnonymousTypeDefinition() == null)
+      {
+        XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
+        ed.setAnonymousTypeDefinition(td);
+        owner = td;        
+      }
+      else if (ed.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)
+      {
+        owner = ed.getAnonymousTypeDefinition();
+      }
+      else if (ed.getAnonymousTypeDefinition() instanceof XSDSimpleTypeDefinition)
+      {
+        XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
+        ed.setAnonymousTypeDefinition(td);
+        owner = td;        
+      }
+    }
+    else if (parent instanceof XSDModelGroup)
+    {
+      ((XSDModelGroup) parent).getContents().add(createModelGroup());
+    }
+    else if (parent instanceof XSDComplexTypeDefinition)
+    {
+      owner = ((XSDComplexTypeDefinition)parent);
+    }
+    if (owner != null)
+    {
+      XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); 
+      XSDModelGroup modelGroup = createModelGroup();
+      particle.setContent(modelGroup);
+
+      XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)owner;
+      ctd.setContent(particle);
+      formatChild(parent.getElement());
+    }  
+  }
+
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+    return false;
+  }
+  
+  protected XSDModelGroup createModelGroup()
+  {
+    XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
+    modelGroup.setCompositor(compositor);
+    return modelGroup;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddSimpleTypeDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddSimpleTypeDefinitionCommand.java
new file mode 100644
index 0000000..b0c347b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddSimpleTypeDefinitionCommand.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+public final class AddSimpleTypeDefinitionCommand extends AbstractCommand
+{
+  private String name;
+  
+  public AddSimpleTypeDefinitionCommand
+    (XSDConcreteComponent parent,
+     String name)
+  {
+    super(parent);
+    this.name = name; // this may be null for anonymous type
+  }
+  
+  public void run()
+  {
+  	XSDSimpleTypeDefinition typeDef = 
+      XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
+  	typeDef.setName(name);
+  	
+    if (adopt(typeDef))
+      setModelObject(typeDef);
+  }
+  
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+  	XSDConcreteComponent parent = getParent();
+    if (parent instanceof XSDSchema)
+      ((XSDSchema)parent).getTypeDefinitions().add(model);
+    else if (parent instanceof XSDElementDeclaration)
+      ((XSDElementDeclaration)parent).setAnonymousTypeDefinition((XSDSimpleTypeDefinition)model);
+    else if (parent instanceof XSDAttributeDeclaration)
+      ((XSDAttributeDeclaration)parent).setAnonymousTypeDefinition((XSDSimpleTypeDefinition)model);
+    else
+      return false; // invalid parent
+    
+    return true;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeAnonymousTypeGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeAnonymousTypeGlobalCommand.java
new file mode 100644
index 0000000..7562a18
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeAnonymousTypeGlobalCommand.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+public final class MakeAnonymousTypeGlobalCommand extends AbstractCommand {
+
+	String fNewName;
+
+	public MakeAnonymousTypeGlobalCommand(XSDConcreteComponent element,
+			String newName) {
+		super(element.getContainer());
+		setModelObject(element);
+		fNewName = newName;
+	}
+
+	public void run() {
+		XSDConcreteComponent model = getModelObject();
+		XSDConcreteComponent parent = model.getContainer();
+		XSDTypeDefinition globalTypeDef = null;
+		if (model instanceof XSDComplexTypeDefinition) {
+			if (parent instanceof XSDElementDeclaration) {
+				// clone typedef with it's content and set it global
+				globalTypeDef = (XSDComplexTypeDefinition) model
+						.cloneConcreteComponent(true, false);
+				globalTypeDef.setName(fNewName);
+				parent.getSchema().getContents().add(globalTypeDef);
+				((XSDElementDeclaration) parent)
+						.setTypeDefinition(globalTypeDef);
+			}
+		} else if (model instanceof XSDSimpleTypeDefinition) {
+
+			XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) model;
+			if (parent instanceof XSDElementDeclaration) {
+				// clone typedef with it's content and set it global
+				globalTypeDef = (XSDSimpleTypeDefinition) typeDef
+						.cloneConcreteComponent(true, false);
+				globalTypeDef.setName(fNewName);
+				parent.getSchema().getContents().add(globalTypeDef);
+				((XSDElementDeclaration) parent)
+						.setTypeDefinition(globalTypeDef);
+				formatChild(globalTypeDef.getElement());
+
+			} else if (parent instanceof XSDAttributeDeclaration) {
+				// clone typedef with it's content and set it global
+				globalTypeDef = (XSDSimpleTypeDefinition) typeDef
+						.cloneConcreteComponent(true, false);
+				globalTypeDef.setName(fNewName);
+				parent.getSchema().getContents().add(globalTypeDef);
+				((XSDAttributeDeclaration) parent)
+						.setTypeDefinition((XSDSimpleTypeDefinition) globalTypeDef);
+
+			}
+
+		}
+
+		formatChild(globalTypeDef.getElement());
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
+	 */
+	protected boolean adopt(XSDConcreteComponent model) {
+		// TODO Auto-generated method stub
+		return true;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeLocalElementGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeLocalElementGlobalCommand.java
new file mode 100644
index 0000000..7303919
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeLocalElementGlobalCommand.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.xsd.XSDComplexTypeContent;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+public final class MakeLocalElementGlobalCommand extends AbstractCommand
+{
+	
+  public MakeLocalElementGlobalCommand
+    (XSDConcreteComponent element)
+  {
+    super(element.getContainer());
+    setModelObject(element);
+  }
+  
+  public void run()
+  {
+    
+   if(getModelObject() instanceof XSDElementDeclaration){
+   
+	   XSDElementDeclaration element = (XSDElementDeclaration)getModelObject();
+ 	XSDConcreteComponent parent = getParent();
+ 	XSDConcreteComponent container = parent.getContainer();
+ 	
+ 	// clone element with it's content and set it global
+	XSDConcreteComponent  elementDecl = ((XSDElementDeclaration)getModelObject()).cloneConcreteComponent(true, true);
+ 	container.getSchema().getContents().add(elementDecl);
+ 	
+ 	// create local element and set it's reference to the global one
+ 	XSDElementDeclaration elementRef = 
+	      XSDFactory.eINSTANCE.createXSDElementDeclaration();
+	elementRef.setValue(element.getValue());
+    elementRef.setResolvedElementDeclaration((XSDElementDeclaration)elementDecl); 
+    
+    // now set content models
+ 	if(parent instanceof XSDComplexTypeContent){
+ 		if(container instanceof XSDModelGroup){
+ 			XSDModelGroup modelGroup = (XSDModelGroup)container;
+ 			// disconnect parent from its container
+ 			int index = modelGroup.getContents().indexOf(parent);
+ 			 XSDParticle particle = 
+ 			      XSDFactory.eINSTANCE.createXSDParticle();
+ 		    particle.setContent(elementRef);
+ 		    modelGroup.getContents().add(index, particle); 
+ 		   
+ 			modelGroup.getContents().remove(parent);
+ 		    modelGroup.updateElement(true);
+  		    formatChild(modelGroup.getElement());
+ 		}
+ 	}
+ 	else if(parent instanceof XSDTypeDefinition){
+		System.out.println("MakeLocalElementGlobalCommand.run: parent instanceof XSDTypeDefinition");
+		 		
+ 	}
+ 	
+ 	container.getSchema().updateElement(true);
+    formatChild(elementDecl.getElement());
+  
+   }
+
+  }
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
+	 */
+	protected boolean adopt(XSDConcreteComponent model) {
+		// TODO Auto-generated method stub
+		return true;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/RenameCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/RenameCommand.java
new file mode 100644
index 0000000..4ecd336
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/RenameCommand.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+* Copyright (c) 2004, 2005 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
+* http://www.eclipse.org/legal/epl-v10.html
+* 
+* Contributors:
+*     IBM Corporation - Initial API and implementation
+*******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ComplexTypeDefinitionEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ElementDeclarationEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ModelGroupDefinitionEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDNamedComponent;
+
+
+/**
+ * @author kchong
+ *
+ * <a href="mailto:kchong@ca.ibm.com">kchong@ca.ibm.com</a>
+ *
+ */
+public class RenameCommand
+{
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
+  Label label = new Label();
+  XSDNamedComponent namedComponent;
+  GraphicalEditPart editPart;
+  
+  public RenameCommand(XSDNamedComponent namedComponent, GraphicalEditPart editPart)
+  {
+    this.namedComponent = namedComponent;
+    this.editPart = editPart;
+  }
+
+  public void run()
+  {
+    if (editPart instanceof ElementDeclarationEditPart)
+    {
+      ElementDeclarationEditPart elementDeclarationEditPart = (ElementDeclarationEditPart)editPart;
+      elementDeclarationEditPart.doEditName();
+    }
+    else if (editPart instanceof TopLevelComponentEditPart)
+    {
+      TopLevelComponentEditPart topLevelEditPart = (TopLevelComponentEditPart)editPart;
+      topLevelEditPart.doEditName();
+    }
+    else if (editPart instanceof ComplexTypeDefinitionEditPart)
+    {
+      ((ComplexTypeDefinitionEditPart)editPart).doEditName();
+    }
+    else if (editPart instanceof ModelGroupDefinitionEditPart)
+    {
+      ((ModelGroupDefinitionEditPart)editPart).doEditName();
+    }
+  }
+
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetMultiplicityCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetMultiplicityCommand.java
new file mode 100644
index 0000000..4c8c27d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetMultiplicityCommand.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDParticleContent;
+
+public class SetMultiplicityCommand extends AbstractCommand
+{
+  int maxOccurs, minOccurs;
+
+  /**
+   * @param parent
+   */
+  public SetMultiplicityCommand(XSDConcreteComponent parent)
+  {
+    super(parent);
+  }
+  
+  public void setMaxOccurs(int i)
+  {
+    maxOccurs=i;
+  }
+
+  public void setMinOccurs(int i)
+  {
+    minOccurs=i;    
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#run()
+   */
+  public void run()
+  {
+    XSDConcreteComponent parent = getParent();
+    if (parent instanceof XSDParticleContent)
+    {
+      XSDParticleContent xsdParticleContent = (XSDParticleContent)parent;
+      XSDParticle xsdParticle = (XSDParticle)xsdParticleContent.getContainer();
+      if (maxOccurs < 0)
+      {
+        maxOccurs = XSDParticle.UNBOUNDED;
+      }
+      xsdParticle.setMaxOccurs(maxOccurs);
+      xsdParticle.setMinOccurs(minOccurs);
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
+   */
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetTypeCommand.java
new file mode 100644
index 0000000..ce76482
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetTypeCommand.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+* Copyright (c) 2004, 2005 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
+* http://www.eclipse.org/legal/epl-v10.html
+* 
+* Contributors:
+*     IBM Corporation - Initial API and implementation
+*******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.commands;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class SetTypeCommand extends AbstractCommand
+{
+  protected int typeKind = XSDConstants.COMPLEXTYPE_ELEMENT;
+  
+  public SetTypeCommand(XSDConcreteComponent parent)
+  {
+    super(parent);
+  }
+  
+  public void setTypeKind(int type)
+  {
+    this.typeKind = type;
+  }
+
+  public void run()
+  {
+    XSDConcreteComponent parent = getParent();
+    if (parent instanceof XSDElementDeclaration)
+    {
+      XSDElementDeclaration element = (XSDElementDeclaration)parent;
+      XSDSchema schema = element.getSchema();
+      if (typeKind == XSDConstants.COMPLEXTYPE_ELEMENT)
+      {
+        AddModelGroupCommand sequenceCommand = new AddModelGroupCommand(element, XSDCompositor.SEQUENCE_LITERAL);
+        sequenceCommand.run();
+      }
+      else if (typeKind == XSDConstants.SIMPLETYPE_ELEMENT)
+      {
+        AddSimpleTypeDefinitionCommand stCommand = new AddSimpleTypeDefinitionCommand(element, null);
+        stCommand.run();
+        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)stCommand.getModelObject();
+        XSDSimpleTypeDefinition base = schema.resolveSimpleTypeDefinition(schema.getSchemaForSchemaNamespace(), "string");
+        st.setBaseTypeDefinition(base);
+      }
+      else
+      {
+          Shell shell = Display.getCurrent().getActiveShell();
+          IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
+          
+          XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
+          XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
+          provider.setDialog(dialog);
+          
+          dialog.setBlockOnOpen(true);
+          dialog.create();
+          
+          if (dialog.open() == Window.OK) {
+              XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
+              helper.setType(element.getElement(), "type", dialog.getSelection());
+          }
+      }
+      formatChild(element.getElement());
+    }
+
+  }
+  
+  private IEditorPart getActiveEditor()
+  {
+    IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
+    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
+//    IEditorPart editorPart = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
+
+    return editorPart;
+  }
+
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/ComponentSelectionDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/ComponentSelectionDialog.java
new file mode 100644
index 0000000..77ce6ad
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/ComponentSelectionDialog.java
@@ -0,0 +1,445 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.common;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+
+public class ComponentSelectionDialog extends Dialog {
+    private Display display = Display.getCurrent();
+    private String dialogTitle;
+
+    protected IComponentSelectionProvider provider;
+    private List componentTreeViewerInput;
+    private List masterComponentList;
+    
+    // widgets
+    protected Composite topComposite;
+    protected Composite bottomComposite; 
+    private String filterTextLabel = "";
+    private String componentListLabel = XSDEditorPlugin.getXSDString("_UI_LABEL_COMPONENTS");
+    private Text textFilter;
+    protected TreeViewer componentTreeViewer;
+    private org.eclipse.swt.widgets.List qualifierList;
+    
+    protected Object componentSelection;
+    protected Object qualifierTextSelection;
+
+    public ComponentSelectionDialog(Shell shell, String dialogTitle, IComponentSelectionProvider provider) {
+        super(shell);
+        setShellStyle(getShellStyle() | SWT.RESIZE);
+        this.dialogTitle = dialogTitle;
+        this.provider = provider;
+        
+        componentTreeViewerInput = new ArrayList();
+        masterComponentList = new ArrayList();
+    }
+
+    /*
+     * This method should be called before createDialogArea(Composite)
+     */
+    public void setComponentTreeLabel(String string) {
+        componentListLabel = string;
+    }
+
+    /*
+     * This method should be called before createDialogArea(Composite)
+     */
+    public void setFilterLabel(String string) {
+        filterTextLabel = string;
+    }
+    
+    public void create() {
+        super.create();
+        setTextFilterFocus();
+    }
+    
+    protected void setTextFilterFocus() {
+        textFilter.setFocus();        
+    }
+
+    public Control createDialogArea(Composite parent) {
+        getShell().setText(dialogTitle);
+
+        Composite mainComposite = (Composite) super.createDialogArea(parent);
+        GridData gData = (GridData) mainComposite.getLayoutData();
+        gData.heightHint = 500;
+        gData.widthHint = 400;
+
+        // Subclasses may use this Composite to add desired widgets
+        //topComposite = new Composite(mainComposite, SWT.NONE);
+        //topComposite.setLayoutData(new GridData());
+        //topComposite.setLayout(new GridLayout());
+        
+        // do we need to introduce a method here to contain this
+        // so we can add different parent other than 'topComposite'
+        Composite filterLabelAndTree = new Composite(mainComposite, SWT.NONE);
+        GridLayout layout = new GridLayout();
+        layout.marginWidth = 0;
+        filterLabelAndTree.setLayoutData(new GridData(GridData.FILL_BOTH));
+        filterLabelAndTree.setLayout(layout);
+
+        // Create Text textFilter
+        Label filterLabel = new Label(filterLabelAndTree, SWT.NONE);
+        filterLabel.setText(filterTextLabel);// + "(? = any character, * = any string):"); // TODO: Externalize String
+
+        textFilter = new Text(filterLabelAndTree, SWT.SINGLE | SWT.BORDER);
+        textFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));        
+        textFilter.addModifyListener(new TextFilterModifyAdapter());
+        GridData textFilterData = new GridData();
+        textFilterData.horizontalAlignment = GridData.FILL;
+        textFilterData.grabExcessHorizontalSpace = true;
+        textFilter.setLayoutData(textFilterData);
+
+        //textFilter.setSelection(0);
+        //textFilter.setf
+        
+        
+        // Create Component TreeViewer
+        createComponentTreeViewer(filterLabelAndTree);
+
+        // Create Qualifier List widget
+        Label qualifierLabel = new Label(mainComposite, SWT.NONE);
+        qualifierLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_QUALIFIER"));
+
+        qualifierList = new org.eclipse.swt.widgets.List(mainComposite, SWT.BORDER | SWT.SINGLE);
+        GridData data = new GridData();
+        data.horizontalAlignment = GridData.FILL;
+        data.grabExcessHorizontalSpace = true;
+        data.heightHint = 45;
+        qualifierList.setLayoutData(data);
+                
+        bottomComposite = new Composite(mainComposite, SWT.NONE);
+        bottomComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+        bottomComposite.setLayout(new GridLayout());
+
+        // Populate the Component TreeViewer via the provider
+        // TODO: Is this the right way to set/get the ContentProvider?
+        componentTreeViewer.setContentProvider(new ComponentTreeContentProvider());
+        componentTreeViewer.setLabelProvider(provider.getLabelProvider());
+        componentTreeViewer.setSorter(new ViewerSorter());
+        componentTreeViewer.setInput(componentTreeViewerInput);
+        
+        populateMasterComponentList();
+        refreshTreeViewer("");
+
+        return mainComposite;
+    }
+
+    protected TreeViewer createTreeViewer(Composite comp, String title) {
+        Label label = new Label(comp, SWT.NONE);
+        label.setText(title);
+
+        TreeViewer treeViewer = new TreeViewer(new Tree(comp, SWT.SINGLE | SWT.BORDER));
+        Control treeWidget = treeViewer.getTree();
+        GridData gd = new GridData(GridData.FILL_BOTH);
+        treeWidget.setLayoutData(gd);
+
+        return treeViewer;
+    }
+    
+    /*
+     * Creates the Component TreeViewer.
+     */
+    private void createComponentTreeViewer(Composite base) {
+        componentTreeViewer = createTreeViewer(base, componentListLabel);    
+        
+        componentTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+            public void selectionChanged(SelectionChangedEvent event) {
+                IStructuredSelection structuredSelection = (IStructuredSelection) event.getSelection();
+                List qualifiers = provider.getQualifiers(structuredSelection.getFirstElement());
+                updateQualifierList(qualifiers);
+                updateCanFinish();
+            }
+        });
+    }
+    
+    private void updateQualifierList(List qualifiers) {
+        qualifierList.removeAll();
+        Iterator it = qualifiers.iterator();
+        while (it.hasNext()) {
+            qualifierList.add(it.next().toString());
+        }
+    }
+    
+    
+    /*
+     * Returns the processed filter text for the Text field.  Inserts a "."
+     * before each supported meta-character.
+     */
+    protected String getProcessedFilterString() {
+        return processFilterString(textFilter.getText());
+    }
+
+    /*
+     * If supported metacharacters are used in the filter string, we need to
+     * insert a "." before each metacharacter.
+     */
+    private String processFilterString(String inputString) {
+        if (!(inputString.equals(""))) {
+            inputString = insertString("*", ".", inputString);
+            inputString = insertString("?", ".", inputString);
+            inputString = inputString + ".*";
+        } else {
+            inputString = ".*";
+        }
+
+        return inputString.toLowerCase();
+    }
+    
+    /*
+     * Helper method to insert a "." before each metacharacter in the
+     * search/filter string.
+     */
+    private String insertString(String target, String newString, String string) {
+        StringBuffer stringBuffer = new StringBuffer(string);
+
+        int index = stringBuffer.indexOf(target);
+        while (index != -1) {
+            stringBuffer = stringBuffer.insert(index, newString);
+            index = stringBuffer.indexOf(target, index + newString.length() + target.length());
+        }
+
+        return stringBuffer.toString();
+    }
+
+    /*
+     * Listens to changes made in the text filter widget
+     */
+    private class TextFilterModifyAdapter implements ModifyListener {
+        public void modifyText(ModifyEvent e) {
+            if (e.widget == textFilter) {
+                if (delayedEvent != null) {
+                    delayedEvent.CANCEL = true;
+                }
+
+                delayedEvent = new DelayedEvent();
+                Display.getCurrent().timerExec(400, delayedEvent);
+            }
+        }
+    }
+
+    //TODO... do we really need one instance?
+    private DelayedEvent delayedEvent;
+
+    /*
+     * Update the component TreeViewer when the text filter is modified.
+     * Use a DelayedEvent so we don't update on every keystroke.
+     */
+    private class DelayedEvent implements Runnable {
+        public boolean CANCEL = false;
+
+        public void run() {
+            if (!CANCEL) {
+                refreshTreeViewer(getProcessedFilterString());
+                
+                // Select first match
+                if (componentTreeViewer.getTree().getItemCount() > 0) {
+                    TreeItem item = componentTreeViewer.getTree().getItems()[0];
+                    TreeItem items[] = new TreeItem[1];
+                    items[0] = item;
+                    componentTreeViewer.getTree().setSelection(items);
+                }
+                
+                // Update qualifierList
+                IStructuredSelection structuredSelection = (IStructuredSelection) componentTreeViewer.getSelection();
+                List qualifiers = provider.getQualifiers(structuredSelection.getFirstElement());
+                updateQualifierList(qualifiers);
+                
+                updateCanFinish();
+            }
+        }
+    }
+
+    class ComponentList implements IComponentList {
+        private Vector objectVector = new Vector();
+        private long currentChangeCounter = 0;
+        
+        public void addComponent(Object o) {
+            objectVector.add(o);
+            currentChangeCounter++;
+            doViewerUpdate();
+        }
+        
+        private void doViewerUpdate() {
+            // TODO: Investigate if we should also add a timer condition??
+            if (currentChangeCounter == 10) {
+                currentChangeCounter = 0;
+                fireUpdateList(this);
+            }
+        }
+
+        public int size() {
+            return objectVector.size();
+        }
+        
+        public List subList(int startIndex, int endIndex) {
+            return objectVector.subList(startIndex, endIndex);
+        }
+        
+        public Iterator iterator() {
+            return objectVector.iterator();
+        }
+    }
+
+    
+    // this method gets called from a non-ui thread so needs to call
+    // asyncExec to ensure the UI updates happen on the UI thread
+    //
+    protected void fireUpdateList(final ComponentList list) {    
+        Runnable runnable = new Runnable() {
+            public void run(){
+                // add new objects
+                int growingListSize = list.size();
+                int currentSize = masterComponentList.size();
+                if (growingListSize > currentSize) {
+                    masterComponentList.addAll(list.subList(currentSize, growingListSize));
+                }
+
+                refreshTreeViewer(getProcessedFilterString());
+            }
+        };
+        display.asyncExec(runnable);        
+    }
+
+    
+    /*
+     * Populate the Component TreeViewer with items.
+     */
+    protected void populateMasterComponentList() {
+        masterComponentList.clear();
+        
+        final ComponentList componentList = new ComponentList();
+        provider.getComponents(componentList, true);
+        
+        Job job = new Job("read components") {
+          protected IStatus run(IProgressMonitor monitor) {
+            try {
+              // this stuff gets executed on a non-UI thread
+              //
+              provider.getComponents(componentList, false);
+              
+              // Do a final update of our Input for the component tree viewer.
+              fireUpdateList(componentList);
+            }
+            catch (Exception e) {
+            }
+            return Status.OK_STATUS;
+          }          
+        };
+        job.schedule();
+    }
+    
+    protected void refreshTreeViewer(String filterText) {
+        componentTreeViewerInput.clear();
+        ILabelProvider labelProvider = provider.getLabelProvider();
+        Pattern regex = Pattern.compile(filterText);
+        Iterator it = masterComponentList.iterator();
+        while (it.hasNext()) {
+            Object item = it.next();
+            String itemString = labelProvider.getText(item);           
+            Matcher m = regex.matcher(itemString.toLowerCase());
+            if (itemString.toLowerCase().startsWith(filterText) || m.matches()) {
+                componentTreeViewerInput.add(item);
+            }
+        }
+        
+        componentTreeViewer.refresh();
+    }
+    
+    /*
+     * If there is a selection in the ComponentTreeViewer, enable OK
+     */
+    protected void updateCanFinish() {
+        IStructuredSelection selection = (IStructuredSelection) componentTreeViewer.getSelection();
+        if (selection.getFirstElement() != null) {
+            getButton(IDialogConstants.OK_ID).setEnabled(true);
+        }
+        else {
+            getButton(IDialogConstants.OK_ID).setEnabled(false);
+        }
+    }
+    
+    protected void okPressed() {
+        IStructuredSelection selection = (IStructuredSelection) componentTreeViewer.getSelection();
+        componentSelection = selection.getFirstElement();
+        int qualifierIndex = qualifierList.getSelectionIndex();
+        if (qualifierIndex < 0) {
+            qualifierIndex = 0;
+        }
+        qualifierTextSelection = qualifierList.getItem(qualifierIndex);
+        
+        super.okPressed();
+    }
+    
+    private class ComponentTreeContentProvider implements ITreeContentProvider {
+        public Object[] getChildren(Object parentElement) {
+            if (parentElement instanceof List) {
+                return ((List) parentElement).toArray();
+            }
+            return new Object[0];
+        }
+        
+        public Object[] getElements(Object inputElement) {
+            return getChildren(inputElement);
+        }
+        
+        public Object getParent(Object element) {
+            return null;
+        }
+        
+        public boolean hasChildren(Object element) {
+            if (getChildren(element).length > 0) {
+                return true;
+            }
+            return false;
+        }
+        
+        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+        }
+        
+        public void dispose() {
+        }
+    }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentList.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentList.java
new file mode 100644
index 0000000..5c5d46a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentList.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.common;
+
+import java.util.Iterator;
+
+public interface IComponentList {
+   public void addComponent(Object o);
+   public Iterator iterator();
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentSelectionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentSelectionProvider.java
new file mode 100644
index 0000000..de68271
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentSelectionProvider.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.common;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+
+public interface IComponentSelectionProvider {
+    
+    // warning ... this will get called on a non UI thread
+    void getComponents(IComponentList list, boolean quick);
+    
+	String getType(Object component);
+	ILabelProvider getLabelProvider();
+	List getQualifiers(Object component);
+	String getNameFieldTitle();
+	String getListTitle();
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/ResourceView.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/ResourceView.java
new file mode 100644
index 0000000..2a61449
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/ResourceView.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
+
+public class ResourceView {
+/*
+	Label scopeComboLabel = new Label(topComposite, SWT.NONE);
+	scopeComboLabel.setText(searchScopeComboLabel);
+	scopeCombo = new Combo(topComposite, SWT.NONE);
+	initializeSearchScopeCombo();
+	
+	sashForm = new SashForm(topComposite,  SWT.VERTICAL);
+	GridData sashGD = new GridData(GridData.FILL_BOTH);
+	sashGD.grabExcessHorizontalSpace = true;
+	sashGD.grabExcessVerticalSpace = true;
+	sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
+	sashForm.setLayout(new GridLayout());
+	
+				int[] sashFormWeights = new int[2];
+			sashFormWeights[0] = 0;
+			sashFormWeights[1] = 7;
+			sashForm.setWeights(sashFormWeights);
+	
+	// Create PageBook for High Level TreeViewer
+			highLevelPageBook = new PageBook(sashForm, SWT.NONE);
+			GridData fileSystemPBData = new GridData();
+			fileSystemPBData.horizontalAlignment = SWT.FILL;
+			highLevelPageBook.setLayoutData(fileSystemPBData);
+			
+			blankHighLevelComposite = new Composite(highLevelPageBook, SWT.NONE);
+			highLevelComposite = new Composite(highLevelPageBook, SWT.NONE);
+			GridLayout fileSystemLayout = new GridLayout();
+			fileSystemLayout.marginWidth = 0;
+			highLevelComposite.setLayout(fileSystemLayout);
+			highLevelComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+			createHighLevelTreeViewer(highLevelComposite);
+			populateHighLevelTreeViewer();
+			
+			highLevelPageBook.showPage(blankHighLevelComposite);
+//////////////////////////////////////////////////////////////////////////////	//
+			
+		/*
+		 * Creates the High Level TreeViewer (Top TreeViewer).
+		 *
+		private void createHighLevelTreeViewer(Composite base) {
+			highLevelTreeViewer = createTreeViewer(highLevelComposite, "Resources");
+			initializeHighLevelTreeViewer();
+			String ext[] = new String[1];
+			ext[0] = "xsd";
+			addFilterExtensions(highLevelTreeViewer, ext, new IFile[0]); 
+			
+			initializeHighLevelTreeViewer();
+			populateHighLevelTreeViewer();
+		}
+        
+        
+          protected void showHighLevelView(boolean show) {
+        if (show) {
+            int[] sashFormWeights = new int[2];
+            sashFormWeights[0] = 4;
+            sashFormWeights[1] = 5;
+            sashForm.setWeights(sashFormWeights);
+
+            highLevelPageBook.showPage(highLevelComposite);
+            topComposite.layout(true, true);
+
+            showHighLevelView();
+        } else {
+            int[] sashFormWeights = new int[2];
+            sashFormWeights[0] = 0;
+            sashFormWeights[1] = 7;
+            sashForm.setWeights(sashFormWeights);
+
+            highLevelPageBook.showPage(blankHighLevelComposite);
+            topComposite.layout(true, true);
+
+            hideHighLevelView();
+        }
+    }
+    
+    protected void setFilter(TreeViewer treeViewer, ViewerFilter filter) {
+        treeViewer.getTree().setRedraw(false);
+        treeViewer.resetFilters();
+        treeViewer.addFilter(filter);
+        treeViewer.getTree().setRedraw(true);
+        treeViewer.getTree().redraw();
+    }
+    
+  // ///////////////////////////////////////////////////
+    // This is a convenience method that allows filtering of the given file
+    // exensions. It internally creates a ResourceFilter so that users of this
+    // class don't have to construct one.
+    // If the extensions provided don't have '.', one will be added.
+    protected void addFilterExtensions(TreeViewer treeViewer, String[] filterExtensions, IFile[] excludedFiles) {
+        // First add the '.' to the filterExtensions if they don't already have
+        // one
+        String[] correctedFilterExtensions = new String[filterExtensions.length];
+        for (int i = 0; i < filterExtensions.length; i++) {
+            // If the extension doesn't start with a '.', then add one.
+            if (filterExtensions[i].startsWith(".")) {
+                correctedFilterExtensions[i] = filterExtensions[i];
+            } else {
+                correctedFilterExtensions[i] = "." + filterExtensions[i];
+            }
+        }
+        ViewerFilter filter;
+        if (excludedFiles != null) {
+            filter = new SetTypeResourceFilter(correctedFilterExtensions, excludedFiles, null);
+        } else {
+            filter = new SetTypeResourceFilter(correctedFilterExtensions, null);
+        }
+        setFilter(treeViewer, filter);
+    }    
+    
+    
+  
+     * Creates a Generic TreeViewer object with the specified label and sets
+     * it's GridData value.
+  
+    protected TreeViewer createTreeViewer(Composite comp, String title) {
+        Label label = new Label(comp, SWT.NONE);
+        label.setText(title);
+
+        TreeViewer treeViewer = new TreeViewer(new Tree(comp, SWT.SINGLE | SWT.BORDER));
+        Control treeWidget = treeViewer.getTree();
+        GridData gd = new GridData(GridData.FILL_BOTH);
+        treeWidget.setLayoutData(gd);
+
+        return treeViewer;
+    }
+*/		
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentFinder.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentFinder.java
new file mode 100644
index 0000000..d73adcb
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentFinder.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+/**
+ * this thing parsers xml artifacts and picks out the specified components attributes
+ * 
+ */
+public class XMLComponentFinder {
+    public static final int ENCLOSING_PROJECT_SCOPE = 0;
+    public static final int ENTIRE_WORKSPACE_SCOPE = 1;
+
+    protected IFile currentIFile;
+	protected List validExtensions;			// List of extensions as String objects
+	protected List excludeFiles;			// List of files (full path) as String objects
+
+	public XMLComponentFinder() {
+		validExtensions = new ArrayList();
+		excludeFiles = new ArrayList();
+	}
+    
+    /*
+     * Takes in the IFile we are currently editing.
+     * The currentIFile must be set before the getEnclosingProjectFiles()
+     * method will return correctly.
+     */
+    public void setFile(IFile file) {
+        currentIFile = file;
+    }
+    
+    public void setValidExtensions(List newExtensions) {
+        validExtensions.clear();
+        validExtensions.addAll(newExtensions);
+    }
+
+    public void addExcludeFiles(List newExclude) {
+        excludeFiles.addAll(newExclude);
+    }
+
+    /*
+     * Returns a List of absolute file locations. For example
+     * "D:\files\....\file.xsd"
+     */
+    protected List getEnclosingProjectFiles() {
+        List files = new ArrayList();
+        
+        if (currentIFile != null) {
+            IProject project = currentIFile.getProject();
+            try {
+                traverseIContainer(project, validExtensions, excludeFiles, files);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        
+        return files;
+    }
+
+    protected List getWorkspaceFiles() {
+        List files = new ArrayList();
+        IWorkspaceRoot iwr = ResourcesPlugin.getWorkspace().getRoot();
+        IProject[] projects = iwr.getProjects();
+
+        try {
+            for (int index = 0; index < projects.length; index++) {
+                traverseIContainer(projects[index], validExtensions, excludeFiles, files);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return files;
+    }
+
+    /**
+     * Returns a List of absolute file locations. For example
+     * "D:\files\....\file.xsd"
+     */
+    protected void traverseIContainer(IContainer container, List extensions, List excludeFiles, List list) throws Exception {
+        IResource[] children = container.members();
+
+        for (int index = 0; index < children.length; index++) {
+            if (children[index] instanceof IFolder) {
+                traverseIContainer((IFolder) children[index], extensions, excludeFiles, list);
+            } else if (children[index] instanceof IFile) {
+                IFile file = (IFile) children[index];
+                String fileName = file.getLocation().toOSString();
+                String ext = file.getFileExtension();
+                if (extensions.contains(ext) && !excludeFiles.contains(fileName)) {
+                    list.add(file.getLocation());
+                }
+            }
+        }
+    }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionDialog.java
new file mode 100644
index 0000000..d9a74d5
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionDialog.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.ComponentSelectionDialog;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentSelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSelectionProvider.XMLComponentTreeObject;
+
+public class XMLComponentSelectionDialog extends ComponentSelectionDialog {
+
+    protected final static String DEFAULT_NAME_FIELD_TITLE = XSDEditorPlugin.getXSDString("_UI_LABEL_COMPONENT_NAME");
+    protected final static String DEFAULT_LIST_TITLE = XSDEditorPlugin.getXSDString("_UI_LABEL_MATCHING_COMPONENTS");
+	
+	public static final String SCOPE_SPECIFIED_FILE = XSDEditorPlugin.getXSDString("_UI_LABEL_SPECIFIED_FILE");
+
+	public static final String SCOPE_ENCLOSING_PROJECT = XSDEditorPlugin.getXSDString("_UI_LABEL_ENCLOSING_PROJECT");
+
+	public static final String SCOPE_WORKSPACE = XSDEditorPlugin.getXSDString("_UI_LABEL_WORKSPACE");
+
+	public static final String SCOPE_CURRENT_RESOURCE = XSDEditorPlugin.getXSDString("_UI_LABEL_CURRENT_RESOURCE");
+
+	private String currentSearchScope = SCOPE_CURRENT_RESOURCE;
+
+	protected Button chooseButton;
+	protected Button[] radioButton = new Button[3];
+
+	public XMLComponentSelectionDialog(Shell shell, String dialogTitle,
+			IComponentSelectionProvider provider) {
+		super(shell, dialogTitle, provider);
+	}
+
+public Control createDialogArea(Composite parent) {
+
+        setFilterLabel(provider.getNameFieldTitle() != null ? provider.getNameFieldTitle() : DEFAULT_NAME_FIELD_TITLE);         
+        setComponentTreeLabel(provider.getListTitle() != null ? provider.getListTitle() : DEFAULT_LIST_TITLE);
+        super.createDialogArea(parent);
+        
+        // We use the Composite topComposite to create additional widgets
+        GridLayout layout = new GridLayout();
+        layout.marginWidth = 0;
+        bottomComposite.setLayout(layout);
+        
+        
+        Group group = new Group(bottomComposite, SWT.NONE);
+        GridLayout gridLayout = new GridLayout(3, false);
+        //gridLayout.marginWidth = 0;
+        //gridLayout.marginLeft = 2;
+        group.setLayout(gridLayout);
+        group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+        group.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SEARCH_SCOPE"));
+        
+        ScopeChangeListener scopeChangeListener = new ScopeChangeListener();
+        radioButton[0] = new Button(group, SWT.RADIO);       
+        radioButton[0].setText(SCOPE_WORKSPACE);
+        
+        radioButton[1] = new Button(group, SWT.RADIO);
+        radioButton[1].setText(SCOPE_ENCLOSING_PROJECT);
+        
+        radioButton[2] = new Button(group, SWT.RADIO);
+        radioButton[2].setText(SCOPE_CURRENT_RESOURCE);
+        
+        //radioButton[3] = new Button(group, SWT.RADIO);
+        //radioButton[3].setText("Resource Set");
+
+        
+        for (int i = 0; i < radioButton.length; i++)
+        {          	
+          if (radioButton[i].getText().equals(currentSearchScope))
+          {
+          	radioButton[i].setSelection(true);
+          }	
+          radioButton[i].addSelectionListener(scopeChangeListener);        	
+        }
+        if (false){
+        Composite selectFileGroup = new Composite(group, SWT.NONE);
+        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+        gd.horizontalSpan = 2;
+        selectFileGroup.setLayoutData(gd);
+        GridLayout gridLayout3 = new GridLayout(2, false);       
+        gridLayout3.marginWidth = 0;    
+        gridLayout3.marginHeight = 0;
+        selectFileGroup.setLayout(gridLayout3);
+        Text t = new Text(selectFileGroup, SWT.BORDER | SWT.READ_ONLY);
+        t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+        Button choose = new Button(selectFileGroup, SWT.NONE);
+        choose.setText("Choose...");
+        choose.addSelectionListener(scopeChangeListener);
+        }
+        
+        
+        Button check = new Button(group, SWT.CHECK);
+        check.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_NARROW_SEARCH_SCOPE_RESOURCE"));
+        GridData gd = new GridData();
+        gd.horizontalSpan = 3;
+        check.setLayoutData(gd);
+        check.setEnabled(false);
+
+        return parent;
+    }	/*
+		  * Returns the selected search scope.
+		  */
+	public String getSearchScope() {
+		return currentSearchScope;
+	}
+
+	public XMLComponentSpecification getSelection() {
+		XMLComponentTreeObject treeObject = (XMLComponentTreeObject) componentSelection;
+		List specs = treeObject.getXMLComponentSpecification();
+
+		int matchingIndex = 0;
+		for (int index = 0; index < specs.size(); index++) {
+			XMLComponentSpecification spec = (XMLComponentSpecification) specs
+					.get(index);
+			IPath path = new Path(spec.getFileLocation());
+			String specText = spec.getTargetNamespace() + " - "
+					+ path.lastSegment();
+			if (specText.equals(qualifierTextSelection)) {
+				matchingIndex = index;
+				break;
+			}
+		}
+
+		return (XMLComponentSpecification) specs.get(matchingIndex);
+	}
+
+	private class ScopeChangeListener extends SelectionAdapter {
+		public void widgetSelected(SelectionEvent e) {
+
+			if (e.widget instanceof Button) {
+				Button b = (Button) e.widget;
+				if ((b.getStyle() & SWT.RADIO) != 0) {
+					currentSearchScope = b.getText();
+					populateMasterComponentList();
+					refreshTreeViewer(getProcessedFilterString());
+
+					// Select the first matching component. Though we should be
+					// smarter here
+					// and determine if there was a selection before the scope
+					// switch (and if
+					// the component is still available.
+					Tree tree = componentTreeViewer.getTree();
+					TreeItem items[] = tree.getItems();
+					if (items.length > 0) {
+						TreeItem select[] = new TreeItem[1];
+						select[0] = items[0];
+						tree.setSelection(select);
+					}
+
+					updateCanFinish();
+				}				
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionProvider.java
new file mode 100644
index 0000000..aef0a01
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionProvider.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentList;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentSelectionProvider;
+
+public abstract class XMLComponentSelectionProvider implements IComponentSelectionProvider {
+    public List getQualifiers(Object component) {
+        List qualifiers = new ArrayList();
+        if (component != null) {
+            XMLComponentTreeObject specification = (XMLComponentTreeObject) component;
+            Iterator it = specification.getXMLComponentSpecification().iterator();
+            while (it.hasNext()) {
+                XMLComponentSpecification spec = (XMLComponentSpecification) it.next();
+                qualifiers.add(createQualifierText(spec));
+            }
+        }
+        
+        return qualifiers;
+    }
+    
+    protected String createQualifierText(XMLComponentSpecification spec) {
+        IPath path = new Path(spec.getFileLocation());
+        return spec.getTargetNamespace() + " - " + path.lastSegment();        
+    }
+    
+    protected void addDataItemToTreeNode(IComponentList comps, XMLComponentSpecification dataItem) {
+        boolean foundMatch = false;
+        Iterator it = comps.iterator();
+        XMLComponentTreeObject containingTreeObject = null;
+
+        while (it.hasNext()) {
+            XMLComponentTreeObject treeObject = (XMLComponentTreeObject) it.next();
+            if (treeObject.getName().equals(dataItem.getAttributeInfo("name"))) {
+                // If the existing data item and the new data item have the same names
+                if (treeObject.getXMLComponentSpecification().size() > 0) {
+                    String existingPath = ((XMLComponentSpecification) treeObject.getXMLComponentSpecification().get(0)).getTagPath();
+                    if (existingPath.equals(dataItem.getTagPath())) {
+                        // If they are the same 'type' of items (according to the path value)
+                        containingTreeObject = treeObject;
+                        foundMatch = true;
+                        break;
+                    }
+                }
+            }
+        }
+        
+        if (!foundMatch) {
+            containingTreeObject = new XMLComponentTreeObject(dataItem);
+            comps.addComponent(containingTreeObject);
+        }
+        else {
+            // Only add to the tree object if the qualifier text differs than existing
+            // qualifier information contained in the tree object.
+            Iterator existingQualifiers = getQualifiers(containingTreeObject).iterator();
+            boolean alreadyExists = false;
+            while (existingQualifiers.hasNext()) {
+                String existingText = (String) existingQualifiers.next();
+                String newItemText = createQualifierText(dataItem);
+                if (existingText.equals(newItemText)) {
+                    alreadyExists = true;
+                    break;
+                }
+            }
+            
+            if (!alreadyExists) {
+                containingTreeObject.addXMLComponentSpecification(dataItem);
+            }
+        }
+    }
+    
+    protected String getNormalizedLocation(String location) {
+        try {
+            URL url = new URL(location);
+            URL resolvedURL = Platform.resolve(url);
+            location = resolvedURL.getPath();
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return location;
+    }
+
+    
+    /*
+     * Object used to hold components with the same name but different qualifiers.
+     * This object will contain a list of XMLComponentSpecifications (with the same
+     * names but different qualifiers).
+     */
+    public class XMLComponentTreeObject {
+        private String name;
+        private List xmlComponentSpecifications;
+        
+        public XMLComponentTreeObject(XMLComponentSpecification spec) {
+            xmlComponentSpecifications = new ArrayList();
+            xmlComponentSpecifications.add(spec);
+            name = (String) spec.getAttributeInfo("name");
+        }
+        
+        public String getName() {
+            return name;
+        }
+        
+        public void addXMLComponentSpecification(XMLComponentSpecification spec) {
+            xmlComponentSpecifications.add(spec);
+        }
+        
+        public List getXMLComponentSpecification() {
+            return xmlComponentSpecifications;
+        }
+    }
+
+    /*
+     * Used to provide labels to the ComponentSeletionDialog
+     */
+    public class XMLComponentSelectionLabelProvider extends LabelProvider {
+        public String getText(Object element) {
+            XMLComponentTreeObject specification = (XMLComponentTreeObject) element;
+            return specification.getName();
+        }        
+    }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSpecification.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSpecification.java
new file mode 100644
index 0000000..04c2546
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSpecification.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
+
+import java.util.Hashtable;
+
+/*
+ * Simple class which keeps track of attribute information.
+ * This class is basically a Hashtable with convenience methods.
+ */
+public class XMLComponentSpecification {
+    String tagPath;
+    Hashtable hashtable;
+    String targetNamespace;
+    String fileLocation;
+    
+    public XMLComponentSpecification(String path) {
+        this.tagPath = path;
+        hashtable = new Hashtable();
+    }
+    
+    public void addAttributeInfo(Object attribute, Object value) {
+        hashtable.put(attribute, value);
+    }
+    
+    public Object getAttributeInfo(Object attribute) {
+        return hashtable.get(attribute);
+    }
+    
+    public String getTagPath() {
+        return tagPath;
+    }
+    
+    public String getTargetNamespace() {
+        return targetNamespace;
+    }
+    
+    public void setTargetNamespace(String tns) {
+        targetNamespace = tns;
+    }
+    
+    public String getFileLocation() {
+        return fileLocation;
+    }
+    
+    public void setFileLocation(String location) {
+        fileLocation = location;
+    }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLQuickScan.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLQuickScan.java
new file mode 100644
index 0000000..30409c2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLQuickScan.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ *
+ */
+public class XMLQuickScan {
+  
+	/*
+	 * Returns information about matches encountered
+     * based on the criteria provided. 
+	 */
+  public static List getTagInfo(String fullFilePath, List paths, List attributes) {
+    XSDGlobalElementTypeContentHandler handler = new XSDGlobalElementTypeContentHandler();
+    handler.stringTagPaths = paths;
+    handler.searchAttributes = attributes;
+    handler.fileLocation = fullFilePath;
+
+    ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
+    
+    try {
+        IPath path = new Path(fullFilePath);
+    	FileInputStream inputStream = new FileInputStream(new File(path.toOSString()));
+    	
+        
+//      SAXParser  sparser = SAXParserFactory.newInstance().newSAXParser();
+//      XMLReader reader = sparser.getXMLReader();
+        
+        // Line below is a hack to get XMLReader working
+        Thread.currentThread().setContextClassLoader(XMLQuickScan.class.getClassLoader());
+        
+    	XMLReader reader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
+    	reader.setContentHandler(handler);
+    	reader.parse(new InputSource(inputStream));
+    }
+    catch (Exception e) {
+    	e.printStackTrace();
+    }
+    finally {
+      Thread.currentThread().setContextClassLoader(prevClassLoader);
+    }
+    return handler.getSearchAttributeValues();
+  }
+  
+  public static class XSDGlobalElementTypeContentHandler extends DefaultHandler {
+  	protected List stringTagPaths;
+  	protected List searchAttributes;
+  	private List matchingTags = new ArrayList();
+  	private String targetNamespace = "";
+  	private String fileLocation;
+
+  	StringBuffer currentPath = new StringBuffer();
+  	
+    public void startElement(String uri, String localName, String qName, Attributes attributes)  throws SAXException {
+    	currentPath.append("/" + localName);
+    	
+    	// Search for targetNamespace if we haven't encountered it yet.
+    	if (targetNamespace.equals("")) {
+	        int nAttributes = attributes.getLength();
+	        for (int i = 0; i < nAttributes; i++)
+	        {
+	          if (attributes.getLocalName(i).equals("targetNamespace"))
+	          {
+	            targetNamespace = attributes.getValue(i);
+	            break;
+	          }
+	        }
+    	}
+    	
+    	// Search for the path
+    	for (int index = 0; index < stringTagPaths.size(); index++) {
+    		String path = (String) stringTagPaths.get(index);
+    		if (currentPath.length() == path.length() && currentPath.toString().equals(path)) {
+    			// Found a path match
+    			createTagInfo(attributes, (String[]) searchAttributes.get(index));
+    		}
+    	}
+    }
+    
+    public void endElement(String uri, String localName, String qName) throws SAXException {
+    	int slashIndex = currentPath.lastIndexOf("/");
+    	currentPath.delete(slashIndex, currentPath.length());
+    }
+    
+    /*
+     * Information about a tag is stored in a TagInfo class.
+     */
+    private void createTagInfo(Attributes attributes, String[] attributesToSearch) {
+    	XMLComponentSpecification spec = new XMLComponentSpecification(currentPath.toString());
+    	
+//    	tagInfo.addAttributeInfo("name", attributes.getValue("name"));
+    	for (int index = 0; index < attributesToSearch.length; index++) {
+    		String attrString = (String) attributesToSearch[index];
+    		String value = attributes.getValue(attrString);
+    		if (value != null) {
+    			spec.addAttributeInfo(attrString, value);
+    		}
+    	}
+    	spec.setTargetNamespace(targetNamespace);
+    	spec.setFileLocation(fileLocation);
+    	matchingTags.add(spec);
+    }
+        
+    public List getSearchAttributeValues() {
+    	return matchingTags;
+    }
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentFinder.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentFinder.java
new file mode 100644
index 0000000..7f9fc7d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentFinder.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentFinder;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLQuickScan;
+
+public class XSDComponentFinder extends XMLComponentFinder {    
+    public XSDComponentFinder() {
+        validExtensions.add("xsd");
+    }
+    
+    public List getWorkbenchResourceComponents(int scope) {
+        List components = new ArrayList();
+        List filePaths = new ArrayList();
+        
+        // We don't want to search through the current file we're working on.
+        if (currentIFile != null) {
+            excludeFiles.add(currentIFile.getLocation().toOSString());
+        }
+        
+        // Find files matching the search criteria specified in List extensions and
+        // List excludeFiles.
+        switch (scope) {
+        case ENCLOSING_PROJECT_SCOPE:
+            filePaths = getEnclosingProjectFiles();
+            break;
+            
+        case ENTIRE_WORKSPACE_SCOPE:
+            filePaths = getWorkspaceFiles();
+            break;
+            
+        default:            
+            break;
+        }
+        
+        // Search for the components in each of the files specified in the path.
+        List paths = new ArrayList();
+        paths.add("/schema/complexType");
+        paths.add("/schema/simpleType");
+        
+        List attributes = new ArrayList();
+        String[] nameAttr = new String[1];
+        nameAttr[0] = "name";
+        attributes.add(nameAttr);
+        attributes.add(nameAttr);
+
+        Iterator pathsIterator = filePaths.iterator();
+        while (pathsIterator.hasNext()) {
+//           String stringPath = ((Path) pathsIterator.next()).toOSString();
+           String stringPath = ((Path) pathsIterator.next()).toString();
+           components.addAll(XMLQuickScan.getTagInfo(stringPath, paths, attributes));
+        }
+        
+        return components;
+    }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionDialog.java
new file mode 100644
index 0000000..b66e13c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionDialog.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd;
+
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentSelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSelectionDialog;
+
+public class XSDComponentSelectionDialog extends XMLComponentSelectionDialog {
+
+	public static final int ELEMENT = 1;
+	public static final int TYPE = 2;
+	
+	public XSDComponentSelectionDialog(Shell shell, String dialogTitle,
+			IComponentSelectionProvider provider) {
+		super(shell, dialogTitle, provider);
+	}
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionProvider.java
new file mode 100644
index 0000000..d1936d4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionProvider.java
@@ -0,0 +1,346 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentList;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentFinder;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSpecification;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaContent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.impl.XSDImportImpl;
+import org.eclipse.xsd.util.XSDConstants;
+
+/*
+ *
+ */
+public class XSDComponentSelectionProvider extends XMLComponentSelectionProvider {
+    private XSDComponentFinder xsdComponentFinder;
+    private XSDComponentSelectionDialog dialog;
+    private XSDSchema schema;
+    private XSDComponentLabelProvider labelProvider;
+    
+    private boolean showComplexTypes = true;
+    
+    /*
+     * Takes in the IFile we are currently editing.
+     */
+    public XSDComponentSelectionProvider(IFile file, XSDSchema schema) {
+        xsdComponentFinder = new XSDComponentFinder();
+        xsdComponentFinder.setFile(file);
+        this.schema = schema;
+        labelProvider = new XSDComponentLabelProvider();
+    }
+    
+    public void setDialog(XSDComponentSelectionDialog dialog) {
+        this.dialog = dialog;
+    }
+    
+    public void showComplexTypes(boolean show) {
+        showComplexTypes = show;
+    }
+    
+    public String getType(Object element) {
+        return null;
+    }
+        
+    /*
+     * The return value is a List of XMLComponentTreeObjects.
+     * 
+     */
+	public void getComponents(IComponentList list, boolean quick) {
+	    if (quick) {
+            // Populate IComponentList list with components most easily accessible (fastest)
+            // Grab Built-In types
+            Iterator builtInIt = getBuiltInTypes().iterator();
+            while (builtInIt.hasNext()) {
+                XMLComponentSpecification tagItem = (XMLComponentSpecification) builtInIt.next();
+                addDataItemToTreeNode(list, tagItem);
+            }
+            
+            // Create current Schema's complex and simple types
+            createComplexTypes(list);
+            createSimpleTypes(list);
+        }
+        else {
+            getComponents(list);
+        }
+	}
+    
+    /*
+     * TODO: Need to revisit how we build up our treeObject list.... 
+     * And it's somewhat messy, clean this up.
+     */
+    private void getComponents(IComponentList list) {
+        List extensions = new ArrayList();
+        extensions.add("xsd");
+        
+        String scope = "";
+        if (dialog != null) {
+            scope = dialog.getSearchScope();
+        }
+        
+        List comps = new ArrayList();
+        if (scope.equals(XSDComponentSelectionDialog.SCOPE_ENCLOSING_PROJECT)) {
+            comps = xsdComponentFinder.getWorkbenchResourceComponents(XMLComponentFinder.ENCLOSING_PROJECT_SCOPE);
+        }
+        else if (scope.equals(XSDComponentSelectionDialog.SCOPE_WORKSPACE)) {
+            comps = xsdComponentFinder.getWorkbenchResourceComponents(XMLComponentFinder.ENTIRE_WORKSPACE_SCOPE);            
+        }
+        
+//      Group same item types together (simple/complex)
+        List complex = new ArrayList();
+        List simple = new ArrayList();
+        Iterator itemsIterator = comps.iterator();
+        while (itemsIterator.hasNext()) {
+            XMLComponentSpecification tagItem = (XMLComponentSpecification) itemsIterator.next();
+            if (tagItem.getTagPath().equals("/schema/complexType")) {
+                complex.add(tagItem);
+            }               
+            else if (tagItem.getTagPath().equals("/schema/simpleType")) {
+                simple.add(tagItem);
+            }
+        }
+        
+        Iterator complexIt = complex.iterator();
+        Iterator simpleIt = simple.iterator();
+        if (showComplexTypes) {
+            while (complexIt.hasNext()) {
+                XMLComponentSpecification item = (XMLComponentSpecification) complexIt.next();
+                addDataItemToTreeNode(list, item);
+            }
+        }
+        
+        while (simpleIt.hasNext()) {
+            XMLComponentSpecification item = (XMLComponentSpecification) simpleIt.next();
+            addDataItemToTreeNode(list, item);
+        }
+        
+        // Create from imports, includes, and redefines
+        createFromImport(list);
+        createFromInclude(list);
+        createFromRedefine(list);
+    }
+    
+////////////////////////////////////////////////////////////////////////////////    
+    private List getBuiltInTypes() {        
+        List items = new ArrayList();
+        for (int i = 0; i < XSDDOMHelper.dataType.length; i++) {
+          items.add(XSDDOMHelper.dataType[i][0]);
+        }
+        Iterator it = items.iterator();
+        
+        List builtInComponentSpecs = new ArrayList();
+        while (it.hasNext()) {
+            Object item = it.next();
+            String itemString = item.toString();
+            
+            XMLComponentSpecification builtInTypeItem = new XMLComponentSpecification("BUILT_IN_SIMPLE_TYPE");
+            builtInTypeItem.addAttributeInfo("name", itemString);
+            builtInTypeItem.setTargetNamespace(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
+//            String normalizedFile = getNormalizedLocation(schema.getSchemaLocation());
+//            builtInTypeItem.setFileLocation(normalizedFile);
+            builtInTypeItem.setFileLocation("Built-In");
+            
+            builtInComponentSpecs.add(builtInTypeItem);
+        }
+        
+        return builtInComponentSpecs;
+    }
+
+    private void createComplexTypes(IComponentList treeObjectList) {
+        TypesHelper typesHelper = new TypesHelper(schema);
+        List complexTypes = typesHelper.getUserComplexTypes();
+        createComplexSimpleTreeObject(treeObjectList, complexTypes, true);
+    }
+    
+    private void createSimpleTypes(IComponentList treeObjectList) {
+        TypesHelper typesHelper = new TypesHelper(schema);
+        List complexTypes = typesHelper.getUserSimpleTypes();
+        createComplexSimpleTreeObject(treeObjectList, complexTypes, true);
+    }
+
+    
+    private void createFromImport(IComponentList treeObjectList) {
+        Iterator imports = getXSDImports().iterator();
+        while (imports.hasNext()) {
+            XSDImport importItem = (XSDImport) imports.next();
+            if (importItem.getSchemaLocation() != null) {
+                ((XSDImportImpl) importItem).importSchema();
+                TypesHelper helper = new TypesHelper(importItem.getResolvedSchema());
+                
+                List types = helper.getUserComplexTypes();
+                types.addAll(helper.getUserSimpleTypes());
+                createComplexSimpleTreeObject(treeObjectList, types, false);
+            }
+        }
+    }
+    
+        private void createFromInclude(IComponentList treeObjectList) {
+        Iterator imports = getXSDIncludes().iterator();
+        while (imports.hasNext()) {
+            XSDInclude includeItem = (XSDInclude) imports.next();
+            if (includeItem.getSchemaLocation() != null) {
+                TypesHelper helper = new TypesHelper(includeItem.getResolvedSchema());  
+                
+                List types = helper.getUserComplexTypes();
+                types.addAll(helper.getUserSimpleTypes());
+                createComplexSimpleTreeObject(treeObjectList, types, false);
+            }
+        }
+    }
+    
+    private void createFromRedefine(IComponentList treeObjectList) {
+        Iterator redefines = getXSDRedefines().iterator();
+        while (redefines.hasNext()) {
+            XSDRedefine redefineItem = (XSDRedefine) redefines.next();
+            if (redefineItem.getSchemaLocation() != null) {
+                TypesHelper helper = new TypesHelper(redefineItem.getResolvedSchema());
+                
+                List types = helper.getUserComplexTypes();
+                types.addAll(helper.getUserSimpleTypes());
+                createComplexSimpleTreeObject(treeObjectList, types, false);
+            }
+        }
+    }
+    
+        protected List getXSDImports() {
+        List imports = new ArrayList();
+        
+        Iterator contents = schema.getContents().iterator();
+        while (contents.hasNext()) {
+            XSDSchemaContent content = (XSDSchemaContent) contents.next();
+            if (content instanceof XSDImport) {
+                imports.add(content);             
+            }
+        }
+        
+        return imports;
+    }
+    
+    protected List getXSDIncludes() {
+        List includes = new ArrayList();
+        
+        Iterator contents = schema.getContents().iterator();
+        while (contents.hasNext()) {
+            XSDSchemaContent content = (XSDSchemaContent) contents.next();
+            if (content instanceof XSDInclude) {
+                includes.add(content);            
+            }
+        }
+        
+        return includes;
+    }
+
+    protected List getXSDRedefines() {
+        List includes = new ArrayList();
+        
+        Iterator contents = schema.getContents().iterator();
+        while (contents.hasNext()) {
+            XSDSchemaContent content = (XSDSchemaContent) contents.next();
+            if (content instanceof XSDRedefine) {
+                includes.add(content);            
+            }
+        }
+        
+        return includes;
+    }
+
+    private void createComplexSimpleTreeObject(IComponentList treeObjectList, List complexTypes, boolean sameNS) {
+        boolean proceed = true;
+        
+        for (int i = 0; i < complexTypes.size(); i++) {
+            XSDNamedComponent item = (XSDNamedComponent) complexTypes.get(i); 
+        
+            if (sameNS) {
+                // We do this check because Types from Includes might show up.  However, we don't want to show them
+                String itemLocation = item.getSchema().getSchemaLocation();
+                String currentSchemaLocation = schema.getSchemaLocation();
+                if (itemLocation != null) {
+                    proceed = itemLocation.equals(currentSchemaLocation);
+                }
+                else {
+                    proceed = false;
+                }
+            }
+            
+            if (proceed) {
+                XMLComponentSpecification typeItem =  null;
+                if (showComplexTypes && item instanceof XSDComplexTypeDefinition) {
+                    typeItem = new XMLComponentSpecification("/schema/complexType");
+                    typeItem.addAttributeInfo("name", ((XSDComplexTypeDefinition) item).getName());
+                }
+                else if (item instanceof XSDSimpleTypeDefinition) {
+                    typeItem = new XMLComponentSpecification("/schema/simpleType");
+                    typeItem.addAttributeInfo("name", ((XSDSimpleTypeDefinition) item).getName());
+                }
+                
+                if (typeItem != null) {
+                    typeItem.setTargetNamespace(item.getTargetNamespace());
+                    String normalizedFile = getNormalizedLocation(schema.getSchemaLocation());
+                    typeItem.setFileLocation(normalizedFile);
+    
+                    addDataItemToTreeNode(treeObjectList, typeItem);
+                }
+            }
+        }
+    }
+
+    
+	public ILabelProvider getLabelProvider() {
+		return labelProvider;
+	}
+
+    
+    public class XSDComponentLabelProvider extends XMLComponentSelectionLabelProvider {
+        public Image getImage(Object element) {
+            XMLComponentTreeObject specification = (XMLComponentTreeObject) element;
+            XMLComponentSpecification spec = (XMLComponentSpecification) specification.getXMLComponentSpecification().get(0);
+            if (spec.getTagPath().equals("/schema/complexType")) {
+                return XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif");
+            }
+            else if (spec.getTagPath().equals("/schema/simpleType")) {
+                return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
+            }
+            else if (spec.getTagPath().equals("BUILT_IN_SIMPLE_TYPE")) {
+                return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
+            }
+    
+            return null;
+        }
+    }
+    
+    
+
+	public String getListTitle() {
+		return XSDEditorPlugin.getXSDString("_UI_LABEL_MATCHING_TYPES");
+	}
+
+	public String getNameFieldTitle() {
+		return XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_NAME");
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDSetTypeHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDSetTypeHelper.java
new file mode 100644
index 0000000..a5b8e17
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDSetTypeHelper.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Copyright (c) 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
+import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSpecification;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaContent;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.util.XSDConstants;
+import org.eclipse.xsd.util.XSDParser;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class XSDSetTypeHelper {
+    private XSDSchema xsdSchema;
+    private IFile currentIFile;
+    
+    public XSDSetTypeHelper(IFile iFile, XSDSchema schema) {
+        currentIFile = iFile;
+        xsdSchema = schema;
+    }
+
+    public void setType(Element element, String property, XMLComponentSpecification spec) {
+        addImportIfNecessary(element, spec);        
+        String typeObject = getPrefixedTypeName(spec);
+        
+        // Get the previous type --> previousStringType
+        String previousStringType = "";
+        Attr attr = element.getAttributeNode(property);
+        if (attr != null) {
+            attr.getValue();
+        }
+
+        if (!XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
+        {
+            if (spec != null && spec.getTagPath().equals("**anonymous**"))
+            {
+              if (spec.getTagPath().equals("ANONYMOUS_SIMPLE_TYPE"))
+              {
+                if (!previousStringType.equals("**anonymous**"))
+                {
+                  updateElementToAnonymous(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+                }
+              }
+              else
+              {
+                if (!previousStringType.equals("**anonymous**"))
+                {
+                  updateElementToAnonymous(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+                }
+              }
+              // element.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
+              element.removeAttribute(property);
+            }
+            else
+            {
+              XSDDOMHelper.updateElementToNotAnonymous(element);
+              //element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, typeObject.toString());
+              element.setAttribute(property, typeObject.toString());
+            }
+        }
+    }
+    
+    public void addImportIfNecessary(Element element, XMLComponentSpecification spec) {
+        
+        // Get the new type --> typeObject
+        if (spec != null) {
+            String itemType = spec.getTagPath();
+           
+            if (!itemType.equals("BUILT_IN_SIMPLE_TYPE")) {
+                // Do an actual import if needed
+                XSDParser parser = new XSDParser();
+                parser.parse(spec.getFileLocation());
+                XSDSchema schema = parser.getSchema();
+                String tns = schema.getTargetNamespace();
+                
+                boolean exists = false;
+                // Check if the type is defined in the 'current' file itself.
+                String currentFile = getNormalizedLocation(xsdSchema.getSchemaLocation());
+                IPath currentFilePath = new Path(currentFile);
+                if (currentFilePath.equals(new Path(spec.getFileLocation()))) {
+                    exists = true;
+                }
+
+                if (!exists) {
+                    if (tns.equals(xsdSchema.getTargetNamespace())) {
+                        // Check if the schema is in a redefine/include
+                        List existingList = getXSDIncludes();
+                        existingList.addAll(getXSDRedefines());
+                        Iterator it = existingList.iterator();
+                        while (it.hasNext()) {
+                            XSDSchemaDirective existingSchema = (XSDSchemaDirective) it.next();
+                            String normalizedFile = getNormalizedLocation(existingSchema.getResolvedSchema().getSchemaLocation());
+                            String normalizedSpec = spec.getFileLocation();
+                            
+                            if (normalizedFile.equals(normalizedSpec)) {
+                                // Found and existing one
+                                exists = true;
+                            }
+                        }                        
+                    }
+                    else {
+                        // Check if the schema is in a import
+                        List existingList = getXSDImports();
+                        Iterator it = existingList.iterator();
+                        while (it.hasNext()) {
+                            XSDSchemaDirective existingSchema = (XSDSchemaDirective) it.next();
+                            String normalizedFile = getNormalizedLocation(existingSchema.getResolvedSchema().getSchemaLocation());
+                            String normalizedSpec = spec.getFileLocation();
+
+                            if (normalizedFile.equals(normalizedSpec)) {
+                                // Found and existing one
+                                exists = true;
+                            }
+                        }                        
+                    }
+                }
+                
+                if (!exists) {
+                    doImport(spec.getFileLocation(), schema);
+                }
+            }
+        }
+    }
+    
+    /*
+     * Return the prefixed type name for the type described by the given
+     * XMLComponentSpecification object.
+     * If the type described is a Built-in type, do not add the prefix
+     */
+    public String getPrefixedTypeName(XMLComponentSpecification spec) {
+        String typeObject = (String) spec.getAttributeInfo("name");
+        
+        TypesHelper typesHelper = new TypesHelper(xsdSchema); // ???? Is this correct?
+        List prefixedNames = typesHelper.getPrefixedNames(spec.getTargetNamespace(), typeObject);
+        if (prefixedNames.size() > 0) {
+            // Grab the first prefixed name
+            typeObject = (String) prefixedNames.get(0);
+        }
+
+        return typeObject;
+    }
+    
+    private void updateElementToAnonymous(Element element, String xsdType) {
+        String prefix = element.getPrefix();
+        prefix = (prefix == null) ? "" : (prefix + ":");
+        XSDDOMHelper.updateElementToNotAnonymous(element);
+        Element childNode = null;
+        if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG)) {
+            childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+        }
+        else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG)) {
+            childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+        }
+        
+        if (childNode != null) {
+            XSDDOMHelper helper = new XSDDOMHelper();
+            Node annotationNode = helper.getChildNode(element, XSDConstants.ANNOTATION_ELEMENT_TAG);
+            if (annotationNode == null) {
+                Node firstChild = element.getFirstChild();
+                element.insertBefore(childNode, firstChild);
+            } else {
+                Node nextSibling = annotationNode.getNextSibling();
+                element.insertBefore(childNode, nextSibling);
+            }
+            XSDDOMHelper.formatChild(childNode);
+        }
+    }
+
+    // TODO: We shouldn't need to pass in IPath externalSchemaPath.
+    private void doImport(String externalSchemaPath, XSDSchema externalSchema) {
+        // Determine schemaLocation
+        String locationAttribute = URIHelper.getRelativeURI(externalSchemaPath, currentIFile.getLocation().toOSString());
+        
+        boolean isInclude = false;
+        if (externalSchema.getTargetNamespace().equals(xsdSchema.getTargetNamespace())) {
+            isInclude = true;
+        }
+        
+        if (externalSchema != null) { // In case we have problems loading the file.... we should display an error message.
+                Element newElement;
+                if (isInclude) {                
+                    List attributes = new ArrayList();
+                    attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, locationAttribute));
+                    newElement = createElement(XSDConstants.INCLUDE_ELEMENT_TAG, attributes);
+                }
+                else if (!isInclude) {
+                    List attributes = new ArrayList();
+                    attributes.add(new DOMAttribute(XSDConstants.NAMESPACE_ATTRIBUTE, externalSchema.getTargetNamespace()));
+                    attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, locationAttribute));
+                    newElement = createElement(XSDConstants.IMPORT_ELEMENT_TAG, attributes);
+                    handleImportNS(newElement, externalSchema);
+                }
+        }
+    }
+
+    private void handleImportNS(Element importElement, XSDSchema externalSchema) {
+        String namespace = externalSchema.getTargetNamespace();
+        if (namespace == null) namespace = "";
+
+        XSDImport xsdImport = (XSDImport) xsdSchema.getCorrespondingComponent(importElement);
+        xsdImport.setResolvedSchema(externalSchema);
+        
+        java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+        
+//        System.out.println("changed Import Map is " + map.values());
+//        System.out.println("changed import Map keys are " + map.keySet());
+
+        // Referential integrity on old import
+        // How can we be sure that if the newlocation is the same as the oldlocation
+        // the file hasn't changed
+        
+        XSDSchema referencedSchema = xsdImport.getResolvedSchema();
+        if (referencedSchema != null)
+        {
+          XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
+          cleanHelper.visitSchema(xsdSchema);
+        }
+
+        Element schemaElement = xsdSchema.getElement();
+
+        // update the xmlns in the schema element first, and then update the import element next
+        // so that the last change will be in the import element.  This keeps the selection
+        // on the import element
+        TypesHelper helper = new TypesHelper(externalSchema);
+        String prefix = helper.getPrefix(namespace, false);
+        
+        if (map.containsKey(prefix))
+        {
+          prefix = null;
+        }
+
+        if (prefix == null || (prefix !=null && prefix.length() == 0))
+        {
+          StringBuffer newPrefix = new StringBuffer("pref");  //$NON-NLS-1$
+          int prefixExtension = 1;
+          while (map.containsKey(newPrefix.toString()) && prefixExtension < 100)
+          {
+            newPrefix = new StringBuffer("pref" + String.valueOf(prefixExtension));
+            prefixExtension++;
+          }
+          prefix = newPrefix.toString();
+        }
+
+        if (namespace.length() > 0)
+        {
+          // if ns already in map, use its corresponding prefix
+          if (map.containsValue(namespace))
+          {
+            TypesHelper typesHelper = new TypesHelper(xsdSchema);
+            prefix = typesHelper.getPrefix(namespace, false);
+          }
+          else // otherwise add to the map
+          {
+            schemaElement.setAttribute("xmlns:"+prefix, namespace);
+          }
+        }
+
+
+//        System.out.println("changed Import Map is " + map.values());
+//        System.out.println("changed import Map keys are " + map.keySet());
+    }
+    
+    private Element createElement(String elementTag, List attributes) {
+        Node relativeNode = XSDDOMHelper.getNextElementNode(xsdSchema.getElement().getFirstChild());
+        
+        CreateElementAction action = new CreateElementAction("");
+        action.setElementTag(elementTag);
+        action.setAttributes(attributes);
+        action.setParentNode(xsdSchema.getElement());
+        action.setRelativeNode(relativeNode);
+        action.setXSDSchema(xsdSchema);
+        return action.createAndAddNewChildElement();
+    }
+
+    private String getNormalizedLocation(String location) {
+        try {
+            URL url = new URL(location);
+            URL resolvedURL = Platform.resolve(url);
+            location = resolvedURL.getPath();
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+        }
+        
+        return location; 
+      }
+    
+    private List getXSDImports() {
+        List imports = new ArrayList();
+        
+        Iterator contents = xsdSchema.getContents().iterator();
+        while (contents.hasNext()) {
+            XSDSchemaContent content = (XSDSchemaContent) contents.next();
+            if (content instanceof XSDImport) {
+                imports.add(content);             
+            }
+        }
+        
+        return imports;
+    }
+    
+    private List getXSDIncludes() {
+        List includes = new ArrayList();
+        
+        Iterator contents = xsdSchema.getContents().iterator();
+        while (contents.hasNext()) {
+            XSDSchemaContent content = (XSDSchemaContent) contents.next();
+            if (content instanceof XSDInclude) {
+                includes.add(content);            
+            }
+        }
+        
+        return includes;
+    }
+
+    private List getXSDRedefines() {
+        List includes = new ArrayList();
+        
+        Iterator contents = xsdSchema.getContents().iterator();
+        while (contents.hasNext()) {
+            XSDSchemaContent content = (XSDSchemaContent) contents.next();
+            if (content instanceof XSDRedefine) {
+                includes.add(content);            
+            }
+        }
+        
+        return includes;
+    }
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/BaseDragNodesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/BaseDragNodesCommand.java
new file mode 100644
index 0000000..d83fc47
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/BaseDragNodesCommand.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dnd;
+
+import java.util.Collection;
+
+import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Node;
+
+
+public abstract class BaseDragNodesCommand extends DefaultDragAndDropCommand
+{
+  /**
+   * Constructor for BaseDragNodesCommand.
+   * @param target
+   * @param location
+   * @param operations
+   * @param operation
+   * @param sources
+   */
+  public BaseDragNodesCommand(
+    Object target,
+    float location,
+    int operations,
+    int operation,
+    Collection sources)
+  {
+    super(target, location, operations, operation, sources);
+  }
+
+  protected boolean isDirectSchemaChild(Node node)
+  {
+    Node parent = node.getParentNode();
+    if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false) &&
+        parent.getParentNode().equals(parent.getOwnerDocument()))
+    {
+      return true;
+    }
+    return false;
+  } 
+  
+  protected boolean isSiblingNodes(Node first, Node second)
+  {
+    if (first.getParentNode() != null)
+    {
+      return first.getParentNode().equals(second.getParentNode());
+    }
+    return false;
+  }
+  
+  protected void beginRecording()
+  {
+    if (target != null)
+    {
+      IDOMModel model = getModel((Node)target);
+      
+      if (model != null)
+      {
+        model.beginRecording(this, XSDEditorPlugin.getXSDString("_UI_LABEL_MOVE"));
+      }
+    }
+  }
+  
+  protected void endRecording()
+  {
+    if (target != null)
+    {
+      IDOMModel model = getModel((Node)target);
+      
+      if (model != null)
+      {
+        model.endRecording(this);
+      }
+    }
+  }
+  protected IDOMModel getModel(Node node)
+  {
+    Object object = node.getOwnerDocument();
+    if (object instanceof DocumentImpl)
+    {
+      return ((DocumentImpl) object).getModel();
+    }
+    return null;
+  }
+  
+  protected void moveNode(Node referenceNode, Node nodeToMove, boolean isBefore)
+  {
+    XSDDOMHelper.moveNode(referenceNode, nodeToMove, isBefore);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/DragNodesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/DragNodesCommand.java
new file mode 100644
index 0000000..fa0d0b9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/DragNodesCommand.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dnd;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.format.NodeFormatter;
+import org.w3c.dom.Node;
+
+public class DragNodesCommand extends BaseDragNodesCommand
+{
+  /**
+   * Constructor for DragNodesCommand.
+   * @param target
+   * @param location
+   * @param operations
+   * @param operation
+   * @param sources
+   */
+  public DragNodesCommand(
+    Object target,
+    float location,
+    int operations,
+    int operation,
+    Collection sources)
+  {
+    super(target, location, operations, operation, sources);
+  }
+
+  /**
+   * @see org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand#canExecute()
+   */
+  public boolean canExecute()
+  {
+    if (sources.size() > 0)
+    {
+      Node firstSource = (Node) sources.toArray()[0];
+      return isSiblingNodes((Node) target, firstSource);
+    }
+    return false;
+//    return isDirectSchemaChild((Node)target);
+  }
+
+  
+  /**
+   * @see org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand#execute()
+   */
+  public void execute()
+  {
+  	NodeFormatter formatProcessor = new NodeFormatter();
+    Node referenceNode = (Node) target;
+    Iterator iter = sources.iterator();
+    beginRecording();
+
+    while (iter.hasNext()) 
+    {
+      Node node = (Node) iter.next();
+      if (isSiblingNodes(referenceNode,node)) 
+      {
+        moveNode(referenceNode, node, !isAfter());
+        formatProcessor.format((IDOMNode)node);
+      }
+    }
+//    formatProcessor.format((XMLNode)referenceNode.getParentNode());
+    endRecording();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/XSDDragAndDropManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/XSDDragAndDropManager.java
new file mode 100644
index 0000000..7c52cc9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/XSDDragAndDropManager.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dnd;
+
+import java.util.Collection;
+
+import org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand;
+import org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Node;
+
+public class XSDDragAndDropManager implements DragAndDropManager
+{
+  /**
+   * Constructor for XSDDragAndDropManager.
+   */
+  public XSDDragAndDropManager()
+  {
+  }
+  
+  protected boolean isDirectSchemaChild(Node node)
+  {
+    Node parent = node.getParentNode();
+    if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false) &&
+        parent.getParentNode().equals(parent.getOwnerDocument()))
+    {
+      return true;
+    }
+    return false;
+  } 
+
+  /**
+   * @see org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager#createCommand(Object, float, int, int, Collection)
+   */
+  public DragAndDropCommand createCommand(
+    Object target,
+    float location,
+    int operations,
+    int operation,
+    Collection source)
+  {
+    if (target instanceof Node) 
+    {
+      return new DragNodesCommand(target, location, operations, operation, source);
+    }
+    return null;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java
new file mode 100644
index 0000000..caef397
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.editparts;
+                                      
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Panel;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerLayout;
+              
+
+public abstract class AbstractComponentViewerRootEditPart extends AbstractGraphicalEditPart 
+{
+  protected final static String MESSAGE_PLACE_HOLDER = "MESSAGE_PLACE_HOLDER";
+  protected Object input;              
+
+  public void setInput(Object input)
+  {
+    this.input = input;
+    refreshChildren();
+  }
+
+  protected IFigure createFigure()
+  {
+    Panel panel = new Panel();
+    ContainerLayout layout = new ContainerLayout();
+    layout.setBorder(60);
+    panel.setLayoutManager(layout);
+    return panel;
+  }   
+           
+
+  protected List getModelChildren() 
+  {               
+    List list = new ArrayList();
+    if (input != null)
+    {
+      list.add(input);
+    }
+    else
+    {
+      list.add(MESSAGE_PLACE_HOLDER);
+    }
+    return list;
+  }         
+
+  protected abstract EditPart createChild(Object model);
+  
+  protected void createEditPolicies()
+  {  
+  }             
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java
new file mode 100644
index 0000000..f25f677
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+           
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+
+              
+public class ConnectedEditPartFigure extends ContainerFigure implements IConnectedEditPartFigure
+{                 
+  protected EditPart editPart;
+  protected boolean childConnectionsEnabled = true;
+  protected List connectedFigures = new ArrayList();
+  protected int connectionType = RIGHT_CONNECTION;
+    
+  public ConnectedEditPartFigure(EditPart editPart)
+  {
+    this.editPart = editPart;    
+  }     
+
+  public void setChildConnectionsEnabled(boolean enabled)
+  {
+    childConnectionsEnabled = enabled;
+  }          
+
+  protected IConnectedEditPartFigure getParentGraphNodeFigure()
+  {
+    IConnectedEditPartFigure result = null;
+    for (EditPart parentEditPart = editPart.getParent(); parentEditPart != null; parentEditPart = parentEditPart.getParent())
+    {                                                              
+      IFigure figure = ((AbstractGraphicalEditPart)parentEditPart).getFigure();    
+      if (figure instanceof IConnectedEditPartFigure)
+      {                                                            
+        IConnectedEditPartFigure graphNodeFigure = (IConnectedEditPartFigure)figure;
+        if (graphNodeFigure.getConnectionFigure() != null)
+        {
+          result = graphNodeFigure;
+          break;
+        }
+      }          
+    }          
+    return result;
+  }
+
+  public void addNotify()                     
+  {           
+    super.addNotify();
+    if (getConnectionFigure() != null)
+    {
+      IConnectedEditPartFigure parentGraphNodeFigure = getParentGraphNodeFigure();
+      if (parentGraphNodeFigure != null)
+      {   
+        parentGraphNodeFigure.addConnectedFigure(this);
+      }   
+    }
+  }   
+
+  public void removeNotify()
+  {
+    super.removeNotify();
+    if (getConnectionFigure() != null)
+    {
+      IConnectedEditPartFigure parentGraphNodeFigure = getParentGraphNodeFigure();
+      if (parentGraphNodeFigure != null)
+      {   
+        parentGraphNodeFigure.removeConnectedFigure(this);
+      }   
+    }
+  }   
+
+  public void addConnectedFigure(IConnectedEditPartFigure figure)
+  {   
+    if (childConnectionsEnabled) 
+    {  
+      // this test is required since we sometimes receive the 'addNotify' call twice
+      //
+      if (!connectedFigures.contains(figure))
+      {
+        connectedFigures.add(figure);
+      }
+    }
+  }
+
+  public void removeConnectedFigure(IConnectedEditPartFigure figure)
+  {
+    if (childConnectionsEnabled) 
+    { 
+      connectedFigures.remove(figure);
+    }
+  }    
+                    
+  public IFigure getSelectionFigure()
+  {
+    return this;
+  }
+
+  public IFigure getConnectionFigure()
+  {
+    return this;
+  }
+
+  public List getConnectedFigures(int type)
+  {
+    List list = new ArrayList();
+    for (Iterator i = connectedFigures.iterator(); i.hasNext(); )
+    {           
+      IConnectedEditPartFigure figure = (IConnectedEditPartFigure)i.next();
+      //if (type == 0 || type == figure.getConnectionType())
+      {
+        list.add(figure);
+      }      
+    }
+    return list;
+  }                               
+
+  public int getConnectionType()
+  {
+    return connectionType;
+  }
+
+  public void setConnectionType(int type)
+  {
+    connectionType = type;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java
new file mode 100644
index 0000000..7192108
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+        
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+              
+
+public class ConnectionRenderingFigure extends RectangleFigure
+{               
+  protected boolean isOutlined = true;
+  protected IFigure primaryLayer;
+
+  public ConnectionRenderingFigure(IFigure primaryLayer)
+  {
+    setOpaque(false);                   
+    this.primaryLayer = primaryLayer;
+    //setFocusTraversable(false); 
+    //setEnabled(false); 
+  }
+           
+  protected boolean isMouseEventTarget()
+  {
+    return false;
+  }        
+
+  public boolean containsPoint(int x, int y)
+  {
+    return false;
+  }
+
+  protected void fillShape(Graphics graphics)
+  { 
+    graphics.setForegroundColor(ColorConstants.black);
+    drawLines(graphics, primaryLayer);
+  }
+
+  protected void outlineShape(Graphics graphics)
+  { 
+    if (isOutlined)
+    {
+      super.outlineShape(graphics);
+    }
+  } 
+
+  protected void drawLines(Graphics graphics, IFigure figure)
+  {      
+    if (figure instanceof IConnectedEditPartFigure)
+    {
+      IConnectedEditPartFigure graphNodeFigure = (IConnectedEditPartFigure)figure;         
+      List connectedFigures = graphNodeFigure.getConnectedFigures(IConnectedEditPartFigure.RIGHT_CONNECTION);
+      int connectedFiguresSize = connectedFigures.size();              
+
+      if (connectedFiguresSize > 0) 
+      {                                         
+        IConnectedEditPartFigure firstGraphNodeFigure = (IConnectedEditPartFigure)connectedFigures.get(0);
+        Rectangle r = graphNodeFigure.getConnectionFigure().getBounds();    
+          
+        int x1 = r.x + r.width;
+        int y1 = r.y + r.height/2;
+                                                                                   
+        int startOfChildBox = firstGraphNodeFigure.getConnectionFigure().getBounds().x;
+        int x2 = x1 + (startOfChildBox - x1) / 3;
+        int y2 = y1;
+      
+        if (connectedFiguresSize == 1)
+        {
+          graphics.drawLine(x1, y1, startOfChildBox, y2);   
+        }
+        else // (connectedFigures.length > 1)
+        { 
+          graphics.drawLine(x1, y1, x2, y2);
+
+          int minY = Integer.MAX_VALUE;
+          int maxY = -1;
+
+          for (Iterator i = connectedFigures.iterator(); i.hasNext(); )
+          {                                 
+            IConnectedEditPartFigure connectedFigure = (IConnectedEditPartFigure)i.next();
+            Rectangle childConnectionRectangle = connectedFigure.getConnectionFigure().getBounds();
+            int y = childConnectionRectangle.y + childConnectionRectangle.height / 2;
+            minY = Math.min(minY, y);
+            maxY = Math.max(maxY, y);
+            graphics.drawLine(x2, y, childConnectionRectangle.x, y);
+          }                   
+          graphics.drawLine(x2, minY, x2, maxY);
+        }                          
+      }                             
+    }            
+
+    //boolean visitChildren = true;
+    List children = figure.getChildren();
+    for (Iterator i = children.iterator(); i.hasNext(); )
+    {
+      IFigure child = (IFigure)i.next();
+      drawLines(graphics, child);
+    }
+  }    
+
+  // This method supports the preview connection line function related to drag and drop
+  //     
+  public PointList getConnectionPoints(GraphicalEditPart parentEditPart, GraphicalEditPart childRefEditPart, Rectangle draggedFigureBounds)
+  {           
+    PointList pointList = new PointList();                         
+    int[] data = new int[1];
+    Point a = getConnectionPoint(parentEditPart, childRefEditPart, data);
+    if (a != null)
+    {   
+      int draggedFigureBoundsY = draggedFigureBounds.y + draggedFigureBounds.height/2;
+
+      pointList.addPoint(a); 
+      //pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
+      
+      if (data[0] == 0) // insert between 2 items
+      {                                         
+        int x = a.x + (draggedFigureBounds.x - a.x)/2;
+        pointList.addPoint(new Point(x, a.y));
+        pointList.addPoint(new Point(x, draggedFigureBoundsY));        
+        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
+      }
+      else // insert at first or last position
+      {
+        pointList.addPoint(new Point(a.x, draggedFigureBoundsY));   
+        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
+      }
+    }       
+    return pointList;
+  }
+
+         
+  // This method supports the preview connection line function related to drag and drop
+  //     
+  protected Point getConnectionPoint(GraphicalEditPart parentEditPart, GraphicalEditPart childRefEditPart, int[] data)
+  {                      
+    Point point = null;     
+    List childList = parentEditPart.getChildren();         
+                                                                                                                                               
+    if (parentEditPart.getFigure() instanceof IConnectedEditPartFigure && childList.size() > 0)
+    {   
+      point = new Point();
+
+      GraphicalEditPart prev = null;    
+      GraphicalEditPart next = null;
+                               
+      for (Iterator i = childList.iterator(); i.hasNext(); )
+      {             
+        Object o = i.next();    
+        if (o instanceof GraphicalEditPart)
+        {
+          GraphicalEditPart childEditPart = (GraphicalEditPart)o;
+          if (childEditPart.getFigure() instanceof IConnectedEditPartFigure)
+          {
+            if (childEditPart == childRefEditPart)
+            {
+              next = childEditPart;
+              break;
+            }                                           
+            prev = childEditPart;
+          }
+        }
+      }                            
+                          
+
+      if (next != null && prev != null)
+      {                   
+        int ya = getConnectedEditPartConnectionBounds(prev).getCenter().y;
+        int yb = getConnectedEditPartConnectionBounds(next).getCenter().y;
+        point.y = ya + (yb - ya)/2;   
+        data[0] = 0;
+      }                               
+      else if (prev != null) // add it last
+      {
+        point.y = getConnectedEditPartConnectionBounds(prev).getCenter().y;
+        data[0] = 1;
+      }
+      else if (next != null) // add it first!
+      {                           
+        point.y = getConnectedEditPartConnectionBounds(next).getCenter().y;
+        data[0] = -1;
+      }
+          
+      if (next != null || prev != null)
+      {
+        GraphicalEditPart child = prev != null ? prev : next;
+        int startOfChildBox = getConnectedEditPartConnectionBounds(child).x;
+        Rectangle r = getConnectedEditPartConnectionBounds(parentEditPart);  
+        int x1 = r.x + r.width;
+        point.x = x1 + (startOfChildBox - x1) / 3;
+      }
+    }    
+    return point;
+  }
+
+  protected Rectangle getConnectedEditPartConnectionBounds(GraphicalEditPart editPart)
+  {
+    return ((IConnectedEditPartFigure)editPart.getFigure()).getConnectionFigure().getBounds();
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java
new file mode 100644
index 0000000..d7a77ac
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+            
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.RectangleFigure;
+              
+public class ContainerFigure extends RectangleFigure implements IExpandable
+{               
+  protected boolean isOutlined = false;
+  protected boolean isExpanded = true;
+
+  public ContainerFigure()
+  {
+    setLayoutManager(new ContainerLayout());
+    setFill(false);
+  }
+
+  public void doLayout()
+  {
+	  layout();
+	  setValid(true);
+  }  
+          
+  public ContainerLayout getContainerLayout()
+  {
+    return (ContainerLayout)getLayoutManager();
+  }           
+
+  public void setOutlined(boolean isOutlined)
+  {
+    this.isOutlined = isOutlined;
+  }     
+
+  protected void outlineShape(Graphics graphics)
+  { 
+    if (isOutlined)
+    {
+      super.outlineShape(graphics);
+    }
+  }
+
+  public boolean isExpanded()
+  {
+    return isExpanded;
+  }
+  
+  public void setExpanded(boolean isExpanded)
+  {
+    this.isExpanded = isExpanded;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java
new file mode 100644
index 0000000..78480f9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+                   
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+              
+
+public class ContainerLayout extends AbstractLayout
+{                                         
+  protected boolean isHorizontal;
+  protected int spacing = 0;
+  protected int border = 0; 
+
+  public ContainerLayout()
+  { 
+    this(true, 0); 
+  }             
+
+  public ContainerLayout(boolean isHorizontal, int spacing)
+  {
+    this.isHorizontal = isHorizontal;   
+    this.spacing = spacing;
+  }  
+
+  public void setHorizontal(boolean isHorizontal)
+  {
+    this.isHorizontal = isHorizontal;
+  }  
+
+  public void setSpacing(int spacing)
+  {
+    this.spacing = spacing;
+  }  
+
+  public void setBorder(int border)
+  {
+    this.border = border;
+  }  
+
+  protected int alignFigure(IFigure parent, IFigure child)
+  { 
+    return -1;
+  }
+
+  /**
+   * Calculates and returns the preferred size of the container 
+   * given as input.
+   * 
+   * @param figure  Figure whose preferred size is required.
+   * @return  The preferred size of the passed Figure.
+   */
+  protected Dimension calculatePreferredSizeHelper(IFigure parent)
+  { 
+    Dimension	preferred = new Dimension();
+  	List children = parent.getChildren();
+		                                        
+	  for (int i=0; i < children.size(); i++)
+    {
+		  IFigure child = (IFigure)children.get(i);      
+    
+      Dimension	childSize = child.getPreferredSize();
+	  
+      if (isHorizontal)
+      {
+		    preferred.width += childSize.width;
+		    preferred.height = Math.max(preferred.height, childSize.height);
+      }
+      else
+      {  
+        preferred.height += childSize.height;
+        preferred.width = Math.max(preferred.width, childSize.width);
+      }
+	  }   
+
+    int childrenSize = children.size();
+    if (childrenSize > 1)
+    {                      
+      if (isHorizontal)    
+      {
+        preferred.width += spacing * (childrenSize - 1);
+      }
+      else
+      {
+		    preferred.height += spacing * (childrenSize - 1);
+      } 
+    }
+                          
+    preferred.width += border * 2;
+    preferred.height += border * 2;
+	  preferred.width += parent.getInsets().getWidth();
+	  preferred.height += parent.getInsets().getHeight();       
+  
+  	return preferred;
+  }
+
+  protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
+  {    
+    Dimension	preferred = null;                                              
+                                  
+    // Here we ensure that an unexpanded container is given a size of (0,0)
+    //
+    if (parent instanceof IExpandable)
+    {
+      IExpandable expandableFigure = (IExpandable)parent;
+      if (!expandableFigure.isExpanded())
+      {
+        preferred = new Dimension(); 
+      }
+    }   
+    
+    if (preferred == null)
+    {
+	    preferred = calculatePreferredSizeHelper(parent);    
+    }
+    
+    return preferred;
+  }
+     
+
+  protected void adjustLayoutLocation(IFigure parent, Dimension dimension)
+  {     
+  }   
+
+  public void layout(IFigure parent)
+  {       
+  	List children = parent.getChildren();
+ 
+    int rx = 0;
+    Dimension	dimension = new Dimension();                                          
+
+
+	  for (int i=0; i < children.size(); i++)
+    {
+		  IFigure child = (IFigure)children.get(i);
+		  Dimension	childSize = child.getPreferredSize();
+      if (isHorizontal)
+      {   
+        dimension.height = Math.max(dimension.height, childSize.height);
+        rx += childSize.width;
+      }
+      else
+      {
+        dimension.width = Math.max(dimension.width, childSize.width);
+      }
+    }
+
+	  //dimension.width += parent.getInsets().left;
+    //dimension.height += parent.getInsets().top;
+
+    if (isHorizontal)
+    {
+      dimension.height += border*2;
+    	dimension.width += border;
+    }
+    else
+    {
+      dimension.width += border*2;
+    	dimension.height += border;
+    }
+    adjustLayoutLocation(parent, dimension);    
+
+    for (int i=0; i < children.size(); i++)
+    {
+      IFigure child = (IFigure)children.get(i);
+	    Dimension	childSize = child.getPreferredSize();
+        
+      if (isHorizontal)
+      {   
+        int y = -1; 
+    
+        y = alignFigure(parent, child);
+    
+        if (y == -1)
+        {
+           y = (dimension.height - childSize.height) / 2;                                      
+        }                      
+                                                   
+        Rectangle rectangle = new Rectangle(dimension.width, y, childSize.width, childSize.height);
+        rectangle.translate(parent.getClientArea().getLocation());                           
+
+
+        child.setBounds(rectangle);                           
+	      dimension.width += childSize.width; 
+        dimension.width += spacing;       
+
+        if (child instanceof SpacingFigure)
+        {          
+          int availableHorizontalSpace = parent.getClientArea().width - rx;
+          dimension.width += availableHorizontalSpace;
+        }           
+      }
+      else
+      {
+        Rectangle rectangle = new Rectangle(0, dimension.height, childSize.width, childSize.height);
+	      rectangle.translate(parent.getClientArea().getLocation());                                  
+        
+
+        child.setBounds(rectangle);  
+        dimension.height += childSize.height;
+        dimension.height += spacing;
+      }
+	  }	      
+  }                                      
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java
new file mode 100644
index 0000000..9f3de7c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+
+public class FillLayout extends AbstractLayout
+{         
+  protected boolean isHorizontal = false;                    
+  protected int spacing = 0;
+  public Dimension min;
+
+  public FillLayout(){}     
+  
+  public FillLayout(int spacing)
+  { 
+    this.spacing = spacing; 
+  }
+  
+  public void setHorizontal(boolean isHorizontal)
+  {
+   this.isHorizontal = isHorizontal;
+  }
+  
+  /**
+   * Calculates and returns the preferred size of the input container.
+   * This is the size of the largest child of the container, as all
+   * other children fit into this size.
+   *
+   * @param figure  Container figure for which preferred size is required.
+   * @return  The preferred size of the input figure.
+   */
+
+  protected Dimension calculatePreferredSize(IFigure figure, int width, int height)
+  {	                 
+    Dimension d = calculatePreferredClientAreaSize(figure);
+  	d.expand(figure.getInsets().getWidth(),
+  	         figure.getInsets().getHeight());
+  	d.union(getBorderPreferredSize(figure));
+  	return d;
+  } 
+  
+  protected Dimension calculatePreferredClientAreaSize(IFigure figure)
+  {
+    Dimension d = new Dimension();
+  	List children = figure.getChildren(); 
+  
+  
+  	for (Iterator i = children.iterator(); i.hasNext(); )
+    {
+  		IFigure child = (IFigure)i.next();
+      Dimension childSize = child.getPreferredSize();
+  
+      if (isHorizontal)
+      {
+        d.width += childSize.width;
+        d.height = Math.max(childSize.height, d.height);
+      }
+      else
+      {
+        d.height += childSize.height;
+        d.width = Math.max(childSize.width, d.width);
+      }
+  	}	 
+  
+                     
+    int childrenSize = children.size();       
+    if (childrenSize > 0)
+    {
+      if (isHorizontal)
+      {
+        d.width += spacing * (childrenSize - 1); 
+      }
+      else
+      {
+        d.height += spacing * (childrenSize - 1);  
+      }
+    }       
+      
+    if (min != null)
+    {
+      d.width = Math.max(d.width, min.width);
+      d.height = Math.max(d.height, min.height);
+    }
+    return d;
+  }
+  
+  /*
+   * Returns the minimum size required by the input container.
+   * This is the size of the largest child of the container, as all
+   * other children fit into this size.
+   */
+  public Dimension getMinimumSize(IFigure figure, int width, int height)
+  {
+  	Dimension d = new Dimension();
+  	List children = figure.getChildren();
+  	IFigure child;
+
+  	for (int i=0; i < children.size(); i++)
+    {
+  		child = (IFigure)children.get(i);
+  		d.union(child.getMinimumSize());
+  	}
+  	d.expand(figure.getInsets().getWidth(),
+  	         figure.getInsets().getHeight());
+  	return d;
+  }
+  
+  public Dimension getPreferredSize(IFigure figure, int width, int height)
+  {
+  	return calculatePreferredSize(figure, width, height);
+  }
+  
+  /*
+   * Lays out the children on top of each other with
+   * their sizes equal to that of the available
+   * paintable area of the input container figure.
+   */
+  public void layout(IFigure figure)
+  {                         
+    Dimension	preferredSize = calculatePreferredClientAreaSize(figure);
+  	Rectangle r = figure.getClientArea().getCopy();
+  	List children = figure.getChildren();
+
+    int nChildren = children.size();                                                          
+    int extraHorizontalSpace = r.width - preferredSize.width;
+
+  	for (Iterator i = children.iterator(); i.hasNext(); )
+    {
+  		IFigure child = (IFigure)i.next();
+      Dimension preferredChildSize = child.getPreferredSize();
+         
+      if (isHorizontal)
+      {                       
+        int w = preferredChildSize.width + (extraHorizontalSpace / nChildren);
+  		  child.setBounds(new Rectangle(r.x, r.y, w, Math.max(preferredSize.height, r.height)));
+        r.x += w + spacing;
+      }
+      else
+      {
+  		  child.setBounds(new Rectangle(r.x, r.y, Math.max(preferredSize.width, r.width), preferredChildSize.height));
+        r.y += preferredChildSize.height + spacing;
+      }
+  	}
+  }   
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java
new file mode 100644
index 0000000..4c778d7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+            
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+
+public interface IConnectedEditPartFigure extends IConnectedFigure
+{                       
+  public static final int UP_CONNECTION = 1; 
+  public static final int DOWN_CONNECTION = 2;
+  public static final int LEFT_CONNECTION = 3;
+  public static final int RIGHT_CONNECTION = 4;
+
+  public IFigure getSelectionFigure();
+  public IFigure getConnectionFigure();
+  public List getConnectedFigures(int type);
+  public int getConnectionType();      
+  public void addConnectedFigure(IConnectedEditPartFigure figure);
+  public void removeConnectedFigure(IConnectedEditPartFigure figure);
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java
new file mode 100644
index 0000000..4a6d7de
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+            
+import org.eclipse.draw2d.IFigure;
+
+public interface IConnectedFigure extends IFigure
+{                       
+  public IFigure getConnectionFigure();
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java
new file mode 100644
index 0000000..6ed611d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+
+public interface IConnectionRenderingViewer
+{        
+  public ConnectionRenderingFigure getConnectionRenderingFigure();
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java
new file mode 100644
index 0000000..161581b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;  
+
+import org.eclipse.draw2d.IFigure;
+
+public interface IExpandable extends IFigure
+{
+  boolean isExpanded(); 
+  void setExpanded(boolean isExpanded);
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java
new file mode 100644
index 0000000..e245d69
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
+            
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+              
+public class SpacingFigure extends RectangleFigure
+{  
+  public SpacingFigure()
+  {
+    setFill(false);
+    setPreferredSize(new Dimension(0, 0));
+  }
+  
+  //protected void outlineShape(Graphics graphics)
+  //{ 
+  //}                                              
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/BaseGraphicalViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/BaseGraphicalViewer.java
new file mode 100644
index 0000000..9f1bbec
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/BaseGraphicalViewer.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+
+import java.util.Iterator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.EditDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.KeyHandler;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editparts.ScalableRootEditPart;
+import org.eclipse.gef.tools.SelectionTool;
+import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+import org.eclipse.wst.xsd.ui.internal.XSDMenuListener;
+import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ConnectionRenderingFigure;
+import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IConnectionRenderingViewer;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.CenterLayout;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+
+/**
+ * @author ernest
+ *
+ * To change this generated comment go to 
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public abstract class BaseGraphicalViewer extends ScrollingGraphicalViewer implements IConnectionRenderingViewer
+{
+  protected FigureCanvasKeyboardHandler figureCanvasKeyboardHandler;
+
+  protected EditDomain editDomain;
+
+  protected boolean isInputEnabled = true;
+
+  protected boolean isSelectionEnabled = true;
+
+  protected ISelectionProvider menuSelectionProvider;
+
+  protected GraphContextMenuProvider menuProvider;
+
+  protected XSDEditor editor;
+
+  protected XSDConcreteComponent input;
+
+  protected ConnectionRenderingFigure connectionRenderingFigure;
+
+  public BaseGraphicalViewer(XSDEditor editor, ISelectionProvider selectionProvider)
+  {
+    super();
+    this.editor = editor;
+    menuSelectionProvider = selectionProvider;
+  }
+  
+  public ConnectionRenderingFigure getConnectionRenderingFigure()
+  {
+    return connectionRenderingFigure;
+  }
+
+  public void setInputEnabled(boolean enabled)
+  {
+    isInputEnabled = enabled;
+  }
+
+  public void setSelectionEnabled(boolean enabled)
+  {
+    isSelectionEnabled = enabled;
+  }
+
+  public XSDMenuListener getMenuListener()
+  {
+    return menuProvider.getMenuListener();
+  }
+
+  protected static Color white = null;
+  protected void hookControl()
+  {                     
+    super.hookControl();
+  
+    if (white == null)
+    {
+      white = new Color(getControl().getDisplay(), 255, 255, 255);
+    }
+    getControl().setBackground(white); 
+  
+    editDomain = new DefaultEditDomain(null);
+    ((DefaultEditDomain)editDomain).setDefaultTool(new SelectionTool());
+    editDomain.loadDefaultTool();
+    editDomain.addViewer(this);
+  
+    //jvh - gef port - moved this from below so it is available when adding context menu below
+    menuProvider = new GraphContextMenuProvider(this, menuSelectionProvider);
+    setContextMenu(menuProvider);
+  
+    // add context menu to the graph
+    MenuManager manager = new MenuManager();
+    manager.addMenuListener(getMenuListener());  //jvh - gef port
+    manager.setRemoveAllWhenShown(true);
+    Menu menu = manager.createContextMenu(getControl());
+    getControl().setMenu(menu);
+    
+    // enable popupMenus extension
+    //BUG 68938 eclipse bug fixed. Bug 112955 - Filter out menu contributions.
+    editor.getEditorSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.graph", manager, menuSelectionProvider, false);
+    
+//    KeyAdapter keyListener = new KeyAdapter()
+//    {
+//      /**
+//       * @see org.eclipse.swt.events.KeyAdapter#keyReleased(KeyEvent)
+//       */
+//      public void keyReleased(KeyEvent e)
+//      {
+//        if (e.character == SWT.DEL)
+//        {
+//          getMenuListener().getDeleteAction().run();
+//        }
+//      }
+//    };
+  
+    setKeyHandler(new XSDGraphicalViewerKeyHandler(this).setParent(new KeyHandler()));
+    
+//    getControl().addKeyListener(keyListener);
+
+    figureCanvasKeyboardHandler = new FigureCanvasKeyboardHandler(this);
+    getFigureCanvas().addKeyListener(figureCanvasKeyboardHandler);
+    
+  	getRootEditPart().activate();		
+                       
+  	ScalableRootEditPart graphicalRootEditPart = (ScalableRootEditPart)getRootEditPart();
+     
+    // set the layout for the primary layer so that the children are always centered
+    //
+    graphicalRootEditPart.getLayer(LayerConstants.PRIMARY_LAYER).setLayoutManager(new CenterLayout());
+  
+    // add the ConnectionRenderingFigure which is responsible for drawing all of the lines in the view
+    //                       
+    IFigure figure = graphicalRootEditPart.getLayer(LayerConstants.HANDLE_LAYER);
+    figure.setLayoutManager(new StackLayout());          
+    connectionRenderingFigure = new ConnectionRenderingFigure(graphicalRootEditPart.getLayer(LayerConstants.PRIMARY_LAYER));      
+    figure.add(connectionRenderingFigure);
+  
+    figure.validate();      
+  }
+
+  public XSDConcreteComponent getInput()
+  {
+    return input;
+  }
+
+  protected EditPart getEditPart(EditPart parent, Object object)
+  {
+    EditPart result = null;
+    for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
+    {
+      EditPart editPart = (EditPart)i.next();
+      if (editPart.getModel() == object)
+      {  
+        result = editPart;
+        break;
+      }
+    }             
+  
+    if (result == null)
+    { 
+      for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
+      {
+        EditPart editPart = getEditPart((EditPart)i.next(), object);
+        if (editPart != null)
+        {
+          result = editPart;
+          break;
+        }
+      }            
+    }
+  
+    return result;
+  }
+  
+  public abstract void setInput(XSDConcreteComponent comp);
+  
+  public abstract void setSelection(XSDConcreteComponent comp);
+  
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/FigureCanvasKeyboardHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/FigureCanvasKeyboardHandler.java
new file mode 100644
index 0000000..012e15e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/FigureCanvasKeyboardHandler.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.draw2d.RangeModel;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.CategoryEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
+
+public class FigureCanvasKeyboardHandler extends KeyAdapter
+{
+  public static final int H_SCROLL_INCREMENT = 5;
+  public static final int V_SCROLL_INCREMENT = 30;
+
+  BaseGraphicalViewer viewer;
+  
+  /**
+   * Constructor for FigureCanvasKeyboardHandler.
+   */
+  public FigureCanvasKeyboardHandler(BaseGraphicalViewer viewer)
+  {
+    super();
+    this.viewer = viewer;
+  }
+
+  public void keyPressed(KeyEvent e)
+  {
+    Widget w = e.widget;
+    if (w instanceof FigureCanvas)
+    {
+      processKey(e.keyCode, (FigureCanvas)w);
+      update();
+    }
+  }
+
+  private void processKey(int keyCode, FigureCanvas figureCanvas)
+  {
+    switch (keyCode)
+    {
+      case SWT.ARROW_DOWN :
+        scrollVertical(figureCanvas, false);
+        break;
+      case SWT.ARROW_UP :
+        scrollVertical(figureCanvas, true);
+        break;
+      case SWT.ARROW_LEFT :
+        scrollHorizontal(figureCanvas, true);
+        break;
+      case SWT.ARROW_RIGHT :
+        scrollHorizontal(figureCanvas, false);
+        break;
+      case SWT.PAGE_UP :
+        scrollPage(figureCanvas, true);
+        break;
+      case SWT.PAGE_DOWN :
+        scrollPage(figureCanvas, false);
+        break;
+    }
+  }
+
+  private int verifyScrollBarOffset(RangeModel model, int value)
+  {
+    value = Math.max(model.getMinimum(), value);
+    return Math.min(model.getMaximum() - model.getExtent(), value);
+  }
+
+  private void scrollVertical(FigureCanvas figureCanvas, boolean up)
+  {
+    Point location = figureCanvas.getViewport().getViewLocation();
+    int vOffset = up ? -V_SCROLL_INCREMENT : V_SCROLL_INCREMENT;
+    int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x);
+    int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y + vOffset);
+    figureCanvas.scrollSmoothTo(x, y);
+  }
+
+  private void scrollHorizontal(FigureCanvas figureCanvas, boolean left)
+  {
+    Point location = figureCanvas.getViewport().getViewLocation();
+    int hOffset = left ? -H_SCROLL_INCREMENT : H_SCROLL_INCREMENT;
+    int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x + hOffset);
+    int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y);
+    figureCanvas.scrollSmoothTo(x, y);
+  }
+
+  private void scrollPage(FigureCanvas figureCanvas, boolean up)
+  {
+    Rectangle clientArea = figureCanvas.getClientArea();
+    int increment = up ? -clientArea.height : clientArea.height;
+    Point location = figureCanvas.getViewport().getViewLocation();
+    int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x);
+    int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y + increment);
+    figureCanvas.scrollSmoothTo(x, y);
+  }
+  
+  private void update()
+  {
+    StructuredSelection s = (StructuredSelection)viewer.getSelection();
+    Object newSelectedEditPart = s.getFirstElement();
+
+    if (newSelectedEditPart instanceof TopLevelComponentEditPart)
+    {
+      TopLevelComponentEditPart topLevel = (TopLevelComponentEditPart) newSelectedEditPart;
+      CategoryEditPart categoryEP = (CategoryEditPart) topLevel.getParent();
+      categoryEP.scrollTo(topLevel);
+      viewer.reveal((TopLevelComponentEditPart)newSelectedEditPart);
+    }                           
+  }
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphContextMenuProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphContextMenuProvider.java
new file mode 100644
index 0000000..dc539e2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphContextMenuProvider.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+
+import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.XSDMenuListener;
+
+
+public class GraphContextMenuProvider extends ContextMenuProvider
+{
+
+  XSDMenuListener xsdMenuListener;
+  
+  /**
+   * Constructor for GraphContextMenuProvider.
+   * @param selectionProvider
+   * @param editor
+   */
+  public GraphContextMenuProvider(
+    EditPartViewer viewer,
+    ISelectionProvider selectionProvider)
+  {
+    super(viewer);
+    this.viewer = viewer;
+    xsdMenuListener = new XSDMenuListener(selectionProvider);
+    xsdMenuListener.setSourceContext(viewer);
+  }
+
+  public XSDMenuListener getMenuListener()
+  {
+      return xsdMenuListener;
+  }
+
+  
+  /**
+   * @see org.eclipse.gef.ui.parts.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager, org.eclipse.gef.EditPartViewer)
+   */
+  public void buildContextMenu(IMenuManager arg0)
+  {
+    xsdMenuListener.menuAboutToShow(arg0);
+  }
+  
+  protected EditPartViewer viewer;
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphicsConstants.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphicsConstants.java
new file mode 100644
index 0000000..691996d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphicsConstants.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * A collection of color-related constants.
+ */
+public interface GraphicsConstants 
+{                          
+  public final static Display display = Display.getDefault();
+  public final static Color categoryBorderColor     = new Color(null, 118, 134, 164);
+  public final static Color elementBorderColor      = new Color(null, 138, 154, 184);
+  public final static Color elementBackgroundColor  = new Color(null, 236, 242, 252);  
+  public final static Color elementLabelColor       = new Color(null,  80,  96, 144);
+  public final static Color readOnlyBorderColor     = new Color(null, 164, 164, 164); 
+
+  public final static Color readOnlyBackgroundColor = ColorConstants.white;
+
+  public final static Font  smallFont               = new Font(Display.getCurrent(), "Small Fonts", 6, SWT.NONE); 
+  public final static Font  medium                  = new Font(Display.getCurrent(), "Tahoma", 8, SWT.NONE); 
+  public final static Font  mediumBoldFont          = new Font(Display.getCurrent(), "Tahoma", 8, SWT.BOLD); 
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/LinkedGraphViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/LinkedGraphViewer.java
new file mode 100644
index 0000000..73e21aa
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/LinkedGraphViewer.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+
+import java.util.Iterator;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.w3c.dom.Element;
+
+
+
+public class LinkedGraphViewer
+{
+  
+  protected ISelectionProvider menuSelectionProvider;
+  protected XSDEditor editor;
+  protected BaseGraphicalViewer majorViewer, minorViewer;
+  
+  /**
+   * 
+   */
+  public LinkedGraphViewer(XSDEditor editor, ISelectionProvider selectionProvider)
+  {
+    menuSelectionProvider = selectionProvider;
+    this.editor = editor;
+  }
+
+  public void setMajorViewer(BaseGraphicalViewer majorViewer)
+  {
+    this.majorViewer = majorViewer;
+  }
+
+  public void setMinorViewer(BaseGraphicalViewer minorViewer)
+  {
+    this.minorViewer = minorViewer;
+  }
+  
+  protected Composite control;
+  protected SashForm sashForm;
+  
+  public Control createControl(Composite parent)
+  {
+    //control = new Composite(parent, SWT.DEFAULT);
+   
+    control = sashForm = new SashForm(parent, SWT.VERTICAL | SWT.BORDER);
+    sashForm.setLayoutData(ViewUtility.createFill());
+    
+    majorViewer.createControl(sashForm);
+    minorViewer.createControl(sashForm);
+//    control.setLayout(new GridLayout());
+//    control.setLayoutData(ViewUtility.createFill());
+    return control;
+  }
+  
+  public void addSelectionChangedListener(ISelectionChangedListener selectionListener)
+  {
+    if (majorViewer != null)
+    {
+      majorViewer.addSelectionChangedListener(selectionListener);
+      majorViewer.addSelectionChangedListener(majorViewerListener);
+    }
+    if (minorViewer != null)
+    {
+      minorViewer.addSelectionChangedListener(selectionListener);
+    }
+  }
+  
+  /**
+   * @return Composite
+   */
+  public Composite getControl()
+  {
+    return control;
+  }
+
+  /**
+   * 
+   */
+  protected XSDConcreteComponent getInput()
+  {
+    return majorViewer.getInput();
+  }
+
+  /**
+   * @param schema
+   */
+  protected void setInput(XSDConcreteComponent input)
+  {
+    majorViewer.setInput(input);
+    minorViewer.setInput(input);
+  }
+
+  /**
+   * @param component
+   */
+  public void setSelection(XSDConcreteComponent component)
+  {
+    majorViewer.setSelection(component);
+  }
+
+  protected MajorViewerSelectionChangedListener majorViewerListener = new MajorViewerSelectionChangedListener();
+  
+  private class MajorViewerSelectionChangedListener implements ISelectionChangedListener
+  {
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+     */
+    public void selectionChanged(SelectionChangedEvent event)
+    {
+      ISelection editPartSelection = event.getSelection();
+      if (editPartSelection instanceof IStructuredSelection)
+      {
+        for (Iterator i = ((IStructuredSelection)editPartSelection).iterator(); i.hasNext(); )
+        {
+          EditPart editPart = (EditPart)i.next();
+          if (editPart != null)
+          {
+            Object model = editPart.getModel();
+            if (model instanceof XSDConcreteComponent)
+            {
+              Element element = ((XSDConcreteComponent)model).getElement();
+
+              // this test ensures that we don't attempt to select an element for an external schema
+              //
+              if (element instanceof IDOMNode)
+              {
+                // now update the minor viewer based on the selected component in the major viewer
+                minorViewer.setInput((XSDConcreteComponent)model);
+                minorViewer.setSelection((XSDConcreteComponent)model);
+              }
+            }
+          }
+        }
+      }                
+    }
+
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/PrintGraphAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/PrintGraphAction.java
new file mode 100644
index 0000000..53df913
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/PrintGraphAction.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+             
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.printing.PrintDialog;
+import org.eclipse.swt.printing.Printer;
+import org.eclipse.swt.printing.PrinterData;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+
+public class PrintGraphAction extends Action
+{ 
+  protected XSDComponentViewer componentViewer;
+
+  public PrintGraphAction(XSDComponentViewer componentViewer)
+  {
+    super("Print");
+    this.componentViewer = componentViewer;
+  } 
+
+  public void run()
+  {
+    try
+    {
+      PrintDialog dialog = new PrintDialog(Display.getCurrent().getActiveShell());
+      PrinterData data = dialog.open();
+      Printer printer = new Printer(data);
+                                                   
+      Control control = componentViewer.getControl();
+      Display display = Display.getCurrent();
+      Image graphImage = new Image(display, control.getSize().x, control.getSize().y);
+      GC graphGC = new GC(control);
+      graphGC.copyArea(graphImage, 0, 0);
+        
+      ImageData graphImageData = graphImage.getImageData();
+      graphImageData.transparentPixel = -1;
+        
+      Point screenDPI = display.getDPI();
+      Point printerDPI = printer.getDPI();
+      int scaleFactor = printerDPI.x / screenDPI.x;
+      Rectangle trim = printer.computeTrim(0, 0, 0, 0);
+      if (printer.startJob("Print XML Schema Graph")) 
+      {
+        GC gc = new GC(printer);
+        if (printer.startPage()) 
+        {
+          gc.drawImage(
+            graphImage,
+            0,
+            0,
+            graphImageData.width,
+            graphImageData.height,
+            -trim.x,
+            -trim.y,
+            scaleFactor * graphImageData.width,
+            scaleFactor * graphImageData.height);
+          printer.endPage();
+        }
+        printer.endJob();
+      }
+      printer.dispose();
+      graphGC.dispose();
+    }    
+    catch (Exception e)
+    {
+      e.printStackTrace();
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDChildUtility.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDChildUtility.java
new file mode 100644
index 0000000..887889c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDChildUtility.java
@@ -0,0 +1,285 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.util.XSDSwitch;
+              
+
+public class XSDChildUtility
+{              
+  static public List getModelChildren(Object model)
+  {                     
+    XSDChildVisitor visitor = new XSDChildVisitor(model);
+    visitor.visitXSDObject(model); 
+    return visitor.list;
+  }    
+   
+  static public List getImmediateDerivedTypes(XSDComplexTypeDefinition complexType)
+  {
+    ArrayList typesDerivedFrom = new ArrayList();
+
+    // A handy convenience method quickly gets all 
+    // typeDefinitions within our schema; note that 
+    // whether or not this returns types in included, 
+    // imported, or redefined schemas is subject to change
+    List typedefs = complexType.getSchema().getTypeDefinitions();
+
+    for (Iterator iter = typedefs.iterator(); iter.hasNext(); )
+    {
+      XSDTypeDefinition typedef = (XSDTypeDefinition)iter.next();
+      // Walk the baseTypes from this typedef seeing if any 
+      // of them match the requested one
+      if (complexType.equals(typedef.getBaseType()))
+      {
+        // We found it, return the original one and continue
+        typesDerivedFrom.add(typedef);
+      }
+    }
+    return typesDerivedFrom;
+  }
+  // TODO... use the XSDVisitor defined in xsdeditor.util instead
+  //          
+  public static class XSDChildVisitor extends XSDVisitor
+  {
+    Object root;
+    List list = new ArrayList();
+
+    public XSDChildVisitor(Object root)
+    {
+      this.root = root;
+    }                  
+
+    public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
+    {
+      if (xsdModelGroup != root)
+      {
+        list.add(xsdModelGroup);
+      }                         
+      else
+      {
+        super.visitXSDModelGroup(xsdModelGroup);
+      }
+    }
+
+    public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
+    {
+      if (xsdModelGroupDefinition != root)
+      {
+        list.add(xsdModelGroupDefinition);
+      }                         
+      else
+      {
+        super.visitXSDModelGroupDefinition(xsdModelGroupDefinition);
+      }
+    }
+
+    public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
+    {
+      if (xsdElementDeclaration != root)
+      {
+        list.add(xsdElementDeclaration);
+      }                         
+      else
+      {
+        super.visitXSDElementDeclaration(xsdElementDeclaration);
+      }
+    }
+
+    public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
+    {
+      if (xsdComplexTypeDefinition != root)
+      {                                    
+        if (xsdComplexTypeDefinition.getName() != null || getModelChildren(xsdComplexTypeDefinition).size() > 0)
+        {
+          list.add(xsdComplexTypeDefinition);
+        }
+      }                         
+      else
+      {
+        super.visitXSDComplexTypeDefinition(xsdComplexTypeDefinition);
+      }
+    }    
+
+    public void visitXSDWildcard(XSDWildcard xsdWildCard)
+    {
+      if (xsdWildCard != root)
+      {                                    
+        list.add(xsdWildCard);        
+      }                         
+      else
+      {
+        super.visitXSDWildcard(xsdWildCard);
+      }
+    }
+  }
+               
+
+  public static class XSDVisitor
+  { 
+    int indent = 0;
+                 
+    public void visitXSDObject(Object object)
+    {           
+      if (object == null)
+        return;
+
+      XSDSwitch theSwitch = new XSDSwitch()
+      {   
+        public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
+        {
+          visitXSDComplexTypeDefinition(object);
+          return null;
+        } 
+
+        public Object caseXSDAttributeUse(XSDAttributeUse object)
+        {
+          visitXSDAttributeUse(object);
+          return null;
+        }
+
+        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
+        {
+          visitXSDElementDeclaration(object);
+          return null;
+        }
+
+        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
+        {
+          visitXSDModelGroupDefinition(object);
+          return super.caseXSDModelGroupDefinition(object);
+        }
+
+        public Object caseXSDModelGroup(XSDModelGroup object)
+        {
+          visitXSDModelGroup(object);
+          return super.caseXSDModelGroup(object);
+        }
+
+        public Object caseXSDParticle(XSDParticle object)
+        { 
+          visitXSDParticle(object);
+          return null;
+        } 
+
+        public Object caseXSDSchema(XSDSchema object)
+        { 
+          visitXSDSchema(object);
+          return null;
+        } 
+
+        public Object caseXSDWildcard(XSDWildcard object)
+        { 
+          visitXSDWildcard(object);
+          return null;
+        } 
+      };
+      theSwitch.doSwitch((EObject)object);
+    }
+         
+    public void visitXSDAttributeUse(XSDAttributeUse xsdAttributeUse)
+    {  
+//      printIndented("@" + xsdAttributeUse.getAttributeDeclaration().getName());
+    }
+
+    public void visitXSDSchema(XSDSchema xsdSchema)
+    {         
+//      printIndented("XSDSchema");
+      indent += 2;
+      for (Iterator iterator = xsdSchema.getElementDeclarations().iterator(); iterator.hasNext(); )
+      {
+        visitXSDObject(iterator.next());
+      }
+      indent -= 2;
+    }
+
+    public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
+    {      
+//      printIndented(xsdElementDeclaration.getName());
+      indent += 2;         
+      XSDTypeDefinition td = xsdElementDeclaration.getTypeDefinition();
+      if (td == null)
+      {
+        td = xsdElementDeclaration.getAnonymousTypeDefinition();
+      }                       
+      visitXSDObject(td);
+      indent -= 2;
+    }
+   
+    public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
+    {
+//      printIndented("XSDComplexTypeDefinition : " + xsdComplexTypeDefinition.getContent());
+      indent += 2;
+      for (Iterator i = xsdComplexTypeDefinition.getAttributeUses().iterator(); i.hasNext(); )
+      {        
+        visitXSDObject((XSDAttributeUse)i.next());
+      }
+      visitXSDObject(xsdComplexTypeDefinition.getContent());
+      indent -= 2;
+    }
+
+    public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
+    {
+//      printIndented("XSDModelGroup");
+      indent += 2;
+      for (Iterator iterator = xsdModelGroup.getContents().iterator(); iterator.hasNext(); )
+      {
+        visitXSDObject(iterator.next());
+      } 
+      indent -= 2;
+    }     
+
+    public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
+    {
+//      printIndented("XSDModelGroupDefinition");
+      indent += 2;
+      visitXSDObject(xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup());
+      indent -= 2;
+    }
+
+    public void visitXSDParticle(XSDParticle xsdParticle)
+    {
+//      printIndented("XSDParticle");
+      indent += 2;                 
+      if (xsdParticle.getContent() != null)
+        visitXSDObject(xsdParticle.getContent());
+      indent -= 2;
+    } 
+
+    public void visitXSDWildcard(XSDWildcard object)
+    { 
+//      printIndented("XSDWildcard");
+    }
+
+    public void printIndented(String string)
+    { 
+      //String spaces = "";
+      //for (int i = 0; i < indent; i++)
+      //{
+      //  spaces += " ";
+      //}               
+      //System.out.println(spaces + string);      
+    }
+  } 
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDComponentViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDComponentViewer.java
new file mode 100644
index 0000000..a8a0525
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDComponentViewer.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+             
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ComponentViewerRootEditPart;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDSchema;
+
+
+public class XSDComponentViewer extends BaseGraphicalViewer
+{               
+  protected ComponentViewerRootEditPart componentViewerRootEditPart;
+  public XSDComponentViewer(XSDEditor editor, ISelectionProvider menuSelectionProvider)
+  {
+    super(editor, menuSelectionProvider);       
+  }        
+
+  public void setInput(XSDConcreteComponent component)
+  {               
+    if (isInputEnabled)
+    {
+      input = null;         
+
+      if (component instanceof XSDElementDeclaration || 
+          component instanceof XSDSchema ||
+          component instanceof XSDModelGroup ||   
+          component instanceof XSDModelGroupDefinition ||
+          component instanceof XSDComplexTypeDefinition)
+      {            
+        input = component;
+      }
+      
+      componentViewerRootEditPart.setInput(input);
+      if (!(input instanceof XSDSchema))
+      {
+        editor.getGraphViewer().backButton.setEnabled(true);
+      }
+    }
+  }     
+
+  public void setSelection(XSDConcreteComponent component)
+  {                    
+    if (isSelectionEnabled)
+    {                      
+      //System.out.println("XSDComponentViewer.setSelection(" + component + ")");
+      List editPartList = new ArrayList();    
+      if (component instanceof XSDElementDeclaration || 
+          component instanceof XSDSchema ||
+          component instanceof XSDModelGroup ||        
+          component instanceof XSDModelGroupDefinition ||
+          component instanceof XSDComplexTypeDefinition)
+      {                     
+        if (component != null)
+        {
+          EditPart editPart = getEditPart(componentViewerRootEditPart, component);    
+          if (editPart != null)
+          { 
+            // TODO ... take a look at this to figure our why a newly added component
+            // seems to have the wrong bounds at this point... is this a layout issue?           
+            // As a temp hack I'm ignoring the selection of component with bounds (x, y) == (0, 0)
+            // Perhaps a delayed selection is required?
+            Rectangle bounds = ((GraphicalEditPart)editPart).getFigure().getBounds();
+            if (bounds.x > 0 || bounds.y > 0)
+            {
+              editPartList.add(editPart); 
+            }
+          } 
+        }    
+      }              
+      setSelection(new StructuredSelection(editPartList));
+    }
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#hookControl()
+   */
+  protected void hookControl()
+  {
+    super.hookControl();
+    componentViewerRootEditPart = new ComponentViewerRootEditPart();
+    setContents(componentViewerRootEditPart);
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphUtil.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphUtil.java
new file mode 100644
index 0000000..f66c279
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphUtil.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.w3c.dom.Element;
+              
+
+public class XSDGraphUtil
+{                        
+  public static boolean isEditable(Object model)
+  {                    
+    boolean result = false;
+    if (model instanceof XSDConcreteComponent)
+    {
+      Element element = ((XSDConcreteComponent)model).getElement();
+      // this test ensures that we don't attempt to select an element for an external schema
+      //
+      if (element instanceof IDOMNode)
+      {
+         result = true;
+      }
+    }                      
+    return result;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphViewer.java
new file mode 100644
index 0000000..95bcd15
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphViewer.java
@@ -0,0 +1,460 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.ViewForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.XSDSelectionManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
+import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+public class XSDGraphViewer implements ISelectionChangedListener
+{
+  protected PageBook pageBook;
+  protected Control componentViewerControl;
+  protected Control inheritanceViewerControl;
+  protected Control subGroupsViewerControl;
+  protected XSDComponentViewer componentViewer;
+  protected XSDInheritanceViewer inheritanceViewer;
+  protected XSDSubstitutionGroupsViewer subGroupsViewer;
+  protected XSDSelectionManager xsdSelectionManager;
+  protected XSDSchema schema;
+  protected InternalSelectionProvider internalSelectionProvider = new InternalSelectionProvider();
+  protected XSDEditor editor;
+  protected PrintGraphAction printGraphAction;
+  protected SashForm sashForm;
+  protected ToolItem backButton;
+
+  public XSDGraphViewer(XSDEditor editor)
+  {
+    super();
+    this.editor = editor;
+  }
+
+  public void setSchema(XSDSchema schema)
+  {
+    this.schema = schema;
+  }
+  ToolBar graphToolBar; // the toolbar at the top of the graph view
+  ToolItem toolItem; // the view tool item
+  ViewForm form; // view form for holding all the views
+  Composite frameBar; // The composite that contains the toolbar
+  Composite c; // temporary blank page. Clean this up when all views completed
+  LinkedGraphViewer linkInheritanceViewer;
+
+  protected void createInheritanceViewer(Composite parent)
+  {
+    linkInheritanceViewer = new LinkedGraphViewer(editor, internalSelectionProvider);
+    BaseGraphicalViewer graphViewer = new XSDInheritanceViewer(editor, internalSelectionProvider);
+    linkInheritanceViewer.setMajorViewer(graphViewer);
+    graphViewer = new XSDComponentViewer(editor, editor.getSelectionManager());
+    linkInheritanceViewer.setMinorViewer(graphViewer);
+    linkInheritanceViewer.createControl(parent);
+  }
+  LinkedGraphViewer linkSubstitutionGroupViewer;
+
+  protected void createSubstitutionGroupViewer(Composite parent)
+  {
+    linkSubstitutionGroupViewer = new LinkedGraphViewer(editor, internalSelectionProvider);
+    BaseGraphicalViewer graphViewer = new XSDSubstitutionGroupsViewer(editor, internalSelectionProvider);
+    linkSubstitutionGroupViewer.setMajorViewer(graphViewer);
+    graphViewer = new XSDComponentViewer(editor, internalSelectionProvider);
+    linkSubstitutionGroupViewer.setMinorViewer(graphViewer);
+    linkSubstitutionGroupViewer.createControl(parent);
+  }
+  static private Color dividerColor;
+
+  public Control createControl(Composite parent)
+  {
+    pageBook = new PageBook(parent, 0);
+    
+    componentViewer = new XSDComponentViewer(editor, editor.getSelectionManager());
+    form = new ViewForm(pageBook, SWT.NONE);
+    frameBar = new Composite(form, SWT.NONE);
+    org.eclipse.swt.layout.GridLayout frameLayout = new org.eclipse.swt.layout.GridLayout();
+    frameLayout.marginWidth = 0;
+    frameLayout.marginHeight = 0;
+    frameBar.setLayout(frameLayout);
+    graphToolBar = new ToolBar(frameBar, SWT.FLAT);
+    graphToolBar.addTraverseListener(new TraverseListener()
+    {
+      public void keyTraversed(TraverseEvent e)
+      {
+        if (e.detail == SWT.TRAVERSE_MNEMONIC)
+          e.doit = false;
+      }
+    });
+    backButton = new ToolItem(graphToolBar, SWT.PUSH);
+    backButton.setImage(XSDEditorPlugin.getXSDImage("icons/back.gif")); //$NON-NLS-1$
+    backButton.setToolTipText(XSDEditorPlugin.getXSDString("_UI_HOVER_BACK_TO_SCHEMA_VIEW")); //$NON-NLS-1$
+    backButton.setEnabled(false);
+    backButton.addSelectionListener(new SelectionAdapter()
+    {
+      public void widgetSelected(SelectionEvent e)
+      {
+        editor.getGraphViewer().setInput(editor.getXSDSchema());
+        editor.getSelectionManager().setSelection(new StructuredSelection(editor.getXSDSchema()));
+      }
+    });
+    form.setTopLeft(frameBar);
+    componentViewerControl = componentViewer.createControl(form);
+    c = ViewUtility.createComposite(form, 1);
+    form.setContent(componentViewerControl);
+    form.setData("layout ratio", new Float(0.65));
+    if (dividerColor == null)
+    {
+      dividerColor = new Color(componentViewerControl.getDisplay(), 143, 141, 138);
+    }
+    pageBook.showPage(form);
+    componentViewer.addSelectionChangedListener(internalSelectionProvider);
+    printGraphAction = new PrintGraphAction(componentViewer);
+    return pageBook;
+  }
+
+  public Action getPrintGraphAction()
+  {
+    return printGraphAction;
+  }
+
+  public void updateDesignLayout(int newLayout)
+  {
+    sashForm.setOrientation(newLayout);
+    sashForm.layout();
+  }
+
+  public SashForm getSashForm()
+  {
+    return sashForm;
+  }
+
+  public void enableDesignView(boolean enable)
+  {
+  }
+
+  public XSDComponentViewer getComponentViewer()
+  {
+    return componentViewer;
+  }
+  
+  public void setBackButtonEnabled(boolean state)
+  {
+    backButton.setEnabled(state);
+  }
+
+  public void setInput(Object object)
+  {
+    if (object instanceof XSDConcreteComponent)
+    {
+      XSDConcreteComponent xsdComp = (XSDConcreteComponent) object;
+      if (xsdComp instanceof XSDSchema)
+      {
+        setBackButtonEnabled(false);
+      }
+      else
+      {
+        setBackButtonEnabled(true);
+      }
+      componentViewer.setInput(xsdComp);
+      componentViewer.setSelection(xsdComp);
+    }   
+  }
+
+  protected boolean isDeleted(XSDConcreteComponent component)
+  {
+    boolean result = false;
+    if (component != null && component.getElement() != null)
+    {
+      result = component.getElement().getParentNode() == null;
+    }
+    return result;
+  }
+
+  public void setSelectionManager(XSDSelectionManager newSelectionManager)
+  {
+    // disconnect from old one
+    if (xsdSelectionManager != null)
+    {
+      xsdSelectionManager.removeSelectionChangedListener(this);
+      internalSelectionProvider.removeSelectionChangedListener(xsdSelectionManager);
+    }
+    xsdSelectionManager = newSelectionManager;
+    // connect to new one
+    if (xsdSelectionManager != null)
+    {
+      xsdSelectionManager.addSelectionChangedListener(this);
+      internalSelectionProvider.addSelectionChangedListener(xsdSelectionManager);
+    }
+  }
+
+  // this method is called by the SelectionManager to notify the graph view
+  // that the editor selection has changed
+  //
+  public void selectionChanged(SelectionChangedEvent event)
+  {
+    // here we check the selection source to ensure that this selection came
+    // from a different view (not from the graph view)
+    if (event.getSource() != getComponentViewer())
+    { 
+      handleSelection(event, true);
+    }
+  }
+
+  protected XSDConcreteComponent getTopLevelComponent(XSDConcreteComponent component)
+  {
+    XSDConcreteComponent prev = component;
+    XSDConcreteComponent container = component;
+    while ( container != null && !(container instanceof XSDSchema))
+    {
+      prev = container;     
+      container = container.getContainer();
+    }
+    return container != null ? prev : null;
+  }
+  
+  // TODO.. we need to clean this method up and add comments to clarify what's going on
+  //
+  protected void handleSelection(SelectionChangedEvent event, boolean isSelectionRequired)
+  {
+    StructuredSelection s = (StructuredSelection)event.getSelection();
+    Object obj = s.getFirstElement();
+    if (obj instanceof XSDConcreteComponent)
+    {
+      XSDConcreteComponent selectedComponent = (XSDConcreteComponent)obj;
+      Object currentInput = getComponentViewer().getInput();
+      
+      // in this case we're looking at a top level view
+      // so if the selection is a 'non-top-level' component we need to do a set input
+      XSDSchema topLevelSchema = null;
+      if (currentInput instanceof XSDSchema)
+      {
+        if (selectedComponent instanceof XSDSchema || 
+            selectedComponent.getContainer() instanceof XSDSchema)
+        {
+          topLevelSchema = (XSDSchema)currentInput;
+        }
+      }
+      if (selectedComponent instanceof XSDSchemaDirective || 
+          selectedComponent instanceof XSDNotationDeclaration)      
+      {
+        topLevelSchema = selectedComponent.getSchema();
+      }
+      else if (selectedComponent instanceof XSDAttributeGroupContent ||
+               selectedComponent instanceof XSDWildcard)
+      {
+        if (selectedComponent.getContainer() instanceof XSDAttributeGroupDefinition)
+        {
+          topLevelSchema = selectedComponent.getSchema();
+        }
+      }
+      else if (selectedComponent instanceof XSDSimpleTypeDefinition)
+      {
+        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)selectedComponent;
+        EditPart editPart = componentViewer.getEditPart(componentViewer.getRootEditPart(), st);
+        if (editPart == null)
+        {
+          if (st.getContainer() == editor.getXSDSchema())
+          {
+            topLevelSchema = selectedComponent.getSchema();
+          }
+        }
+      }
+      
+      if (topLevelSchema != null)
+      {
+        setInput(topLevelSchema);
+        // TODO... this is not 'quite' right
+        // it should be possible to view in
+      }  
+      else
+      { 
+        EditPart editPart = getComponentViewer().getEditPart(getComponentViewer().getRootEditPart(), obj);
+        if (editPart == null)
+        {  
+          XSDConcreteComponent topLevelComponent = getTopLevelComponent(selectedComponent);
+          if (topLevelComponent != null)
+          {
+            setInput(topLevelComponent);  
+          }
+        }  
+      }  
+      // now we handle the selection
+      //
+      if (isSelectionRequired)
+      {  
+        EditPart editPart = getComponentViewer().getRootEditPart();        
+        EditPart newSelectedEditPart = getComponentViewer().getEditPart(editPart, obj);
+        if (newSelectedEditPart != null)
+        {
+          if (newSelectedEditPart instanceof TopLevelComponentEditPart)
+          {
+            ((TopLevelComponentEditPart)newSelectedEditPart).setScroll(true);
+          }
+          getComponentViewer().setSelection(new StructuredSelection(newSelectedEditPart));
+        }
+      }      
+    }
+    else if (obj instanceof CategoryAdapter)
+    {
+      setInput(((CategoryAdapter)obj).getXSDSchema());  
+    }
+  }
+
+  protected Element getElementNode(Node node)
+  {
+    while (!(node instanceof Element))
+    {
+      if (node instanceof Attr)
+      {
+        node = ((Attr) node).getOwnerElement();
+      }
+      else if (node instanceof Text)
+      {
+        Node sibling = node.getNextSibling();
+        if (sibling == null)
+        {
+          break;
+        }
+        node = sibling;
+      }
+      else
+      {
+        Node parent = node.getParentNode();
+        if (parent == null)
+        {
+          break;
+        }
+        node = node.getParentNode();
+      }
+    }
+    return node instanceof Element ? (Element) node : null;
+  }
+
+
+
+  // This class listens to the graph view and converts edit part selection
+  // events
+  // into XSD component selection events that can be 'fired' to the
+  // selectionManager
+  //
+  class InternalSelectionProvider implements ISelectionProvider, ISelectionChangedListener
+  {
+    protected List listenerList = new ArrayList();
+    protected ISelection selection = new StructuredSelection();
+
+    public void addSelectionChangedListener(ISelectionChangedListener listener)
+    {
+      listenerList.add(listener);
+    }
+
+    public void removeSelectionChangedListener(ISelectionChangedListener listener)
+    {
+      listenerList.remove(listener);
+    }
+
+    public ISelection getSelection()
+    {
+      return selection;
+    }
+
+    protected void notifyListeners(SelectionChangedEvent event)
+    {
+      for (Iterator i = listenerList.iterator(); i.hasNext();)
+      {
+        ISelectionChangedListener listener = (ISelectionChangedListener) i.next();
+        listener.selectionChanged(event);
+      }
+    }
+
+    public StructuredSelection convertSelectionFromEditPartToModel(ISelection editPartSelection)
+    {
+      List selectedModelObjectList = new ArrayList();
+      if (editPartSelection instanceof IStructuredSelection)
+      {
+        for (Iterator i = ((IStructuredSelection) editPartSelection).iterator(); i.hasNext();)
+        {
+          Object obj = i.next();
+          Object model = null;
+          if (obj instanceof EditPart)
+          {
+            EditPart editPart = (EditPart) obj;
+            model = editPart.getModel();
+            // Convert category to XSDSchema
+            // if (editPart instanceof CategoryEditPart)
+            // {
+            //   model = ((Category)((CategoryEditPart)editPart).getModel()).getXSDSchema();
+            // }
+          }
+          else if (obj instanceof XSDConcreteComponent)
+          {
+            //cs .. not sure why would we'd ever hit this case?
+            model = obj;
+          }
+          if (model != null)//&& model instanceof XSDConcreteComponent)
+          {
+            selectedModelObjectList.add(model);
+          }
+        }
+      }
+      return new StructuredSelection(selectedModelObjectList);
+    }
+
+    public void setSelection(ISelection selection)
+    {
+      this.selection = selection;
+    }
+
+    // This method gets called when an edit part in the graph view is selected
+    //
+    public void selectionChanged(SelectionChangedEvent event)
+    {
+      ISelection newSelection = convertSelectionFromEditPartToModel(event.getSelection());
+      this.selection = newSelection;
+      SelectionChangedEvent newEvent = new SelectionChangedEvent(getComponentViewer(), newSelection);
+      notifyListeners(newEvent);
+    }
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphicalViewerKeyHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphicalViewerKeyHandler.java
new file mode 100644
index 0000000..b6c8026
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphicalViewerKeyHandler.java
@@ -0,0 +1,352 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.KeyHandler;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ExpandableGraphNodeEditPart;
+
+
+public class XSDGraphicalViewerKeyHandler extends KeyHandler
+{
+    public XSDGraphicalViewerKeyHandler(GraphicalViewer viewer)
+    {
+      this.viewer = viewer;
+    }
+    
+    private WeakReference cachedNode;
+    int counter;
+    private GraphicalViewer viewer;
+
+    private boolean acceptConnection(KeyEvent event)
+    {
+      return event.character == '/'
+        || event.character == '?'
+        || event.character == '\\'
+        || event.character == '|';
+    }
+    private boolean acceptIntoContainer(KeyEvent event)
+    {
+      return (((event.stateMask & SWT.ALT) != 0)
+        && (event.keyCode == SWT.ARROW_RIGHT)) || (event.keyCode == SWT.ARROW_RIGHT);
+//      return (event.keyCode == SWT.ARROW_RIGHT);
+    }
+    private boolean acceptLeaveConnection(KeyEvent event)
+    {
+      int key = event.keyCode;
+      if (getFocus() instanceof ConnectionEditPart)
+        if ((key == SWT.ARROW_UP)
+          || (key == SWT.ARROW_RIGHT)
+          || (key == SWT.ARROW_DOWN)
+          || (key == SWT.ARROW_LEFT))
+          return true;
+      return false;
+    }
+    private boolean acceptLeaveContents(KeyEvent event)
+    {
+      int key = event.keyCode;
+      return getFocus() == getViewer().getContents()
+        && ((key == SWT.ARROW_UP)
+          || (key == SWT.ARROW_RIGHT)
+          || (key == SWT.ARROW_DOWN)
+          || (key == SWT.ARROW_LEFT));
+    }
+    private boolean acceptOutOf(KeyEvent event)
+    {
+      return (((event.stateMask & SWT.ALT) != 0) && (event.keyCode == SWT.ARROW_LEFT)) || (event.keyCode == SWT.ARROW_LEFT);
+//      return (event.keyCode == SWT.ARROW_LEFT);
+    }
+    private ConnectionEditPart findConnection(
+      GraphicalEditPart node,
+      ConnectionEditPart current,
+      boolean forward)
+    {
+      List connections = new ArrayList(node.getSourceConnections());
+      connections.addAll(node.getTargetConnections());
+      if (connections.isEmpty())
+        return null;
+      if (forward)
+        counter++;
+      else
+        counter--;
+      while (counter < 0)
+        counter += connections.size();
+      counter %= connections.size();
+      return (ConnectionEditPart) connections.get(counter % connections.size());
+    }
+    /*
+     * pStart is a point in absolute coordinates.
+     */
+    private GraphicalEditPart findSibling(
+      List siblings,
+      Point pStart,
+      int direction,
+      EditPart exclude)
+    {
+      GraphicalEditPart epCurrent;
+      GraphicalEditPart epFinal = null;
+      IFigure figure;
+      Point pCurrent;
+      int distance = Integer.MAX_VALUE;
+      Iterator iter = siblings.iterator();
+      while (iter.hasNext())
+      {
+        epCurrent = (GraphicalEditPart) iter.next();
+        if (epCurrent == exclude)
+          continue;
+        figure = epCurrent.getFigure();
+        pCurrent = getInterestingPoint(figure);
+        figure.translateToAbsolute(pCurrent);
+        if (pStart.getPosition(pCurrent) != direction)
+          continue;
+        int d = pCurrent.getDistanceOrthogonal(pStart);
+        if (d < distance)
+        {
+          distance = d;
+          epFinal = epCurrent;
+        }
+      }
+      return epFinal;
+    }
+    Point getInterestingPoint(IFigure figure)
+    {
+//      return figure.getBounds().getCenter();
+      return figure.getBounds().getTopLeft();
+    }
+    /**
+     * Returns the cached node.  It is possible that the node is not longer in the viewer but has
+     * not been garbage collected yet.
+     */
+    private GraphicalEditPart getCachedNode()
+    {
+      if (cachedNode == null)
+        return null;
+      if (cachedNode.isEnqueued())
+        return null;
+      return (GraphicalEditPart) cachedNode.get();
+    }
+    GraphicalEditPart getFocus()
+    {
+      return (GraphicalEditPart) getViewer().getFocusEditPart();
+    }
+    List getNavigationSiblings()
+    {
+      return getFocus().getParent().getChildren();
+    }
+    protected GraphicalViewer getViewer()
+    {
+      return viewer;
+    }
+    public boolean keyPressed(KeyEvent event)
+    {
+      if (event.character == ' ')
+      {
+        processSelect(event);
+        return true;
+      }
+      else if (acceptIntoContainer(event))
+      {
+        navigateIntoContainer(event);
+        return true;
+      }
+      else if (acceptOutOf(event))
+      {
+        navigateOut(event);
+        return true;
+      }
+      else if (acceptConnection(event))
+      {
+        navigateConnections(event);
+        return true;
+      }
+      else if (acceptLeaveConnection(event))
+      {
+        navigateOutOfConnection(event);
+        return true;
+      }
+      else if (acceptLeaveContents(event))
+      {
+        navigateIntoContainer(event);
+        return true;
+      }
+      switch (event.keyCode)
+      {
+        case SWT.ARROW_LEFT :
+          return navigateNextSibling(event, PositionConstants.WEST);
+        case SWT.ARROW_RIGHT :
+          return navigateNextSibling(event, PositionConstants.EAST);
+        case SWT.ARROW_UP :
+          return navigateNextSibling(event, PositionConstants.NORTH);
+        case SWT.ARROW_DOWN :
+          return navigateNextSibling(event, PositionConstants.SOUTH);
+        case SWT.HOME :
+          return navigateJumpSibling(event, PositionConstants.WEST);
+        case SWT.END :
+          return navigateJumpSibling(event, PositionConstants.EAST);
+        case SWT.PAGE_DOWN :
+          return navigateJumpSibling(event, PositionConstants.SOUTH);
+        case SWT.PAGE_UP :
+          return navigateJumpSibling(event, PositionConstants.NORTH);
+      }
+      return super.keyPressed(event);
+    }
+    private void navigateConnections(KeyEvent event)
+    {
+      GraphicalEditPart focus = getFocus();
+      ConnectionEditPart current = null;
+      GraphicalEditPart node = getCachedNode();
+      if (focus instanceof ConnectionEditPart)
+      {
+        current = (ConnectionEditPart) focus;
+        if (node == null
+          || (node != current.getSource() && node != current.getTarget()))
+        {
+          node = (GraphicalEditPart) current.getSource();
+          counter = 0;
+        }
+      }
+      else
+      {
+        node = focus;
+      }
+      setCachedNode(node);
+      boolean forward = event.character == '/' || event.character == '?';
+      ConnectionEditPart next = findConnection(node, current, forward);
+      navigateTo(next, event);
+    }
+    private void navigateIntoContainer(KeyEvent event)
+    {
+      GraphicalEditPart focus = getFocus();
+      List childList = focus.getChildren();
+
+      if (focus instanceof ExpandableGraphNodeEditPart)
+      {
+        if (!((ExpandableGraphNodeEditPart)focus).isExpanded())
+        {
+          ((ExpandableGraphNodeEditPart)focus).doPerformExpandOrCollapse();
+        }
+      }
+
+      Point tl = focus.getContentPane().getBounds().getTopLeft();
+      int minimum = Integer.MAX_VALUE;
+      int current;
+      GraphicalEditPart closestPart = null;
+      for (int i = 0; i < childList.size(); i++)
+      {
+        GraphicalEditPart ged = (GraphicalEditPart) childList.get(i);
+        Rectangle childBounds = ged.getFigure().getBounds();
+        current = (childBounds.x - tl.x) + (childBounds.y - tl.y);
+        if (current < minimum)
+        {
+          minimum = current;
+          closestPart = ged;
+        }
+      }
+      if (closestPart != null)
+        navigateTo(closestPart, event);
+    }
+    private boolean navigateJumpSibling(KeyEvent event, int direction)
+    {
+      return false;
+    }
+    private boolean navigateNextSibling(KeyEvent event, int direction)
+    {
+      GraphicalEditPart epStart = getFocus();
+      IFigure figure = epStart.getFigure();
+      Point pStart = getInterestingPoint(figure);
+      figure.translateToAbsolute(pStart);
+      EditPart next =
+        findSibling(getNavigationSiblings(), pStart, direction, epStart);
+      if (next == null)
+        return false;
+      navigateTo(next, event);
+      return true;
+    }
+    private void navigateOut(KeyEvent event)
+    {
+      if (getFocus() == null
+        || getFocus() == getViewer().getContents()
+        || getFocus().getParent() == getViewer().getContents())
+        return;
+
+      EditPart parent = getFocus().getParent();
+      if (((event.stateMask & SWT.ALT) != 0) && (event.keyCode == SWT.ARROW_LEFT))
+      {
+        if ((parent != null) && (parent instanceof ExpandableGraphNodeEditPart))
+        {
+          if (((ExpandableGraphNodeEditPart)parent).isExpanded())
+          {
+            ((ExpandableGraphNodeEditPart)parent).doPerformExpandOrCollapse();
+          }
+        }
+      }
+      navigateTo(parent, event);
+//      navigateTo(getFocus().getParent(), event);
+    }
+    private void navigateOutOfConnection(KeyEvent event)
+    {
+      GraphicalEditPart cached = getCachedNode();
+      ConnectionEditPart conn = (ConnectionEditPart) getFocus();
+      if (cached != null
+        && (cached == conn.getSource() || cached == conn.getTarget()))
+        navigateTo(cached, event);
+      else
+        navigateTo(conn.getSource(), event);
+    }
+    void navigateTo(EditPart part, KeyEvent event)
+    {
+      if (part == null)
+        return;
+      if ((event.stateMask & SWT.SHIFT) != 0)
+      {
+        getViewer().appendSelection(part);
+        getViewer().setFocus(part);
+      }
+      else if ((event.stateMask & SWT.CONTROL) != 0)
+        getViewer().setFocus(part);
+      else
+        getViewer().select(part);
+    }
+    private void processSelect(KeyEvent event)
+    {
+      EditPart part = getViewer().getFocusEditPart();
+      if ((event.stateMask & SWT.CONTROL) != 0
+        && part.getSelected() != EditPart.SELECTED_NONE)
+      {
+        getViewer().deselect(part);
+      }
+      else
+      {
+        getViewer().appendSelection(part);
+      }
+      getViewer().setFocus(part);
+    }
+    private void setCachedNode(GraphicalEditPart node)
+    {
+      if (node == null)
+        cachedNode = null;
+      else
+        cachedNode = new WeakReference(node);
+    }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDInheritanceViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDInheritanceViewer.java
new file mode 100644
index 0000000..de95c0c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDInheritanceViewer.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+             
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.SubstitutionGroupViewerRootEditPart;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDSchema;
+
+
+public class XSDInheritanceViewer extends BaseGraphicalViewer
+{               
+  protected SubstitutionGroupViewerRootEditPart inheritanceViewerRootEditPart;
+  public XSDInheritanceViewer(XSDEditor editor, ISelectionProvider menuSelectionProvider)
+  {
+    super(editor, menuSelectionProvider);       
+  }        
+
+  public void setInput(XSDConcreteComponent component)
+  {               
+    if (isInputEnabled)
+    {
+      input = null;         
+
+      if (component instanceof XSDSchema ||
+          component instanceof XSDComplexTypeDefinition)
+      {            
+        input = component;
+      }
+      
+      inheritanceViewerRootEditPart.setInput(input);       
+    }
+  }     
+
+  public void setSelection(XSDConcreteComponent component)
+  {                    
+    if (isSelectionEnabled)
+    {                      
+      //System.out.println("XSDComponentViewer.setSelection(" + component + ")");
+      List editPartList = new ArrayList();    
+      if (component instanceof XSDElementDeclaration || 
+          component instanceof XSDSchema ||
+          component instanceof XSDModelGroup ||        
+          component instanceof XSDModelGroupDefinition ||
+          component instanceof XSDComplexTypeDefinition)
+      {                     
+        if (component != null)
+        {
+          EditPart editPart = getEditPart(inheritanceViewerRootEditPart, component);    
+          if (editPart != null)
+          { 
+            // TODO ... take a look at this to figure our why a newly added component
+            // seems to have the wrong bounds at this point... is this a layout issue?           
+            // As a temp hack I'm ignoring the selection of component with bounds (x, y) == (0, 0)
+            // Perhaps a delayed selection is required?
+            Rectangle bounds = ((GraphicalEditPart)editPart).getFigure().getBounds();
+            if (bounds.x > 0 || bounds.y > 0)
+            {
+              editPartList.add(editPart); 
+            }
+          } 
+        }    
+      }              
+      setSelection(new StructuredSelection(editPartList));
+    }
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#hookControl()
+   */
+  protected void hookControl()
+  {
+    super.hookControl();
+    inheritanceViewerRootEditPart = new SubstitutionGroupViewerRootEditPart();
+    setContents(inheritanceViewerRootEditPart);
+  }
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupChildUtility.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupChildUtility.java
new file mode 100644
index 0000000..9fa84bd
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupChildUtility.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.xsd.XSDElementDeclaration;
+
+/**
+ * @author ernest
+ *
+ * To change this generated comment go to 
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class XSDSubstitutionGroupChildUtility
+{
+
+  /**
+   * @param declaration
+   * @return List
+   */
+  public static List getModelChildren(XSDElementDeclaration declaration)
+  {
+    ArrayList children = new ArrayList();
+    List substitutionGroup = declaration.getSubstitutionGroup();
+    for (int i = 0, size = substitutionGroup.size(); i < size; i++)
+    {
+      XSDElementDeclaration element = (XSDElementDeclaration) substitutionGroup.get(i);
+      if (declaration.equals(element.getSubstitutionGroupAffiliation()))
+      {
+        children.add(element);
+      }
+    }
+    return children;
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupsViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupsViewer.java
new file mode 100644
index 0000000..cd3074f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupsViewer.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph;
+             
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.SubstitutionGroupViewerRootEditPart;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDSchema;
+
+
+public class XSDSubstitutionGroupsViewer extends BaseGraphicalViewer
+{               
+  protected SubstitutionGroupViewerRootEditPart subGroupViewerRootEditPart;
+  public XSDSubstitutionGroupsViewer(XSDEditor editor, ISelectionProvider menuSelectionProvider)
+  {
+    super(editor, menuSelectionProvider);       
+  }        
+
+  public void setInput(XSDConcreteComponent component)
+  {               
+    if (isInputEnabled)
+    {
+      input = null;         
+
+      if (component instanceof XSDElementDeclaration || 
+          component instanceof XSDSchema)
+      {            
+        input = component;
+      }
+      
+      subGroupViewerRootEditPart.setInput(input);       
+    }
+  }     
+
+  public void setSelection(XSDConcreteComponent component)
+  {                    
+    if (isSelectionEnabled)
+    {                      
+      //System.out.println("XSDComponentViewer.setSelection(" + component + ")");
+      List editPartList = new ArrayList();    
+      if (component instanceof XSDElementDeclaration || 
+          component instanceof XSDSchema ||
+          component instanceof XSDModelGroup ||        
+          component instanceof XSDModelGroupDefinition ||
+          component instanceof XSDComplexTypeDefinition)
+      {                     
+        if (component != null)
+        {
+          EditPart editPart = getEditPart(subGroupViewerRootEditPart, component);    
+          if (editPart != null)
+          { 
+            // TODO ... take a look at this to figure our why a newly added component
+            // seems to have the wrong bounds at this point... is this a layout issue?           
+            // As a temp hack I'm ignoring the selection of component with bounds (x, y) == (0, 0)
+            // Perhaps a delayed selection is required?
+            Rectangle bounds = ((GraphicalEditPart)editPart).getFigure().getBounds();
+            if (bounds.x > 0 || bounds.y > 0)
+            {
+              editPartList.add(editPart); 
+            }
+          } 
+        }    
+      }              
+      setSelection(new StructuredSelection(editPartList));
+    }
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#hookControl()
+   */
+  protected void hookControl()
+  {
+    super.hookControl();
+    subGroupViewerRootEditPart = new SubstitutionGroupViewerRootEditPart();
+    setContents(subGroupViewerRootEditPart);
+  }
+
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/BaseEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/BaseEditPart.java
new file mode 100644
index 0000000..f98da1a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/BaseEditPart.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                 
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
+import org.eclipse.wst.xsd.ui.internal.graph.model.ModelAdapterListener;
+import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
+
+
+public abstract class BaseEditPart extends AbstractGraphicalEditPart implements ModelAdapterListener, GraphicsConstants, IFeedbackHandler
+{
+	protected boolean isSelected = false;
+	/**
+	 * Activates the <code>EditPart</code> by setting the
+	 * appropriate flags, and activating its children.
+	 * activation signals to the EditPart that is should start observing
+	 * it's model, and that is should support editing at this time.
+	 * An EditPart will have a parent prior to activiation.
+	 * @see #deactivate()
+	 */
+	public void activate() 
+  {
+		super.activate();         
+    XSDModelAdapterFactory.addModelAdapterListener(getModel(), this);  
+	}
+	/** 
+	 * Apart from the deactivation done in super, the source
+	 * and target connections are deactivated, and the visual
+	 * part of the this is removed.
+	 *
+	 * @see #activate() 
+	 */
+	public void deactivate() 
+  {
+    XSDModelAdapterFactory.removeModelAdapterListener(getModel(), this);  
+		super.deactivate();
+	}   
+    
+  protected void createEditPolicies() 
+  {
+  }  
+
+  protected EditPart createChild(Object model) 
+  {
+    return XSDEditPartFactory.getInstance().createEditPart(this, model);
+  } 
+
+  public void propertyChanged(Object object, String property)
+  {                                                                                                  
+    refresh(); 
+  }    
+
+  //public BaseGraphicalViewer getBaseGraphicalViewer()
+  //{
+  //  return (BaseGraphicalViewer)getViewer();
+  //}
+
+  public IFigure getSelectionFigure()
+  {
+    return getFigure();
+  }
+  
+  
+  public void addFeedback()
+  {
+    isSelected = true;
+    refreshVisuals();
+  }
+
+  public void removeFeedback()
+  {
+    isSelected = false;
+    refreshVisuals();
+  }  
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/CategoryEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/CategoryEditPart.java
new file mode 100644
index 0000000..afffaad
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/CategoryEditPart.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                           
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.ScrollPane;
+import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.ViewportLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
+
+
+public class CategoryEditPart extends BaseEditPart
+{
+  protected ScrollPane scrollpane;
+  protected Label label;
+  protected ContainerFigure outerPane, r;
+  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
+
+  public int getType()
+  {
+    return ((Category)getModel()).getGroupType();
+  }
+
+  protected IFigure createFigure()
+  {           
+    outerPane = new ContainerFigure();    
+    outerPane.setBorder(new RoundedLineBorder(1, 6));
+    outerPane.setForegroundColor(categoryBorderColor);
+
+    r = new ContainerFigure();  
+    r.setOutline(false);
+    r.setMinimumSize(new Dimension(0, 0));
+    r.setFill(true);
+    r.setBackgroundColor(GraphicsConstants.elementBackgroundColor);
+    outerPane.add(r);
+    
+    int minHeight = 250;
+    switch (getType())
+    {
+    	case Category.DIRECTIVES :
+		case Category.NOTATIONS :
+		{
+			minHeight = 50;
+			break;	
+		}
+		case Category.ATTRIBUTES :
+		case Category.GROUPS :		  
+		{
+			minHeight = 100;
+			break;
+		}
+    }
+    
+	final int theMinHeight = minHeight;
+    FillLayout outerLayout = new FillLayout()
+    {
+      protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
+      {
+        Dimension d = super.calculatePreferredSize(parent, width, height);
+        d.union(new Dimension(100, theMinHeight));
+        return d;
+      }
+    };
+    //outerLayout.setHorizontal(false);
+    outerPane.setLayoutManager(outerLayout);
+    
+   
+    label = new Label();
+    label.setForegroundColor(ColorConstants.black);
+    label.setBorder(new MarginBorder(2, 4, 2, 4));
+    r.add(label); //Holder);
+
+    RectangleFigure line = new RectangleFigure();
+    line.setPreferredSize(20, 1);
+    outerPane.add(line);
+
+
+    scrollpane = new ScrollPane();
+    scrollpane.setForegroundColor(ColorConstants.black);
+    scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC); //ScrollPane.ALWAYS);
+    outerPane.add(scrollpane);
+
+    ContainerFigure pane = new ContainerFigure();
+    pane.setBorder(new MarginBorder(5, 8, 5, 8));
+    ContainerLayout layout = new ContainerLayout();
+    layout.setHorizontal(false);
+    layout.setSpacing(0);
+    pane.setLayoutManager(layout);
+
+    Viewport viewport = new Viewport();
+    viewport.setContentsTracksHeight(true);
+    ViewportLayout viewportLayout = new ViewportLayout()
+    {
+      protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
+      {
+        Dimension d = super.calculatePreferredSize(parent, width, height);
+        d.height = Math.min(d.height, theMinHeight - 25); //getViewer().getControl().getBounds().height);
+        return d;
+      }
+    };
+    viewport.setLayoutManager(viewportLayout);
+
+    scrollpane.setViewport(viewport);
+    scrollpane.setContents(pane);
+
+    return outerPane;
+  }  
+
+  protected List getModelChildren() 
+  {            
+    return ((Category)getModel()).getChildren();
+  }  
+        
+  public void refreshVisuals()
+  {
+    outerPane.setBorder(new RoundedLineBorder(isSelected ? ColorConstants.black : categoryBorderColor, isSelected ? 1 : 1, 6));
+    outerPane.repaint();
+// Uncomment this for coloured titles
+//    r.setBackgroundColor(isSelected ? ColorConstants.blue : GraphicsConstants.elementBackgroundColor);
+//    label.setForegroundColor(isSelected ? ColorConstants.white : ColorConstants.black);
+//    r.repaint();
+//    outerPane.setForegroundColor(isSelected ? ColorConstants.black : elementBorderColor);
+    
+    Category category = (Category)getModel();
+    // temp hack --- added empty space to make the min width of groups bigger  
+    label.setText("  " + category.getName() + "                                                    ");
+  } 
+  
+  public ScrollPane getScrollPane()
+  {
+    return scrollpane;
+  }
+  
+  public IFigure getContentPane()
+  {
+    return scrollpane.getContents();
+  }  
+
+  public void scrollTo(AbstractGraphicalEditPart topLevel)
+  {
+    Rectangle topLevelBounds = topLevel.getFigure().getBounds();
+    Rectangle categoryBounds = getFigure().getBounds();
+    int scrollValue = scrollpane.getVerticalScrollBar().getValue();
+    int location = topLevelBounds.y + scrollValue - categoryBounds.y;
+    scrollpane.scrollVerticalTo(location - categoryBounds.height/2);
+  }
+
+  protected EditPart createChild(Object model)
+  {
+    EditPart editPart = new TopLevelComponentEditPart();
+    editPart.setModel(model);
+    editPart.setParent(this);
+    return editPart;
+  }
+  
+  protected void createEditPolicies()
+  { 
+    selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
+    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);   
+  }  
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeDefinitionEditPart.java
new file mode 100644
index 0000000..620cdc5
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeDefinitionEditPart.java
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                      
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.requests.LocationRequest;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.CenteredIconFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+
+              
+
+public class ComplexTypeDefinitionEditPart extends GraphNodeEditPart
+{
+  protected ContainerFigure contentFigure;   
+  protected Label label;     
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
+  protected CenteredIconFigure centeredIconFigure;  
+  protected RectangleFigure preceedingSpace;  
+  protected ContainerFigure contentPane;
+
+  public XSDComplexTypeDefinition getXSDComplexTypeDefinition()
+  {         
+    return (XSDComplexTypeDefinition)getModel();
+  }  
+
+  protected boolean isConnectedEditPart()
+  {
+    return false;
+  } 
+
+  protected GraphNodeFigure createGraphNodeFigure()  
+  {
+    GraphNodeFigure figure = new GraphNodeFigure();
+
+    figure.getOutlinedArea().setBorder(new RoundedLineBorder(1, 6));
+    figure.getOutlinedArea().setFill(true);
+    figure.getOutlinedArea().setLayoutManager(new FillLayout(true));
+
+    figure.getInnerContentArea().getContainerLayout().setHorizontal(true);
+
+    preceedingSpace = new RectangleFigure();
+    preceedingSpace.setVisible(false);
+    figure.getInnerContentArea().add(preceedingSpace, 0);
+
+    contentPane = new ContainerFigure();
+    contentPane.getContainerLayout().setHorizontal(false); 
+    contentPane.getContainerLayout().setSpacing(5);   
+    contentPane.setBorder(new MarginBorder(5, 5, 5, 5));
+    figure.getInnerContentArea().add(contentPane);
+    
+    label = new Label();    
+    label.setBorder(new MarginBorder(0, 5, 5, 5));
+    figure.getIconArea().add(label);     
+    label.setFont(mediumBoldFont);
+ 
+    figure.getInnerContentArea().getContainerLayout().setSpacing(5);   
+    figure.getInnerContentArea().setBorder(new MarginBorder(5, 5, 5, 5));
+    
+    return figure;
+  }      
+                                                                    
+  protected EditPart createChild(Object model) 
+  {   
+    EditPart editPart = null;                                     
+    if (model == getModel())
+    {
+      editPart = new ComplexTypeInheritedContentEditPart();
+      editPart.setModel(model);
+      editPart.setParent(this);
+    }
+    else
+    {
+      editPart = super.createChild(model);
+    }            
+    return editPart;
+  } 
+
+  protected List getModelChildren() 
+  {                           
+    List list = new ArrayList();
+
+    XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)getModel();
+
+    if (ct.getDerivationMethod().getName().equals("extension"))
+    {
+      list.add(getModel());
+    }  
+
+    list.addAll(XSDChildUtility.getModelChildren(getModel()));
+    return list;
+  }
+
+  public IFigure getContentPane()  
+  {
+    return contentPane;
+  }
+                        
+  protected void refreshVisuals()
+  { 
+    XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)getModel();                   
+
+    String name = ctd.getName();
+    if (name == null)
+    {
+      try
+      {
+        if (label != null)
+        {
+          graphNodeFigure.getIconArea().remove(label);
+        }
+        label = null;
+      }
+      catch (Exception e)
+      {
+      }
+    }
+    else
+    {
+      if (label == null)
+      {
+        label = new Label();    
+        label.setBorder(new MarginBorder(0, 5, 5, 5));
+        ((GraphNodeFigure)getFigure()).getIconArea().add(label);     
+        label.setFont(mediumBoldFont);
+      }
+      graphNodeFigure.getIconArea().add(label);
+      label.setText(name);
+    }
+
+    // provides some room if we need to draw lines for the inherited
+    boolean includesInheritedContent = getModelChildren().contains(getModel());
+    preceedingSpace.setPreferredSize(includesInheritedContent ? new Dimension(10, 1) : new Dimension(0, 0));
+
+    if (XSDGraphUtil.isEditable(getModel()))
+    { 
+      graphNodeFigure.setForegroundColor(isSelected ? ColorConstants.black : elementBorderColor);
+      if (label != null)
+      label.setForegroundColor(elementBorderColor);
+    }
+    else
+    {
+      graphNodeFigure.setForegroundColor(isSelected ? ColorConstants.black : readOnlyBorderColor);
+      if (label != null)
+      label.setForegroundColor(readOnlyBorderColor);
+    }
+  }
+             
+  protected void performDirectEdit()
+  {  
+    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, (XSDComplexTypeDefinition)getModel());   
+    simpleDirectEditPolicy.setDelegate(manager);
+    manager.show();
+  }    
+            
+
+  protected void createEditPolicies()
+  {  
+    super.createEditPolicies();
+  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
+  } 
+       
+
+  public void performRequest(Request request)
+  {
+  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
+        request.getType() == RequestConstants.REQ_OPEN)
+    {     
+      if (XSDGraphUtil.isEditable(getModel()))
+      {                 
+        LocationRequest locationRequest = (LocationRequest)request;
+        Point p = locationRequest.getLocation();
+        
+        if (label != null && hitTest(label, p))
+        {
+  		    performDirectEdit();
+        }
+      }
+    }
+  }
+  
+  public void doEditName()
+  {
+    performDirectEdit();
+  }
+} 
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeInheritedContentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeInheritedContentEditPart.java
new file mode 100644
index 0000000..0295265
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeInheritedContentEditPart.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+// This is a dashed box that displays the inherited content of a complex type
+//
+public class ComplexTypeInheritedContentEditPart extends BaseEditPart
+{
+  protected Label label;     
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
+  protected boolean isParentExpanded;
+               
+  public ComplexTypeInheritedContentEditPart()
+  {
+    super();
+  }   
+                 
+  public XSDComplexTypeDefinition getXSDComplexTypeDefinition()
+  {         
+    return (XSDComplexTypeDefinition)getModel();
+  }
+                  
+  protected IFigure createFigure()
+  {                            
+    ContainerFigure figure = new ContainerFigure();
+    figure.getContainerLayout().setHorizontal(false);
+    figure.getContainerLayout().setBorder(5);
+    figure.getContainerLayout().setSpacing(5);
+    figure.setBorder(new RoundedLineBorder(ColorConstants.gray, 1, 6, Graphics.LINE_DASH));
+    return figure;
+  }    
+           
+  protected List getModelChildren() 
+  {                                              
+    XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)getModel();
+
+    List list = new ArrayList();
+
+    if (ct.getDerivationMethod().getName().equals("extension") && !isParentExpanded)
+    {
+      XSDTypeDefinition type = ct.getBaseTypeDefinition();
+      Iterator iter = XSDChildUtility.getModelChildren(type).iterator();
+      boolean cont = true;
+      while (cont)
+      {
+        while (iter.hasNext())
+        {
+          list.add(0, iter.next());
+        }
+        
+        if (type instanceof XSDComplexTypeDefinition)
+        {
+          XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)type;
+          type = ctd.getBaseTypeDefinition();
+                    
+					// defect 264957 - workbench hangs when modifying complex content
+					// Since we don't filter out the current complexType from
+					// the combobox, we can potentially have an endless loop
+					if (ctd == type)
+					{
+						cont = false;
+						break;
+					}
+
+          if (ctd.getDerivationMethod().getName().equals("extension"))
+          {
+            iter = XSDChildUtility.getModelChildren(type).iterator();
+          }
+          else
+          {
+            cont = false;
+          }
+        }
+        else
+        {
+          cont = false;
+        }
+      }
+    }
+    return list;
+  }
+
+  protected void refreshVisuals()
+  { 
+    List children = getModelChildren();
+    figure.setVisible(children.size() > 0);   
+    // todo set preferredSize to 0 ?
+  }
+
+  protected void performDirectEdit()
+  {
+    // Why are we allowing direct editing when the label is null?
+    // Should remove the policy
+    if (label != null)
+    {
+      ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, (XSDComplexTypeDefinition)getModel());   
+      simpleDirectEditPolicy.setDelegate(manager);
+      manager.show();
+    }
+  }    
+            
+
+  protected void createEditPolicies()
+  {  
+    super.createEditPolicies();
+    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
+  } 
+       
+
+  public void performRequest(Request request)
+  {
+    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
+    {     
+      if (XSDGraphUtil.isEditable(getModel()))
+      {
+        performDirectEdit();
+      }
+    }
+  } 
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComponentViewerRootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComponentViewerRootEditPart.java
new file mode 100644
index 0000000..fa8d191
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComponentViewerRootEditPart.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                      
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Panel;
+import org.eclipse.gef.EditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerLayout;
+
+              
+
+public class ComponentViewerRootEditPart extends BaseEditPart
+{
+  protected final static String MESSAGE_PLACE_HOLDER = "MESSAGE_PLACE_HOLDER";
+  protected Object input;              
+
+  public void setInput(Object input)
+  {
+    this.input = input;
+    refreshChildren();
+  }
+
+  protected IFigure createFigure()
+  {
+    Panel panel = new Panel();
+    ContainerLayout layout = new ContainerLayout();
+    layout.setBorder(60);
+    panel.setLayoutManager(layout);
+    return panel;
+  }   
+           
+
+  protected List getModelChildren() 
+  {               
+    List list = new ArrayList();
+    if (input != null)
+    {
+      list.add(input);
+    }
+    else
+    {
+      list.add(MESSAGE_PLACE_HOLDER);
+    }
+    return list;
+  }         
+
+  protected EditPart createChild(Object model) 
+  { 
+    EditPart editPart = null;
+    if (model == MESSAGE_PLACE_HOLDER)
+    {
+      editPart = new MessageEditPart();
+      editPart.setModel(model);
+    }
+    else
+    {
+      editPart = super.createChild(model);
+    }
+    return editPart;
+  } 
+
+  protected void createEditPolicies()
+  {  
+  }             
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ElementDeclarationEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ElementDeclarationEditPart.java
new file mode 100644
index 0000000..249c88b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ElementDeclarationEditPart.java
@@ -0,0 +1,460 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                   
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.requests.LocationRequest;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
+import org.eclipse.wst.xsd.ui.internal.gef.util.figures.SpacingFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDSubstitutionGroupChildUtility;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDSubstitutionGroupsViewer;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComboBoxCellEditorManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.w3c.dom.Element;
+
+              
+
+public class ElementDeclarationEditPart extends ExpandableGraphNodeEditPart
+{
+  public Label label;  
+  protected Label contentIconLabel;
+  protected Label typeValueLabel;
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
+  protected boolean isContentIconLabelSelected = false;
+
+  protected final static String ELEMENT_TYPE_PLACE_HOLDER = "ELEMENT_TYPE_PLACE_HOLDER";
+
+  public XSDParticle getXSDParticle()
+  {
+    Object o = getXSDElementDeclaration().getContainer(); 
+    return (o instanceof XSDParticle) ? (XSDParticle)o : null;
+  }        
+
+  public XSDElementDeclaration getXSDElementDeclaration()
+  {         
+    return (XSDElementDeclaration)getModel();
+  }
+     
+  protected boolean isDefaultExpanded()
+  {
+    // hack to expand up to its content.  The previous test didn't appear to work
+    int depth = 0;
+    for (EditPart part = this; part != null; part = part.getParent())
+    {
+      depth++;
+    }      
+    return depth <= 3;
+  }
+                     
+  protected GraphNodeFigure createGraphNodeFigure()
+  {
+    ExpandableGraphNodeFigure figure = new ExpandableGraphNodeFigure();
+
+    figure.getOutlinedArea().setFill(true);
+    figure.getOutlinedArea().setLayoutManager(new FillLayout());
+
+    label = new Label();    
+    figure.getIconArea().add(label);     
+    label.setFont(mediumBoldFont);
+    
+    SpacingFigure spacingFigure = new SpacingFigure();
+    figure.getIconArea().add(spacingFigure);
+    
+    contentIconLabel = new Label();
+    //contentIcon.setBorder(new MarginBorder(2, 2, 2, 10));
+    figure.getIconArea().add(contentIconLabel);
+
+    // A sneaky null check.... getViewer() does a getRoot(), but getRoot() might be null
+    // same with getParent()
+    if (getParent() != null && getRoot() != null && getViewer() instanceof XSDSubstitutionGroupsViewer)
+    {
+      figure.getOuterContentArea().getContainerLayout().setSpacing(5);
+    }
+    else
+    {  
+      RectangleFigure line = new RectangleFigure();
+      line.setPreferredSize(20, 1);   
+      figure.getOutlinedArea().add(line, 1);
+
+      figure.getInnerContentArea().setLayoutManager(new FillLayout(2));
+      figure.getInnerContentArea().setBorder(new MarginBorder(2,2,2,1));
+
+      ContainerFigure labelGroup = new ContainerFigure();   
+      Label typeLabel = new Label("type");
+      labelGroup.add(typeLabel);
+      labelGroup.setBorder(new MarginBorder(0, 4, 0, 4));      
+
+      Label equalsLabel = new Label(" = ");
+      labelGroup.add(equalsLabel);
+
+      typeValueLabel = new Label();                         
+      labelGroup.add(typeValueLabel);
+      figure.getOutlinedArea().add(labelGroup, 2);
+    }
+    return figure;
+  }          
+
+  protected ExpandableGraphNodeFigure getExpandableGraphNodeFigure()
+  {
+    return (ExpandableGraphNodeFigure)graphNodeFigure;
+  }                                            
+                    
+  protected List getModelChildren() 
+  {
+    XSDTypeDefinition typeDef = getXSDElementDeclaration().getTypeDefinition();
+    
+    // Special case simple type.   Need to add it to the list as well
+    List list = new ArrayList();
+    if (typeDef instanceof XSDSimpleTypeDefinition)
+    {
+      list.add((XSDSimpleTypeDefinition)typeDef);
+      if (getExpandableGraphNodeFigure().isExpanded())
+      {
+        list.addAll(getModelChildrenHelper());
+      }
+      return list;
+    }
+    return getExpandableGraphNodeFigure().isExpanded() ? getModelChildrenHelper() : Collections.EMPTY_LIST;
+  }  
+                       
+  protected List getModelChildrenHelper()
+  {
+    if (getViewer() instanceof XSDSubstitutionGroupsViewer)
+    {
+      return XSDSubstitutionGroupChildUtility.getModelChildren(getXSDElementDeclaration().getResolvedElementDeclaration());
+    }
+    else
+    {
+      return XSDChildUtility.getModelChildren(getXSDElementDeclaration().getResolvedElementDeclaration());
+    }
+  }           
+                
+  protected void refreshContentIcon()
+  {
+    String iconName = null;
+    XSDTypeDefinition td = getXSDElementDeclaration().getResolvedElementDeclaration().getTypeDefinition();
+
+    if (td instanceof XSDComplexTypeDefinition)
+    {
+      XSDComplexTypeDefinition complexTypeDefinition = (XSDComplexTypeDefinition)td;
+      if (complexTypeDefinition.getAttributeUses().size() > 0)
+      {
+        iconName = "icons/XSDAttribute.gif";  
+      }  
+    }  
+    Image image = iconName != null ? XSDEditorPlugin.getXSDImage(iconName) : null;
+    contentIconLabel.setIcon(image);    
+  }
+
+  protected void refreshVisuals()
+  { 
+    String text = getXSDElementDeclaration().isElementDeclarationReference() ?
+                  getXSDElementDeclaration().getResolvedElementDeclaration().getQName(getXSDElementDeclaration().getSchema()) :
+                  getXSDElementDeclaration().getName();
+
+    label.setText(text);
+    
+    ContainerFigure rectangle = graphNodeFigure.getOutlinedArea();
+    if (XSDGraphUtil.isEditable(getXSDElementDeclaration()))
+    {
+      rectangle.setBorder(new LineBorder(isSelected ? ColorConstants.black : elementBorderColor, 2));
+      rectangle.setBackgroundColor(elementBackgroundColor);
+      rectangle.setForegroundColor(elementBorderColor);
+      
+      graphNodeFigure.getInnerContentArea().setForegroundColor(ColorConstants.black);
+      if (XSDGraphUtil.isEditable(getXSDElementDeclaration().getResolvedElementDeclaration()))
+      { 
+        // give label 'editable' colour
+        graphNodeFigure.getInnerContentArea().setForegroundColor(elementLabelColor);    
+      }
+      else
+      {   
+        // give label 'read only' colour
+        graphNodeFigure.getInnerContentArea().setForegroundColor(elementBorderColor);
+      }
+      label.setBackgroundColor(elementBackgroundColor);
+      label.setForegroundColor(elementLabelColor);
+    }
+    else
+    {
+      rectangle.setBorder(new LineBorder(isSelected ? ColorConstants.black : readOnlyBorderColor, 2));
+      rectangle.setBackgroundColor(readOnlyBackgroundColor);
+      rectangle.setForegroundColor(readOnlyBorderColor);
+      graphNodeFigure.getInnerContentArea().setForegroundColor(readOnlyBorderColor);     
+      label.setBackgroundColor(readOnlyBackgroundColor);
+    }
+                                                                                   
+    if (getXSDElementDeclaration().isElementDeclarationReference())
+    {
+      label.setIcon(XSDEditorPlugin.getXSDImage("icons/GraphViewElementRef.gif"));
+      label.setBorder(new MarginBorder(0, 0, 0, 4)); 
+    }
+    else
+    {                     
+      label.setIcon(null);
+      label.setBorder(new MarginBorder(0, 6, 0, 4));
+    }
+    
+    if (getXSDParticle() != null)
+    { 
+      refreshOccurenceLabel(getXSDParticle().getMinOccurs(), getXSDParticle().getMaxOccurs());
+    }                      
+     
+   
+    if (typeValueLabel != null)
+    {
+      XSDElementDeclaration ed = getXSDElementDeclaration();
+      if (ed.getElement() != null)
+      {
+        String type = ed.getElement().getAttribute("type");
+        if (type == null)
+        {
+          type = "";
+        }
+        if (!getXSDElementDeclaration().isElementDeclarationReference())
+				{   
+          typeValueLabel.setText(type.equals("") ? "<anonymous>" : type);
+				}
+        else // if it is a ref, we show the resolved type
+        {
+        	String resolvedType = "";
+        	if (ed.getResolvedElementDeclaration() != null)
+        	{
+        		if (ed.getResolvedElementDeclaration().getTypeDefinition() != null)
+        	  {
+        	    resolvedType = ed.getResolvedElementDeclaration().getTypeDefinition().getQName(ed.getSchema());
+              
+              // if null, it has an anonymous type that has no resolved type
+              if (resolvedType == null)
+              {
+                resolvedType = "<anonymous>";
+              }
+        	  }
+        	}
+          typeValueLabel.setText(resolvedType);
+				}
+      }
+    }
+    refreshContentIcon();
+  } 
+ 
+                                                                        
+  public void performRequest(Request request)
+  {
+  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
+        request.getType() == RequestConstants.REQ_OPEN)
+    {                                        
+      if (XSDGraphUtil.isEditable(getXSDElementDeclaration()))
+      {
+        if (request instanceof LocationRequest)
+        {
+          LocationRequest locationRequest = (LocationRequest)request;
+          Point p = locationRequest.getLocation();
+          isContentIconLabelSelected = false;
+          
+          if (hitTest(label, p))
+          {
+  		      performDirectEditForLabel();
+          }
+          else if (hitTest(typeValueLabel, p))
+          {                             
+   		      performDirectEditForTypeValueLabel();
+          }
+        }
+      }
+    }
+  } 
+         
+  private void performDirectEditForTypeValueLabel()
+  {
+		if (!getXSDElementDeclaration().isElementDeclarationReference())
+		{    
+//      TypeReferenceDirectEditManager manager = new TypeReferenceDirectEditManager(this, getXSDElementDeclaration(), typeValueLabel);   
+//      simpleDirectEditPolicy.setDelegate(manager);
+//      manager.show();
+//TODO remove TypeReferenceDirectEditManager since it is not used any longer
+            
+            Shell shell = Display.getCurrent().getActiveShell();
+            IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
+            IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+            IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
+            IFile currentIFile = ((IFileEditorInput)editorPart.getEditorInput()).getFile();
+            
+            XSDSchema schema = getXSDElementDeclaration().getSchema();
+                
+            XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
+            XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
+            provider.setDialog(dialog);
+            
+            dialog.setBlockOnOpen(true);
+            dialog.create();
+
+            if (dialog.open() == Window.OK) {
+                Element element = getXSDElementDeclaration().getElement();
+                XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
+                helper.setType(element, "type", dialog.getSelection());
+            }        
+
+            
+		}
+		// just ignore type edit for element ref's
+  }                                                                
+
+                                                       
+  private void performDirectEditForLabel()
+  {    
+    if (getXSDElementDeclaration().isElementDeclarationReference())   
+    {
+      ComboBoxCellEditorManager manager = new ComboBoxCellEditorManager(this, label)
+      {
+         protected List computeComboContent()
+         {             
+           XSDSchema schema = getXSDElementDeclaration().getSchema();
+           List globalElementNameList = new ArrayList();
+           if (schema != null)
+           {
+             TypesHelper typesHelper = new TypesHelper(schema);
+             globalElementNameList = typesHelper.getGlobalElements();
+           }                                           
+           return globalElementNameList;
+         }
+
+         public void performModify(String value)
+         { 
+           getXSDElementDeclaration().getElement().setAttribute("ref", value);
+         }
+      };
+      simpleDirectEditPolicy.setDelegate(manager);
+      manager.show();
+    }
+    else
+    {
+      ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, getXSDElementDeclaration());   
+      simpleDirectEditPolicy.setDelegate(manager);
+      manager.show();
+    }
+  }                                
+  
+
+  protected void createEditPolicies()
+  {  
+    super.createEditPolicies();
+  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
+  }
+  
+  
+  public void activate() 
+  {
+    super.activate();
+    if (getXSDParticle() != null)
+    {
+      XSDModelAdapterFactory.addModelAdapterListener(getXSDParticle(), this);
+    }
+  }
+  /** 
+   * Apart from the deactivation done in super, the source
+   * and target connections are deactivated, and the visual
+   * part of the this is removed.
+   *
+   * @see #activate() 
+   */
+  public void deactivate() 
+  {
+    if (getXSDParticle() != null)
+    {
+      XSDModelAdapterFactory.removeModelAdapterListener(getXSDParticle(), this);
+    }
+    super.deactivate();
+  }   
+
+  public boolean isContentIconLabelSelected()
+  {
+    return isContentIconLabelSelected;
+  }
+
+  protected void addChildVisual(EditPart childEditPart, int index)
+  {
+    IFigure child = ((GraphicalEditPart)childEditPart).getFigure();
+    if (childEditPart instanceof SimpleTypeDefinitionEditPart)
+    {
+      graphNodeFigure.getIconArea().add(child, index+ 1);
+      SpacingFigure spacingFigure = new SpacingFigure();
+      graphNodeFigure.getIconArea().add(spacingFigure, index+1);
+    }
+    else
+    {
+      getContentPane().add(child, index);
+    }
+  }
+  
+  protected void removeChildVisual(EditPart childEditPart)
+  {
+    IFigure child = ((GraphicalEditPart)childEditPart).getFigure();
+    if (childEditPart instanceof SimpleTypeDefinitionEditPart)
+    {
+      graphNodeFigure.getIconArea().remove(child);
+    }    
+    else
+    {
+      super.removeChildVisual(childEditPart);
+    }
+  }
+
+  public void doEditName()
+  {
+    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, getXSDElementDeclaration());
+    simpleDirectEditPolicy.setDelegate(manager);
+    manager.show();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ExpandableGraphNodeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ExpandableGraphNodeEditPart.java
new file mode 100644
index 0000000..1ad4057
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ExpandableGraphNodeEditPart.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                        
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.ActionEvent;
+import org.eclipse.draw2d.ActionListener;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LayoutManager;
+import org.eclipse.draw2d.MouseEvent;
+import org.eclipse.draw2d.MouseListener;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+
+                  
+
+public abstract class ExpandableGraphNodeEditPart extends RepeatableGraphNodeEditPart implements MouseListener, ActionListener
+{
+  protected boolean needToPerformDefaultExpansion = true;
+   
+  protected GraphNodeFigure createGraphNodeFigure()
+  {
+    return new ExpandableGraphNodeFigure();     
+  }
+
+  protected void addGraphNodeFigureListeners()
+  {                                                                    
+    getExpandableGraphNodeFigure().getInteractor().addMouseListener(this); 
+  }  
+            
+  protected ExpandableGraphNodeFigure getExpandableGraphNodeFigure()
+  {
+    return (ExpandableGraphNodeFigure)graphNodeFigure;
+  } 
+
+  public IFigure getContentPane()  
+  {
+    return getExpandableGraphNodeFigure().getOuterContentArea();
+  }
+    
+  protected boolean isDefaultExpanded()
+  {
+    return false;
+  }
+
+  protected boolean hasChildren()
+  {
+    return getModelChildrenHelper().size() > 0;
+  }         
+
+  protected abstract List getModelChildrenHelper();
+      
+
+  protected List getModelChildren() 
+  {                                                                             
+    return getExpandableGraphNodeFigure().isExpanded() ? getModelChildrenHelper() : Collections.EMPTY_LIST;
+  }  
+
+  protected void refreshChildren()
+  {    
+    if (needToPerformDefaultExpansion && isDefaultExpanded())
+    {
+      needToPerformDefaultExpansion = false;   
+      performExpandOrCollapseHelper();
+
+      super.refreshChildren();
+
+      EditPart root = getRoot();
+      if (root instanceof AbstractGraphicalEditPart)
+      {         
+        getContentPane().setVisible(true); 
+                    
+        IFigure rootFigure = ((AbstractGraphicalEditPart)root).getFigure();
+        invalidateAll(rootFigure);
+        rootFigure.validate();
+        rootFigure.repaint();
+      }     
+      getExpandableGraphNodeFigure().getInteractor().repaint();
+    } 
+    else
+    {
+      super.refreshChildren(); 
+    }   
+    getExpandableGraphNodeFigure().getInteractor().setVisible(hasChildren());
+  }
+
+
+  protected void performExpandOrCollapseHelper()
+  {
+    boolean isButtonExpanded = !getExpandableGraphNodeFigure().isExpanded();
+    getExpandableGraphNodeFigure().setExpanded(isButtonExpanded);
+  }
+
+  public void doPerformExpandOrCollapse()
+  {
+    performExpandOrCollapse();
+  }  
+  
+  public boolean isExpanded()
+  {
+    return getExpandableGraphNodeFigure().isExpanded();
+  }
+
+  protected void performExpandOrCollapse()
+  {
+    performExpandOrCollapseHelper();                              
+
+    boolean isButtonExpanded = getExpandableGraphNodeFigure().isExpanded();
+
+    refreshChildren();
+
+    EditPart root = getRoot();
+    if (root instanceof AbstractGraphicalEditPart)
+    {         
+      getContentPane().setVisible(isButtonExpanded); 
+                       
+      IFigure rootFigure = ((AbstractGraphicalEditPart)root).getFigure();
+      invalidateAll(rootFigure);
+      rootFigure.validate();
+      rootFigure.repaint();
+    }      
+    getExpandableGraphNodeFigure().getInteractor().repaint();
+  }
+
+  
+  protected void refreshOccurenceLabel(int min, int max)
+  {
+    super.refreshOccurenceLabel(min, max);
+
+    // TODO: revisit the 'hack' to understand why we need to do this 
+    // in order to get the view to layout propetly
+    //
+    IFigure thisFigure = getFigure();
+    invalidateAll(thisFigure);
+    thisFigure.validate();
+    thisFigure.repaint();
+  }
+
+  protected void invalidateAll(IFigure figure)
+  {
+    figure.invalidate();   
+    LayoutManager manager = figure.getLayoutManager();
+    if (manager != null)
+    {
+      manager.invalidate();
+    }
+    for (Iterator i = figure.getChildren().iterator(); i.hasNext(); )
+    {
+      IFigure child = (IFigure)i.next();
+      invalidateAll(child);
+    }
+  } 
+
+  
+  // implements MouseListener
+  // 
+  public void mouseDoubleClicked(MouseEvent me) 
+  {
+  }
+
+  public void mousePressed(MouseEvent me) 
+  {                             
+    me.consume();
+    needToPerformDefaultExpansion = false;
+    performExpandOrCollapse();  
+  }
+
+  public void mouseReleased(MouseEvent me) 
+  {
+  } 
+
+  public void actionPerformed(ActionEvent event) 
+  {                      
+    performExpandOrCollapse();
+  }   
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/GraphNodeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/GraphNodeEditPart.java
new file mode 100644
index 0000000..ce6ad0a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/GraphNodeEditPart.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                        
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.LocationRequest;
+import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ConnectedEditPartFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.GraphNodeDragTracker;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+
+              
+
+public abstract class GraphNodeEditPart extends BaseEditPart
+{
+  protected GraphNodeFigure graphNodeFigure;
+  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
+                                 
+  protected boolean isConnectedEditPart()
+  {
+    return true;
+  }
+
+  protected IFigure createFigure()
+  {                           
+    IFigure result = graphNodeFigure = createGraphNodeFigure();    
+    addGraphNodeFigureListeners();
+
+    if (isConnectedEditPart())
+    {
+      ConnectedEditPartFigure connectedEditPartFigure = createConnectedEditPartFigure();                                    
+      connectedEditPartFigure.add(graphNodeFigure);
+      result = connectedEditPartFigure;
+    }
+    return result;
+  }       
+           
+  protected ConnectedEditPartFigure createConnectedEditPartFigure()
+  {
+    ConnectedEditPartFigure connectedEditPartFigure = new ConnectedEditPartFigure(this)
+    {
+      public IFigure getSelectionFigure()
+      {
+        return graphNodeFigure.getOutlinedArea();
+      }
+
+      public IFigure getConnectionFigure()
+      {
+        return graphNodeFigure.getConnectionFigure();
+      }
+    };
+    return connectedEditPartFigure;
+  }                                
+
+  protected abstract GraphNodeFigure createGraphNodeFigure();           
+  
+  protected void addGraphNodeFigureListeners()
+  {
+  }
+ 
+  public IFigure getSelectionFigure()
+  {
+    return graphNodeFigure.getOutlinedArea();
+  }
+
+  public Rectangle getConnectionRectangle()
+  {
+    return graphNodeFigure.getConnectionRectangle();
+  }
+
+  protected void createEditPolicies()
+  { 
+    //installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new NonResizableEditPolicy());    
+    selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
+    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);   
+  }  
+
+  public DragTracker getDragTracker(Request request)
+  {
+    return new GraphNodeDragTracker((EditPart)this);
+  }   
+
+ protected EditPart getApplicableEditPart(EditPart editPart, Point p)
+  {        
+    while (true)
+    {    
+      EditPart parent = null;
+      if (editPart instanceof GraphNodeEditPart)
+      {                                  
+        IFigure f = ((GraphNodeEditPart)editPart).getSelectionFigure();
+        if (!hitTest(f, p))
+        {                                 
+          parent = editPart.getParent();        
+        }             
+      }   
+
+      if (parent != null)
+      {
+        editPart = parent;
+      }                   
+      else
+      {
+        break;
+      }
+    }         
+    return editPart;
+  }
+
+  public EditPart getTargetEditPart(Request request)   
+  { 
+    EditPart editPart = null;
+    if (request.getType() == REQ_SELECTION)
+    {                                                                       
+      if (request instanceof LocationRequest)
+      {
+        LocationRequest locationRequest = (LocationRequest)request;
+        Point p = locationRequest.getLocation();
+        editPart = getApplicableEditPart(this, p);
+      }
+    }
+    return (editPart != null) ? editPart : super.getTargetEditPart(request);
+  }   
+
+  public boolean hitTest(IFigure target, Point location)
+  {
+    Rectangle b = target.getBounds().getCopy();
+    target.translateToAbsolute(b);  
+    return b.contains(location);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/IFeedbackHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/IFeedbackHandler.java
new file mode 100644
index 0000000..24a0537
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/IFeedbackHandler.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+
+public interface IFeedbackHandler
+{
+  public void addFeedback();
+  public void removeFeedback();
+}              
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/MessageEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/MessageEditPart.java
new file mode 100644
index 0000000..bbb7f92
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/MessageEditPart.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                          
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+
+              
+
+public class MessageEditPart extends BaseEditPart
+{
+  public MessageEditPart()
+  {
+  }   
+  
+  protected IFigure createFigure()
+  {                            
+    Label label = new Label(XSDEditorPlugin.getXSDString("_UI_GRAPH_VIEW_NOT_AVAILABLE"));         
+    return label;
+  }    
+
+  protected List getModelChildren() 
+  {                  
+    return Collections.EMPTY_LIST;
+  }   
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupDefinitionEditPart.java
new file mode 100644
index 0000000..af5804a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupDefinitionEditPart.java
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                      
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComboBoxCellEditorManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RepeatableGraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+
+              
+public class ModelGroupDefinitionEditPart extends RepeatableGraphNodeEditPart
+{
+  protected Label label;     
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
+
+  public XSDModelGroupDefinition getXSDModelGroupDefinition()
+  {
+    return (XSDModelGroupDefinition)getModel();
+  } 
+
+  protected boolean isConnectedEditPart()
+  {
+    return false;
+  }          
+
+  public XSDParticle getXSDParticle()
+  {                    
+    Object o = getXSDModelGroupDefinition().getContainer();
+    return (o instanceof XSDParticle) ? (XSDParticle)o : null;
+  }
+             
+  protected GraphNodeFigure createGraphNodeFigure()
+  {
+    RepeatableGraphNodeFigure figure = new RepeatableGraphNodeFigure();                                                        
+    figure.getOutlinedArea().setBorder(new RoundedLineBorder(1, 6));
+    figure.getInnerContentArea().setBorder(new MarginBorder(10, 0, 10, 0));
+
+    label = new Label();    
+    label.setFont(mediumBoldFont); 
+    figure.getIconArea().add(label);     
+
+
+    return figure;
+  }  
+ 
+  public IFigure getContentPane()  
+  {
+    return graphNodeFigure.getInnerContentArea();
+  }
+           
+  protected List getModelChildren() 
+  {                                             
+    return XSDChildUtility.getModelChildren(getModel());  
+  }
+
+  protected void createEditPolicies()
+  {     
+    super.createEditPolicies();
+  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
+  }             
+             
+  protected void refreshVisuals()
+  { 
+    super.refreshVisuals();                                                                
+  
+    if (getXSDModelGroupDefinition().isModelGroupDefinitionReference())
+    {
+      label.setText(getXSDModelGroupDefinition().getResolvedModelGroupDefinition().getQName());
+      label.setIcon(XSDEditorPlugin.getXSDImage("icons/GraphViewElementRef.gif"));
+      label.setBorder(new MarginBorder(0, 0, 0, 4)); 
+
+      // todo update occurence label
+      //
+    }
+    else
+    {               
+      label.setText(getXSDModelGroupDefinition().getName());      
+      label.setIcon(null);
+      label.setBorder(new MarginBorder(0, 6, 0, 4));
+    }
+                       
+    if (XSDGraphUtil.isEditable(getModel()))
+    { 
+      graphNodeFigure.getOutlinedArea().setForegroundColor(isSelected ? ColorConstants.black : elementBorderColor);
+      label.setForegroundColor(elementLabelColor);
+    }
+    else
+    {
+      graphNodeFigure.getOutlinedArea().setForegroundColor(readOnlyBackgroundColor);
+      label.setForegroundColor(readOnlyBackgroundColor);
+    }   
+
+    refreshOccurenceLabel(getXSDParticle());
+  }
+ 
+
+  protected void performDirectEdit()
+  {              
+    if (getXSDModelGroupDefinition().isModelGroupDefinitionReference())
+    {
+      ComboBoxCellEditorManager manager = new ComboBoxCellEditorManager(this, label)
+      {
+         protected List computeComboContent()
+         {             
+           XSDSchema schema = getXSDModelGroupDefinition().getSchema();
+           List nameList = new ArrayList();
+           if (schema != null)
+           {
+             TypesHelper typesHelper = new TypesHelper(schema);
+             nameList = typesHelper.getModelGroups();
+           }                                           
+           return nameList;
+         }
+
+         public void performModify(String value)
+         {  
+           Display.getCurrent().asyncExec(new DelayedModelGroupRenameAction(getXSDModelGroupDefinition(), value));
+         }
+      };                                          
+      simpleDirectEditPolicy.setDelegate(manager);
+      manager.show();
+    }
+    else 
+    {
+      ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, getXSDModelGroupDefinition());           
+      simpleDirectEditPolicy.setDelegate(manager);
+      manager.show();
+    }
+  }  
+       
+
+  protected class DelayedModelGroupRenameAction implements Runnable
+  {
+     XSDModelGroupDefinition modelGroupDefinition;                                     
+     String value;
+
+     DelayedModelGroupRenameAction(XSDModelGroupDefinition modelGroupDefinition, String value)
+     {
+       this.modelGroupDefinition = modelGroupDefinition;
+       this.value = value;
+     }
+
+     public void run()
+     {
+       modelGroupDefinition.getElement().setAttribute("ref", value);
+     }
+  }
+    
+
+  public void performRequest(Request request)
+  {
+  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
+    {     
+      if (XSDGraphUtil.isEditable(getModel()))
+      {
+  		  performDirectEdit();
+      }
+    }
+  }    
+ 
+  // TODO... I added this as a quick fix to makesure the title gets redrawn when the groupRef is changed
+  // we should probably fix the ModelListenerUtil to fire both call both 'change' methods for the ref property
+  //public void modelChildrenChanged()
+  //{   
+  //  super.modelChildrenChanged();                                              
+  //  refreshVisuals(); 
+  //} 
+
+  public void doEditName()
+  {
+    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, getXSDModelGroupDefinition());           
+    simpleDirectEditPolicy.setDelegate(manager);
+    manager.show();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupEditPart.java
new file mode 100644
index 0000000..b793eba
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupEditPart.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                          
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.DragAndDropEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.CenteredIconFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDParticle;
+
+              
+
+public class ModelGroupEditPart extends ExpandableGraphNodeEditPart
+{
+  protected CenteredIconFigure centeredIconFigure;
+ 
+  protected static Color editableBackgroundColor = null;
+  protected static Color editableForegroundColor = null;
+  protected static Color nonEditableForegroundColor = null;
+
+  public XSDParticle getXSDParticle()
+  {                    
+    Object o = getXSDModelGroup().getContainer();
+    return (o instanceof XSDParticle) ? (XSDParticle)o : null;
+  }
+
+  public XSDModelGroup getXSDModelGroup()
+  {
+    return (XSDModelGroup)getModel();
+  }           
+
+  protected GraphNodeFigure createGraphNodeFigure()
+  {
+    ExpandableGraphNodeFigure figure = new ExpandableGraphNodeFigure();      
+
+    centeredIconFigure = new CenteredIconFigure();
+    centeredIconFigure.setPreferredSize(new Dimension(32, 20)); 
+    //centeredIconFigure.setBackgroundColor(new Color(Display.getCurrent(), 255, 0, 0)); 
+    figure.getIconArea().add(centeredIconFigure);   
+    //figure.getIconArea().setLayout(new CenterLayout());
+
+    ContainerFigure outlinedArea = figure.getOutlinedArea();                        
+    outlinedArea.setBorder(new RoundedLineBorder(1, 10));   
+    //outlinedArea.setPreferredSize(new Dimension(32, 20)); 
+                         
+    // set layout so that children are aligned vertically with some spacing
+    //
+    figure.getOuterContentArea().getContainerLayout().setHorizontal(false);  
+    figure.getOuterContentArea().getContainerLayout().setSpacing(10);
+
+    return figure;
+  }    
+
+  protected List getModelChildrenHelper()
+  {
+    return XSDChildUtility.getModelChildren(getXSDModelGroup());
+  }  
+ 
+  protected void refreshVisuals()
+  {         
+    String iconName = "icons/XSDSequence.gif";    
+    switch (getXSDModelGroup().getCompositor().getValue())
+    {
+      case XSDCompositor.ALL   : { iconName = "icons/XSDAll.gif"; break; }
+      case XSDCompositor.CHOICE   : { iconName = "icons/XSDChoice.gif"; break; }
+      case XSDCompositor.SEQUENCE : { iconName = "icons/XSDSequence.gif"; break; }
+    }
+    centeredIconFigure.image = XSDEditorPlugin.getXSDImage(iconName);
+    centeredIconFigure.repaint();
+                                                          
+
+    ContainerFigure outlinedArea = graphNodeFigure.getOutlinedArea() ;    
+    if (XSDGraphUtil.isEditable(getXSDModelGroup()))
+    {
+      if (editableForegroundColor == null) 
+        editableForegroundColor = new Color(Display.getCurrent(), 120, 152, 184);
+
+      if (editableBackgroundColor == null) 
+        editableBackgroundColor = new Color(Display.getCurrent(), 232, 240, 248);
+       
+      outlinedArea.setForegroundColor(isSelected ? ColorConstants.black : editableForegroundColor);
+      outlinedArea.setBackgroundColor(editableBackgroundColor);
+    }
+    else
+    {                                          
+      if (nonEditableForegroundColor == null) 
+        nonEditableForegroundColor = new Color(Display.getCurrent(), 164, 164, 164);    
+        
+      outlinedArea.setForegroundColor(isSelected ? ColorConstants.black : nonEditableForegroundColor);
+      outlinedArea.setBackgroundColor(ColorConstants.white);
+    }  
+
+    refreshOccurenceLabel(getXSDParticle());
+  }        
+
+  protected boolean isChildLayoutHorizontal()
+  {
+    return false;
+  } 
+
+  protected boolean isDefaultExpanded()
+  {        
+    return isPossibleCycle() ? false : true;
+  }  
+                                                                                         
+  // This test ensures that we don't end up with an infinite default expansion (e.g. when a group contains a cyclic group ref)
+  // TODO... we probably need some more extensible 'OO' way of computing this information
+  protected boolean isPossibleCycle()
+  {        
+    boolean result = false;
+    if (getParent() instanceof ModelGroupDefinitionEditPart)
+    {                                                      
+      ModelGroupDefinitionEditPart group = (ModelGroupDefinitionEditPart)getParent();
+      for (EditPart parent = group.getParent(); parent != null; parent = parent.getParent())
+      {
+        if (parent.getModel() instanceof ElementDeclarationEditPart)
+        {
+          break;
+        }       
+        else 
+        {
+          if (parent.getModel() == group.getModel())
+          {
+            result = true;
+            break;
+          }
+        }
+      }      
+    }      
+    return result;
+  } 
+       
+  protected void createEditPolicies()
+  { 
+    super.createEditPolicies();
+    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));      
+  }
+  
+  public void activate() 
+  {
+    super.activate();
+    if (getXSDParticle() != null)
+    {
+      XSDModelAdapterFactory.addModelAdapterListener(getXSDParticle(), this);
+    }
+  }
+  /** 
+   * Apart from the deactivation done in super, the source
+   * and target connections are deactivated, and the visual
+   * part of the this is removed.
+   *
+   * @see #activate() 
+   */
+  public void deactivate() 
+  {
+    if (getXSDParticle() != null)
+    {
+      XSDModelAdapterFactory.removeModelAdapterListener(getXSDParticle(), this);
+    }
+    super.deactivate();
+  }   
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RepeatableGraphNodeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RepeatableGraphNodeEditPart.java
new file mode 100644
index 0000000..6fdf7d6
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RepeatableGraphNodeEditPart.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                        
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.DragAndDropEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RepeatableGraphNodeFigure;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+
+                  
+
+public class RepeatableGraphNodeEditPart extends GraphNodeEditPart
+{
+  protected RepeatableGraphNodeFigure getRepeatableGraphNodeFigure()
+  {
+    return (RepeatableGraphNodeFigure)graphNodeFigure;
+  }
+  
+  protected GraphNodeFigure createGraphNodeFigure()
+  {
+    return new RepeatableGraphNodeFigure();                                                        
+  }   
+      
+  protected void refreshOccurenceLabel(XSDParticle particle)
+  {  
+    if (particle != null)
+    { 
+      refreshOccurenceLabel(particle.getMinOccurs(), particle.getMaxOccurs());
+    }
+  }
+
+  protected void refreshOccurenceLabel(int min, int max)
+  {                     
+    if (min == 1 && max == 1)
+    {
+      getRepeatableGraphNodeFigure().getOccurenceLabel().setText("");
+    }
+    else
+    {
+      String maxString = max == -1 ? "*" : "" + max;
+      getRepeatableGraphNodeFigure().getOccurenceLabel().setText(min + ".." + maxString);
+    }
+    getRepeatableGraphNodeFigure().getOccurenceLabel().repaint();
+  }
+
+  protected void createEditPolicies()
+  { 
+    super.createEditPolicies();
+    
+    if (getModel() instanceof XSDElementDeclaration) {
+    	Object parent = ((XSDElementDeclaration) getModel()).eContainer();
+    	
+    	if (!(parent instanceof XSDSchema)) {
+    		installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));      
+    	}
+    }
+    else {
+    	installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));
+    }
+  }  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootComplexTypeDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootComplexTypeDefinitionEditPart.java
new file mode 100644
index 0000000..853a2df
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootComplexTypeDefinitionEditPart.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                   
+import java.util.List;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDInheritanceViewer;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+
+              
+
+public class RootComplexTypeDefinitionEditPart extends ExpandableGraphNodeEditPart
+{                      
+  public Label label;  
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();                              
+        
+
+  protected GraphNodeFigure createGraphNodeFigure()
+  {
+    ExpandableGraphNodeFigure figure = new ExpandableGraphNodeFigure();
+    figure.getOutlinedArea().setBorder(new RoundedLineBorder(1, 6));
+    figure.getOutlinedArea().setLayoutManager(new FillLayout());
+    figure.getOutlinedArea().setFill(true);
+    
+    if (getViewer() instanceof XSDInheritanceViewer)
+    {
+      figure.getOuterContentArea().getContainerLayout().setSpacing(10);
+    }
+
+    label = new Label();       
+    label.setFont(mediumBoldFont);
+    label.setBorder(new MarginBorder(5, 8, 5, 8));  
+    figure.getIconArea().add(label);  
+
+    return figure;
+  }          
+   
+                                                                                   
+  protected void refreshVisuals()
+  { 
+    super.refreshVisuals();                                                                
+
+    XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)getModel();                   
+    label.setText(ctd.getName() != null ? ctd.getName(): "");
+
+    if (XSDGraphUtil.isEditable(ctd))
+    { 
+      figure.setForegroundColor(elementBorderColor);
+      label.setForegroundColor(elementBorderColor);
+    }
+    else
+    {
+      figure.setForegroundColor(readOnlyBorderColor);
+      label.setForegroundColor(readOnlyBorderColor);
+    }
+  }
+
+
+  protected List getModelChildrenHelper()
+  {
+    XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)getModel();
+    if (getViewer() instanceof XSDInheritanceViewer)
+    {
+      return XSDChildUtility.getImmediateDerivedTypes(ct);
+    }
+    else
+    {
+      return XSDChildUtility.getModelChildren(getModel());
+    }
+  }     
+
+
+  protected void createEditPolicies()
+  {  
+    SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
+    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);     
+  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
+  }  
+        
+
+  protected void performDirectEdit()
+  {                                  
+    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, (XSDComplexTypeDefinition)getModel());     
+    simpleDirectEditPolicy.setDelegate(manager);
+    manager.show();
+  }    
+
+
+  public void performRequest(Request request)
+  {
+  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
+    {
+      if (XSDGraphUtil.isEditable(getModel()))
+      {
+  		  performDirectEdit();
+      }
+    }
+  } 
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootModelGroupDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootModelGroupDefinitionEditPart.java
new file mode 100644
index 0000000..35f4486
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootModelGroupDefinitionEditPart.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                   
+import java.util.List;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+
+              
+public class RootModelGroupDefinitionEditPart extends ExpandableGraphNodeEditPart
+{                      
+  public Label label;  
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();                              
+                     
+
+  protected GraphNodeFigure createGraphNodeFigure()
+  {
+    ExpandableGraphNodeFigure figure = new ExpandableGraphNodeFigure();
+    figure.getOutlinedArea().setBorder(new RoundedLineBorder(1, 6));
+    figure.getOutlinedArea().setLayoutManager(new FillLayout());
+    figure.getOutlinedArea().setFill(true);
+
+    label = new Label();       
+    label.setFont(mediumBoldFont);
+    label.setBorder(new MarginBorder(5, 8, 5, 8));  
+    figure.getIconArea().add(label);  
+
+    return figure;
+  }  
+                                                                          
+  protected void refreshVisuals()
+  { 
+    super.refreshVisuals();                                                                
+
+    XSDModelGroupDefinition mgd = (XSDModelGroupDefinition)getModel();                      
+    String name = mgd.getResolvedModelGroupDefinition().getName();                  
+    label.setText(name);
+
+    if (XSDGraphUtil.isEditable(getModel()))
+    { 
+      figure.setForegroundColor(elementBorderColor);
+      label.setForegroundColor(elementBorderColor);
+    }
+    else
+    {
+      figure.setForegroundColor(readOnlyBorderColor);
+      label.setForegroundColor(readOnlyBorderColor);
+    }
+  }  
+
+  protected List getModelChildrenHelper()
+  {
+    return XSDChildUtility.getModelChildren(getModel());
+  }   
+
+
+  protected void createEditPolicies()
+  {  
+    SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
+    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);     
+  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
+  }  
+        
+
+  protected void performDirectEdit()
+  {                                  
+    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, ((XSDModelGroupDefinition)getModel()).getResolvedModelGroupDefinition());           
+    simpleDirectEditPolicy.setDelegate(manager);
+    manager.show();
+  }    
+
+
+  public void performRequest(Request request)
+  {
+  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
+    {
+      if (XSDGraphUtil.isEditable(getModel()))
+      {
+  		  performDirectEdit();
+      }
+    }
+  } 
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaDirectiveEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaDirectiveEditPart.java
new file mode 100644
index 0000000..c0697d5
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaDirectiveEditPart.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.CenteredIconFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.xsd.XSDSchemaDirective;
+
+
+public class SchemaDirectiveEditPart extends BaseEditPart
+{
+  protected CenteredIconFigure centeredIconFigure;
+  protected Label label;
+  /**
+   * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
+   */
+  protected IFigure createFigure()
+  {
+ 
+    ContainerFigure figure = new ContainerFigure();
+
+    figure.setLayoutManager(new FillLayout());
+    figure.setBorder(new RoundedLineBorder(1, 8));
+
+    ContainerFigure fig = new ContainerFigure();
+    fig.setLayoutManager(new FillLayout());
+    fig.setBorder(new MarginBorder(10, 0, 10, 0));
+    figure.add(fig);
+
+
+    label = new Label();    
+    label.setBorder(new MarginBorder(4, 2, 2, 10));
+    fig.add(label);        
+
+    return figure;
+  }  
+ 
+  public void refreshVisuals()
+  {
+    XSDSchemaDirective directive = (XSDSchemaDirective)getModel();
+    String schemaLocation = directive.getSchemaLocation();
+    if (schemaLocation == null) schemaLocation = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
+    if (schemaLocation.equals("")) schemaLocation = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
+    label.setText("  " + directive.getElement().getLocalName() + " " + schemaLocation);
+  } 
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaEditPart.java
new file mode 100644
index 0000000..ad1f64b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaEditPart.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.gef.EditPart;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
+import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
+import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
+import org.eclipse.xsd.XSDSchema;
+
+public class SchemaEditPart extends BaseEditPart
+{
+  protected ContainerFigure containerFigure;
+  protected Label label;
+
+  //protected ContainerFigure childExpansionContainer;
+  public IFigure getContentPane()
+  {
+    return containerFigure;
+  }
+
+  protected IFigure createFigure()
+  {
+    ContainerFigure outer = new ContainerFigure();
+    outer.setBorder(new RoundedLineBorder(1, 6));
+    outer.setForegroundColor(categoryBorderColor);
+    FillLayout fillLayout = new FillLayout(4);
+    outer.setLayoutManager(fillLayout); 
+    //outer.getContainerLayout().setHorizontal(false);
+    
+    ContainerFigure r = new ContainerFigure();  
+    r.setOutline(false);
+    r.setMinimumSize(new Dimension(0, 0));
+    r.setFill(true);
+    r.setBackgroundColor(GraphicsConstants.elementBackgroundColor);
+    outer.add(r);
+    
+	final int theMinHeight = 200;
+    FillLayout outerLayout = new FillLayout()
+    {
+      protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
+      {
+        Dimension d = super.calculatePreferredSize(parent, width, height);
+        d.union(new Dimension(100, theMinHeight));
+        return d;
+      }
+    };
+    outerLayout.setHorizontal(false);
+    outer.setLayoutManager(outerLayout);
+    
+    label = new Label();
+    label.setForegroundColor(ColorConstants.black);
+    label.setBorder(new MarginBorder(2, 4, 2, 4));    
+    r.add(label);
+    
+    RectangleFigure line = new RectangleFigure();
+    line.setPreferredSize(20, 1);
+    outer.add(line);
+    
+    containerFigure = new ContainerFigure();
+    //containerFigure.setBackgroundColor(ColorConstants.red);
+    containerFigure.setBorder(new MarginBorder(4, 4, 4, 4));
+    fillLayout = new FillLayout(4);
+    containerFigure.setLayoutManager(fillLayout);
+    //containerFigure.setLayoutManager(new FillLayout(false));
+    /*
+     * FlowLayout layout1 = new FlowLayout(false); layout1.setMajorSpacing(0);
+     * layout1.setMinorSpacing(0); layout1.setStretchMinorAxis(true);
+     * containerFigure.setLayoutManager(layout1);
+     */
+    outer.add(containerFigure);
+    //childExpansionContainer = new ContainerFigure();
+    //childExpansionContainer.getContainerLayout().setHorizontal(false);
+    //childExpansionContainer.setOutlined(true);
+    return outer;
+  }
+
+  protected List getModelChildren()
+  {
+    List list = new ArrayList();
+    list.add(CategoryRowEditPart.DIRECTIVES_AND_NOTATIONS);
+    list.add(CategoryRowEditPart.ELEMENTS_AND_TYPES);
+    list.add(CategoryRowEditPart.MODEL_GROUPS_AND_ATTRIBUTES);      
+    return list;
+  }
+
+  protected EditPart createChild(Object model)
+  {
+    CategoryRowEditPart result = new CategoryRowEditPart();
+    result.setModel(model);
+    result.setParent(this);
+    result.setSchema((XSDSchema)getModel());
+    return result;
+  }
+  
+
+  protected void refreshVisuals()
+  {
+    super.refreshVisuals();
+    String targetNamespaceValue = ((XSDSchema)getModel()).getTargetNamespace();
+    if (targetNamespaceValue == null || targetNamespaceValue.length() == 0)
+    {
+      targetNamespaceValue = XSDEditorPlugin.getXSDString("_UI_GRAPH_XSDSCHEMA_NO_NAMESPACE");
+    }     
+    label.setText(XSDEditorPlugin.getXSDString("_UI_GRAPH_XSDSCHEMA") + " : " + targetNamespaceValue);
+  }
+}
+
+class CategoryRowEditPart extends BaseEditPart
+{  
+  public static final int[] ELEMENTS_AND_TYPES = {Category.ELEMENTS, Category.TYPES };
+  public static final int[] DIRECTIVES_AND_NOTATIONS =  {Category.DIRECTIVES, Category.NOTATIONS };
+  public static final int[] MODEL_GROUPS_AND_ATTRIBUTES = {Category.GROUPS, Category.ATTRIBUTES};//, Category.COMPLEX_TYPES };
+  
+  protected XSDSchema schema;
+  protected Figure contentPane;
+  
+  protected IFigure createFigure()
+  {
+    ContainerFigure containerFigure = new ContainerFigure();
+    //containerFigure.setBackgroundColor(ColorConstants.red);
+    containerFigure.setFill(true);
+    containerFigure.setBorder(new MarginBorder(4, 4, 4, 4));
+    org.eclipse.wst.xsd.ui.internal.gef.util.figures.FillLayout fillLayout = new org.eclipse.wst.xsd.ui.internal.gef.util.figures.FillLayout(4);
+    fillLayout.setHorizontal(true);
+    containerFigure.setLayoutManager(fillLayout);
+    //containerFigure.setLayoutManager(new FillLayout(4));
+    return containerFigure;
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getContentPane()
+   */
+  public IFigure getContentPane()
+  {
+    return super.getContentPane();
+  }
+
+  public XSDSchema getSchema()
+  {
+    return schema;
+  }
+
+  public void setSchema(XSDSchema schema)
+  {
+    this.schema = schema;
+  }
+  
+
+  protected List getModelChildren()
+  {
+    List categoryList = (List) XSDModelAdapterFactory.getAdapter(schema).getProperty(schema, "groups");
+    return filterCategoryList(categoryList);
+  }
+  
+  protected List filterCategoryList(List list)
+  {
+    List result = new ArrayList();
+    int[] categoryTypes = (int[])getModel();
+    for (Iterator i = list.iterator(); i.hasNext(); )
+    {
+      Category category = (Category)i.next();
+      if (isMatching(categoryTypes, category))
+      {
+        result.add(category);
+      }
+    }
+    return result;
+  }
+  
+  private boolean isMatching(int[] categoryTypes, Category category)
+  {
+    boolean result = false;
+    for (int i = 0; i < categoryTypes.length; i++)
+    {
+      if (categoryTypes[i] == category.getGroupType())
+      {
+        result = true;
+        break;
+      }
+    }
+    return result;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SimpleTypeDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SimpleTypeDefinitionEditPart.java
new file mode 100644
index 0000000..df1afad
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SimpleTypeDefinitionEditPart.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.ImageFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
+
+public class SimpleTypeDefinitionEditPart extends BaseEditPart
+{
+  protected Label label;
+  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
+
+  ImageFigure figure;
+  Image image;
+  
+  protected IFigure createFigure()
+  {
+    String iconName = "icons/XSDSimpleTypeForEditPart.gif";
+    image = XSDEditorPlugin.getXSDImage(iconName);
+  
+    figure = new ImageFigure(image);
+    return figure;
+  }
+
+  protected void refreshVisuals()
+  {
+    if (isSelected)
+    {
+      image = XSDEditorPlugin.getXSDImage("icons/XSDSimpleTypeForEditPart.gif");
+    }
+    else
+    {
+      image = XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
+    }
+    figure.setImage(image);
+    figure.repaint();
+  }
+  
+  protected boolean isConnectedEditPart()
+  {
+    return false;
+  }
+  
+  public void deactivate()
+  {
+    super.deactivate();
+    image = null;  // where do we dispose the image?
+  }
+  
+
+  protected void createEditPolicies()
+  { 
+    selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
+    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);   
+  }  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SubstitutionGroupViewerRootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SubstitutionGroupViewerRootEditPart.java
new file mode 100644
index 0000000..3899e8e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SubstitutionGroupViewerRootEditPart.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                                      
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Panel;
+import org.eclipse.gef.EditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerLayout;
+
+              
+
+public class SubstitutionGroupViewerRootEditPart extends BaseEditPart
+{
+  protected final static String MESSAGE_PLACE_HOLDER = "MESSAGE_PLACE_HOLDER";
+  protected Object input;              
+
+  public void setInput(Object input)
+  {
+    this.input = input;
+    refreshChildren();
+  }
+
+  protected IFigure createFigure()
+  {
+    Panel panel = new Panel();
+    ContainerLayout layout = new ContainerLayout();
+    layout.setBorder(60);
+    panel.setLayoutManager(layout);
+    return panel;
+  }   
+           
+
+  protected List getModelChildren() 
+  {               
+    List list = new ArrayList();
+    if (input != null)
+    {
+      list.add(input);
+    }
+    else
+    {
+      list.add(MESSAGE_PLACE_HOLDER);
+    }
+    return list;
+  }         
+
+  protected EditPart createChild(Object model) 
+  { 
+    EditPart editPart = null;
+    if (model == MESSAGE_PLACE_HOLDER)
+    {
+      editPart = new MessageEditPart();
+      editPart.setModel(model);
+    }
+    else
+    {
+      editPart = super.createChild(model);
+    }
+    return editPart;
+  } 
+
+  protected void createEditPolicies()
+  {  
+  }             
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TopLevelComponentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TopLevelComponentEditPart.java
new file mode 100644
index 0000000..04b686a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TopLevelComponentEditPart.java
@@ -0,0 +1,319 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.editpolicies.SelectionEditPolicy;
+import org.eclipse.gef.requests.LocationRequest;
+import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.gef.util.editparts.AbstractComponentViewerRootEditPart;
+import org.eclipse.wst.xsd.ui.internal.gef.util.figures.FillLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDComponentViewer;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.model.ModelAdapter;
+import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+
+
+public class TopLevelComponentEditPart extends BaseEditPart implements IFeedbackHandler
+{
+  protected Label label;
+  //protected Label arrowLabel;
+  protected ContainerFigure labelHolder = new ContainerFigure();
+  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
+  protected boolean isReadOnly;
+  protected boolean isSelected;
+  protected Font font;
+  
+  protected IFigure createFigure()
+  {
+    ContainerFigure typeGroup = new ContainerFigure();
+    typeGroup.getContainerLayout().setHorizontal(true);
+
+    //arrowLabel = new Label();
+    //arrowLabel.setIcon(XSDEditorPlugin.getPlugin().getImage("icons/forward.gif"));
+    //typeGroup.add(arrowLabel);
+
+    labelHolder = new ContainerFigure();
+    FillLayout fillLayout = new FillLayout();
+    labelHolder.setLayoutManager(fillLayout);
+    labelHolder.setFill(true);
+    typeGroup.add(labelHolder);
+
+    label = new Label();
+    label.setBorder(new MarginBorder(0, 2, 2, 1));
+    label.setForegroundColor(ColorConstants.black);
+    labelHolder.add(label);
+    
+    try
+	{
+      // evil hack to provide underlines
+      Object model = getModel();
+      
+      boolean isLinux = java.io.File.separator.equals("/");
+      if (model instanceof XSDComplexTypeDefinition ||
+          model instanceof XSDElementDeclaration ||
+          model instanceof XSDModelGroupDefinition)
+      {
+        if (!isLinux)
+        {
+          FontData oldData = GraphicsConstants.medium.getFontData()[0];
+          FontData fontData = new FontData(oldData.getName(), oldData.getHeight(), SWT.NONE);
+
+            // TODO... clean this awful code up... we seem to be leaking here too
+            // we can't call this directly since the methods are OS dependant
+            // fontData.data.lfUnderline = 1
+            // so instead we use reflection
+            Object data = fontData.getClass().getField("data").get(fontData);
+//            System.out.println("data" + data.getClass());
+            data.getClass().getField("lfUnderline").setByte(data, (byte)1);
+            font = new Font(Display.getCurrent(), fontData);
+            label.setFont(font);
+        }
+      }
+	}
+    catch (Exception e)
+	{
+
+	}
+    
+    return typeGroup;
+  }
+  
+  public void deactivate()
+  {
+	  super.deactivate();
+	  if (font != null)
+	  {
+		  font.dispose();
+		  font = null;
+	  }
+  }
+  
+  public void refreshVisuals()
+  {
+    ModelAdapter adapter = XSDModelAdapterFactory.getAdapter(getModel());
+    if (adapter != null)
+    {
+      // isReadOnly = Boolean.TRUE.equals(adapter.getProperty(getModel(), "isReadOnly"));
+      isReadOnly = !XSDGraphUtil.isEditable(getModel());
+      label.setForegroundColor(computeLabelColor());
+      label.setText((String)adapter.getProperty(getModel(), ModelAdapter.LABEL_PROPERTY));
+      Image image = (Image)adapter.getProperty(getModel(), ModelAdapter.IMAGE_PROPERTY);
+      if (image != null) label.setIcon(image);
+      //arrowLabel.setVisible(Boolean.TRUE.equals(adapter.getProperty(getModel(), "drillDown")));
+    }
+    else
+    {
+      label.setText(XSDEditorPlugin.getXSDString("_UI_GRAPH_UNKNOWN_OBJECT") + getModel().getClass().getName());
+      //arrowLabel.setVisible(false);
+    }
+
+    if (reselect)
+    {
+      getViewer().select(this);
+      setReselect(false);
+    }
+  }
+
+
+  public XSDNamedComponent getXSDNamedComponent()
+  {
+    return (XSDNamedComponent) getModel();
+  }
+
+  public List getModelChildren()
+  {
+    return Collections.EMPTY_LIST;
+  }
+  
+  protected void createEditPolicies()
+  { 
+    //installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new NonResizableEditPolicy());    
+    //selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
+    //installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);  
+  	
+    SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
+    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);
+
+    SelectionEditPolicy feedBackSelectionEditPolicy = new SelectionEditPolicy()
+    {
+      protected void hideSelection()
+      {
+        EditPart editPart = getHost();
+        if (editPart instanceof IFeedbackHandler)
+        {
+          ((IFeedbackHandler)editPart).removeFeedback();
+        }
+      }
+
+      protected void showSelection()
+      {
+        EditPart editPart = getHost();
+        if (editPart instanceof IFeedbackHandler)
+        {
+          ((IFeedbackHandler)editPart).addFeedback();
+        }
+      }
+    };
+    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, feedBackSelectionEditPolicy);
+
+    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
+  }  
+  
+  public Color computeLabelColor()
+  {
+    Color color = ColorConstants.black;
+    if (isSelected)
+    {
+      color = ColorConstants.white;
+    }
+    else if (isReadOnly)
+    {
+      color = ColorConstants.gray;
+    }
+    return color;
+  }
+
+
+  public void addFeedback()
+  {
+    isSelected = true;
+
+    labelHolder.setBackgroundColor(ColorConstants.black);
+    label.setForegroundColor(computeLabelColor());
+    labelHolder.setFill(true);
+    
+    if (doScroll)
+    {
+      CategoryEditPart categoryEP = (CategoryEditPart)getParent();
+      categoryEP.scrollTo(this);
+      setScroll(false);
+    }
+  }
+  
+  private boolean doScroll = false;
+  public void setScroll(boolean doScroll)
+  {
+    this.doScroll = doScroll;
+  }
+
+  public void removeFeedback()
+  {
+    isSelected = false;
+    labelHolder.setBackgroundColor(null);
+    label.setForegroundColor(computeLabelColor());
+    labelHolder.setFill(false);
+  }
+
+  public void performRequest(Request request)
+  {  
+    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
+        request.getType() == RequestConstants.REQ_OPEN)
+    {
+      
+      Object model = getModel();
+      if (model instanceof XSDComplexTypeDefinition ||
+          model instanceof XSDElementDeclaration ||
+          model instanceof XSDModelGroupDefinition)
+      {
+        if (request instanceof LocationRequest)
+        {
+          LocationRequest locationRequest = (LocationRequest)request;
+          Point p = locationRequest.getLocation();
+        
+          if (hitTest(labelHolder, p))
+          {
+            performDrillDownAction();
+          }              
+        }
+      }
+    }
+  }  
+
+  public boolean hitTest(IFigure target, Point location)
+  {
+    Rectangle b = target.getBounds().getCopy();
+    target.translateToAbsolute(b);  
+    return b.contains(location);
+  }  
+
+  protected void performDrillDownAction()
+  {                                                                                    
+    Runnable runnable = new Runnable()
+    {
+      public void run()
+      {
+        //((XSDComponentViewer)getViewer()).setInput((XSDConcreteComponent)getModel());
+        
+        EditPart editPart = ((AbstractEditPartViewer)getViewer()).getRootEditPart().getContents();
+        if (editPart instanceof AbstractComponentViewerRootEditPart)
+        {
+          AbstractComponentViewerRootEditPart rootEditPart = (AbstractComponentViewerRootEditPart)editPart;
+          rootEditPart.setInput((XSDConcreteComponent)getModel());
+        }
+        else if (editPart instanceof BaseEditPart)
+        {
+          ((XSDComponentViewer)getViewer()).setInput((XSDConcreteComponent)getModel());
+        }
+      }
+    };
+    Display.getCurrent().asyncExec(runnable);
+  }
+  
+  public void doEditName()
+  {
+    removeFeedback();
+    Object object = getModel();
+    if (object instanceof XSDNamedComponent)
+    {
+      ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, (XSDNamedComponent)object);
+      simpleDirectEditPolicy.setDelegate(manager);
+      manager.show();
+    }
+  }
+
+  
+  static boolean reselect = false;
+  
+  public void setReselect(boolean state)
+  {
+    reselect = state;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TypeEditPart.java
new file mode 100644
index 0000000..37a83e1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TypeEditPart.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
+import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+public class TypeEditPart extends BaseEditPart
+{
+  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
+
+  protected IFigure createFigure()
+  {
+    ContainerFigure typeGroup = new ContainerFigure();
+//    typeGroup.setBorder(new SimpleRaisedBorder(1));
+//    typeGroup.setBorder(new LineBorder(1));
+//    typeGroup.setBorder(new RoundedLineBorder(1,5));
+
+    Label typeLabel = new Label("type");
+    typeLabel.setBorder(new MarginBorder(0,2,2,1));
+    typeGroup.add(typeLabel);
+
+    return typeGroup;
+  }    
+
+  protected void refreshVisuals()
+  {                 
+    super.refreshVisuals();
+  }
+
+  public XSDTypeDefinition getXSDTypeDefinition()
+  {         
+    return (XSDTypeDefinition)getModel();
+  }
+
+                    
+  public List getModelChildren() 
+  {                   
+    return Collections.EMPTY_LIST;
+  }  
+
+  protected void createEditPolicies()
+  {        
+    SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
+    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);      
+  } 
+  
+               
+  public void performRequest(Request request)
+  {
+    super.performRequest(request);
+  }  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/WildcardEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/WildcardEditPart.java
new file mode 100644
index 0000000..53a86a1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/WildcardEditPart.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                          
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.RepeatableGraphNodeFigure;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDWildcard;
+              
+
+public class WildcardEditPart extends RepeatableGraphNodeEditPart
+{
+  protected Label label;
+
+                             
+  public XSDParticle getXSDParticle()
+  {                    
+    Object o = getXSDWildcard().getContainer();
+    return (o instanceof XSDParticle) ? (XSDParticle)o : null;
+  }
+
+
+  public XSDWildcard getXSDWildcard()
+  {
+    return (XSDWildcard)getModel();
+  }
+
+   
+  protected GraphNodeFigure createGraphNodeFigure()
+  {
+    RepeatableGraphNodeFigure figure = new RepeatableGraphNodeFigure();                                                        
+    figure.setConnected(true);
+    figure.getOutlinedArea().setFill(true);
+
+    label = new Label();    
+    label.setText(XSDEditorPlugin.getXSDString("_UI_ANY_ELEMENT")); 
+    label.setBorder(new MarginBorder(0, 6, 0, 4));
+    label.setFont(mediumBoldFont);        
+
+    figure.getIconArea().add(label);     
+
+    return figure;
+  }  
+ 
+      
+  protected void refreshVisuals()
+  {     
+    ContainerFigure rectangle = graphNodeFigure.getOutlinedArea();
+    if (XSDGraphUtil.isEditable(getModel()))
+    {
+      rectangle.setBorder(new LineBorder(2));
+      rectangle.setBackgroundColor(elementBackgroundColor);
+      rectangle.setForegroundColor(isSelected ? ColorConstants.black : elementBorderColor);
+
+      label.setBackgroundColor(elementBackgroundColor);
+      label.setForegroundColor(elementLabelColor);
+    }
+    else
+    {            
+      rectangle.setBorder(new LineBorder(readOnlyBorderColor, 2));
+      rectangle.setBackgroundColor(readOnlyBackgroundColor);
+      rectangle.setForegroundColor(isSelected ? ColorConstants.black : readOnlyBorderColor);
+   
+      label.setBackgroundColor(readOnlyBackgroundColor);
+      label.setForegroundColor(readOnlyBorderColor);
+    } 
+
+    refreshOccurenceLabel(getXSDParticle());
+  }      
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/XSDEditPartFactory.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/XSDEditPartFactory.java
new file mode 100644
index 0000000..5d6ed1e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/XSDEditPartFactory.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editparts;
+                              
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDInheritanceViewer;
+import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+
+
+
+public class XSDEditPartFactory implements EditPartFactory
+{   
+  protected static XSDEditPartFactory instance;
+                      
+  public static XSDEditPartFactory getInstance()
+  {
+    if (instance == null)
+    {               
+      instance = new XSDEditPartFactory();
+    }
+    return instance;
+  }
+  
+  public EditPart createEditPart(EditPart parent, Object model)
+  {
+    EditPart editPart = null;
+           
+    if (model instanceof Category)
+    {                                  
+      editPart = new CategoryEditPart();
+    }
+    else if (model instanceof XSDElementDeclaration)
+    {       
+      editPart = new ElementDeclarationEditPart();
+    }    
+    else if (model instanceof XSDComplexTypeDefinition)
+    {
+      if (parent.getViewer() instanceof XSDInheritanceViewer)
+      {
+        editPart = new RootComplexTypeDefinitionEditPart();
+      }
+      else
+      {
+        if (parent instanceof CategoryEditPart)
+          editPart = new RootComplexTypeDefinitionEditPart();
+        else
+          editPart = new ComplexTypeDefinitionEditPart();             
+      }
+    }      
+    else if (model instanceof XSDModelGroup)
+    {       
+      editPart = new ModelGroupEditPart();
+    }      
+    else if (model instanceof XSDModelGroupDefinition)
+    {       
+      if (parent instanceof CategoryEditPart)
+        editPart = new RootModelGroupDefinitionEditPart();
+      else
+        editPart = new ModelGroupDefinitionEditPart();
+    }  
+    else if (model instanceof XSDSchema)
+    {                                  
+      editPart = new SchemaEditPart();
+    }
+    else if (model instanceof XSDWildcard)
+    {                                  
+      editPart = new WildcardEditPart();
+    }
+    else if (model instanceof XSDSimpleTypeDefinition)
+    {
+      editPart = new SimpleTypeDefinitionEditPart();
+    }
+
+    if (editPart != null)   
+    {
+      editPart.setModel(model);
+      editPart.setParent(parent);
+    }
+    else
+    {      
+//      System.out.println("can't create editPart for " + model);
+//      Thread.dumpStack();
+    }
+    return editPart;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComboBoxCellEditorManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComboBoxCellEditorManager.java
new file mode 100644
index 0000000..a7b2329
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComboBoxCellEditorManager.java
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+                                                  
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.jface.viewers.ICellEditorListener;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+public abstract class ComboBoxCellEditorManager extends DirectEditManager implements DirectEditPolicyDelegate
+{
+  protected Label label;                                 
+
+  public ComboBoxCellEditorManager(GraphicalEditPart source,	Label label)
+  {
+	  super(source, ComboBoxCellEditor.class, new InternalCellEditorLocator(label));
+    this.label = label;                        
+  }
+
+  protected void initCellEditor() 
+  {                                             
+  	String initialLabelText = label.getText();   
+
+    CCombo combo = (CCombo)getCellEditor().getControl();
+   	combo.setFont(label.getFont());
+    combo.setForeground(label.getForegroundColor());
+    combo.setBackground(label.getBackgroundColor());
+    /*
+	combo.addKeyListener(new KeyAdapter() {
+			// hook key pressed - see PR 14201  
+			public void keyPressed(KeyEvent keyEvent) {
+				if (keyEvent.character == 'z') { 
+					getCellEditor().applyEditorValue();
+				}
+			}
+		});
+*/
+  ICellEditorListener cellEditorListener = new ICellEditorListener()
+  {
+    public void cancelEditor()
+    {
+//      System.out.println("cancelEditor");
+    }
+    public void applyEditorValue()
+    {
+//      System.out.println("applyEditorValue");
+    }
+    public void editorValueChanged(boolean old, boolean newState)
+    {
+//      System.out.println("editorValueChanged");
+    }
+  };
+  getCellEditor().addListener(cellEditorListener);
+
+    String[] item = combo.getItems();
+    for (int i = 0; i < item.length; i++)
+    {
+      if (item[i].equals(initialLabelText))
+      {
+        getCellEditor().setValue(new Integer(i));
+        break;
+      }
+    } 	
+  }	 
+         
+  // hack... for some reason the ComboBoxCellEditor does't fire an editorValueChanged to set the dirty flag
+  // unless we overide this method to return true, the manager is not notified of changes made in the cell editor
+  protected boolean isDirty()
+  {
+	  return true;
+  }
+
+  protected CellEditor createCellEditorOn(Composite composite)
+  { 
+    boolean isLabelTextInList = false;                                       
+    List list = computeComboContent();
+    for (Iterator i = list.iterator(); i.hasNext(); )
+    {
+      String string = (String)i.next();
+      if (string.equals(label.getText()))
+      {                               
+         isLabelTextInList = true;
+         break;
+      }
+    } 
+         
+    if (!isLabelTextInList)
+    {
+      list.add(label.getText());
+    }
+                                               
+    List sortedList = computeSortedList(list);
+    String[] stringArray = new String[sortedList.size()];
+    for (int i = 0; i < stringArray.length; i++)
+    {
+      stringArray[i] = (String)sortedList.get(i);
+    }
+    return new ComboBoxCellEditor(composite, stringArray);
+	}                                                                 
+
+  protected List computeSortedList(List list)
+  {
+    return list;
+  }
+
+  protected abstract List computeComboContent(); 
+
+  protected abstract void performModify(String value);
+
+  public static class InternalCellEditorLocator implements CellEditorLocator
+  {
+    protected Label label;
+
+    public InternalCellEditorLocator(Label label)
+    {
+      this.label = label;
+    }                   
+
+    public void relocate(CellEditor celleditor) 
+    {
+      CCombo combo = (CCombo)celleditor.getControl();  
+	    Point pref = combo.computeSize(-1, -1);
+	    Rectangle rect = label.getTextBounds().getCopy();
+	    label.translateToAbsolute(rect);
+	    combo.setBounds(rect.x-4, rect.y-1, pref.x+1, pref.y+1);
+    }
+  } 
+   
+  // implements DirectEditPolicyDelegate
+  // 
+  public void performEdit(CellEditor cellEditor)
+  {   
+    CCombo combo = (CCombo)getCellEditor().getControl();
+    int index = combo.getSelectionIndex();              
+    if (index != -1)
+    {      
+      performModify(combo.getItem(index));
+    }  
+    else
+    {
+      String typedValue = combo.getText();	
+      if (combo.indexOf(typedValue) != -1)
+      {	      
+	    performModify(typedValue);
+      }      	
+      else
+      {
+      	String closeMatch = getCloseMatch(typedValue, combo.getItems());
+      	if (closeMatch != null)
+      	{
+		  performModify(closeMatch);      	
+      	}
+      	else
+      	{      	
+      	  Display.getCurrent().beep();
+      	}
+      }
+    }    	                                                
+  }
+  
+  protected String getCloseMatch(String value, String[] items)
+  {
+    int matchIndex = -1;
+
+    for (int i = 0; i < items.length; i++)
+    {
+    	String item = items[i];
+    	String a = getLocalName(value);
+    	String b = getLocalName(item);
+		  if (a.equalsIgnoreCase(b))
+		  { 
+			  matchIndex = i;
+			  break;				
+		  }	    	     
+    }  
+    return matchIndex != -1 ? items[matchIndex] : null;
+  }
+  
+  protected String getLocalName(String string)
+  {
+		int index = string.indexOf(":");
+	  return (index != -1) ? string.substring(index + 1) : string;  
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComponentNameDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComponentNameDirectEditManager.java
new file mode 100644
index 0000000..5f25abc
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComponentNameDirectEditManager.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+                                                  
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalElementRenamer;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalGroupRenamer;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalSimpleOrComplexTypeRenamer;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDSwitch;
+
+
+
+public class ComponentNameDirectEditManager extends TextCellEditorManager
+{
+  protected XSDNamedComponent component;
+  protected static GraphicalEditPart mySource;
+
+  public ComponentNameDirectEditManager(GraphicalEditPart source,	Label label, XSDNamedComponent component)
+  {
+    super(source, label);  
+    this.component = component;
+    mySource = source;
+  }
+
+  public void performModify(final String value)
+  {
+    if (value.length() > 0)
+    {
+      DelayedRenameRunnable runnable = new DelayedRenameRunnable(component, value);
+      Display.getCurrent().asyncExec(runnable);
+    }
+  }      
+
+  protected static class DelayedRenameRunnable implements Runnable
+  {
+    protected XSDNamedComponent component;
+    protected String name;
+
+    public DelayedRenameRunnable(XSDNamedComponent component, String name)
+    {                                                               
+      this.component = component;
+      this.name = name;
+    }                                                              
+
+    public void run()
+    {                             
+      XSDSwitch xsdSwitch = new XSDSwitch()
+      {                   
+        public Object caseXSDTypeDefinition(XSDTypeDefinition object)
+        {
+          new GlobalSimpleOrComplexTypeRenamer(object, name).visitSchema(object.getSchema());
+          return null;
+        } 
+      
+        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
+        {           
+          if (object.isGlobal())
+          {
+            new GlobalElementRenamer(object, name).visitSchema(object.getSchema());
+          }
+          return null;
+        }
+      
+        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
+        {
+          new GlobalGroupRenamer(object, name).visitSchema(object.getSchema());
+          return null;
+        }
+      };
+      xsdSwitch.doSwitch(component); 
+      component.setName(name);
+      if (mySource instanceof TopLevelComponentEditPart)
+      {
+        ((TopLevelComponentEditPart)mySource).setReselect(true);        
+      }
+    }
+  }
+  
+  protected void bringDown()
+  {
+    super.bringDown();
+    if (mySource != null)
+    {
+      if (mySource instanceof TopLevelComponentEditPart)
+      {
+        ((TopLevelComponentEditPart)mySource).setReselect(true);        
+      }
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DirectEditPolicyDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DirectEditPolicyDelegate.java
new file mode 100644
index 0000000..b5cce8b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DirectEditPolicyDelegate.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+   
+import org.eclipse.jface.viewers.CellEditor;
+
+public interface DirectEditPolicyDelegate
+{       
+  public void performEdit(CellEditor cellEditor);  
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropCommand.java
new file mode 100644
index 0000000..aa7a60d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropCommand.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
+import org.eclipse.wst.xsd.ui.internal.actions.MoveAction;
+import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IConnectionRenderingViewer;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ComplexTypeDefinitionEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.GraphNodeEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ModelGroupDefinitionEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.ModelGroupEditPart;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+
+public class DragAndDropCommand extends Command //AbstractCommand
+{ 
+  protected EditPartViewer viewer;    
+  protected ChangeBoundsRequest request;
+  protected GraphNodeEditPart childRefEditPart;    
+  public GraphNodeEditPart parentEditPart; 
+  public Point location;
+  protected MoveAction action;    
+  protected boolean canExecute;
+
+  public DragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request)
+  {
+    this.viewer = viewer;                    
+    this.request = request;
+
+    location = request.getLocation();   
+    EditPart target = viewer.findObjectAt(location); 
+    if (viewer instanceof ScrollingGraphicalViewer)
+    {  
+      ScrollingGraphicalViewer sgv = (ScrollingGraphicalViewer)viewer;
+      Point p = ((FigureCanvas)sgv.getControl()).getViewport().getViewLocation();
+      location.y += p.y;
+      location.x += p.x;
+    }
+     
+    List list = request.getEditParts();
+    if (list.size() > 0)
+    {           
+      parentEditPart = getParentEditPart(target);
+      if (parentEditPart != null)
+      {                                          
+        for (Iterator i = parentEditPart.getChildren().iterator(); i.hasNext(); )
+        {
+          EditPart child = (EditPart)i.next();
+          if (child instanceof GraphNodeEditPart)
+          {
+            GraphNodeEditPart childGraphNodeEditPart = (GraphNodeEditPart)child;
+            Rectangle rectangle = childGraphNodeEditPart.getSelectionFigure().getBounds();
+     
+            if (location.y < rectangle.getCenter().y)
+            {                                    
+              childRefEditPart = childGraphNodeEditPart;   
+              break;
+            }
+          }
+        } 
+            
+        List editPartsList = request.getEditParts();
+        List concreteComponentList = new ArrayList(editPartsList.size());
+        for (Iterator i = editPartsList.iterator(); i.hasNext(); )
+        {                                                       
+          EditPart editPart = (EditPart)i.next();
+          concreteComponentList.add((XSDConcreteComponent)editPart.getModel());
+        } 
+        XSDConcreteComponent refComponent = childRefEditPart != null ? (XSDConcreteComponent)childRefEditPart.getModel() : null;
+
+        action = new MoveAction((XSDConcreteComponent)parentEditPart.getModel(), concreteComponentList, refComponent);
+        canExecute = action.canMove();                                            
+      }            
+    }     
+  }
+             
+  protected GraphNodeEditPart getParentEditPart(EditPart target)
+  {
+    GraphNodeEditPart result = null;    
+    while (target != null)
+    {                     
+      if (target instanceof ModelGroupEditPart)
+      {
+        result = (GraphNodeEditPart)target;
+        break;
+      }
+      else if (target instanceof ComplexTypeDefinitionEditPart ||
+               target instanceof ModelGroupDefinitionEditPart)
+      {
+        List list = target.getChildren();
+        for (Iterator i = list.iterator(); i.hasNext(); )
+        {
+          Object child = i.next();
+          if (child instanceof ModelGroupEditPart)
+          {
+            result = (GraphNodeEditPart)child;
+            break;
+          }
+        }   
+        if (result != null)
+        {
+          break;
+        }
+      }
+      target = target.getParent();
+    }
+    return result;
+  }
+
+  public void execute()
+  {           
+    if (canExecute)
+    { 
+      action.run(); 
+    }
+  }     
+  
+  public void redo()
+  {
+
+  }  
+  
+  public void undo()
+  {
+  }     
+  
+  public boolean canExecute()
+  { 
+    return canExecute;
+  } 
+
+  public PointList getConnectionPoints(Rectangle draggedFigureBounds)
+  {             
+    PointList pointList = null;      
+    if (parentEditPart != null && childRefEditPart != null && viewer instanceof IConnectionRenderingViewer)
+    {                                
+      pointList = ((IConnectionRenderingViewer)viewer).getConnectionRenderingFigure().getConnectionPoints(parentEditPart, childRefEditPart, draggedFigureBounds);      
+    }               
+    return pointList != null ? pointList : new PointList();
+  }                                                                  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropEditPolicy.java
new file mode 100644
index 0000000..18468c8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropEditPolicy.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+
+public class DragAndDropEditPolicy extends org.eclipse.gef.editpolicies.GraphicalEditPolicy
+{ 
+  protected EditPartViewer viewer;    
+  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
+
+  public DragAndDropEditPolicy(EditPartViewer viewer, SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy)
+  {
+    this.viewer = viewer;
+    this.selectionHandlesEditPolicy = selectionHandlesEditPolicy;
+  }
+
+  public boolean understandsRequest(Request req)
+  {
+	  return true;
+  }                           
+    
+  static int count2 = 0;
+  boolean theCommandResult = true;   
+  
+  public org.eclipse.gef.commands.Command getCommand(Request request)
+  {             
+    // this block is commented out to disable move for now
+    DragAndDropCommand command = null;                            
+    if (request instanceof ChangeBoundsRequest)
+    {
+      command = new DragAndDropCommand(viewer, (ChangeBoundsRequest)request);  
+      selectionHandlesEditPolicy.setDragAndDropCommand(command);
+    } 
+    return command;             
+  }                                                     
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/GraphNodeDragTracker.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/GraphNodeDragTracker.java
new file mode 100644
index 0000000..58fbaac
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/GraphNodeDragTracker.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.tools.DragEditPartsTracker;
+
+                                   
+public class GraphNodeDragTracker extends DragEditPartsTracker 
+{                                     
+  protected EditPart editPart; 
+           
+  public GraphNodeDragTracker(EditPart editPart)
+  {
+    super(editPart);
+    this.editPart = editPart;
+  } 
+                                              
+  protected Command getCommand() 
+  { 
+	  Request request = getTargetRequest();
+    return editPart.getCommand(request); 
+  }
+} 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SelectionHandlesEditPolicyImpl.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SelectionHandlesEditPolicyImpl.java
new file mode 100644
index 0000000..d09b53a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SelectionHandlesEditPolicyImpl.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+                                 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.MoveHandleLocator;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.BaseEditPart;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.IFeedbackHandler;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.BogusLayout;
+import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
+
+
+
+
+
+public class SelectionHandlesEditPolicyImpl	extends SelectionHandlesEditPolicy
+{
+  protected IFigure feedback;
+  protected Rectangle originalLocation;
+  protected DragAndDropCommand dragAndDropCommand;
+
+  protected List createSelectionHandles()
+  {              
+    List list = new ArrayList();
+    EditPart editPart = getHost();
+     
+    if (editPart instanceof GraphicalEditPart)
+    {
+      GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
+      IFigure figure = (graphicalEditPart instanceof BaseEditPart) ? 
+                          ((BaseEditPart)graphicalEditPart).getSelectionFigure() :
+                          graphicalEditPart.getFigure();
+   
+      Cursor cursorFigure = figure.getCursor();
+      MoveHandleLocator loc = new MoveHandleLocator(figure);    
+      MoveHandle moveHandle = new MoveHandle(graphicalEditPart, loc);     
+      moveHandle.setCursor(cursorFigure);
+      list.add(moveHandle);
+    }
+
+    return list;
+  }   
+  
+
+  public boolean understandsRequest(Request request)
+  {    
+    boolean result = false;
+
+	  if (REQ_MOVE.equals(request.getType()))
+    {  
+		  result = false; // return false to disable move for now 
+    }
+    else
+    {
+	    result = super.understandsRequest(request);
+    }
+    return result;
+  }
+  
+
+  public org.eclipse.gef.commands.Command getCommand(Request request) 
+  {                                          
+    return null;  
+  }   
+
+  public void setDragAndDropCommand(DragAndDropCommand dragAndDropCommand)
+  {
+    this.dragAndDropCommand = dragAndDropCommand;
+  }
+
+  protected org.eclipse.gef.commands.Command getMoveCommand(ChangeBoundsRequest request) 
+  {
+	  ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_MOVE_CHILDREN);
+	  req.setEditParts(getHost());
+	
+	  req.setMoveDelta(request.getMoveDelta());
+	  req.setSizeDelta(request.getSizeDelta());
+	  req.setLocation(request.getLocation());
+
+	  return getHost().getParent().getCommand(req);
+  } 
+
+  public void showSourceFeedback(Request request)
+  {  	
+	  if (REQ_MOVE.equals(request.getType()) ||
+		  REQ_ADD.equals(request.getType()))
+		  showChangeBoundsFeedback((ChangeBoundsRequest)request);
+  }
+
+  protected void showChangeBoundsFeedback(ChangeBoundsRequest request)
+  {
+  	IFigure p = getDragSourceFeedbackFigure();
+  	Rectangle r = originalLocation.getTranslated(request.getMoveDelta());
+  	Dimension resize = request.getSizeDelta();
+  	r.width += resize.width;
+  	r.height+= resize.height;
+  
+  	((GraphicalEditPart)getHost()).getFigure().translateToAbsolute(r);
+  	p.translateToRelative(r);
+                
+    Rectangle pBounds = r.getCopy();                            
+
+    if (dragAndDropCommand != null && dragAndDropCommand.canExecute())
+    {                     
+      int size = request.getEditParts().size();
+      if (size > 0 && request.getEditParts().get(size - 1) == getHost())
+      {         
+        PointList pointList = dragAndDropCommand.getConnectionPoints(r);
+        if (pointList != null && pointList.size() > 0)
+        {
+          polyLine.setPoints(pointList);
+          
+          Point firstPoint = pointList.getFirstPoint();
+          if (firstPoint != null)
+          {
+            pBounds = pBounds.getUnion(new Rectangle(firstPoint.x, firstPoint.y, 1, 1));
+          }
+        }
+      }
+    }
+    p.setBounds(pBounds);
+    ghostShape.setBounds(r);
+  	p.validate();
+  }        
+
+
+
+
+  protected IFigure getDragSourceFeedbackFigure() 
+  {
+    EditPart editPart = getHost(); 
+    if (feedback == null && editPart instanceof BaseEditPart)
+    {                                       
+      BaseEditPart baseEditPart = (BaseEditPart)editPart;
+		  originalLocation = new Rectangle(baseEditPart.getSelectionFigure().getBounds());
+		  feedback = createDragSourceFeedbackFigure(baseEditPart.getSelectionFigure());
+	  }
+	  return feedback;
+  }  
+    
+  Polyline polyLine;
+  RectangleFigure ghostShape;
+
+  protected IFigure createDragSourceFeedbackFigure(IFigure draggedFigure)
+  {
+		// Use a ghost rectangle for feedback  
+    ContainerFigure panel = new ContainerFigure(); 
+    panel.setLayoutManager(new BogusLayout());//new FreeformLayout());
+
+		ghostShape = new RectangleFigure();
+		FigureUtilities.makeGhostShape(ghostShape);
+		ghostShape.setLineStyle(Graphics.LINE_DASHDOT);
+		ghostShape.setForegroundColor(ColorConstants.white);
+    
+    Rectangle r = draggedFigure.getBounds();
+    panel.setOpaque(false);
+    panel.add(ghostShape);                 
+
+    polyLine = new Polyline();                         
+    //polyLine.setLineStyle(Graphics.LINE_DASHDOT);      
+    polyLine.setLineWidth(3);
+    panel.add(polyLine);
+
+    panel.setBounds(r);
+		ghostShape.setBounds(r);
+
+		addFeedback(panel);
+
+		return panel;
+	} 
+
+  public void deactivate()
+  {
+	  if (feedback != null)
+    {
+		  removeFeedback(feedback);
+		  feedback = null;
+	  }
+	  hideFocus();
+	  super.deactivate();
+  }
+
+  /**
+   * Erase feedback indicating that the receiver object is 
+   * being dragged.  This method is called when a drag is
+   * completed or cancelled on the receiver object.
+   * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
+   */
+  protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request) 
+  {
+	  if (feedback != null) 
+    {		      
+		  removeFeedback(feedback);
+	  }
+	  feedback = null;
+	  originalLocation = null;
+  }
+
+  /**
+   * Erase feedback indicating that the receiver object is 
+   * being dragged.  This method is called when a drag is
+   * completed or cancelled on the receiver object.
+   * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
+   */
+  public void eraseSourceFeedback(Request request) 
+  {
+    if (REQ_MOVE.equals(request.getType()) ||  REQ_ADD.equals(request.getType()))
+    {
+		  eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
+    }
+  }
+  
+  protected void hideSelection()
+  {
+    EditPart editPart = getHost();
+    if (editPart instanceof IFeedbackHandler)
+    {
+      ((IFeedbackHandler)editPart).removeFeedback();
+    }
+  }
+
+  protected void showSelection()
+  {
+    EditPart editPart = getHost();
+    if (editPart instanceof IFeedbackHandler)
+    {
+      ((IFeedbackHandler)editPart).addFeedback();
+    }
+  }  
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SimpleDirectEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SimpleDirectEditPolicy.java
new file mode 100644
index 0000000..531eef2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SimpleDirectEditPolicy.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.DirectEditPolicy;
+import org.eclipse.gef.requests.DirectEditRequest;
+                                   
+public class SimpleDirectEditPolicy extends DirectEditPolicy 
+{
+  protected DirectEditPolicyDelegate delegate;
+
+  public void setDelegate(DirectEditPolicyDelegate delegate)
+  {                                           
+    this.delegate = delegate;
+  }
+
+  protected org.eclipse.gef.commands.Command getDirectEditCommand(final DirectEditRequest request) 
+  { 
+  	return new Command() //AbstractCommand()
+    {
+      public void execute()
+      {                       
+        if (delegate != null)
+        {
+          delegate.performEdit(request.getCellEditor());
+        }  
+      }     
+  
+      public void redo()
+      {
+      }  
+  
+      public void undo()
+      {
+      }     
+  
+      public boolean canExecute()
+      {
+        return true;
+      }
+    };
+  }
+  
+  protected void showCurrentEditValue(DirectEditRequest request) 
+  {      
+  	//hack to prevent async layout from placing the cell editor twice.
+  	getHostFigure().getUpdateManager().performUpdate();
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TextCellEditorManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TextCellEditorManager.java
new file mode 100644
index 0000000..6409937
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TextCellEditorManager.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+                                                  
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Text;
+
+public abstract class TextCellEditorManager extends DirectEditManager implements DirectEditPolicyDelegate
+{
+  protected Label label;                                 
+
+  public TextCellEditorManager(GraphicalEditPart source,	Label label)
+  {
+	  super(source, TextCellEditor.class, new InternalCellEditorLocator(label));
+    this.label = label;     
+  }
+
+  protected void initCellEditor() 
+  {                                             
+  	String initialLabelText = label.getText();
+  	getCellEditor().setValue(initialLabelText);
+  	Text text = (Text)getCellEditor().getControl();
+  	text.setFont(label.getFont());
+    text.setForeground(label.getForegroundColor());
+    text.setBackground(label.getBackgroundColor());
+  	text.selectAll();
+  }	          
+
+  protected abstract void performModify(String value);
+    
+  public static class InternalCellEditorLocator implements CellEditorLocator
+  {
+    protected Label label;
+
+    public InternalCellEditorLocator(Label label)
+    {
+      this.label = label;
+    }                   
+
+    public void relocate(CellEditor celleditor) 
+    {
+      Text text = (Text)celleditor.getControl();  
+	    Point sel = text.getSelection();
+	    Point pref = text.computeSize(-1, -1);
+	    Rectangle rect = label.getTextBounds().getCopy();
+	    label.translateToAbsolute(rect);
+	    text.setBounds(rect.x-4, rect.y-1, pref.x+1, pref.y+1);	
+	    text.setSelection(0);
+	    text.setSelection(sel); 
+    }
+  }    
+
+  // implements DirectEditPolicyDelegate
+  // 
+  public void performEdit(CellEditor cellEditor)
+  {
+    performModify((String)cellEditor.getValue());
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TypeReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TypeReferenceDirectEditManager.java
new file mode 100644
index 0000000..c62d1e9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TypeReferenceDirectEditManager.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.EditPart;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.BaseEditPart;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+
+
+
+public class TypeReferenceDirectEditManager extends ComboBoxCellEditorManager
+{
+  protected BaseEditPart editPart;                                                
+  protected XSDElementDeclaration ed;
+
+  
+  public TypeReferenceDirectEditManager(BaseEditPart source,	XSDElementDeclaration ed, Label label)
+  {
+    super(source, label);  
+    editPart = source;               
+    this.ed = ed;
+  }
+
+  protected List computeComboContent()
+  {             
+    XSDSchema schema = ed.getSchema();
+    List typeNameList = new ArrayList();
+    if (schema != null)
+    {         
+      TypesHelper typesHelper = new TypesHelper(schema);
+      typeNameList.addAll(typesHelper.getUserSimpleTypeNamesList());
+      typeNameList.addAll(typesHelper.getUserComplexTypeNamesList());               
+      typeNameList.addAll(typesHelper.getBuiltInTypeNamesList());
+    }                        
+    return typeNameList;
+  }
+    
+  public void performModify(String value)
+  {                                               
+    // we need to perform an asyncExec here since the 'host' editpart may be removed
+    // as a side effect of performing the action
+    DelayedRenameRunnable runnable = new DelayedRenameRunnable(editPart, ed, value);
+    Display.getCurrent().asyncExec(runnable);   
+  }  
+   
+
+  protected List computeSortedList(List list)
+  {
+    return TypesHelper.sortList(list);
+  }
+
+  protected static class DelayedRenameRunnable implements Runnable
+  {
+    protected BaseEditPart editPart;                                                
+    protected EditPart editPartParent;
+    protected XSDElementDeclaration ed;
+    protected String name;
+
+    public DelayedRenameRunnable(BaseEditPart editPart, XSDElementDeclaration ed, String name)
+    {                                                               
+      this.editPart = editPart;
+      editPartParent = editPart.getParent();
+      this.ed = ed;
+      this.name = name;
+    }                                                              
+
+    public void run()
+    {                             
+      //BaseGraphicalViewer viewer = editPart.getBaseGraphicalViewer();
+      //viewer.setInputEnabled(false);
+      //viewer.setSelectionEnabled(false);      
+      if (name.equals("<anonymous>"))
+      {          
+        try
+        {
+          ed.getResolvedElementDeclaration().getElement().removeAttribute("type");
+        }
+        catch (Exception e)
+        {
+        }
+      }
+      else
+      {
+        if (ed.getResolvedElementDeclaration().getAnonymousTypeDefinition() != null) // isSetAnonymousTypeDefinition())
+        {
+          if (!(name.equals("<anonymous>")))
+          {
+            ed.getResolvedElementDeclaration().getElement().setAttribute("type", name);
+            XSDDOMHelper.updateElementToNotAnonymous(ed.getResolvedElementDeclaration().getElement());
+//            ed.getResolvedElementDeclaration().setAnonymousTypeDefinition(null);
+            return;
+          }
+        }
+        ed.getResolvedElementDeclaration().getElement().setAttribute("type", name);
+      }
+      //viewer.setInputEnabled(true);
+      //viewer.setSelectionEnabled(true);
+      //viewer.setSelection(new StructuredSelection(editPartParent));
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/BogusLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/BogusLayout.java
new file mode 100644
index 0000000..cfa8c75
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/BogusLayout.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+
+
+/**
+ * Figures using the StackLayout as their layout manager have
+ * their children placed on top of one another. Order of 
+ * placement is determined by the order in which the children
+ * were added, first child added placed on the bottom.
+ */
+public class BogusLayout
+	extends AbstractLayout
+{
+                             
+protected int spacing;
+
+public BogusLayout(){}
+
+protected Dimension calculatePreferredSize(IFigure figure, int w, int h)
+{	                 
+  Dimension d = new Dimension();
+  return d;
+} 
+
+/*
+ * Returns the minimum size required by the input container.
+ * This is the size of the largest child of the container, as all
+ * other children fit into this size.
+ */
+/*jvh - final
+public Dimension getMinimumSize(IFigure figure){
+	return new Dimension();
+}
+
+public Dimension getPreferredSize(IFigure figure){
+	return new Dimension();
+}            */
+
+/*
+ * Lays out the children on top of each other with
+ * their sizes equal to that of the available
+ * paintable area of the input container figure.
+ */
+public void layout(IFigure figure){   
+ 
+} 
+ 
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenterLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenterLayout.java
new file mode 100644
index 0000000..a0087ab
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenterLayout.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+
+/**
+ * Figures using the StackLayout as their layout manager have
+ * their children placed on top of one another. Order of 
+ * placement is determined by the order in which the children
+ * were added, first child added placed on the bottom.
+ */
+public class CenterLayout
+	extends AbstractLayout
+{
+                             
+protected int spacing;
+
+public CenterLayout(){}
+public CenterLayout(int spacing){ this.spacing = spacing; }
+
+/**
+ * Calculates and returns the preferred size of the input container.
+ * This is the size of the largest child of the container, as all
+ * other children fit into this size.
+ *
+ * @param figure  Container figure for which preferred size is required.
+ * @return  The preferred size of the input figure.
+ */
+protected Dimension calculatePreferredSize(IFigure figure, int w, int h){
+	Dimension d = calculatePreferredClientAreaSize(figure);
+	/*d.expand(figure.getInsets().getWidth(),
+	         figure.getInsets().getHeight()); */
+        d.expand(w,
+	         h);
+	d.union(getBorderPreferredSize(figure));
+	return d;
+}
+
+protected Dimension calculatePreferredClientAreaSize(IFigure figure){
+	Dimension d = new Dimension();
+	List children = figure.getChildren();
+	for (Iterator i = children.iterator(); i.hasNext(); )
+  {
+		IFigure child = (IFigure)i.next();
+    Dimension childSize = child.getPreferredSize();
+    d.height += childSize.height;
+    d.width = Math.max(childSize.width, d.width);
+	}	                    
+  int childrenSize = children.size();       
+  if (childrenSize > 0)
+  {
+    d.height += spacing * children.size() - 1;
+  }
+	return d;
+}
+
+/*
+ * Returns the minimum size required by the input container.
+ * This is the size of the largest child of the container, as all
+ * other children fit into this size.
+ */
+public Dimension getMinimumSize(IFigure figure, int wHint, int hHint){
+	Dimension d = new Dimension();
+	List children = figure.getChildren();
+	IFigure child;
+	for (int i=0; i < children.size(); i++){
+		child = (IFigure)children.get(i);
+		d.union(child.getMinimumSize());
+	}
+	d.expand(figure.getInsets().getWidth(),
+	         figure.getInsets().getHeight());
+	return d;
+}
+
+public Dimension getPreferredSize(IFigure figure, int wHint, int hHint){
+	return calculatePreferredSize(figure, wHint, hHint);
+}
+
+
+/*
+ * Lays out the children on top of each other with
+ * their sizes equal to that of the available
+ * paintable area of the input container figure.
+ */
+public void layout(IFigure figure){
+	Rectangle r = figure.getClientArea();
+	List children = figure.getChildren();
+  
+  Dimension preferredClientAreaSize = calculatePreferredClientAreaSize(figure);
+  int x = r.x + (r.width - preferredClientAreaSize.width) / 2;
+  int y = r.y + (r.height - preferredClientAreaSize.height) / 2;
+
+	for (Iterator i = children.iterator(); i.hasNext(); )
+  {
+		IFigure child = (IFigure)i.next();
+    Dimension childSize = child.getPreferredSize();
+		child.setBounds(new Rectangle(x, y, childSize.width, childSize.height));
+    y += childSize.height + spacing;
+	}
+}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenteredIconFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenteredIconFigure.java
new file mode 100644
index 0000000..3426bb0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenteredIconFigure.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Image;
+              
+
+public class CenteredIconFigure extends ContainerFigure
+{                                                
+  public Image image;  
+                               
+  public CenteredIconFigure()
+  {
+    super();
+    setFill(true);   
+  }
+
+  protected void fillShape(Graphics g)
+  {    
+    super.fillShape(g);    
+    if (image != null)
+    {                         
+      Rectangle r = getBounds();                                                         
+      Dimension imageSize = new Dimension(16, 16);
+      g.drawImage(image, r.x + (r.width - imageSize.width)/2, r.y + (r.height - imageSize.height)/2);
+    }
+  }          
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ConnectionFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ConnectionFigure.java
new file mode 100644
index 0000000..aaa05f1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ConnectionFigure.java
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+       
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.wst.xsd.ui.internal.graph.editparts.GraphNodeEditPart;
+
+              
+
+public class ConnectionFigure extends RectangleFigure
+{               
+  protected boolean isOutlined = true;
+  protected IFigure xsdFigure;
+
+  public ConnectionFigure(IFigure xsdFigure)
+  {
+    setOpaque(false);                   
+    this.xsdFigure = xsdFigure;
+    //setFocusTraversable(false); 
+    //setEnabled(false); 
+  }
+           
+  protected boolean isMouseEventTarget()
+  {
+    return false;
+  }        
+
+  public boolean containsPoint(int x, int y){return false;}
+
+  protected void fillShape(Graphics graphics)
+  { 
+    graphics.setForegroundColor(ColorConstants.black);
+    drawLines(graphics, xsdFigure);
+  }
+
+  protected void drawLines(Graphics graphics, IFigure figure)
+  {
+    if (figure instanceof GraphNodeFigure)
+    {
+      GraphNodeFigure graphNodeFigure = (GraphNodeFigure)figure;         
+      if (graphNodeFigure.isConnected() && graphNodeFigure.isExpanded())
+      {
+        List childList = graphNodeFigure.getChildGraphNodeFigures();
+        if (childList.size() > 0)
+        {                                         
+          Rectangle r = graphNodeFigure.getConnectionRectangle();    
+          
+          int x1 = r.x + r.width;
+          int y1 = r.y + r.height/2;
+          
+          int startOfChildBox = ((GraphNodeFigure)childList.get(0)).getConnectionRectangle().x;
+
+          int x2 = x1 + (startOfChildBox - x1) / 3;
+          int y2 = y1;
+                    
+          if (childList.size() > 1)
+          {                                 
+            graphics.drawLine(x1, y1, x2, y2);
+          
+            int minY = Integer.MAX_VALUE;
+            int maxY = -1;
+          
+            for (Iterator i = childList.iterator(); i.hasNext(); )
+            {
+              GraphNodeFigure childGraphNodeFigure = (GraphNodeFigure)i.next();
+              Rectangle childConnectionRectangle = childGraphNodeFigure.getConnectionRectangle();
+              int y = childConnectionRectangle.y + childConnectionRectangle.height / 2;
+             
+              minY = Math.min(minY, y);
+              maxY = Math.max(maxY, y);             
+              graphics.drawLine(x2, y, childConnectionRectangle.x, y);            
+            }                   
+            graphics.drawLine(x2, minY, x2, maxY);
+          }
+          else
+          {
+            graphics.drawLine(x1, y1, startOfChildBox, y2);
+          }
+        }                            
+      }                             
+    }
+
+    //boolean visitChildren = true;
+    List children = figure.getChildren();
+    for (Iterator i = children.iterator(); i.hasNext(); )
+    {
+      IFigure child = (IFigure)i.next();
+      drawLines(graphics, child);
+    }
+  }    
+
+
+  // This method supports the preview connection line function related to drag and drop
+  //     
+  public PointList getConnectionPoints(GraphNodeEditPart parentEditPart, GraphNodeEditPart childRefEditPart, Rectangle draggedFigureBounds)
+  {           
+    PointList pointList = new PointList();                         
+    int[] data = new int[1];
+    Point a = getConnectionPoint(parentEditPart, childRefEditPart, data);
+    if (a != null)
+    {   
+      int draggedFigureBoundsY = draggedFigureBounds.y + draggedFigureBounds.height/2;
+
+      pointList.addPoint(a); 
+      //pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
+      
+      if (data[0] == 0) // insert between 2 items
+      {                                         
+        int x = a.x + (draggedFigureBounds.x - a.x)/2;
+        pointList.addPoint(new Point(x, a.y));
+        pointList.addPoint(new Point(x, draggedFigureBoundsY));        
+        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
+      }
+      else // insert at first or last position
+      {
+        pointList.addPoint(new Point(a.x, draggedFigureBoundsY));   
+        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
+      }
+    }       
+    return pointList;
+  }
+
+         
+  // This method supports the preview connection line function related to drag and drop
+  //     
+  protected Point getConnectionPoint(GraphNodeEditPart parentEditPart, GraphNodeEditPart childRefEditPart, int[] data)
+  {                      
+    Point point = null;     
+    List childList = parentEditPart.getChildren();         
+
+    //TreeNodeIconFigure icon = ((TreeNodeFigure)parent.getFigure()).treeNodeIconFigure;
+                                                                                                                                               
+    if (childList.size() > 0)
+    {   
+      point = new Point();
+
+      GraphNodeEditPart prev = null;    
+      GraphNodeEditPart next = null;
+                               
+      for (Iterator i = childList.iterator(); i.hasNext(); )
+      {             
+        Object o = i.next();    
+        if (o instanceof GraphNodeEditPart)
+        {
+          GraphNodeEditPart childEditPart = (GraphNodeEditPart)o;        
+          if (childEditPart == childRefEditPart)
+          {
+            next = childEditPart;
+            break;
+          }                                           
+          prev = childEditPart;
+        }
+      }                            
+
+      if (next != null && prev != null)
+      { 
+        int ya = prev.getConnectionRectangle().getCenter().y;
+        int yb = next.getConnectionRectangle().getCenter().y;
+        point.y = ya + (yb - ya)/2;   
+        data[0] = 0;
+      }                               
+      else if (prev != null) // add it last
+      {
+        point.y = prev.getConnectionRectangle().getCenter().y;
+        data[0] = 1;
+      }
+      else if (next != null) // add it first!
+      {                           
+        point.y = next.getConnectionRectangle().getCenter().y;
+        data[0] = -1;
+      }
+          
+      if (next != null || prev != null)
+      {
+        GraphNodeEditPart child = prev != null ? prev : next;
+        int startOfChildBox = child.getConnectionRectangle().x;
+        Rectangle r = parentEditPart.getConnectionRectangle();  
+        int x1 = r.x + r.width;
+        point.x = x1 + (startOfChildBox - x1) / 3;
+      }
+    }    
+    return point;
+  }
+         
+
+  protected void outlineShape(Graphics graphics)
+  { 
+    if (isOutlined)
+    {
+      super.outlineShape(graphics);
+    }
+  } 
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerFigure.java
new file mode 100644
index 0000000..8594005
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerFigure.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.LayoutManager;
+import org.eclipse.draw2d.RectangleFigure;
+              
+public class ContainerFigure extends RectangleFigure
+{               
+  protected boolean isOutlined = false;
+
+  public ContainerFigure()
+  {
+    setLayoutManager(new ContainerLayout());
+    setFill(false);
+  }
+
+  public void doLayout()
+  {
+	  layout();
+	  setValid(true);
+  }  
+          
+  public ContainerLayout getContainerLayout()
+  {
+    return (ContainerLayout)getLayoutManager();
+  }           
+
+  public void setOutlined(boolean isOutlined)
+  {
+    this.isOutlined = isOutlined;
+  }     
+
+  protected void outlineShape(Graphics graphics)
+  { 
+    if (isOutlined)
+    {
+      super.outlineShape(graphics);
+    }
+  }
+  
+  
+  public void validate() 
+  {
+    if (isValid())
+    {
+      return;
+    }
+    super.validate();	
+    postLayout();
+  }
+
+
+  protected void postLayout()
+  {
+    LayoutManager layoutManager = getLayoutManager();
+    if (layoutManager instanceof PostLayoutManager)
+    {
+      ((PostLayoutManager)layoutManager).postLayout(this);    
+    }  
+  }  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerLayout.java
new file mode 100644
index 0000000..a30b6b8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerLayout.java
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.wst.xsd.ui.internal.gef.util.figures.SpacingFigure;
+
+public class ContainerLayout extends AbstractLayout implements PostLayoutManager
+{                                         
+  protected boolean isHorizontal;
+  protected int spacing = 0;
+  protected int border = 0;
+ 
+  public ContainerLayout()
+  { 
+    this(true, 0); 
+  }             
+
+  public ContainerLayout(boolean isHorizontal, int spacing)
+  {
+    this.isHorizontal = isHorizontal;   
+    this.spacing = spacing;
+  }  
+
+  public void setHorizontal(boolean isHorizontal)
+  {
+    this.isHorizontal = isHorizontal;
+  }  
+
+  public void setSpacing(int spacing)
+  {
+    this.spacing = spacing;
+  }  
+
+  public void setBorder(int border)
+  {
+    this.border = border;
+  }   
+
+  /**
+   * Calculates and returns the preferred size of the container 
+   * given as input.
+   * 
+   * @param figure  Figure whose preferred size is required.
+   * @return  The preferred size of the passed Figure.
+   */
+  protected Dimension calculatePreferredSize(IFigure parent, int w, int h)
+  { 
+    Dimension preferred = null;                                              
+                                  
+    // Here we ensure that an unexpanded container is given a size of (0,0)
+    //
+    if (parent instanceof GraphNodeContainerFigure)
+    {
+      GraphNodeContainerFigure graphNodeContainerFigure = (GraphNodeContainerFigure)parent;
+      if (!graphNodeContainerFigure.isExpanded())
+      {
+        preferred = new Dimension(); 
+      }
+    }   
+    
+    if (preferred == null)
+    {
+      preferred = new Dimension();
+      List children = parent.getChildren();
+                                            
+      for (int i=0; i < children.size(); i++)
+      {
+        IFigure child = (IFigure)children.get(i);      
+    
+        Dimension childSize = child.getPreferredSize();
+        /*
+        if (child instanceof Interactor)
+        {          
+          childSize.width = 9;
+          childSize.height = 9;
+        }*/  
+    
+        if (isHorizontal)
+        {
+          preferred.width += childSize.width;
+          preferred.height = Math.max(preferred.height, childSize.height);
+        }
+        else
+        {  
+          preferred.height += childSize.height;
+          preferred.width = Math.max(preferred.width, childSize.width);
+        }
+      }                                                 
+
+      int childrenSize = children.size();
+      if (childrenSize > 1)
+      {                      
+        if (isHorizontal)    
+        {
+          preferred.width += spacing * (childrenSize - 1);
+        }
+        else
+        {
+          preferred.height += spacing * (childrenSize - 1);
+        } 
+      }
+                            
+      preferred.width += border * 2;
+      preferred.height += border * 2;
+      preferred.width += parent.getInsets().getWidth();
+      preferred.height += parent.getInsets().getHeight();      
+    }
+    return preferred;
+  }
+
+                
+  protected int alignFigure(IFigure parent, IFigure child)
+  {         
+    int y = -1;                                                            
+    return y;
+  }
+
+  public void layout(IFigure parent)
+  {                        
+    List children = parent.getChildren();
+    Dimension preferred = new Dimension();
+
+    int rx = 0;
+    for (int i=0; i < children.size(); i++)
+    {
+      IFigure child = (IFigure)children.get(i);
+      Dimension childSize = child.getPreferredSize();
+      if (isHorizontal)
+      {   
+        preferred.height = Math.max(preferred.height, childSize.height);
+        rx += childSize.width;
+      }
+      else
+      {
+        preferred.width = Math.max(preferred.width, childSize.width);
+      }
+    }
+
+    if (isHorizontal)
+    {
+      preferred.height += border*2;
+      preferred.width += border;
+    }
+    else
+    {
+      preferred.width += border*2;
+      preferred.height += border;
+    }
+
+    int childrenSize = children.size(); 
+    for (int i=0; i < childrenSize; i++)
+    {
+      IFigure child = (IFigure)children.get(i);
+      Dimension childSize = child.getPreferredSize();
+      
+      if (isHorizontal)
+      {   
+        int y = alignFigure(parent, child);             
+
+      
+        if (y == -1)
+        {
+           y = (preferred.height - childSize.height) / 2;                                      
+        }      
+
+        Rectangle rectangle = new Rectangle(preferred.width, y, childSize.width, childSize.height);   
+        rectangle.translate(parent.getClientArea().getLocation());
+
+        child.setBounds(rectangle);         
+        preferred.width += childSize.width; 
+        preferred.width += spacing;   
+        
+        if (child instanceof SpacingFigure)
+        {          
+          int availableHorizontalSpace = parent.getClientArea().width - rx;
+          preferred.width += availableHorizontalSpace;
+        } 
+      }
+      else
+      {
+        Rectangle rectangle = new Rectangle(0, preferred.height, childSize.width, childSize.height);
+        rectangle.translate(parent.getClientArea().getLocation());
+        child.setBounds(rectangle);  
+        preferred.height += childSize.height;
+        preferred.height += spacing;
+      }
+    }     
+  }      
+  
+  public void postLayout(IFigure figure)
+  {       
+    // This method attempts to align a 'FloatableFigure' (e.g. an Element node) 
+    // with any content that it is connected to.  This way a chain of connected figures
+    // will be vertically aligned (e.g. element -> modelgroup -> element).  Any visible clipping of the
+    // figures in the graph is probably a result of a bug in this code that results in a 'FloatableFigure' being
+    // repositioned beyond the bounds of its parent.
+    //     
+    for (Iterator i = figure.getChildren().iterator(); i.hasNext();)
+    {
+      IFigure child = (IFigure)i.next();
+      if (child instanceof FloatableFigure)       
+      {        
+        FloatableFigure floatableFigure = (FloatableFigure)child;
+        GraphNodeFigure graphNodeFigure = floatableFigure.getGraphNodeFigure(); 
+        if (graphNodeFigure.isExpanded() && graphNodeFigure.getChildGraphNodeFigures().size() == 1)
+        {
+          GraphNodeFigure alignedChild = (GraphNodeFigure)graphNodeFigure.getChildGraphNodeFigures().get(0);      
+          Rectangle alignedChildBounds = alignedChild.getConnectionRectangle();                            
+          Rectangle childBounds = child.getBounds();
+        
+          int l = childBounds.y + childBounds.height/2;
+          int r = alignedChildBounds.y + alignedChildBounds.height/2;       
+          int delta = r - l;
+
+          fixUp(child, delta);
+        }          
+      }
+    }      
+  }      
+  
+  protected void fixUp(IFigure figure, int delta)
+  { 
+    Rectangle bounds = figure.getBounds();
+    bounds.y += delta;
+    figure.setBounds(bounds);
+      
+    for (Iterator i = figure.getChildren().iterator(); i.hasNext(); )
+    {
+      IFigure child = (IFigure)i.next();
+      fixUp(child, delta);
+    }                       
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ExpandableGraphNodeFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ExpandableGraphNodeFigure.java
new file mode 100644
index 0000000..e339103
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ExpandableGraphNodeFigure.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+              
+
+//  ------------------------------------------------------------
+//  | ExpandableGraphNodeFigure                                |
+//  |                                                          |
+//  |   ----------------------------------   ---------------   |
+//  |   | verticalGroup                  |   |             |   |
+//  |   |                                |   |             |   |
+//  |   | -----------------------------  |   |             |   |
+//  |   | | horizontalGroup           |  |   |             |   |
+//  |   | |                           |  |   |             |   |
+//  |   | | ---------------------     |  |   |             |   |
+//  |   | | | outlinedArea      |     |  |   |             |   |
+//  |   | | | ----------------- |     |  |   |  outer      |   |
+//  |   | | | | iconArea      | |     |  |   |  Content    |   |
+//  |   | | | ----------------- | [+] |  |   |  Area       |   |
+//  |   | | | ----------------- |     |  |   |             |   |
+//  |   | | | | innerContent  | |     |  |   |             |   |
+//  |   | | | ----------------- |     |  |   |             |   |
+//  |   | | ---------------------     |  |   |             |   |
+//  |   | -----------------------------  |   |             |   |
+//  |   |                                |   |             |   |
+//  |   |   ------------------           |   |             |   |
+//  |   |   | occurenceArea  |           |   |             |   |
+//  |   |   ------------------           |   |             |   |
+//  |   ----------------------------------   ---------------   |
+//  ------------------------------------------------------------
+
+public class ExpandableGraphNodeFigure extends RepeatableGraphNodeFigure
+{                        
+  protected ContainerFigure horizontalGroup;
+  protected Interactor interactor; 
+  protected ContainerFigure outerContentArea;
+
+  public boolean isExpanded()
+  {
+    return interactor.isExpanded();
+  }   
+
+  public void setExpanded(boolean isExpanded)
+  {
+    interactor.setExpanded(isExpanded);
+  }
+  
+  public ExpandableGraphNodeFigure()
+  {
+    super();    
+    isConnected = true;
+  }      
+
+  protected void createFigure()
+  {   
+    createPreceedingSpace(this);           
+    createVerticalGroup(this);
+    createHorizontalGroup(verticalGroup);
+    createOutlinedArea(horizontalGroup);   
+    createInteractor(horizontalGroup);
+    createOccurenceArea(verticalGroup);   
+    createOuterContentArea(this);
+  }
+  
+  protected void createVerticalGroup(IFigure parent)
+  {
+    verticalGroup = new FloatableFigure(this);
+    verticalGroup.getContainerLayout().setHorizontal(false);
+    parent.add(verticalGroup);
+  }
+
+  protected void createHorizontalGroup(IFigure parent)
+  {
+    horizontalGroup = new ContainerFigure();
+    parent.add(horizontalGroup);
+  }                 
+
+  protected void createInteractor(IFigure parent)
+  {
+    interactor = new Interactor();
+    interactor.setForegroundColor(ColorConstants.black);
+    interactor.setBackgroundColor(ColorConstants.white); 
+    parent.add(interactor);
+  } 
+
+  protected void createOuterContentArea(IFigure parent)
+  {
+    // create a small space between the interactor and the contentArea
+    //
+    RectangleFigure space = new RectangleFigure();
+    space.setVisible(false);
+    space.setPreferredSize(new Dimension(5, 10));
+    parent.add(space);   
+      
+    outerContentArea = new GraphNodeContainerFigure(this);
+    outerContentArea.getContainerLayout().setHorizontal(false);
+    parent.add(outerContentArea);
+  }
+
+  public Interactor getInteractor()
+  {
+    return interactor;
+  } 
+
+  public ContainerFigure getOuterContentArea()
+  {
+    return outerContentArea;
+  }
+     
+  public IFigure getConnectionFigure()
+  {
+    return horizontalGroup;
+  }
+
+  public Rectangle getConnectionRectangle()
+  {
+    return horizontalGroup.getBounds();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FillLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FillLayout.java
new file mode 100644
index 0000000..221c147
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FillLayout.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+
+/**
+ * Figures using the StackLayout as their layout manager have
+ * their children placed on top of one another. Order of 
+ * placement is determined by the order in which the children
+ * were added, first child added placed on the bottom.
+ */
+public class FillLayout extends AbstractLayout
+{
+         
+protected boolean isHorizontal = false;                    
+protected int spacing = 0;
+public Dimension min;  
+
+public FillLayout(){}     
+public FillLayout(boolean dummy){} 
+
+public FillLayout(int spacing)
+{ 
+  this.spacing = spacing; 
+}
+
+public void setHorizontal(boolean isHorizontal)
+{
+ this.isHorizontal = isHorizontal;
+}
+
+/**
+ * Calculates and returns the preferred size of the input container.
+ * This is the size of the largest child of the container, as all
+ * other children fit into this size.
+ *
+ * @param figure  Container figure for which preferred size is required.
+ * @return  The preferred size of the input figure.
+ */
+protected Dimension calculatePreferredSize(IFigure figure, int w, int h)
+{	                 
+  Dimension d = calculatePreferredClientAreaSize(figure);
+	d.expand(figure.getInsets().getWidth(),
+	         figure.getInsets().getHeight());
+	//d.union(getBorderPreferredSize(figure));
+	return d;
+} 
+
+protected Dimension calculatePreferredClientAreaSize(IFigure figure)
+{
+  Dimension d = new Dimension();
+	List children = figure.getChildren(); 
+
+
+	for (Iterator i = children.iterator(); i.hasNext(); )
+  {
+		IFigure child = (IFigure)i.next();
+    Dimension childSize = child.getPreferredSize();
+
+    if (isHorizontal)
+    {
+      d.width += childSize.width;
+      d.height = Math.max(childSize.height, d.height);
+    }
+    else
+    {
+      d.height += childSize.height;
+      d.width = Math.max(childSize.width, d.width);
+    }
+	}	 
+
+                   
+  int childrenSize = children.size();       
+  if (childrenSize > 0)
+  {
+    if (isHorizontal)
+      d.width += spacing * (childrenSize - 1); 
+    else
+      d.height += spacing * (childrenSize - 1);
+  }       
+    
+  if (min != null)
+  {
+    d.width = Math.max(d.width, min.width);
+    d.height = Math.max(d.height, min.height);
+  }
+  return d;
+}
+
+/*
+ * Returns the minimum size required by the input container.
+ * This is the size of the largest child of the container, as all
+ * other children fit into this size.
+ */
+public Dimension getMinimumSize(IFigure figure, int w, int h)
+{
+	Dimension d = new Dimension();
+	List children = figure.getChildren();
+	IFigure child;
+	for (int i=0; i < children.size(); i++){
+		child = (IFigure)children.get(i);
+		d.union(child.getMinimumSize());
+	}
+	d.expand(figure.getInsets().getWidth(),
+	         figure.getInsets().getHeight());
+	return d;
+}
+
+public Dimension getPreferredSize(IFigure figure, int w, int h)
+{
+	return calculatePreferredSize(figure, w, h);
+}
+
+/*
+ * Lays out the children on top of each other with
+ * their sizes equal to that of the available
+ * paintable area of the input container figure.
+ */
+public void layout(IFigure figure){   
+                     
+  Dimension	preferredSize = calculatePreferredClientAreaSize(figure);
+	Rectangle r = figure.getClientArea().getCopy(); 
+
+	List children = figure.getChildren();
+                                        
+	for (Iterator i = children.iterator(); i.hasNext(); )
+  {
+		IFigure child = (IFigure)i.next();
+    Dimension childSize = child.getPreferredSize();
+
+    if (isHorizontal)
+    {
+		  child.setBounds(new Rectangle(r.x, r.y, childSize.width, Math.max(preferredSize.height, r.height)));
+      r.x += childSize.width + spacing;
+    }
+    else
+    {            
+		  child.setBounds(new Rectangle(r.x, r.y, Math.max(preferredSize.width, r.width), childSize.height));
+      r.y += childSize.height + spacing;
+    }
+	}
+}
+} 
+ 
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FloatableFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FloatableFigure.java
new file mode 100644
index 0000000..c224145
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FloatableFigure.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+              
+
+public class FloatableFigure extends ContainerFigure
+{               
+  public GraphNodeFigure graphNodeFigure;  
+
+  public FloatableFigure(GraphNodeFigure graphNodeFigure)
+  {                  
+    super();
+    this.graphNodeFigure = graphNodeFigure;
+  }   
+
+  public GraphNodeFigure getGraphNodeFigure()
+  {
+    return graphNodeFigure;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeContainerFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeContainerFigure.java
new file mode 100644
index 0000000..c06a655
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeContainerFigure.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+              
+
+public class GraphNodeContainerFigure extends ContainerFigure
+{               
+  public ExpandableGraphNodeFigure expandableGraphNodeFigure;  
+
+  public GraphNodeContainerFigure(ExpandableGraphNodeFigure expandableGraphNodeFigure)
+  {                  
+    super();
+    this.expandableGraphNodeFigure = expandableGraphNodeFigure;
+  }     
+
+  public boolean isExpanded()
+  {
+    return expandableGraphNodeFigure.isExpanded();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeFigure.java
new file mode 100644
index 0000000..3d9706d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeFigure.java
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+              
+
+//  ------------------------------
+//  | GraphNodeFigure            |
+//  |                            |
+//  | -------------------------  |
+//  | | vertical group        |  |
+//  | | --------------------- |  |
+//  | | | outlined area     | |  |
+//  | | | ----------------- | |  |
+//  | | | | icon area     | | |  |
+//  | | | ----------------- | |  |
+//  | | | ----------------- | |  |
+//  | | | | inner content | | |  |
+//  | | | ----------------- | |  |
+//  | | --------------------- |  |
+//  | -------------------------  |
+//  ------------------------------
+
+public class GraphNodeFigure extends ContainerFigure
+{                        
+  protected ContainerFigure verticalGroup; 
+  protected ContainerFigure outlinedArea;
+  protected ContainerFigure iconArea;
+  protected ContainerFigure innerContentArea; 
+         
+  protected boolean isConnected;
+  protected boolean isIsolated;
+
+  protected List childGraphNodeFigures = new ArrayList();
+  protected GraphNodeFigure parentGraphNodeFigure; 
+
+  public GraphNodeFigure()
+  { 
+    isIsolated = false;
+    createFigure();
+  }      
+
+  public boolean isExpanded()
+  {
+    return true;
+  }    
+
+  public boolean isConnected()
+  {
+    return isConnected;
+  }                    
+
+  public void setConnected(boolean isConnected)
+  {
+    this.isConnected = isConnected;
+  }
+
+  public void setIsIsolated(boolean isIsolated)
+  {
+    this.isIsolated = isIsolated; 
+  }
+
+  public boolean getIsIsolated()
+  {
+    return isIsolated; 
+  }
+
+  protected void createFigure()
+  {
+    createVerticalGroup(this);
+    createOutlinedArea(verticalGroup); 
+  }
+
+  protected void createVerticalGroup(IFigure parent)
+  {
+    verticalGroup = new ContainerFigure();
+    verticalGroup.getContainerLayout().setHorizontal(false);
+    parent.add(verticalGroup);
+  }
+
+  protected void createOutlinedArea(IFigure parent)
+  { 
+    outlinedArea = new ContainerFigure();
+    outlinedArea.getContainerLayout().setHorizontal(false);
+    parent.add(outlinedArea);      
+     
+    iconArea = new ContainerFigure();
+    outlinedArea.add(iconArea);
+
+    innerContentArea = new ContainerFigure();
+    innerContentArea.getContainerLayout().setHorizontal(false);
+    outlinedArea.add(innerContentArea);  
+  }   
+
+  public ContainerFigure getIconArea()
+  {
+    return iconArea;
+  }
+
+  public ContainerFigure getOutlinedArea()
+  {
+    return outlinedArea;
+  }
+
+  public ContainerFigure getInnerContentArea()
+  {
+    return innerContentArea;
+  } 
+
+  public IFigure getConnectionFigure()
+  {
+    return outlinedArea;
+  }
+
+  public Rectangle getConnectionRectangle()
+  {
+    return outlinedArea.getBounds();
+  }
+
+  public List getChildGraphNodeFigures()
+  {
+    return childGraphNodeFigures;
+  }
+
+  public void addNotify()                     
+  {
+    super.addNotify();                 
+    if (isConnected())
+    {
+      parentGraphNodeFigure = computeParentGraphNodeFigure(this);
+      if (parentGraphNodeFigure != null)
+      {   
+        parentGraphNodeFigure.getChildGraphNodeFigures().add(this);
+      }   
+    }
+  } 
+
+  public void removeNotify()
+  {     
+    super.removeNotify();
+    if (parentGraphNodeFigure != null)
+    {   
+      parentGraphNodeFigure.getChildGraphNodeFigures().remove(this);
+    }  
+  }
+
+  public GraphNodeFigure getParentGraphNodeFigure()
+  {
+    return parentGraphNodeFigure;
+  }  
+
+  public GraphNodeFigure computeParentGraphNodeFigure(IFigure figure)
+  {                   
+    GraphNodeFigure result = null;
+    IFigure parent = figure != null ? figure.getParent() : null;
+    while (parent != null)
+    {
+      if (parent instanceof GraphNodeFigure)
+      {    
+        GraphNodeFigure parentGraphNodeFigure = (GraphNodeFigure)parent;
+        if (parentGraphNodeFigure.isConnected())
+        {
+          result = (GraphNodeFigure)parent;
+          break;
+        }
+      }
+      parent = parent.getParent();
+    }   
+    return result;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/Interactor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/Interactor.java
new file mode 100644
index 0000000..7a64b8f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/Interactor.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * Interactor the +/- control commonly found in trees
+ */
+public class Interactor extends RectangleFigure
+{
+  protected boolean isExpanded;
+
+  public Interactor()
+  {
+    super(); 
+    setPreferredSize(new Dimension(9, 9));               
+  }  
+
+  public void setExpanded(boolean isExpanded)
+  {                                         
+    this.isExpanded = isExpanded;
+  }
+
+  public boolean isExpanded()
+  {
+    return isExpanded;
+  }
+    
+  protected void fillShape(Graphics g)
+  {
+    super.fillShape(g);
+    Rectangle r = getBounds();                          
+    int mx = r.x + r.width / 2;
+    int my = r.y + r.height / 2;    
+    int s = 2;       
+    g.drawLine(r.x + s, my, r.x + r.width - s - 1, my); 
+    if (!isExpanded)
+    {
+      g.drawLine(mx, r.y + s, mx, r.y + r.height - s -1);
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/LabelFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/LabelFigure.java
new file mode 100644
index 0000000..04c82b8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/LabelFigure.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+              
+
+public class LabelFigure extends Figure
+{                                                
+  protected String text = "";  
+  protected boolean isShowEmptyLabel = true;
+  protected int left = 4; 
+  protected int right = 4; 
+  protected int textHeight;
+  protected int textWidth;
+                       
+  public LabelFigure()
+  {
+    setPreferredSize(new Dimension());
+  }  
+
+  protected void setLeft(int left)
+  {
+    this.left = left;
+  }
+
+  protected void setRight(int right)
+  {
+    this.right = right;
+  }
+
+  public void setShowEmptyLabel(boolean isShowEmptyLabel)
+  {
+    this.isShowEmptyLabel = isShowEmptyLabel;
+  }     
+       
+
+  public void setText(String s)
+  { 
+	  if (s == null)
+		  s = "";
+
+    if (!text.equals(s))
+    {
+	    text = s;
+      if (text.length() > 0 || isShowEmptyLabel)
+      {
+        textHeight = FigureUtilities.getFontMetrics(getFont()).getHeight();
+        textWidth = FigureUtilities.getTextWidth(text, getFont());
+        textWidth = Math.max(textWidth, FigureUtilities.getTextWidth("abcdefg", getFont()));
+        setPreferredSize(new Dimension(textWidth + left + right, textHeight));
+      } 
+      else
+      {
+        setPreferredSize(new Dimension());
+      } 
+    }   
+    //revalidate(); 
+    //repaint();
+  }
+
+
+  
+  protected void paintFigure(Graphics graphics)
+  //protected void fillShape(Graphics graphics)
+  {  
+    super.paintFigure(graphics);
+    //super.fillShape(graphics);
+    if (text.length() > 0)
+    {
+      Rectangle r = getBounds();
+		  graphics.setForegroundColor(getForegroundColor());
+      graphics.drawString(text, left + r.x, r.y);// + (r.width - textWidth)/2, r.y + (r.height - textHeight)/2);           
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/PostLayoutManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/PostLayoutManager.java
new file mode 100644
index 0000000..21a1f54
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/PostLayoutManager.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+
+import org.eclipse.draw2d.IFigure;
+
+
+public interface PostLayoutManager
+{
+  public void postLayout(IFigure figure);                    
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RepeatableGraphNodeFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RepeatableGraphNodeFigure.java
new file mode 100644
index 0000000..fd8d249
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RepeatableGraphNodeFigure.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
+
+
+              
+
+//  ------------------------------
+//  | RepeatableGraphNodeFigure  |
+//  |                            |
+//  | -------------------------  |
+//  | | vertical group        |  |
+//  | | --------------------- |  |
+//  | | | outlined area     | |  |
+//  | | | ----------------- | |  |
+//  | | | | icon area     | | |  |
+//  | | | ----------------- | |  |
+//  | | | ----------------- | |  |
+//  | | | | inner content | | |  |
+//  | | | ----------------- | |  |
+//  | | --------------------- |  |
+//  | |                       |  |
+//  | | ------------------    |  |
+//  | | | occurence area |    |  |
+//  | | ------------------    |  |
+//  | -------------------------  |
+//  ------------------------------
+
+public class RepeatableGraphNodeFigure extends GraphNodeFigure
+{                            
+  protected ContainerFigure occurenceArea;  
+  protected LabelFigure occurenceLabel; 
+
+  public RepeatableGraphNodeFigure()
+  {    
+    super();          
+  }     
+
+  protected void createFigure()
+  {                  
+    createPreceedingSpace(this);
+    createVerticalGroup(this);
+    createOutlinedArea(verticalGroup); 
+    createOccurenceArea(verticalGroup);
+  }
+
+  protected void createOccurenceArea(IFigure parent)
+  {
+    occurenceArea = new ContainerFigure();   
+    occurenceLabel = new LabelFigure();
+    occurenceLabel.setForegroundColor(ColorConstants.black);
+    occurenceLabel.setShowEmptyLabel(false);
+    occurenceLabel.setFont(GraphicsConstants.medium); 
+    occurenceArea.add(occurenceLabel);               
+    parent.add(occurenceArea);
+  }
+                                 
+  protected void createPreceedingSpace(IFigure parent)
+  {
+    // create a small space
+    RectangleFigure space = new RectangleFigure();
+    space.setVisible(false);
+    space.setPreferredSize(new Dimension(10, 10));
+    parent.add(space);  
+  } 
+
+  public LabelFigure getOccurenceLabel()
+  {
+    return occurenceLabel;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RoundedLineBorder.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RoundedLineBorder.java
new file mode 100644
index 0000000..75dbff7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RoundedLineBorder.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.figures;
+            
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.swt.graphics.Color;
+              
+
+public class RoundedLineBorder extends LineBorder
+{               
+  protected int arcLength;   
+  protected int lineStyle = Graphics.LINE_SOLID;
+
+  public RoundedLineBorder(Color c, int width, int arcLength)
+  {
+	  super(c, width);     
+    this.arcLength = arcLength;
+  }
+
+  public RoundedLineBorder(int width, int arcLength)
+  {
+	  super(width);     
+    this.arcLength = arcLength;
+  }
+  
+  public RoundedLineBorder(Color c, int width, int arcLength, int lineStyle)
+  {
+    super(c, width);
+    this.arcLength = arcLength;
+    this.lineStyle = lineStyle;
+  }
+
+  public RoundedLineBorder(int width, int arcLength, int lineStyle)
+  {
+    super(width);
+    this.arcLength = arcLength;
+    this.lineStyle = lineStyle;
+  }
+
+  public void paint(IFigure figure, Graphics graphics, Insets insets)
+  {
+      int rlbWidth = getWidth();
+	  tempRect.setBounds(getPaintRectangle(figure, insets));
+  	if (rlbWidth%2 == 1)
+    {
+		  tempRect.width--;
+		  tempRect.height--;
+	  }
+	  tempRect.shrink(rlbWidth/2,rlbWidth/2);
+	  graphics.setLineWidth(rlbWidth);
+    graphics.setLineStyle(lineStyle);
+	  if (getColor() != null)
+		  graphics.setForegroundColor(getColor());
+	  graphics.drawRoundRectangle(tempRect, arcLength, arcLength);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/Category.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/Category.java
new file mode 100644
index 0000000..31aa07b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/Category.java
@@ -0,0 +1,265 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.model;
+                                   
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+public class Category implements ModelAdapter
+{
+  public final static int ATTRIBUTES = 1;
+  public final static int ELEMENTS = 2;
+  public final static int TYPES = 3;
+  public final static int GROUPS = 5;
+  public final static int DIRECTIVES = 6;
+  public final static int NOTATIONS = 7;
+  public final static int ATTRIBUTE_GROUPS = 8;
+  public final static int IDENTITY_CONSTRAINTS = 9;
+  public final static int ANNOTATIONS = 10;
+
+  
+  protected XSDSchema schema;
+  protected int groupType;
+
+  //public void modelNameChanged();
+  public Category(XSDSchema schema, int groupType)
+  {
+    this.schema = schema;
+    this.groupType = groupType;
+  }       
+
+  public int getGroupType()
+  {
+    return groupType;
+  }   
+
+  public XSDSchema getXSDSchema()
+  {
+    return schema;
+  }
+
+  public String getName()
+  {
+    String name = "";
+    switch (groupType)
+    {
+      case ATTRIBUTES       : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_ATTRIBUTES"); break; }
+      case NOTATIONS        : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_NOTATIONS"); break; }
+      case ELEMENTS         : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_ELEMENTS"); break; }
+      case TYPES             : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_TYPES"); break; }    
+      case GROUPS           : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_GROUPS"); break; }      
+      case DIRECTIVES       : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_DIRECTIVES"); break; }
+    }      
+    return name;
+  }
+              
+  public List getChildren()
+  {                      
+    List list = Collections.EMPTY_LIST;
+    switch (groupType)
+    {
+      case ATTRIBUTES       : { list = getAttributeList(); break; }
+      case NOTATIONS        : { list = getNotations(); break; }
+      case ELEMENTS         : { list = getGlobalElements(); break; }
+      case TYPES            : { list = getTypes();  break; }
+      case GROUPS           : { list = getGroups(); break; }
+      case DIRECTIVES       : { list = getDirectives(); break; }
+    }      
+    return list;
+  }
+  
+  private boolean isSameNamespace(String ns1, String ns2)
+  {
+    if (ns1 == null) ns1 = "";
+    if (ns2 == null) ns2 = "";
+    
+    if (ns1.equals(ns2))
+    {
+      return true;
+    }
+    return false;
+  }
+  
+  protected List getGlobalElements()
+  {
+    List elements = schema.getElementDeclarations();
+    List list = new ArrayList();
+    for (Iterator i = elements.iterator(); i.hasNext(); )
+    {
+      XSDElementDeclaration elem = (XSDElementDeclaration)i.next();
+      if (isSameNamespace(elem.getTargetNamespace(),schema.getTargetNamespace()))
+      {
+        list.add(elem);
+      }
+    }                
+    return list;
+  }
+
+  protected List getTypes()
+  {
+    List allTypes = schema.getTypeDefinitions();
+    List list = new ArrayList();
+    for (Iterator i = allTypes.iterator(); i.hasNext(); )
+    {
+      XSDTypeDefinition td = (XSDTypeDefinition)i.next();
+      if (td instanceof XSDComplexTypeDefinition)
+      {
+        XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)td;
+        if (isSameNamespace(ct.getTargetNamespace(),schema.getTargetNamespace()))
+        {
+          list.add(ct);
+        }
+      }
+    }                
+
+//    List simpleTypes = schema.getTypeDefinitions();
+    for (Iterator i = allTypes.iterator(); i.hasNext(); )
+    {
+      XSDTypeDefinition td = (XSDTypeDefinition)i.next();
+      if (td instanceof XSDSimpleTypeDefinition)
+      {
+        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)td;
+        if (isSameNamespace(st.getTargetNamespace(),schema.getTargetNamespace()))
+        {
+          list.add(st);
+        }
+      }
+    }                
+    return list;
+  }
+  
+  protected List getGroups()
+  {
+    List groups = schema.getModelGroupDefinitions();
+    List list = new ArrayList();
+    for (Iterator i = groups.iterator(); i.hasNext(); )
+    {
+      XSDModelGroupDefinition group = (XSDModelGroupDefinition)i.next();
+      if (isSameNamespace(group.getTargetNamespace(),schema.getTargetNamespace()))
+      {
+        list.add(group);
+      }
+    }                
+    return list;
+  }
+  
+  protected List getDirectives()
+  {                 
+    List list = new ArrayList();
+    for (Iterator i = schema.getContents().iterator(); i.hasNext(); )
+    {
+      Object o = i.next();
+      if (o instanceof XSDSchemaDirective)
+      {
+        list.add(o);
+      }
+    } 
+    return list;
+  }
+
+  protected List getAttributeList()
+  {
+    List attributesList = new ArrayList();
+    for (Iterator iter = schema.getAttributeDeclarations().iterator(); iter.hasNext(); )
+    {
+      Object o = iter.next();
+      if (o instanceof XSDAttributeDeclaration)
+      {
+        XSDAttributeDeclaration attr = (XSDAttributeDeclaration)o;
+        if (attr != null)
+        {
+          if (attr.getTargetNamespace() != null)
+          {
+            if (!(attr.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema-instance")))
+            {
+              if (isSameNamespace(attr.getTargetNamespace(), schema.getTargetNamespace()))
+              {
+                attributesList.add(attr);
+              }
+            }
+          }
+          else
+          {
+            if (isSameNamespace(attr.getTargetNamespace(),schema.getTargetNamespace()))
+            {
+              attributesList.add(attr);
+            }
+          }
+        }
+      }
+    }
+    return attributesList;
+  }
+
+  protected List getNotations()
+  {
+    List notations = schema.getNotationDeclarations();
+    List list = new ArrayList();
+    for (Iterator i = notations.iterator(); i.hasNext(); )
+    {
+      XSDNotationDeclaration notation = (XSDNotationDeclaration)i.next();
+      if (isSameNamespace(notation.getTargetNamespace(),schema.getTargetNamespace()))
+      {
+        list.add(notation);
+      }
+    }                
+    return list;
+  }
+  
+  //
+  protected List listenerList = new ArrayList();
+                                                                                           
+  public void addListener(ModelAdapterListener l)
+  {
+    listenerList.add(l);
+  }  
+
+  public void removeListener(ModelAdapterListener l)
+  {
+    listenerList.remove(l);
+  } 
+
+  public Object getProperty(Object modelObject, String propertyName)
+  {
+    return null;
+  }
+
+  public void firePropertyChanged(Object modelObject, String propertyName)
+  {
+    List newList = new ArrayList();
+    newList.addAll(listenerList);
+    for (Iterator i = newList.iterator(); i.hasNext(); )
+    {
+      ModelAdapterListener l = (ModelAdapterListener)i.next();                  
+      try
+      {
+        l.propertyChanged(modelObject, propertyName);
+      }
+      catch (Exception e)
+      {
+      }
+    }
+  }  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapter.java
new file mode 100644
index 0000000..3066987
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapter.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.model;
+
+
+
+public interface ModelAdapter
+{               
+  public static final String CHILDREN_PROPERTY = "CHILDREN_PROPERTY";
+  public static final String LABEL_PROPERTY = "LABEL_PROPERTY";
+  public static final String IMAGE_PROPERTY = "IMAGE_PROPERTY";
+  public static final String DETAIL_PROPERTY = "DETAIL_PROPERTY";
+                                       
+  public void addListener(ModelAdapterListener l);
+  public void removeListener(ModelAdapterListener l);
+  public Object getProperty(Object modelObject, String propertyName); 
+  public void firePropertyChanged(Object modelObject, String propertyName);
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapterListener.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapterListener.java
new file mode 100644
index 0000000..ff6e4db
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapterListener.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.model;
+
+
+
+public interface ModelAdapterListener
+{                             
+  public void propertyChanged(Object object, String property);
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/XSDModelAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/XSDModelAdapterFactory.java
new file mode 100644
index 0000000..98f051a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/XSDModelAdapterFactory.java
@@ -0,0 +1,559 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.graph.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDAbstractAdapter;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.util.XSDSwitch;
+
+
+
+
+public class XSDModelAdapterFactory
+{  
+  protected static XSDModelAdapterFactory instance;
+  protected static XSDAdapterFactoryImpl xsdAdapterFactoryImpl = new XSDAdapterFactoryImpl();
+                                              
+  public static XSDModelAdapterFactory getInstance()
+  {
+    if (instance == null)
+    {
+      instance = new XSDModelAdapterFactory();
+    }                                         
+    return instance;
+  }
+
+
+  public static ModelAdapter getAdapter(Object o)
+  {                             
+    ModelAdapter result = null;
+    if (o instanceof Notifier)
+    {                                
+      Notifier target = (Notifier)o;
+		  Adapter adapter = xsdAdapterFactoryImpl.adapt(target);
+      if (adapter instanceof XSDObjectAdapter)
+      {
+        result = (XSDObjectAdapter)adapter;
+      }
+    }                              
+    else if (o instanceof ModelAdapter)
+    {
+      result = (ModelAdapter)o;
+    }
+    return result;
+  }             
+    
+
+  public static XSDObjectAdapter getExisitingAdapter(Object xsdObject)
+  {  
+    XSDObjectAdapter result = null;
+    if (xsdObject instanceof Notifier)
+    {                                
+      Notifier target = (Notifier)xsdObject;
+		  Adapter adapter = EcoreUtil.getExistingAdapter(target,xsdAdapterFactoryImpl);
+      if (adapter instanceof XSDObjectAdapter)
+      {
+        result = (XSDObjectAdapter)adapter;
+      }
+    }
+    return result;
+  }
+   
+  //
+  //
+  //
+  public static class XSDAdapterFactoryImpl extends AdapterFactoryImpl
+  {
+    public Adapter createAdapter(Notifier target)
+    {
+      XSDSwitch xsdSwitch = new XSDSwitch()
+      {                   
+        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
+        {
+          return new XSDElementDeclarationAdapter(object);
+        }
+        
+        public Object caseXSDParticle(XSDParticle object)
+        {
+          return new XSDParticleAdapter(object);
+        }
+
+        public Object caseXSDSchema(XSDSchema object) 
+        {
+          return new XSDSchemaAdapter(object);
+        }
+
+        public Object defaultCase(EObject object) 
+        {
+          return new XSDObjectAdapter();
+        }         
+      };
+      Object o = xsdSwitch.doSwitch((EObject)target);
+
+      Adapter result = null;
+      if (o instanceof Adapter)
+      {
+        result  = (Adapter)o;
+      }
+      else
+      {          
+//        System.out.println("did not create adapter for target : " + target);
+//        Thread.dumpStack();
+      }
+      return result;
+    }      
+                               
+
+    public Adapter adapt(Notifier target)
+    {
+      return adapt(target, this);
+    }
+  }
+    
+
+ 
+  //
+  //
+  //
+  protected static class XSDObjectAdapter extends AdapterImpl implements ModelAdapter
+  {   
+    protected List listenerList = new ArrayList();
+    protected boolean isUpdating = false;
+                                  
+    public boolean isAdapterForType(Object type)
+    {
+      return type == xsdAdapterFactoryImpl;
+    }                                             
+                
+    public void addListener(ModelAdapterListener l)
+    {
+      listenerList.add(l);
+    }  
+
+    public void removeListener(ModelAdapterListener l)
+    {
+      listenerList.remove(l);
+    } 
+                
+    public Object getProperty(Object modelObject, String propertyName)
+    {
+      Object result = null;
+      if (ModelAdapter.LABEL_PROPERTY.equals(propertyName))
+      {
+      	result = "";
+      	// TODO... move this logic into each adapter
+      	//
+        if (modelObject instanceof XSDNamedComponent)
+        {
+      	  result = ((XSDNamedComponent)modelObject).getName();
+        }
+        else if (modelObject instanceof XSDSchemaDirective)
+        {
+       	  result = ((XSDSchemaDirective)modelObject).getSchemaLocation();
+          if (result == null) result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
+          if (result.equals("")) result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
+          return result;
+        }
+      }
+      else if ("drillDown".equals(propertyName))
+      {
+      	// TODO... move this logic into each adapter
+      	//   
+      	List list = XSDChildUtility.getModelChildren(modelObject);	
+      	result = list.size() > 0 ? Boolean.TRUE : Boolean.FALSE;      	   
+      }      
+      else if (ModelAdapter.IMAGE_PROPERTY.equals(propertyName))
+      {
+      	// result = XSDEditorPlugin.getDefault().getImage("icons/XSDElement.gif");
+        XSDModelAdapterFactoryImpl factory = XSDModelAdapterFactoryImpl.getInstance();
+        Adapter adapter = factory.createAdapter((Notifier)modelObject);
+        result = ((XSDAbstractAdapter)adapter).getImage(modelObject);
+      }	
+      return result;
+    }
+
+    public void firePropertyChanged(Object modelObject, String propertyName)
+    {
+      List newList = new ArrayList();
+      newList.addAll(listenerList);
+      for (Iterator i = newList.iterator(); i.hasNext(); )
+      {
+        ModelAdapterListener l = (ModelAdapterListener)i.next();                  
+        try
+        {
+          l.propertyChanged(modelObject, propertyName);
+        }
+        catch (Exception e)
+        {
+        }
+      }
+    }  
+
+    public void notifyChanged(Notification msg)
+    {        
+      firePropertyChanged(msg.getNotifier(), null);
+    }     
+  }
+       
+  protected static class XSDParticleAdapter extends XSDObjectAdapter implements ModelAdapterListener
+  {
+    protected XSDParticle particle;
+
+    public XSDParticleAdapter(XSDParticle particle)
+    {
+      this.particle = particle;
+    } 
+
+    public void notifyChanged(Notification msg)
+    {
+      XSDParticle xsdParticle = (XSDParticle)msg.getNotifier();
+      XSDParticleContent xsdParticleContent = xsdParticle.getContent();
+      XSDModelAdapterFactoryImpl factory = XSDModelAdapterFactoryImpl.getInstance();
+      if (xsdParticleContent != null)
+      {
+        if (xsdParticleContent instanceof XSDElementDeclaration)
+        {
+          firePropertyChanged((XSDElementDeclaration)xsdParticleContent, null);
+          factory.fireNotifyChanged(msg);
+        }
+        else if (xsdParticleContent instanceof XSDModelGroup)
+        {
+          firePropertyChanged((XSDModelGroup)xsdParticleContent, null);
+          factory.fireNotifyChanged(msg);
+        }
+        else if (xsdParticleContent instanceof XSDWildcard)
+        {
+          firePropertyChanged((XSDWildcard)xsdParticleContent, null);
+          factory.fireNotifyChanged(msg);
+        }
+      }
+    } 
+
+
+    public void propertyChanged(Object object, String property)
+    {
+      firePropertyChanged(object, property);
+    }
+  }                         
+     
+  //
+  //
+  //
+  protected static class XSDElementDeclarationAdapter extends XSDObjectAdapter implements ModelAdapterListener
+  {
+    protected XSDElementDeclaration ed;
+    protected XSDTypeDefinition typeDefinition;          
+
+    public XSDElementDeclarationAdapter(XSDElementDeclaration ed)
+    {
+      this.ed = ed;
+      updateTypeDefinition();
+    } 
+    
+    protected void updateTypeDefinition()
+    {
+      XSDTypeDefinition td = ed.getTypeDefinition();
+      td = (td instanceof XSDComplexTypeDefinition) ? td : null;
+      if (td != typeDefinition)
+      {                     
+        if (typeDefinition != null)
+        {
+          XSDObjectAdapter adapter = (XSDObjectAdapter)xsdAdapterFactoryImpl.adapt(typeDefinition);
+          adapter.removeListener(this);
+        }
+        typeDefinition = td;
+        if (typeDefinition != null)
+        {
+          XSDObjectAdapter adapter = (XSDObjectAdapter)xsdAdapterFactoryImpl.adapt(typeDefinition);
+          adapter.addListener(this);
+        }
+      }
+    } 
+
+
+    public void notifyChanged(Notification msg)
+    {
+      updateTypeDefinition();    
+      firePropertyChanged(msg.getNotifier(), null);                                                                          
+    } 
+
+
+    public void propertyChanged(Object object, String property)
+    {                         
+      // here we propagate typeDefinition changes to our listeners
+      firePropertyChanged(object, property);
+    }
+  }                         
+  
+
+  //
+  //
+  protected static class XSDSchemaAdapter extends XSDObjectAdapter
+  { 
+    protected XSDSchema schema;
+    protected List groups;            
+
+    public XSDSchemaAdapter(XSDSchema schema)
+    {
+      this.schema = schema;                         
+      groups = new ArrayList();                                       
+      groups.add(new Category(schema, Category.DIRECTIVES));
+      groups.add(new Category(schema, Category.ATTRIBUTES)); 
+      //groups.add(new Category(schema, Category.ATTRIBUTE_GROUPS));
+      groups.add(new Category(schema, Category.ELEMENTS));
+      groups.add(new Category(schema, Category.TYPES));
+      //groups.add(new Category(schema, Category.SIMPLE_TYPES));
+      groups.add(new Category(schema, Category.GROUPS));
+    }
+
+    public void notifyChanged(Notification msg)
+    {
+      super.notifyChanged(msg);
+      for (Iterator i = groups.iterator(); i.hasNext(); )
+      {
+        ModelAdapter group = (ModelAdapter)i.next();
+        group.firePropertyChanged(group, null);
+      }
+    }
+
+    public Object getProperty(Object modelObject, String propertyName)
+    {
+      Object result = null;
+      if ("groups".equals(propertyName))
+      { 
+        /*
+        List list = new ArrayList();
+        for (Iterator i = groups.iterator(); i.hasNext(); )
+        {
+          Category group = (Category)i.next();
+          if (group.getChildren().size() > 0)
+          {
+            list.add(group);
+          }
+        }
+        result = list;*/
+        result = groups;
+      }      
+      if (result == null)
+      {
+        result = super.getProperty(modelObject, propertyName);
+      }
+      return result;
+    }
+  }
+
+
+  public static void addModelAdapterListener(Object modelObject, ModelAdapterListener listener)
+  {                                                            
+    ModelAdapter modelAdapter = getModelAdapter(modelObject);
+    if (modelAdapter != null)
+    {
+      modelAdapter.addListener(listener);
+    }
+  }    
+
+
+  public static void removeModelAdapterListener(Object modelObject, ModelAdapterListener listener)
+  {                               
+    ModelAdapter modelAdapter = getModelAdapter(modelObject);
+    if (modelAdapter != null)
+    {
+      modelAdapter.removeListener(listener);
+    }
+  }   
+
+  protected static ModelAdapter getModelAdapter(Object modelObject)
+  {
+    ModelAdapter modelAdapter = null;                         
+    if (modelObject instanceof Notifier)
+    {
+      modelAdapter = (ModelAdapter)xsdAdapterFactoryImpl.adapt((Notifier)modelObject);
+    } 
+    else if (modelObject instanceof ModelAdapter)
+    {
+      modelAdapter = (ModelAdapter)modelObject;
+    } 
+    return modelAdapter;
+  }      
+}
+    
+
+
+// --------------------------------------------------------------------------------------------
+// todo... revist this stuff
+// --------------------------------------------------------------------------------------------
+
+  /*                   
+  public static void handleTypeChange(XSDTypeDefinition td, XSDSchema schema, int change)
+  {                                    
+    try
+    {
+      TypeFindingSchemaVisitor visitor = new TypeFindingSchemaVisitor(schema, td, change == Notification.ADD);
+      List list = visitor.findElementsUsingType(schema);          
+      
+      if (change == Notification.REMOVE)          
+      {
+        visitor.removeMatchingReferences();
+      }
+      else if (change == Notification.ADD)          
+      {
+        visitor.setMatchingReferences();
+      }
+      else
+      {
+        visitor.cleanUpTypeMismatches();        
+      }
+      
+      for (Iterator i = list.iterator(); i.hasNext(); )
+      {
+        Object o = i.next();  
+        XSDObjectAdapter adapter = getExisitingAdapter(o);
+        if (adapter != null)
+        { 
+          adapter.fireChildrenChangedNotification();
+        }
+      }          
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+    }
+  }
+          
+
+  protected static class TypeFindingSchemaVisitor extends org.eclipse.wst.xsd.utility.XSDVisitor
+  {                           
+    protected XSDTypeDefinition td;
+    protected List list = new ArrayList();   
+    protected XSDSchema schema;                            
+    protected boolean matchByName;
+
+    public TypeFindingSchemaVisitor(XSDSchema schema, XSDTypeDefinition td, boolean matchByName)
+    {
+      this.td = td;                                 
+      this.schema = schema;
+      this.matchByName = matchByName;
+    }
+
+    public void visitElementDeclaration(XSDElementDeclaration ed)
+    {                                  
+      if (ed.getTypeDefinition() == td)
+      {                
+        list.add(ed);        
+      }  
+      else if (matchByName)
+      {          
+        String[] name = getDOMName(ed);
+        if (name[0].equals(td.getTargetNamespace()) && name[1].equals(td.getName()))
+        {
+          list.add(ed);
+        }
+      }
+    } 
+
+    public List findElementsUsingType(XSDSchema schema)
+    {
+      if (td != null)
+      {
+        visitSchema(schema);
+      }    
+      return list;
+    }   
+
+    public List getMatchingTypeList()
+    {
+      return list;
+    } 
+
+    public String[] getDOMName(XSDElementDeclaration ed)
+    {      
+      String[] result = new String[2];
+      org.w3c.dom.Element domElement = ed.getElement();
+      String typeName = domElement.getAttribute("type");
+      if (typeName != null && !typeName.endsWith(td.getName()))
+      {             
+        int index = typeName.indexOf(":");                                      
+        String prefix = index == -1 ? "" : typeName.substring(0, index);   
+        result[0] = (String)schema.getQNamePrefixToNamespaceMap().get(prefix);
+        if (result[0] == null) result[0] = "";
+        if (result[1] == null) result[1] = "";
+        result[1] = index == -1 ? typeName : typeName.substring(index + 1);
+      }  
+      else
+      {
+        result[0] = "";
+        result[1] = "";
+      }
+      return result;
+    }
+    
+    
+    public void cleanUpTypeMismatches()
+    {
+      for (Iterator i = list.iterator(); i.hasNext(); )
+      {
+        XSDElementDeclaration ed = (XSDElementDeclaration)i.next();
+        XSDTypeDefinition candidateTd = ed.getTypeDefinition();
+        if (candidateTd != null && candidateTd.getName() != null)
+        {
+          String[] result = getDOMName(ed);
+          ed.setTypeDefinition((XSDTypeDefinition)schema.resolveComplexTypeDefinition(result[0], result[1]));         
+        }
+      }
+    }
+    
+    public void removeMatchingReferences()
+    {
+      for (Iterator i = list.iterator(); i.hasNext(); )
+      {
+        XSDElementDeclaration ed = (XSDElementDeclaration)i.next();
+        String[] result = getDOMName(ed);          
+        if (ed.getElement() != null)
+        {
+          // NOTE ... this forces the model to reset the ed's XSDTypeDefinition without causing the
+          // DOM element's 'type' attribute to be set to null
+          ed.elementAttributesChanged(ed.getElement());
+        }
+      }
+    }
+    
+    public void setMatchingReferences()
+    {
+      for (Iterator i = list.iterator(); i.hasNext(); )
+      {
+        XSDElementDeclaration ed = (XSDElementDeclaration)i.next();
+        ed.setTypeDefinition(td);
+      }
+    }    
+  } */   
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/GenerateDtd.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateDtd.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/GenerateDtd.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateDtd.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/GenerateJava.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateJava.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/GenerateJava.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateJava.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/GraphViewElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GraphViewElementRef.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/GraphViewElementRef.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GraphViewElementRef.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/NewXSD.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/NewXSD.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/NewXSD.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/NewXSD.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/RegexWizardArrow.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/RegexWizardArrow.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/RegexWizardArrow.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/RegexWizardArrow.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/ValidateXSD.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/ValidateXSD.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/ValidateXSD.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/ValidateXSD.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAll.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAll.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAll.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAll.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAnnotate.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnnotate.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAnnotate.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnnotate.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAny.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAny.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAny.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAny.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAnyAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnyAttribute.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAnyAttribute.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnyAttribute.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAppInfo.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAppInfo.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAppInfo.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAppInfo.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttribute.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAttribute.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttribute.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAttributeGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroup.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAttributeGroup.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroup.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAttributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroupRef.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAttributeGroupRef.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroupRef.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAttributeRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeRef.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDAttributeRef.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeRef.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDChoice.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDChoice.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDChoice.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDChoice.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDComplexContent.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexContent.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDComplexContent.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexContent.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDComplexType.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexType.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDComplexType.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexType.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDDoc.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDDoc.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDDoc.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDDoc.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDElement.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElement.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDElement.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElement.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElementRef.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDElementRef.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElementRef.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDExtension.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDExtension.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDExtension.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDExtension.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDField.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDField.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDField.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDField.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDFile.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDFile.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDFile.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDFile.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGlobalAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalAttribute.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGlobalAttribute.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalAttribute.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGlobalElement.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalElement.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGlobalElement.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalElement.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroup.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDGroup.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroup.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroupRef.gif
new file mode 100644
index 0000000..3621342
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroupRef.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDImport.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDImport.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDImport.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDImport.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDInclude.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDInclude.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDInclude.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDInclude.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDKey.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKey.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDKey.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKey.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDKeyRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKeyRef.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDKeyRef.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKeyRef.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDNotation.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDNotation.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDNotation.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDNotation.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDRedefine.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDRedefine.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDRedefine.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDRedefine.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSelector.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSelector.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSelector.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSelector.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSequence.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSequence.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSequence.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSequence.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleContent.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleContent.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleContent.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleContent.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleEnum.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleEnum.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleEnum.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleEnum.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleList.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleList.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleList.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleList.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimplePattern.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimplePattern.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimplePattern.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimplePattern.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleRestrict.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleRestrict.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleRestrict.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleRestrict.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleType.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleType.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleType.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleType.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleTypeForEditPart.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleTypeForEditPart.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleTypeForEditPart.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleTypeForEditPart.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleUnion.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleUnion.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDSimpleUnion.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleUnion.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDUnique.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDUnique.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/XSDUnique.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDUnique.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/back.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/back.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/back.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/back.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/browsebutton.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/browsebutton.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/browsebutton.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/browsebutton.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/forward.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/forward.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/forward.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/forward.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/generate_xml.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/generate_xml.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/generate_xml.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/generate_xml.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/regx_wiz.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/regx_wiz.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/regx_wiz.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/regx_wiz.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/reloadgrammar.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/reloadgrammar.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/reloadgrammar.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/reloadgrammar.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/sort.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/sort.gif
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/editor/internal/icons/sort.gif
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/sort.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
new file mode 100644
index 0000000..5f31f56
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
@@ -0,0 +1,254 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+
+public class XSDPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener 
+{
+  Text indentTextField;
+  String indentString;
+  Text schemaNsPrefixField;
+  Text defaultTargetNamespaceText;
+  Button qualifyXSDLanguage;
+
+  /**
+   * Creates preference page controls on demand.
+   *   @param parent  the parent for the preference page
+   */
+  protected Control createContents(Composite parent)
+  {
+    WorkbenchHelp.setHelp(parent, XSDEditorContextIds.XSDP_PREFERENCE_PAGE);
+
+    Group group = createGroup(parent, 2);   
+    group.setText(XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_NAMESPACE_PREFIX"));
+
+    qualifyXSDLanguage = ViewUtility.createCheckBox(group, XSDEditorPlugin.getXSDString("_UI_QUALIFY_XSD"));
+    ViewUtility.createLabel(group, " ");
+
+    createLabel(group, XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_DEFAULT_PREFIX"));
+    schemaNsPrefixField = createTextField(group);
+    schemaNsPrefixField.addKeyListener(new KeyAdapter()
+    {
+      public void keyPressed(KeyEvent e)
+      {
+        setValid(true);
+      }      
+    });
+    
+    createLabel(group, XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE"));
+    defaultTargetNamespaceText = createTextField(group);
+
+    initializeValues();
+
+    return new Composite(parent, SWT.NULL);
+  }
+
+  private Group createGroup(Composite parent, int numColumns) 
+  {
+    Group group = new Group(parent, SWT.NULL);
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = numColumns;
+    group.setLayout(layout);
+
+    GridData data = new GridData();
+    data.verticalAlignment = GridData.FILL;
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    group.setLayoutData(data);
+    
+    return group;
+  }
+
+  private Text createTextField(Composite parent) 
+  {
+     Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
+     GridData data = new GridData();
+     data.verticalAlignment = GridData.FILL;
+     data.horizontalAlignment = GridData.FILL;
+     data.grabExcessHorizontalSpace = true;
+     text.setLayoutData(data);
+
+     return text;
+  }
+
+  private Label createLabel(Composite parent, String text) 
+  {
+    Label label = new Label(parent, SWT.LEFT);
+    label.setText(text);
+    
+    GridData data = new GridData();
+    data.verticalAlignment = GridData.CENTER;
+    data.horizontalAlignment = GridData.FILL;
+    label.setLayoutData(data);
+    
+    return label;
+  }
+  
+  /**
+   * Does anything necessary because the default button has been pressed.
+   */
+  protected void performDefaults() 
+  {
+    super.performDefaults();
+    initializeDefaults();
+    checkValues();
+  }
+
+  /**
+   * Do anything necessary because the OK button has been pressed.
+   *  @return whether it is okay to close the preference page
+   */
+  public boolean performOk() 
+  {
+    if (checkValues())
+    {
+      storeValues();    
+      return true;
+    }
+    return false;
+  }
+
+  protected void performApply()
+  {
+    if (checkValues())
+    {
+      storeValues();    
+    }
+  }
+
+  /**
+   * Handles events generated by controls on this page.
+   *   @param e  the event to handle
+   */
+  public void handleEvent(Event e) 
+  {
+  }
+
+  /**
+   * @see IWorkbenchPreferencePage
+   */
+  public void init(IWorkbench workbench)
+  { 
+  }
+
+  /** 
+   * The indent is stored in the preference store associated with the XML Schema Model
+   */
+  public IPreferenceStore getPreferenceStore()
+  {
+    return XSDEditorPlugin.getPlugin().getPreferenceStore();
+  }
+
+  /**
+   * Initializes states of the controls using default values
+   * in the preference store.
+   */
+  private void initializeDefaults() 
+  {
+    schemaNsPrefixField.setText(getPreferenceStore().getDefaultString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
+    qualifyXSDLanguage.setSelection(getPreferenceStore().getDefaultBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
+    defaultTargetNamespaceText.setText(getPreferenceStore().getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
+  }
+
+  /**
+   * Initializes states of the controls from the preference store.
+   */
+  private void initializeValues() 
+  {
+    IPreferenceStore store = getPreferenceStore();
+    schemaNsPrefixField.setText(store.getString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
+    qualifyXSDLanguage.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
+    defaultTargetNamespaceText.setText(store.getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
+  }
+
+  /**
+   * Stores the values of the controls back to the preference store.
+   */
+  private void storeValues() 
+  {
+    IPreferenceStore store = getPreferenceStore();
+
+    store.setValue(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT, getXMLSchemaPrefix());
+    store.setValue(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY, getQualify());
+    store.setValue(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE, getXMLSchemaTargetNamespace());
+
+    XSDEditorPlugin.getPlugin().savePluginPreferences();
+  }
+
+  public String getXMLSchemaPrefix()
+  {
+    String prefix = schemaNsPrefixField.getText();
+    if (prefix == null || prefix.equals("")) 
+    {
+      return "xsd";
+    }
+    return prefix;
+  }
+
+  public boolean getQualify()
+  {
+    return qualifyXSDLanguage.getSelection();
+  }
+  
+  /**
+   * Get the xml schema default target namespace
+   */
+  public String getXMLSchemaTargetNamespace()
+  {
+  	String targetNamespace = defaultTargetNamespaceText.getText();
+    if (targetNamespace == null || targetNamespace.equals("")) 
+    {
+      return XSDEditorPlugin.DEFAULT_TARGET_NAMESPACE;
+    }
+    return targetNamespace;
+  }
+  
+  public boolean checkValues()
+  {
+// KCPort TODO    String errorMessage = ValidateHelper.checkXMLName(schemaNsPrefixField.getText());
+	 String errorMessage = null;
+
+    if (errorMessage == null || errorMessage.length() == 0)
+    {
+      setErrorMessage(null);
+      setValid(true);
+      return true;
+    }
+    else
+    {
+      setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_INVALID_PREFIX"));
+      setValid(false);
+      return false;
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyAttributePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyAttributePropertySource.java
new file mode 100644
index 0000000..0f4e7e7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyAttributePropertySource.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+public class AnyAttributePropertySource extends BasePropertySource implements IPropertySource
+{
+  private String[] namespaceComboValues = {
+              "",
+              "##any",
+              "##other",
+              "##targetNamespace",
+              "##local"
+  };
+  
+  private String[] processContentsComboValues = {
+              "",
+              XSDEditorPlugin.getXSDString("_UI_COMBO_LAX"),
+              XSDEditorPlugin.getXSDString("_UI_COMBO_SKIP"),
+              XSDEditorPlugin.getXSDString("_UI_COMBO_STRICT")
+  };
+  public AnyAttributePropertySource()
+  {
+  }
+
+  public AnyAttributePropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+    
+  public AnyAttributePropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+
+    XSDComboBoxPropertyDescriptor namespaceDescriptor = new XSDComboBoxPropertyDescriptor(
+        XSDConstants.NAMESPACE_ATTRIBUTE,
+        XSDConstants.NAMESPACE_ATTRIBUTE,
+        namespaceComboValues);
+    list.add(namespaceDescriptor);
+    
+    XSDComboBoxPropertyDescriptor processContentsDescriptor = new XSDComboBoxPropertyDescriptor(
+        XSDConstants.PROCESSCONTENTS_ATTRIBUTE,
+        XSDConstants.PROCESSCONTENTS_ATTRIBUTE,
+        processContentsComboValues);
+    list.add(processContentsDescriptor);
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      if (result == null)
+      {
+        result = "";
+      }
+      return result;
+    }
+    return "";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      if (((String) id).equals(XSDConstants.NAMESPACE_ATTRIBUTE))
+      {
+        String namespace = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"), element);
+        if (namespace != null && namespace.length() > 0)
+        {
+          element.setAttribute(XSDConstants.NAMESPACE_ATTRIBUTE, namespace);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.PROCESSCONTENTS_ATTRIBUTE))
+      {
+        String processContents = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_PROCESSCONTENTS_CHANGE"), element);
+        if (processContents != null && processContents.length() > 0)
+        {
+          element.setAttribute(XSDConstants.PROCESSCONTENTS_ATTRIBUTE, processContents);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.PROCESSCONTENTS_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+
+  }
+
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyContentPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyContentPropertyDescriptor.java
new file mode 100644
index 0000000..7904053
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyContentPropertyDescriptor.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.DialogCellEditor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class AnyContentPropertyDescriptor extends PropertyDescriptor
+{
+  Element element;
+  /**
+   * @param id
+   * @param displayName
+   */
+  public AnyContentPropertyDescriptor(Object id, String displayName, Element element)
+  {
+    super(id, displayName);
+    this.element = element;
+  }
+  
+  public CellEditor createPropertyEditor(Composite parent)
+  {
+    CellEditor editor = new AnyContentDialogCellEditor(parent);
+    if (getValidator() != null)
+      editor.setValidator(getValidator());
+    return editor;
+  }
+
+  public class AnyContentDialogCellEditor extends DialogCellEditor {
+
+    /**
+     * Creates a new Font dialog cell editor parented under the given control.
+     * The cell editor value is <code>null</code> initially, and has no 
+     * validator.
+     *
+     * @param parent the parent control
+     */
+    protected AnyContentDialogCellEditor(Composite parent) {
+      super(parent);
+    }
+
+    /**
+     * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(Control)
+     */
+    protected Object openDialogBox(Control cellEditorWindow)
+    {
+      Shell shell = Display.getCurrent().getActiveShell();
+      
+      AnyContentDialog dialog = new AnyContentDialog(shell);
+      dialog.setBlockOnOpen(true);
+      dialog.create();
+      
+      String value = (String)getValue();
+
+      int result = dialog.open();
+
+      if (result == Window.OK)
+      {
+        return dialog.getComment();
+      }
+      return value;
+    }
+
+  }
+
+  public class AnyContentDialog extends org.eclipse.jface.dialogs.Dialog
+  {
+    protected Text commentField;
+    protected Button okButton, cancelButton;
+    private String comment;
+    
+    public AnyContentDialog(Shell shell)
+    {
+      super(shell);
+    }
+
+    protected void configureShell(Shell shell)
+    {
+      super.configureShell(shell);
+    }
+
+    protected void buttonPressed(int buttonId)
+    {
+      if (buttonId == Dialog.OK)
+      {
+        comment = commentField.getText();
+      }
+      super.buttonPressed(buttonId);
+    }
+
+    public String getComment() { return comment; }
+
+    //
+    // Create the controls
+    //
+    public Control createDialogArea(Composite parent)
+    {
+      Composite client = (Composite)super.createDialogArea(parent);
+      getShell().setText(element.getLocalName());
+      
+      commentField = ViewUtility.createMultiTextField(client, 400, 200, true);
+      
+      WorkbenchHelp.setHelp(commentField, XSDEditorContextIds.XSDE_ANNOTATION_COMMENT);
+      commentField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_COMMENT")); //$NON-NLS-1$
+
+      String initialString = (String)getInitialContent();
+      commentField.setText(initialString);
+      return client;
+    }
+
+    private Object getInitialContent()
+    {
+      Object result = null;
+      if (element.hasChildNodes())
+       {
+        // if the element is Text
+        Node node = element.getFirstChild();
+        if (node instanceof CharacterData)
+         {
+          result = ((CharacterData)node).getData();
+        }
+      }
+      else
+       {
+        result = ""; //$NON-NLS-1$
+      }
+      return result;
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyElementPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyElementPropertySource.java
new file mode 100644
index 0000000..1b2e12b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyElementPropertySource.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+public class AnyElementPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+
+  private String[] namespaceComboValues = {
+        "",
+        "##any",
+        "##other",
+        "##targetNamespace",
+        "##local"
+  };
+  
+  private String[] processContentsComboValues = {
+     "",
+     XSDEditorPlugin.getXSDString("_UI_COMBO_LAX"),
+     XSDEditorPlugin.getXSDString("_UI_COMBO_SKIP"),
+     XSDEditorPlugin.getXSDString("_UI_COMBO_STRICT")
+  };
+  
+  /**
+   * 
+   */
+  public AnyElementPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public AnyElementPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public AnyElementPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+
+    XSDComboBoxPropertyDescriptor namespaceDescriptor = new XSDComboBoxPropertyDescriptor(
+        XSDConstants.NAMESPACE_ATTRIBUTE,
+        XSDConstants.NAMESPACE_ATTRIBUTE,
+        namespaceComboValues);
+    list.add(namespaceDescriptor);
+    
+    XSDComboBoxPropertyDescriptor processContentsDescriptor = new XSDComboBoxPropertyDescriptor(
+        XSDConstants.PROCESSCONTENTS_ATTRIBUTE,
+        XSDConstants.PROCESSCONTENTS_ATTRIBUTE,
+        processContentsComboValues);
+    list.add(processContentsDescriptor);
+
+// These are moved to the tabbed properties general section     
+//    PropertyDescriptor minOccursDescriptor =
+//    new TextPropertyDescriptor(
+//        XSDConstants.MINOCCURS_ATTRIBUTE,
+//        XSDConstants.MINOCCURS_ATTRIBUTE);
+//    list.add(minOccursDescriptor);
+//    PropertyDescriptor maxOccursDescriptor =
+//    new TextPropertyDescriptor(
+//        XSDConstants.MAXOCCURS_ATTRIBUTE,
+//        XSDConstants.MAXOCCURS_ATTRIBUTE);
+//    list.add(maxOccursDescriptor);
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      if (result == null)
+      {
+        result = "";
+      }
+      return result;
+
+//      if (((String) id).equals(XSDConstants.NAMESPACE_ATTRIBUTE))
+//       {
+//      }
+//      else if (((String) id).equals(XSDConstants.PROCESSCONTENTS_ATTRIBUTE))
+//       {
+//      }      
+    }
+    return "";
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+     {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      if (((String) id).equals(XSDConstants.MAXOCCURS_ATTRIBUTE))
+      {
+        String max = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element);
+        if (max.length() > 0)
+        {
+          element.setAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE, max);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.MINOCCURS_ATTRIBUTE))
+      {
+        String min = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element);
+        if (min.length() > 0)
+        {
+          element.setAttribute(XSDConstants.MINOCCURS_ATTRIBUTE, min);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.NAMESPACE_ATTRIBUTE))
+      {
+        String namespace = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"), element);
+        if (namespace.length() > 0)
+        {
+          element.setAttribute(XSDConstants.NAMESPACE_ATTRIBUTE, namespace);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.PROCESSCONTENTS_ATTRIBUTE))
+      {
+        String processContents = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_PROCESSCONTENTS_CHANGE"), element);
+        if (processContents.length() > 0)
+        {
+          element.setAttribute(XSDConstants.PROCESSCONTENTS_ATTRIBUTE, processContents);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.PROCESSCONTENTS_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AppInfoPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AppInfoPropertySource.java
new file mode 100644
index 0000000..b99c768
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AppInfoPropertySource.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Node;
+
+public class AppInfoPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  public static String CONTENT = "Content";
+
+  /**
+   * 
+   */
+  public AppInfoPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public AppInfoPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public AppInfoPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    PropertyDescriptor sourceDescriptor =
+      new TextPropertyDescriptor(
+        XSDConstants.SOURCE_ATTRIBUTE,
+        XSDConstants.SOURCE_ATTRIBUTE);
+    list.add(sourceDescriptor);
+    AnyContentPropertyDescriptor contentDescriptor =
+      new AnyContentPropertyDescriptor(
+        CONTENT,
+        CONTENT,
+        element);
+    list.add(contentDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      if (((String) id).equals(CONTENT))
+      {
+        try
+        {
+          if (element.hasChildNodes())
+          {
+            // if the element is Text
+            Node node = element.getFirstChild();
+            if (node instanceof CharacterData)
+            {
+              return ((CharacterData)node).getData();
+            }
+          }
+          else
+          {
+            return "";
+          }
+        }
+        catch (Exception e)
+        {
+            
+        }
+
+      }
+      else
+      {
+        result = element.getAttribute((String) id);
+      }
+    }
+    if (result == null)
+    {
+      result = "";
+    }
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value != null)
+    {
+      if (value instanceof String)
+      {
+        if (((String)id).equals(XSDConstants.SOURCE_ATTRIBUTE))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_SOURCE_ATTRIBUTE_CHANGE"), element);
+          if (((String)value).length() > 0)
+          {
+            element.setAttribute(XSDConstants.SOURCE_ATTRIBUTE, (String)value);
+          }
+          else
+          {
+            element.removeAttribute(XSDConstants.SOURCE_ATTRIBUTE);
+          }
+          endRecording(element);
+        }
+        else if (((String)id).equals(CONTENT))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMMENT_CHANGE"), element);
+          try
+          {
+            if (element.hasChildNodes())
+            {
+              // if the element is Text
+              Node node = element.getFirstChild();
+              if (node instanceof CharacterData)
+              {
+                ((CharacterData)node).setData((String)value);
+              }
+            }
+            else
+            {
+              if (((String)value).length() > 0)
+              {
+                Node childNode = element.getOwnerDocument().createTextNode((String)value);
+                element.appendChild(childNode);
+              }
+            }
+            endRecording(element);
+          }
+          catch (Exception e)
+          {
+            
+          }
+        }
+        else  // shouldn't be here
+        {
+          element.setAttribute((String) id, (String) value);
+        }
+      }
+      else if (value instanceof Integer)
+      {
+      }
+    }
+    else
+    {
+      element.removeAttribute((String) id);
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributeGroupRefPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributeGroupRefPropertySource.java
new file mode 100644
index 0000000..74ca702
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributeGroupRefPropertySource.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class AttributeGroupRefPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String[] refComboValues = { "" };
+  /**
+   * 
+   */
+  public AttributeGroupRefPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public AttributeGroupRefPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public AttributeGroupRefPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  
+  public void setInput(Element element)
+  {
+    this.element = element;
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    java.util.List items = helper.getGlobalAttributes();
+      
+    if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
+    {
+      items = helper.getGlobalAttributes();
+//      WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_REF_DESIGN_VIEW);
+//      WorkbenchHelp.setHelp(refCombo, XSDEditorContextIds.XSDE_ATTRIBUTE_REF_NAME);      
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
+    {
+      items = helper.getGlobalAttributeGroups();
+//      WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW);
+//      WorkbenchHelp.setHelp(refCombo, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_REF_NAME);
+    }
+    int size = items.size() + 1;
+    refComboValues = new String[size];
+    refComboValues[0] = "";
+    if (items != null)
+    {
+      for (int i = 0; i < items.size(); i++)
+      {
+        refComboValues[i + 1] = (String) items.get(i);
+      }
+    }
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    XSDComboBoxPropertyDescriptor refDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.REF_ATTRIBUTE,
+        XSDConstants.REF_ATTRIBUTE,
+        refComboValues);
+    list.add(refDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      if (result == null)
+      {
+        result = "";
+      }
+//      if (((String) id).equals(XSDConstants.REF_ATTRIBUTE))
+//      {
+//      }
+      return result;
+    }
+    return "";
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+     {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      if (((String) id).equals(XSDConstants.REF_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_REF_CHANGE"), element);
+        element.setAttribute(XSDConstants.REF_ATTRIBUTE, (String) value);
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributePropertySource.java
new file mode 100644
index 0000000..0365346
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributePropertySource.java
@@ -0,0 +1,294 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalAttributeRenamer;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+public class AttributePropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String[] useComboValues =
+  {
+        "", //$NON-NLS-1$
+        "prohibited",   // XSDEditorPlugin.getXSDString("_UI_COMBO_BOX_PROHIBITED"), //$NON-NLS-1$ 
+        "optional",   // XSDEditorPlugin.getXSDString("_UI_COMBO_BOX_OPTIONAL"), //$NON-NLS-1$
+        "required"  // XSDEditorPlugin.getXSDString("_UI_COMBO_BOX_REQUIRED") //$NON-NLS-1$
+  };
+
+  protected String formComboValues[] =
+  {
+        "", //$NON-NLS-1$
+        XSDEditorPlugin.getXSDString("_UI_COMBO_UNQUALIFIED"), //$NON-NLS-1$
+        XSDEditorPlugin.getXSDString("_UI_COMBO_QUALIFIED") //$NON-NLS-1$
+  };
+  
+  
+  /**
+   * 
+   */
+  public AttributePropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public AttributePropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public AttributePropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    PropertyDescriptor nameDescriptor = new TextPropertyDescriptor(XSDConstants.NAME_ATTRIBUTE, XSDConstants.NAME_ATTRIBUTE);
+    list.add(nameDescriptor);
+//    nameDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_GENERAL"));
+    TypesPropertyDescriptor typeDescriptor = new TypesPropertyDescriptor(
+      XSDConstants.TYPE_ATTRIBUTE,
+      XSDConstants.TYPE_ATTRIBUTE,
+      element, xsdSchema);
+    list.add(typeDescriptor);
+//    typeDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_GENERAL"));
+
+    Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
+    Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
+    String str;
+    if (fixedAttr != null)
+     {
+      str = XSDConstants.FIXED_ATTRIBUTE;
+    }
+    else if (defaultAttr != null)
+     {
+      str = XSDConstants.DEFAULT_ATTRIBUTE;
+    }
+    else
+     {
+      str = XSDConstants.FIXED_ATTRIBUTE + "/" + XSDConstants.DEFAULT_ATTRIBUTE; //$NON-NLS-1$
+    }
+    
+    FixedOrDefaultTextPropertyDescriptor fixedOrDefaultDescriptor =
+    new FixedOrDefaultTextPropertyDescriptor(
+        str, 
+        str,
+        element);
+    list.add(fixedOrDefaultDescriptor);
+//    fixedOrDefaultDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_OTHER"));
+    
+    Object parentNode = element.getParentNode();
+    if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+    {
+    }
+    else
+    {
+      XSDComboBoxPropertyDescriptor useDescriptor =
+      new XSDComboBoxPropertyDescriptor(
+          XSDConstants.USE_ATTRIBUTE,
+          XSDConstants.USE_ATTRIBUTE,
+          useComboValues);
+      list.add(useDescriptor);
+//      useDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_OTHER"));
+      XSDComboBoxPropertyDescriptor formDescriptor =
+      new XSDComboBoxPropertyDescriptor(
+          XSDConstants.FORM_ATTRIBUTE,
+          XSDConstants.FORM_ATTRIBUTE,
+          formComboValues);
+      list.add(formDescriptor);
+//      formDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_OTHER"));
+    }
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      if (result == null)
+      {
+        result = ""; //$NON-NLS-1$
+      }
+      if (((String) id).equals(XSDConstants.TYPE_ATTRIBUTE))
+      {
+        if (result.equals("")) //$NON-NLS-1$
+        {
+          if (checkForAnonymousType(element))
+          {
+            return "**anonymous**"; //$NON-NLS-1$
+          }
+          else
+          {
+            return XSDEditorPlugin.getXSDString("_UI_NO_TYPE"); //$NON-NLS-1$ 
+          }
+        }
+        else
+         {
+          return result;
+        }
+      }
+      return result;
+    }
+    return ""; //$NON-NLS-1$
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = ""; //$NON-NLS-1$
+    }
+    if (value instanceof String)
+    {
+      if (((String) id).equals(XSDConstants.TYPE_ATTRIBUTE))
+      {
+//        beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);
+//        element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, (String)value);
+//        updateElementToNotAnonymous(element);
+//        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.NAME_ATTRIBUTE))
+      { 
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_NAME_CHANGE"), element); //$NON-NLS-1$
+        // now rename any references to this element
+        if (xsdSchema != null)
+         {
+          XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+          if (comp != null && comp instanceof XSDAttributeDeclaration && comp.getRootContainer().equals(xsdSchema))
+          {
+            XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)comp;
+            xsdAttributeDeclaration.setName((String)value);
+            GlobalAttributeRenamer renamer = new GlobalAttributeRenamer(xsdAttributeDeclaration, (String)value);
+            renamer.visitSchema(xsdSchema);
+          }
+        }
+        element.setAttribute(XSDConstants.NAME_ATTRIBUTE, (String)value);
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.FIXED_ATTRIBUTE) || ((String) id).equals(XSDConstants.DEFAULT_ATTRIBUTE))
+      {            
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_VALUE_CHANGE"), element); //$NON-NLS-1$
+        if (((String)value).equals("")) //$NON-NLS-1$
+         {
+          element.removeAttribute((String)id);
+        }
+        else
+        {  
+          element.setAttribute((String) id, (String) value);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.USE_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_USE_CHANGE"), element); //$NON-NLS-1$
+        if (((String)value).equals("")) //$NON-NLS-1$
+        {
+          element.removeAttribute(XSDConstants.USE_ATTRIBUTE);
+        }
+        else
+        {  
+          element.setAttribute((String) id, (String)value);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.FORM_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_FORM_CHANGE"), element); //$NON-NLS-1$
+        if (((String)value).equals("")) //$NON-NLS-1$
+        {
+          element.removeAttribute(XSDConstants.FORM_ATTRIBUTE);
+        }
+        else
+        {
+          element.setAttribute(XSDConstants.FORM_ATTRIBUTE, (String)value);
+        }
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+  
+  boolean checkForAnonymousType(Element element)
+  {
+    NodeList list = element.getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+    if (list.getLength() > 0)
+     {
+      return true;
+    }
+    return false;
+  }  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributesTable.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributesTable.java
new file mode 100644
index 0000000..f80e72e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributesTable.java
@@ -0,0 +1,331 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+//import java.text.Collator;
+//import java.util.Comparator;
+//import java.util.List;
+//
+//import org.eclipse.jface.viewers.CellEditor;
+//import org.eclipse.jface.viewers.ColumnPixelData;
+//import org.eclipse.jface.viewers.ICellModifier;
+//import org.eclipse.jface.viewers.ILabelProvider;
+//import org.eclipse.jface.viewers.IStructuredContentProvider;
+//import org.eclipse.jface.viewers.ITableLabelProvider;
+//import org.eclipse.jface.viewers.LabelProvider;
+//import org.eclipse.jface.viewers.TableLayout;
+//import org.eclipse.jface.viewers.TableViewer;
+//import org.eclipse.jface.viewers.TextCellEditor;
+//import org.eclipse.jface.viewers.Viewer;
+//import org.eclipse.swt.SWT;
+//import org.eclipse.swt.events.MouseAdapter;
+//import org.eclipse.swt.events.MouseEvent;
+//import org.eclipse.swt.graphics.Image;
+//import org.eclipse.swt.widgets.Composite;
+//import org.eclipse.swt.widgets.Control;
+//import org.eclipse.swt.widgets.Table;
+//import org.eclipse.swt.widgets.TableColumn;
+//import org.eclipse.swt.widgets.TableItem;
+//import org.eclipse.ui.IEditorPart;
+//import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
+//import org.eclipse.ui.views.properties.IPropertyDescriptor;
+//import org.eclipse.ui.views.properties.IPropertySource;
+//import org.w3c.dom.Element;
+
+public class AttributesTable // extends TableViewer implements ICellModifier
+{
+//	protected static final String PROPERTY = "property"; //$NON-NLS-1$
+//	protected static final String VALUE = "value"; //$NON-NLS-1$
+//
+//	protected IEditorPart editorPart;
+//	protected String[] columnProperties = {PROPERTY, VALUE};
+//	protected PropertyTableProvider tableProvider = new PropertyTableProvider(this);
+//	protected CellEditor cellEditor;
+//	//protected StringComboBoxCellEditor comboCellEditor;
+//	protected IPropertySource propertySource;
+//
+//	public AttributesTable(IEditorPart editorPart, Composite parent)
+//	{
+//		super(new Table(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.FLAT | SWT.H_SCROLL | SWT.V_SCROLL));   
+//				 this.editorPart = editorPart;               
+//		getTable().setLinesVisible(true);
+//		getTable().setHeaderVisible(true);  
+//    
+//		setContentProvider(tableProvider);
+//		setLabelProvider(tableProvider);
+//		setColumnProperties(columnProperties);
+//
+//		for (int i = 0; i < columnProperties.length; i++)
+//		{
+//			TableColumn column = new TableColumn(getTable(), SWT.NONE, i);
+//			column.setText(columnProperties[i]);
+//			column.setAlignment(SWT.LEFT);
+//		}      
+//
+////		TableLayout layout = new TableLayout(); 
+////		ColumnWeightData data = new ColumnWeightData(40, 40, true);
+////		layout.addColumnData(data);
+////    
+////		ColumnWeightData data2 = new ColumnWeightData(80, 80, true);
+////		layout.addColumnData(data2);                       
+//
+//		TableLayout layout = new TableLayout();
+//		layout.addColumnData(new ColumnPixelData(130,true));
+//		layout.addColumnData(new ColumnPixelData(130,true));
+//		getTable().setLayout(layout);
+//		
+//         
+//		cellEditor = new TextCellEditor(getTable());                            
+//		resetCellEditors();           
+//
+//		setCellModifier(this);    
+//	}  
+//
+//	public void setPropertySource(IPropertySource propertySource)
+//	{
+//		this.propertySource = propertySource;
+//	}
+//
+//  /* (non-Javadoc)
+//   * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
+//   */
+//  public boolean canModify(Object element, String property)
+//  {
+//		return property.equals(VALUE);
+//  }
+//  
+//  /* (non-Javadoc)
+//   * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
+//   */
+//  public Object getValue(Object element, String property)
+//  {
+//		int column = 0;
+//		if (property.equals(columnProperties[0]))
+//		{
+//			column = 0;
+//		}
+//		else if (property.equals(columnProperties[1]))
+//		{
+//			column = 1;
+//		}    
+//		return tableProvider.getColumnValue(element, column);
+// }
+//
+//  /* (non-Javadoc)
+//   * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
+//   */
+//  public void modify(Object element, String property, Object value)
+//  {
+//		TableItem item = (TableItem)element;
+//  	IPropertyDescriptor propertyDescriptor = (IPropertyDescriptor)item.getData();
+//              
+//	// if the new value is the same as the old value, the user has only clicked
+//	// on the cell in the course of 'browsing' ... so don't edit the value
+//	  Object oldValue = getValue(propertyDescriptor, property);       
+//	  if (value != null && !value.equals(oldValue)) 
+//	  {      
+//				 // we assume the value is empty that the attribute should be removed
+//				 // todo... we probably need to look at this in more detail
+//				 if (value instanceof String && ((String)value).length() == 0)
+//				 {
+//								value = null;
+//				 }
+//				 propertySource.setPropertyValue(propertyDescriptor.getId(), value);    
+//	  }                       
+//  }
+//
+//      
+//	protected void hookControl(Control control) {
+//	  // we need to hook up our own mouse listener first
+//				 // so that we can update the cellEditors before
+//				 // the 'internal' listener tries to get hold of them
+//			 Table tableControl = (Table)control;
+//				 tableControl.addMouseListener(new MouseAdapter() {
+//								public void mouseDown(MouseEvent e) {
+//								  System.out.println("Mouse down");
+//										   updateCellEditors();
+//								}
+//				 });
+//		  super.hookControl(control);
+//	}                                
+//
+//	protected void updateCellEditors()
+//	{
+//		CellEditor[] cellEditors = new CellEditor[2];
+//		cellEditors[0] = cellEditor;
+//		cellEditors[1] = cellEditor;
+//
+//		Element element = (Element)getInput();
+//              
+//		IPropertyDescriptor[] propertyDescriptors = propertySource.getPropertyDescriptors();
+//		int index = getTable().getSelectionIndex();
+//		if (index >= 0 && index < propertyDescriptors.length)
+//		{
+//			CellEditor[] oldCellEditors = getCellEditors();
+//			CellEditor oldCellEditor = (oldCellEditors.length > 1) ? oldCellEditors[1] : null;
+//			if (oldCellEditor != null && oldCellEditor != cellEditor)
+//			{
+//			 oldCellEditor.deactivate();
+//			 oldCellEditor.dispose();
+//			}
+//			cellEditors[1] = propertyDescriptors[index].createPropertyEditor(getTable());     
+//		}  
+//		setCellEditors(cellEditors);     
+//
+////		IPropertyDescriptor[] propertyDescriptors = propertySource.getPropertyDescriptors();
+////
+//// 		int index = getTable().getSelectionIndex();
+//// 		//cellEditor.dispose();
+////
+////		if (index >= 0 && index < propertyDescriptors.length)
+////		{
+////      cellEditor = propertyDescriptors[index].createPropertyEditor(getTable());
+////			Control control = cellEditor.getControl();
+////			if (control == null) {
+////				cellEditor.deactivate();
+////				cellEditor = null;
+////				return;
+////			}
+////			setCellEditors(new CellEditor[] {null, cellEditor});
+////			cellEditor.activate();
+////			cellEditor.setFocus();
+////		}
+//	}
+//                 
+//
+//	public String[] getStringArray(List list)
+//	{
+//		String[] result = new String[list.size()];
+//		for (int i = 0; i < result.length; i++)
+//		{
+//			result[i] = (String)list.get(i);
+//		}
+//		return result;
+//	}
+//                                   
+//	protected void resetCellEditors()
+//	{
+//			 CellEditor[] cellEditors = new CellEditor[2];
+//			 cellEditors[0] = null;
+//			 cellEditors[1] = cellEditor;
+//			 setCellEditors(cellEditors);  
+//	}
+//
+//
+//	class PropertyTableProvider extends LabelProvider implements ITableLabelProvider, IStructuredContentProvider
+//	{                  
+//		protected TableViewer viewer;
+//
+//		PropertyTableProvider(TableViewer viewer)
+//		{
+//			this.viewer = viewer;
+//		}
+//		
+//		public void inputChanged(Viewer viewer, Object oldInput, Object newInput)  
+//		{
+////		 resetCellEditors();                         
+////			if (newInput instanceof XMLElement)
+////			{      
+////					 propertySource = new ExtensiblePropertySource(editorPart, (XMLElement)newInput);
+////			} 
+////			if (newInput instanceof Element)
+////			{
+////				if (XSDDOMHelper.inputEquals(newInput, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+////				{  
+////				  propertySource = new ElementPropertySource((Element)newInput, viewer);
+////				}
+////				else
+////				{  
+////  				 propertySource = new ReadOnlyPropertySource(editorPart, (Element)newInput);
+////				}
+////			}
+////			else
+////			{
+////						 propertySource = null;
+////			}          
+//		}
+//
+//		public Image getColumnImage(Object element, int columnIndex)
+//		{  
+//			return null;
+//		}      
+//
+//		public Object getColumnValue(Object o, int columnIndex)  
+//		{ 
+//			IPropertyDescriptor propertyDescriptor = (IPropertyDescriptor)o;
+//			if (columnIndex == 0)
+//			{
+//			  return propertyDescriptor.getId();
+//			}
+//			else
+//			{  
+//			  return propertySource.getPropertyValue(propertyDescriptor.getId());
+//			}
+//		}
+//		  
+//		public String getColumnText(Object o, int columnIndex)  
+//		{ 
+//			IPropertyDescriptor propertyDescriptor = (IPropertyDescriptor)o;
+//			// (columnIndex == 1 && propertyDescriptor instanceof XSDComboBoxPropertyDescriptor)
+//			if ((columnIndex == 1 && propertyDescriptor instanceof OptionsComboBoxPropertyDescriptor) ||
+//			   (columnIndex == 1 && propertyDescriptor instanceof ComboBoxPropertyDescriptor))
+//			{
+//			  ILabelProvider lp = propertyDescriptor.getLabelProvider();
+//			  if (lp != null)
+//		  	{
+//			    return lp.getText(propertyDescriptor.getId());
+//		  	}
+//			}
+//			
+//			Object id = propertyDescriptor.getId();
+//      String attribute = "";
+//		  if (id != null && attribute instanceof String)
+//      {
+//        attribute = (String)id;
+//      }
+//      Object value = propertySource.getPropertyValue(attribute);
+//      String attributeValue = "";
+//      if (value != null)
+//      {
+//        attributeValue = (String)value;
+//      }
+//
+//      return (columnIndex == 0) ? attribute : attributeValue;
+//			
+////			  return (columnIndex == 0) ? propertyDescriptor.getId().toString() : propertySource.getPropertyValue(propertyDescriptor.getId()).toString();
+//		}  
+//
+//		public Object[] getElements(Object o)
+//		{         
+//						Object[] result = propertySource.getPropertyDescriptors();
+//						// For some strange reson the ViewerSorter doesn't seem to be working for this table
+//						// As a workaround we sort them in this method before returning them to the viewer
+////						if (result.length > 0)
+////						{
+////									 Arrays.sort(result, new InternalComparator());
+////						}
+//						return result;
+//		}
+//	}
+//
+//	class InternalComparator implements Comparator
+//	{
+//			 public int compare(Object e1, Object e2) 
+//			 {
+//							IPropertyDescriptor p1 = (IPropertyDescriptor)e1;
+//							IPropertyDescriptor p2 = (IPropertyDescriptor)e2;
+//							String p1Name = p1.getDisplayName();
+//							String p2Name = p2.getDisplayName();
+//							return Collator.getInstance().compare(p1.getDisplayName(), p2.getDisplayName());
+//			 }         
+//	}
+//
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/BasePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/BasePropertySource.java
new file mode 100644
index 0000000..dbea691
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/BasePropertySource.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public abstract class BasePropertySource implements IPropertySource
+{
+	protected Element element;
+	protected Viewer viewer;
+	protected IPropertyDescriptor[] propertyDescriptors;
+	protected XSDSchema xsdSchema;
+	protected String [] trueFalseComboValues = {
+		"",
+		"false",
+		"true"
+	};
+
+  public BasePropertySource()
+  {
+    
+  }
+
+  public DocumentImpl getDocument(Element element)
+  {
+    return (DocumentImpl) element.getOwnerDocument();
+  }
+  
+  public void beginRecording(String description, Element element)
+  {
+    getDocument(element).getModel().beginRecording(this, description);
+  }
+  
+  public void endRecording(Element element)
+  {
+    DocumentImpl doc = (DocumentImpl) getDocument(element);
+    
+    doc.getModel().endRecording(this);    
+  }
+  
+  
+  public BasePropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    this.viewer = viewer;
+    this.xsdSchema = xsdSchema;
+  }
+  
+  public BasePropertySource(XSDSchema xsdSchema)
+  {
+    this.xsdSchema = xsdSchema;
+  }
+  
+  public void setViewer(Viewer viewer)
+  {
+    this.viewer = viewer;
+  }
+
+  public void setInput(Element element)
+  {
+    this.element = element;
+  }
+
+  protected XSDDOMHelper domHelper = new XSDDOMHelper();
+  /**
+   * Gets the domHelper.
+   * @return Returns a XSDDomHelper
+   */
+  public XSDDOMHelper getDomHelper()
+  {
+    return domHelper;
+  }
+  
+	protected boolean hasElementChildren(Node parentNode)
+	{
+		boolean hasChildrenElements = false;
+		if (parentNode != null && parentNode.hasChildNodes())
+		{
+			NodeList nodes = parentNode.getChildNodes();
+			for (int i = 0; i < nodes.getLength(); i++)
+			{
+				if (nodes.item(i) instanceof Element)
+				{
+					hasChildrenElements = true;
+					break;
+				}
+			}
+		}
+		return hasChildrenElements;
+	}
+  
+  protected boolean validateName(String name)
+  {
+    return NameValidator.isValid(name);
+  }
+
+  // TODO
+  protected boolean validateLanguage(String lang)
+  {
+    return true;
+  }
+  
+  // TODO  
+  protected boolean validatePrefix(String prefix)
+  {
+    return true;
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ComplexTypePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ComplexTypePropertySource.java
new file mode 100644
index 0000000..0e759c1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ComplexTypePropertySource.java
@@ -0,0 +1,341 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.SetBaseTypeAction;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalSimpleOrComplexTypeRenamer;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class ComplexTypePropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String DERIVED_BY_ID = "derived by"; // XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY");  //$NON-NLS-1$ 
+  private String BASE_TYPE_ID = "base type"; //  XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE");  //$NON-NLS-1$
+  
+  private String[] blockOrFinalComboValues = 
+  {
+    "",    	//$NON-NLS-1$
+    "#all",  //$NON-NLS-1$
+    "extension", //$NON-NLS-1$
+    "restriction" //$NON-NLS-1$
+  };
+  
+  /**
+   * 
+   */
+  public ComplexTypePropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public ComplexTypePropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public ComplexTypePropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    
+    XSDComboBoxPropertyDescriptor abstractDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.ABSTRACT_ATTRIBUTE,
+        XSDConstants.ABSTRACT_ATTRIBUTE,
+        trueFalseComboValues);
+    list.add(abstractDescriptor);
+
+    XSDComboBoxPropertyDescriptor mixedDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.MIXED_ATTRIBUTE,
+        XSDConstants.MIXED_ATTRIBUTE,
+        trueFalseComboValues);
+    list.add(mixedDescriptor);
+        
+    XSDComboBoxPropertyDescriptor blockDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.BLOCK_ATTRIBUTE,
+        XSDConstants.BLOCK_ATTRIBUTE,
+        blockOrFinalComboValues);
+    list.add(blockDescriptor);
+    XSDComboBoxPropertyDescriptor finalDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.FINAL_ATTRIBUTE,
+        XSDConstants.FINAL_ATTRIBUTE,
+        blockOrFinalComboValues);
+    list.add(finalDescriptor);
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+
+  public void setInput(Element element)
+  {
+    this.element = element;
+    
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      String attributeName = (String)id;
+      result = element.getAttribute((String) id);
+      Element contentModelElement = getDomHelper().getContentModelFromParent(element);    
+      String baseType = getDomHelper().getBaseType(contentModelElement);
+      
+      if (result == null)
+      {
+        result = ""; //$NON-NLS-1$
+      }
+      
+      if (attributeName.equals(DERIVED_BY_ID))
+      {
+        return getDomHelper().getDerivedByName(contentModelElement);
+      }
+      else if (attributeName.equals(BASE_TYPE_ID))
+      {
+        if (baseType != null)
+        {
+          return baseType;
+        }
+        else
+        {
+          return ""; //$NON-NLS-1$
+        }
+      }
+      else if (attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
+      {
+        String name = element.getAttribute(XSDConstants.NAME_ATTRIBUTE);
+        
+        boolean isAnonymousType = checkForAnonymousType(element);
+        if (isAnonymousType)
+        {
+          return "**anonymous**";  //$NON-NLS-1$
+        }
+        else
+        {
+          return name;
+        }
+      }
+        
+      return result;
+//      if (((String) id).equals(XSDConstants.ABSTRACT_ATTRIBUTE)
+//          || ((String) id).equals(XSDConstants.MIXED_ATTRIBUTE))
+//      {
+//      }
+//      else if (((String) id).equals(XSDConstants.BLOCK_ATTRIBUTE))
+//       {
+//      }
+//      else if (((String) id).equals(XSDConstants.FINAL_ATTRIBUTE))
+//      {
+//      }
+    }
+    return ""; //$NON-NLS-1$
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = ""; //$NON-NLS-1$
+    }
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      String attributeName = (String)id;
+      
+      if (attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
+      {
+        if (validateName(newValue))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_NAME_CHANGE"), element); //$NON-NLS-1$
+          if (newValue.length() > 0)
+          {
+            // now rename any references to this type
+            if (xsdSchema != null)
+            {
+              XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+              if (comp != null && comp instanceof XSDComplexTypeDefinition && comp.getContainer().equals(xsdSchema))
+              {
+//                XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)comp;
+//                ct.setName(newValue);
+                GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, newValue);
+                renamer.visitSchema(xsdSchema);
+              }
+            }
+            element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+          }
+          else
+          {
+            element.removeAttribute(XSDConstants.NAME_ATTRIBUTE);
+          }
+          endRecording(element);
+        }
+      }
+      else if (attributeName.equals(DERIVED_BY_ID))
+      {
+        Element contentModelElement = getDomHelper().getContentModelFromParent(element);
+        String baseType = getDomHelper().getBaseType(contentModelElement);
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_DERIVEDBY_CHANGE"), element); //$NON-NLS-1$
+        getDomHelper().changeDerivedByType(contentModelElement, newValue, baseType);
+        endRecording(element);
+      }
+      else if (attributeName.equals(BASE_TYPE_ID))
+      {
+        String derivedBy = getDomHelper().getDerivedByName(element);
+        
+        SetBaseTypeAction setBaseTypeAction = new SetBaseTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_BASE_TYPE")); //$NON-NLS-1$
+        setBaseTypeAction.setXSDSchema(xsdSchema);
+        setBaseTypeAction.setComplexTypeElement(element);
+        setBaseTypeAction.setType(newValue);
+        setBaseTypeAction.setDerivedBy(derivedBy);
+        setBaseTypeAction.performAction();
+
+//        handleBaseTypeComboChange(newValue);
+        
+      }
+      else
+      {
+        if (attributeName.equals(XSDConstants.ABSTRACT_ATTRIBUTE))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_ABSTRACT_CHANGE"), element); //$NON-NLS-1$
+        }
+        else if (attributeName.equals(XSDConstants.MIXED_ATTRIBUTE))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_MIXED_CHANGE"), element); //$NON-NLS-1$
+        }
+        else if (attributeName.equals(XSDConstants.BLOCK_ATTRIBUTE))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_BLOCK_CHANGE"), element); //$NON-NLS-1$
+        }
+        else if (attributeName.equals(XSDConstants.FINAL_ATTRIBUTE))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_FINAL_CHANGE"), element); //$NON-NLS-1$
+        }
+        
+        if (newValue.length() > 0)
+        {
+          element.setAttribute((String) id,  (String)value);
+        }
+        else
+        {
+          element.removeAttribute((String) id);
+        }
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+
+  boolean checkForAnonymousType(Element element)
+  {
+    Object parentElement = (Object)element.getParentNode();
+    boolean isAnonymous = false;
+    if (parentElement != null)
+    {
+      if (XSDDOMHelper.inputEquals(parentElement, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+      {
+        isAnonymous = true; 
+      }
+    }
+    return isAnonymous;
+  }
+  
+  
+//  private void handleBaseTypeComboChange(String newType)
+//  {
+//    String tempChoice = newType;
+//    TypesHelper helper = new TypesHelper(xsdSchema);
+//    if (helper.getBuiltInTypeNamesList().contains(tempChoice) ||
+//        helper.getUserSimpleTypeNamesList().contains(tempChoice))
+//    {
+//      derivedByCombo.setText(XSDConstants.EXTENSION_ELEMENT_TAG);
+//      derivedByCombo.setEnabled(false);
+//    }
+//    else if (helper.getUserComplexTypeNamesList().contains(tempChoice))
+//     {
+//      Element contentModelElement = getDomHelper().getContentModelFromParent(element);    
+//      String derivedByString = getDomHelper().getDerivedByName(contentModelElement);
+//      derivedByCombo.setText(derivedByString);
+//      derivedByCombo.setEnabled(true); 
+//    }
+//    else
+//     {
+//      derivedByCombo.setText("");
+//      derivedByCombo.setEnabled(false); 
+//    }
+//  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DocumentationPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DocumentationPropertySource.java
new file mode 100644
index 0000000..06e9ef7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DocumentationPropertySource.java
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Node;
+
+
+public class DocumentationPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  public static String CONTENT = "Content";
+  
+  /**
+   * 
+   */
+  public DocumentationPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public DocumentationPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+
+  }
+  /**
+   * @param xsdSchema
+   */
+  public DocumentationPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    PropertyDescriptor languageDescriptor =
+    new TextPropertyDescriptor(
+        "xml:lang",
+        "xml:lang"
+        );
+    list.add(languageDescriptor);
+    PropertyDescriptor sourceDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.SOURCE_ATTRIBUTE,
+        XSDConstants.SOURCE_ATTRIBUTE);
+    list.add(sourceDescriptor);
+    AnyContentPropertyDescriptor contentDescriptor =
+    new AnyContentPropertyDescriptor(
+        CONTENT,
+        CONTENT,
+        element);
+    list.add(contentDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+     {
+      if (((String) id).equals(CONTENT))
+       {
+        try
+        {
+          if (element.hasChildNodes())
+           {
+            // if the element is Text
+            Node node = element.getFirstChild();
+            if (node instanceof CharacterData)
+             {
+              return ((CharacterData)node).getData();
+            }
+          }
+          else
+           {
+            return "";
+          }
+        }
+        catch (Exception e)
+        {
+          
+        }
+
+      }
+      else
+       {
+        result = element.getAttribute((String) id);
+      }
+    }
+    if (result == null)
+     {
+      result = "";
+    }
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value != null)
+    {
+      if (value instanceof String)
+      {
+        String newValue = (String)value;
+        if (((String)id).equals("xml:lang"))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_DOCUMENTATION_LANG_CHANGE"), element);
+          if (newValue.length() > 0)
+          {
+            if (validateLanguage(newValue))
+            {
+              element.setAttribute("xml:lang", newValue);
+            }
+          }
+          else
+          {
+            // clearErrorMessage();
+            element.removeAttribute("xml:lang");
+          }
+          endRecording(element);
+        }
+        else if (((String)id).equals(XSDConstants.SOURCE_ATTRIBUTE))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_DOCUMENTATION_SOURCE_CHANGE"), element);
+          if (newValue.length() > 0)
+          {
+            element.setAttribute(XSDConstants.SOURCE_ATTRIBUTE, newValue);
+          }
+          else
+          {
+            element.removeAttribute(XSDConstants.SOURCE_ATTRIBUTE);
+          }
+          endRecording(element);
+        }
+        else if (((String)id).equals(CONTENT))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_DOCUMENTATION_COMMENT_CHANGE"), element);
+          try
+          {
+            if (element.hasChildNodes())
+            {
+              // if the element is Text
+              Node node = element.getFirstChild();
+              if (node instanceof CharacterData)
+              {
+                ((CharacterData)node).setData(newValue);
+              }
+            }
+            else
+            {
+              if (newValue.length() > 0)
+              {
+                Node childNode = element.getOwnerDocument().createTextNode(newValue);
+                element.appendChild(childNode);
+              }
+            }
+            endRecording(element);
+          }
+          catch (Exception e)
+          {
+            
+          }
+        }
+        else  // shouldn't be here
+        {
+          element.setAttribute((String) id, newValue);
+        }
+      }
+      else if (value instanceof Integer)
+      {
+      }
+    }
+    else
+    {
+      element.removeAttribute((String) id);
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+ 
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DynamicCellEditor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DynamicCellEditor.java
new file mode 100644
index 0000000..b09526a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DynamicCellEditor.java
@@ -0,0 +1,1174 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleTextAdapter;
+import org.eclipse.swt.accessibility.AccessibleTextEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TypedListener;
+
+public class DynamicCellEditor extends Composite
+{
+	Text text;
+	List list;
+	int maxItemCount = 5;
+	Shell popup;
+	Button arrow;
+	boolean hasFocus;
+	
+  public DynamicCellEditor(Composite parent, int style) {
+	super (parent, checkStyle (style));
+	
+	style = getStyle();
+	
+	int textStyle = SWT.SINGLE;
+	if ((style & SWT.READ_ONLY) != 0) textStyle |= SWT.READ_ONLY;
+	if ((style & SWT.FLAT) != 0) textStyle |= SWT.FLAT;
+	text = new Text (this, textStyle);
+	
+	popup = new Shell (getShell (), SWT.NO_TRIM);
+	
+	int listStyle = SWT.SINGLE | SWT.V_SCROLL;
+	if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT;
+	if ((style & SWT.RIGHT_TO_LEFT) != 0) listStyle |= SWT.RIGHT_TO_LEFT;
+	if ((style & SWT.LEFT_TO_RIGHT) != 0) listStyle |= SWT.LEFT_TO_RIGHT;
+	list = new List (popup, listStyle);
+	
+	int arrowStyle = SWT.ARROW | SWT.DOWN;
+	if ((style & SWT.FLAT) != 0) arrowStyle |= SWT.FLAT;
+	arrow = new Button (this, arrowStyle);
+
+	Listener listener = new Listener () {
+		public void handleEvent (Event event) {
+			if (popup == event.widget) {
+				popupEvent (event);
+				return;
+			}
+			if (text == event.widget) {
+				textEvent (event);
+				return;
+			}
+			if (list == event.widget) {
+				listEvent (event);
+				return;
+			}
+			if (arrow == event.widget) {
+				arrowEvent (event);
+				return;
+			}
+			if (DynamicCellEditor.this == event.widget) {
+				comboEvent (event);
+				return;
+			}
+
+		}
+	};
+	
+	int [] comboEvents = {SWT.Dispose, SWT.Move, SWT.Resize};
+	for (int i=0; i<comboEvents.length; i++) this.addListener (comboEvents [i], listener);
+	
+	int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate};
+	for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
+	
+	int [] textEvents = {SWT.KeyDown, SWT.KeyUp, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.Traverse, SWT.FocusIn, SWT.FocusOut};
+	for (int i=0; i<textEvents.length; i++) text.addListener (textEvents [i], listener);
+	
+	int [] listEvents = {SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut};
+	for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
+	
+	int [] arrowEvents = {SWT.Selection, SWT.FocusIn, SWT.FocusOut};
+	for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
+	
+	initAccessible();
+}
+static int checkStyle (int style) {
+	int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+	return style & mask;
+}
+/**
+* Adds an item.
+* <p>
+* The item is placed at the end of the list.
+* Indexing is zero based.
+*
+* @param string the new item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when the string is null
+* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_ADDED)
+*	when the item cannot be added
+*/
+public void add (String string) {
+	checkWidget();
+	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	list.add (string);
+}
+/**
+* Adds an item at an index.
+* <p>
+* The item is placed at an index in the list.
+* Indexing is zero based.
+*
+* This operation will fail when the index is
+* out of range.
+*
+* @param string the new item
+* @param index the index for the item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when the string is null
+* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_ADDED)
+*	when the item cannot be added
+*/
+public void add (String string, int index) {
+	checkWidget();
+	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	list.add (string, index);
+}
+/**	 
+* Adds the listener to receive events.
+* <p>
+*
+* @param listener the listener
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when listener is null
+*/
+public void addModifyListener (ModifyListener listener) {;
+	checkWidget();
+	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	TypedListener typedListener = new TypedListener (listener);
+	addListener (SWT.Modify, typedListener);
+}
+/**	 
+* Adds the listener to receive events.
+* <p>
+*
+* @param listener the listener
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when listener is null
+*/
+public void addSelectionListener(SelectionListener listener) {
+	checkWidget();
+	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	TypedListener typedListener = new TypedListener (listener);
+	addListener (SWT.Selection,typedListener);
+	addListener (SWT.DefaultSelection,typedListener);
+}
+void arrowEvent (Event event) {
+	switch (event.type) {
+		case SWT.FocusIn: {
+			if (hasFocus) return;
+			hasFocus = true;
+			if (getEditable ()) text.selectAll ();
+			Event e = new Event();
+			e.time = event.time;
+			notifyListeners(SWT.FocusIn, e);
+			break;
+		}
+		case SWT.FocusOut: {
+			event.display.asyncExec(new Runnable() {
+				public void run() {
+					if (DynamicCellEditor.this.isDisposed()) return;
+					Control focusControl = getDisplay().getFocusControl();
+					if (focusControl == list || focusControl == text) return;
+					hasFocus = false;
+					Event e = new Event();
+					notifyListeners(SWT.FocusOut, e);
+				}
+			});
+			break;
+		}
+		case SWT.Selection: {
+			dropDown (!isDropped ());
+			break;
+		}
+	}
+}
+/**
+* Clears the current selection.
+* <p>
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public void clearSelection () {
+	checkWidget();
+	text.clearSelection ();
+	list.deselectAll ();
+}
+void comboEvent (Event event) {
+	switch (event.type) {
+		case SWT.Dispose:
+			if (popup != null && !popup.isDisposed ()) popup.dispose ();
+			popup = null;  
+			text = null;  
+			list = null;  
+			arrow = null;
+			break;
+		case SWT.Move:
+			dropDown(false);
+			break;
+		case SWT.Resize:
+			internalLayout();
+			break;
+	}
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+	checkWidget();
+	int width = 0, height = 0;
+	Point textSize = text.computeSize (wHint, SWT.DEFAULT, changed);
+	Point arrowSize = arrow.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
+	Point listSize = list.computeSize (wHint, SWT.DEFAULT, changed);
+	int borderWidth = getBorderWidth();
+	
+	height = Math.max (hHint, Math.max(textSize.y, arrowSize.y)  + 2*borderWidth);
+	width = Math.max (wHint, Math.max(textSize.x + arrowSize.x + 2*borderWidth, listSize.x + 2)  );
+	return new Point (width, height);
+}
+/**
+* Deselects an item.
+* <p>
+* If the item at an index is selected, it is
+* deselected.  If the item at an index is not
+* selected, it remains deselected.  Indices
+* that are out of range are ignored.  Indexing
+* is zero based.
+*
+* @param index the index of the item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public void deselect (int index) {
+	checkWidget();
+	list.deselect (index);
+}
+/**
+* Deselects all items.
+* <p>
+*
+* If an item is selected, it is deselected.
+* If an item is not selected, it remains unselected.
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public void deselectAll () {
+	checkWidget();
+	list.deselectAll ();
+}
+void dropDown (boolean drop) {
+	if (drop == isDropped ()) return;
+	if (!drop) {
+		popup.setVisible (false);
+		text.setFocus();
+		return;
+	}
+
+	int index = list.getSelectionIndex ();
+	if (index != -1) list.setTopIndex (index);
+	Display display = getDisplay ();
+	Rectangle listRect = list.getBounds ();
+	Rectangle parentRect = display.map (getParent (), null, getBounds());
+	Point comboSize = getSize ();
+	Rectangle displayRect = getMonitor().getClientArea();
+	int width = Math.max (comboSize.x, listRect.width + 2);
+	int height = listRect.height + 2;
+	int x = parentRect.x;
+	int y = parentRect.y + comboSize.y;
+	if (y + height > displayRect.y + displayRect.height) y = parentRect.y - height;
+	popup.setBounds (x, y, width, height);
+	popup.setVisible (true);
+	list.setFocus();
+}
+public Control [] getChildren () {
+	checkWidget();
+	return new Control [0];
+}
+boolean getEditable () {
+	return text.getEditable ();
+}
+/**
+* Gets an item at an index.
+* <p>
+* Indexing is zero based.
+*
+* This operation will fail when the index is out
+* of range or an item could not be queried from
+* the OS.
+*
+* @param index the index of the item
+* @return the item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_GET_ITEM)
+*	when the operation fails
+*/
+public String getItem (int index) {
+	checkWidget();
+	return list.getItem (index);
+}
+/**
+* Gets the number of items.
+* <p>
+* This operation will fail if the number of
+* items could not be queried from the OS.
+*
+* @return the number of items in the widget
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_GET_COUNT)
+*	when the operation fails
+*/
+public int getItemCount () {
+	checkWidget();
+	return list.getItemCount ();
+}
+/**
+* Gets the height of one item.
+* <p>
+* This operation will fail if the height of
+* one item could not be queried from the OS.
+*
+* @return the height of one item in the widget
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_GET_ITEM_HEIGHT)
+*	when the operation fails
+*/
+public int getItemHeight () {
+	checkWidget();
+	return list.getItemHeight ();
+}
+/**
+* Gets the items.
+* <p>
+* This operation will fail if the items cannot
+* be queried from the OS.
+*
+* @return the items in the widget
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_GET_ITEM)
+*	when the operation fails
+*/
+public String [] getItems () {
+	checkWidget();
+	return list.getItems ();
+}
+/**
+* Gets the selection.
+* <p>
+* @return a point representing the selection start and end
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public Point getSelection () {
+	checkWidget();
+	return text.getSelection ();
+}
+/**
+* Gets the index of the selected item.
+* <p>
+* Indexing is zero based.
+* If no item is selected -1 is returned.
+*
+* @return the index of the selected item.
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public int getSelectionIndex () {
+	checkWidget();
+	return list.getSelectionIndex ();
+}
+/**
+* Gets the widget text.
+* <p>
+* If the widget has no text, an empty string is returned.
+*
+* @return the widget text
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public String getText () {
+	checkWidget();
+	return text.getText ();
+}
+/**
+* Gets the height of the combo's text field.
+* <p>
+* The operation will fail if the height cannot 
+* be queried from the OS.
+
+* @return the height of the combo's text field.
+* 
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_ERROR_CANNOT_GET_ITEM_HEIGHT)
+*	when the operation fails
+*/
+public int getTextHeight () {
+	checkWidget();
+	return text.getLineHeight();
+}
+/**
+* Gets the text limit.
+* <p>
+* @return the text limit
+* 
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public int getTextLimit () {
+	checkWidget();
+	return text.getTextLimit ();
+}
+/**
+* Gets the index of an item.
+* <p>
+* The list is searched starting at 0 until an
+* item is found that is equal to the search item.
+* If no item is found, -1 is returned.  Indexing
+* is zero based.
+*
+* @param string the search item
+* @return the index of the item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when string is null
+*/
+public int indexOf (String string) {
+	checkWidget();
+	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	return list.indexOf (string);
+}
+/**
+* Gets the index of an item.
+* <p>
+* The widget is searched starting at start including
+* the end position until an item is found that
+* is equal to the search itenm.  If no item is
+* found, -1 is returned.  Indexing is zero based.
+*
+* @param string the search item
+* @param index the starting position
+* @return the index of the item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when string is null
+*/
+public int indexOf (String string, int start) {
+	checkWidget();
+	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	return list.indexOf (string, start);
+}
+
+void initAccessible() {
+	getAccessible().addAccessibleListener(new AccessibleAdapter() {
+		public void getHelp(AccessibleEvent e) {
+			e.result = getToolTipText();
+		}
+	});
+	
+	getAccessible().addAccessibleTextListener(new AccessibleTextAdapter() {
+		public void getCaretOffset(AccessibleTextEvent e) {
+			e.offset = text.getCaretPosition();
+		}
+	});
+	
+	getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
+		public void getChildAtPoint(AccessibleControlEvent e) {
+			Point testPoint = toControl(new Point(e.x, e.y));
+			if (getBounds().contains(testPoint)) {
+				e.childID = ACC.CHILDID_SELF;
+			}
+		}
+		
+		public void getLocation(AccessibleControlEvent e) {
+			Rectangle location = getBounds();
+			Point pt = toDisplay(new Point(location.x, location.y));
+			e.x = pt.x;
+			e.y = pt.y;
+			e.width = location.width;
+			e.height = location.height;
+		}
+		
+		public void getChildCount(AccessibleControlEvent e) {
+			e.detail = 0;
+		}
+		
+		public void getRole(AccessibleControlEvent e) {
+			e.detail = ACC.ROLE_COMBOBOX;
+		}
+		
+		public void getState(AccessibleControlEvent e) {
+			e.detail = ACC.STATE_NORMAL;
+		}
+
+		public void getValue(AccessibleControlEvent e) {
+			e.result = getText();
+		}
+	});
+}
+boolean isDropped () {
+	return popup.getVisible ();
+}
+public boolean isFocusControl () {
+	checkWidget();
+	if (text.isFocusControl() || arrow.isFocusControl() || list.isFocusControl() || popup.isFocusControl()) {
+		return true;
+	} else {
+		return super.isFocusControl();
+	}
+}
+
+//public boolean isListVisible()
+//{
+//  checkWidget();
+//  return list.isVisible();
+//}
+
+void internalLayout () {
+	if (isDropped ()) dropDown (false);
+	
+	Rectangle rect = getClientArea();
+	int width = rect.width;
+	int height = rect.height;
+	Point arrowSize = arrow.computeSize(SWT.DEFAULT, height);
+	text.setBounds (0, 0, width - arrowSize.x, height);
+	arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
+	
+	Point size = getSize();
+	int itemCount = list.getItemCount();
+	itemCount = (itemCount == 0) ? maxItemCount : Math.min(maxItemCount, itemCount);
+	int itemHeight = list.getItemHeight () * itemCount;
+	Point listSize = list.computeSize (SWT.DEFAULT, itemHeight);
+	list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);
+}
+void listEvent (Event event) {
+	switch (event.type) {
+		case SWT.FocusIn: {
+			if (hasFocus) return;
+			hasFocus = true;
+			if (getEditable ()) text.selectAll ();
+			Event e = new Event();
+			e.time = event.time;
+			notifyListeners(SWT.FocusIn, e);
+			break;
+		}
+		case SWT.FocusOut: {
+			event.display.asyncExec(new Runnable() {
+				public void run() {
+					if (DynamicCellEditor.this.isDisposed()) return;
+					Control focusControl = getDisplay().getFocusControl();
+					if (focusControl == text || focusControl == arrow || focusControl == list) return;
+					hasFocus = false;
+					Event e = new Event();
+					notifyListeners(SWT.FocusOut, e);
+				}
+			});
+			break;
+		}
+		case SWT.MouseUp: {
+			if (event.button != 1) return;
+			dropDown (false);
+			break;
+		}
+		case SWT.Selection: {
+			int index = list.getSelectionIndex ();
+			if (index == -1) return;
+			text.setText (list.getItem (index));
+			text.selectAll ();
+			list.setSelection(index);
+			Event e = new Event();
+			e.time = event.time;
+			e.stateMask = event.stateMask;
+			e.doit = event.doit;
+			notifyListeners(SWT.Selection, e);
+			event.doit = e.doit;
+			break;
+		}
+		case SWT.Traverse: {
+			switch (event.detail) {
+				case SWT.TRAVERSE_TAB_NEXT:
+				case SWT.TRAVERSE_RETURN:
+				case SWT.TRAVERSE_ESCAPE:
+				case SWT.TRAVERSE_ARROW_PREVIOUS:
+				case SWT.TRAVERSE_ARROW_NEXT:
+					event.doit = false;
+					break;
+			}
+			Event e = new Event();
+			e.time = event.time;
+			e.detail = event.detail;
+			e.doit = event.doit;
+			e.keyCode = event.keyCode;
+			notifyListeners(SWT.Traverse, e);
+			event.doit = e.doit;
+			break;
+		}
+		case SWT.KeyUp: {		
+			Event e = new Event();
+			e.time = event.time;
+			e.character = event.character;
+			e.keyCode = event.keyCode;
+			e.stateMask = event.stateMask;
+			notifyListeners(SWT.KeyUp, e);
+			break;
+		}
+		case SWT.KeyDown: {
+			if (event.character == SWT.ESC) { 
+				// escape key cancels popup list
+				dropDown (false);
+			}
+			if (event.character == SWT.CR || event.character == '\t') {
+				// Enter and Tab cause default selection
+				dropDown (false);
+				Event e = new Event();
+				e.time = event.time;
+				e.stateMask = event.stateMask;
+				notifyListeners(SWT.DefaultSelection, e);
+			}
+			//At this point the widget may have been disposed.
+			// If so, do not continue.
+			if (isDisposed()) break;
+			Event e = new Event();
+			e.time = event.time;
+			e.character = event.character;
+			e.keyCode = event.keyCode;
+			e.stateMask = event.stateMask;
+			notifyListeners(SWT.KeyDown, e);
+			break;
+			
+		}
+	}
+}
+void popupEvent(Event event) {
+	switch (event.type) {
+		case SWT.Paint:
+			// draw black rectangle around list
+			Rectangle listRect = list.getBounds();
+			Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
+			event.gc.setForeground(black);
+			event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
+			break;
+		case SWT.Close:
+			event.doit = false;
+			dropDown (false);
+			break;
+		case SWT.Deactivate:
+			dropDown (false);
+			break;
+	}
+}
+public void redraw () {
+	super.redraw();
+	text.redraw();
+	arrow.redraw();
+	if (popup.isVisible()) list.redraw();
+}
+public void redraw (int x, int y, int width, int height, boolean all) {
+	super.redraw(x, y, width, height, true);
+}
+
+/**
+* Removes an item at an index.
+* <p>
+* Indexing is zero based.
+*
+* This operation will fail when the index is out
+* of range or an item could not be removed from
+* the OS.
+*
+* @param index the index of the item
+* @return the selection state
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_REMOVED)
+*	when the operation fails
+*/
+public void remove (int index) {
+	checkWidget();
+	list.remove (index);
+}
+/**
+* Removes a range of items.
+* <p>
+* Indexing is zero based.  The range of items
+* is from the start index up to and including
+* the end index.
+*
+* This operation will fail when the index is out
+* of range or an item could not be removed from
+* the OS.
+*
+* @param start the start of the range
+* @param end the end of the range
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_REMOVED)
+*	when the operation fails
+*/
+public void remove (int start, int end) {
+	checkWidget();
+	list.remove (start, end);
+}
+/**
+* Removes an item.
+* <p>
+* This operation will fail when the item
+* could not be removed from the OS.
+*
+* @param string the search item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when string is null
+* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_REMOVED)
+*	when the operation fails
+*/
+public void remove (String string) {
+	checkWidget();
+	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	list.remove (string);
+}
+/**
+* Removes all items.
+* <p>
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public void removeAll () {
+	checkWidget();
+	text.setText (""); //$NON-NLS-1$
+	list.removeAll ();
+}
+/**	 
+* Removes the listener.
+* <p>
+*
+* @param listener the listener
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when listener is null
+*/
+public void removeModifyListener (ModifyListener listener) {
+	checkWidget();
+	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	removeListener(SWT.Modify, listener);	
+}
+/**	 
+* Removes the listener.
+* <p>
+*
+* @param listener the listener
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when listener is null
+*/
+public void removeSelectionListener (SelectionListener listener) {
+	checkWidget();
+	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	removeListener(SWT.Selection, listener);
+	removeListener(SWT.DefaultSelection,listener);	
+}
+/**
+* Selects an item.
+* <p>
+* If the item at an index is not selected, it is
+* selected. Indices that are out of
+* range are ignored.  Indexing is zero based.
+*
+* @param index the index of the item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+*/
+public void select (int index) {
+	checkWidget();
+	if (index == -1) {
+		list.deselectAll ();
+		text.setText (""); //$NON-NLS-1$
+		return;
+	}
+	if (0 <= index && index < list.getItemCount()) {
+		if (index != getSelectionIndex()) {
+			text.setText (list.getItem (index));
+			text.selectAll ();
+			list.select (index);
+			list.showSelection ();
+		}
+	}
+}
+public void setBackground (Color color) {
+	super.setBackground(color);
+	if (text != null) text.setBackground(color);
+	if (list != null) list.setBackground(color);
+	if (arrow != null) arrow.setBackground(color);
+}
+public boolean setFocus () {
+	checkWidget();
+	return text.setFocus ();
+}
+public void setFont (Font font) {
+	super.setFont (font);
+	text.setFont (font);
+	list.setFont (font);
+	internalLayout ();
+}
+public void setForeground (Color color) {
+	super.setForeground(color);
+	if (text != null) text.setForeground(color);
+	if (list != null) list.setForeground(color);
+	if (arrow != null) arrow.setForeground(color);
+}
+/**
+* Sets the text of an item; indexing is zero based.
+*
+* This operation will fail when the index is out
+* of range or an item could not be changed in
+* the OS.
+*
+* @param index the index for the item
+* @param string the item
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when items is null
+* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_MODIFIED)
+*	when the operation fails
+*/
+public void setItem (int index, String string) {
+	checkWidget();
+	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	list.setItem (index, string);
+}
+/**
+* Sets all items.
+*
+* @param items the array of items
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when items is null
+* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_ADDED)
+*	when the operation fails
+*/
+public void setItems (String [] items) {
+	checkWidget();
+	if (items == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	int style = getStyle();
+	if ((style & SWT.READ_ONLY) != 0) text.setText (""); //$NON-NLS-1$
+	list.setItems (items);
+}
+/**
+* Sets the new selection.
+*
+* @param selection point representing the start and the end of the new selection
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when selection is null
+*/
+public void setSelection (Point selection) {
+	checkWidget();
+	if (selection == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	text.setSelection (selection.x, selection.y);
+}
+
+/**
+* Sets the widget text.
+*
+* @param string the widget text
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
+*	when string is null
+*/
+public void setText (String string) {
+	checkWidget();
+	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+	int index = list.indexOf (string);
+	if (index == -1) {
+		list.deselectAll ();
+		text.setText (string);
+		return;
+	}
+	text.setText (string);
+	text.selectAll ();
+	list.setSelection (index);
+	list.showSelection ();
+}
+/**
+* Sets the text limit.
+* 
+* @param limit new text limit
+*
+* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
+*	when called from the wrong thread
+* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
+*	when the widget has been disposed
+* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_BE_ZERO)
+*	when limit is 0
+*/
+public void setTextLimit (int limit) {
+	checkWidget();
+	text.setTextLimit (limit);
+}
+
+public void setToolTipText (String string) {
+	checkWidget();
+	super.setToolTipText(string);
+	arrow.setToolTipText (string);
+	text.setToolTipText (string);		
+}
+
+public void setVisible (boolean visible) {
+	super.setVisible(visible);
+	if (!visible) popup.setVisible(false);
+}
+
+void textEvent (Event event) {
+	switch (event.type) {
+		case SWT.FocusIn: {
+			if (hasFocus) return;
+			hasFocus = true;
+			if (getEditable ()) text.selectAll ();
+			Event e = new Event();
+			e.time = event.time;
+			notifyListeners(SWT.FocusIn, e);
+			break;
+		}
+		case SWT.FocusOut: {
+			event.display.asyncExec(new Runnable() {
+				public void run() {
+					if (DynamicCellEditor.this.isDisposed()) return;
+					Control focusControl = getDisplay().getFocusControl();
+					if (focusControl == list || focusControl == arrow) return;
+					hasFocus = false;
+					Event e = new Event();
+					notifyListeners(SWT.FocusOut, e);
+				}
+			});
+			break;
+		}
+		case SWT.KeyDown: {
+			
+			if (event.character == SWT.ESC) { // escape key cancels popup list
+				dropDown (false);
+			}
+			if (event.character == SWT.CR) {
+				dropDown (false);
+				Event e = new Event();
+				e.time = event.time;
+				e.stateMask = event.stateMask;
+				notifyListeners(SWT.DefaultSelection, e);
+			}
+			//At this point the widget may have been disposed.
+			// If so, do not continue.
+			if (isDisposed()) break;
+			
+			if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN) {
+				int oldIndex = getSelectionIndex ();
+				if (event.keyCode == SWT.ARROW_UP) {
+					select (Math.max (oldIndex - 1, 0));
+				} else {
+					select (Math.min (oldIndex + 1, getItemCount () - 1));
+				}
+		
+				if (oldIndex != getSelectionIndex ()) {
+					Event e = new Event();
+					e.time = event.time;
+					e.stateMask = event.stateMask;
+					notifyListeners(SWT.Selection, e);
+				}
+				//At this point the widget may have been disposed.
+				// If so, do not continue.
+				if (isDisposed()) break;
+			}
+			
+			// Further work : Need to add support for incremental search in 
+			// pop up list as characters typed in text widget
+						
+			Event e = new Event();
+			e.time = event.time;
+			e.character = event.character;
+			e.keyCode = event.keyCode;
+			e.stateMask = event.stateMask;
+			notifyListeners(SWT.KeyDown, e);
+			break;
+		}
+		case SWT.KeyUp: {
+			Event e = new Event();
+			e.time = event.time;
+			e.character = event.character;
+			e.keyCode = event.keyCode;
+			e.stateMask = event.stateMask;
+			notifyListeners(SWT.KeyUp, e);
+			break;
+		}
+		case SWT.Modify: {
+			list.deselectAll ();
+			Event e = new Event();
+			e.time = event.time;
+			notifyListeners(SWT.Modify, e);
+			break;
+		}
+		case SWT.MouseDown: {
+			if (event.button != 1) return;
+			if (text.getEditable ()) return;
+			boolean dropped = isDropped ();
+			text.selectAll ();
+			if (!dropped) setFocus ();
+			dropDown (!dropped);
+			break;
+		}
+		case SWT.MouseUp: {
+			if (event.button != 1) return;
+			if (text.getEditable ()) return;
+			text.selectAll ();
+			break;
+		}
+		case SWT.Traverse: {		
+			switch (event.detail) {
+				case SWT.TRAVERSE_RETURN:
+				case SWT.TRAVERSE_ARROW_PREVIOUS:
+				case SWT.TRAVERSE_ARROW_NEXT:
+					// The enter causes default selection and
+					// the arrow keys are used to manipulate the list contents so
+					// do not use them for traversal.
+					event.doit = false;
+					break;
+			}
+			
+			Event e = new Event();
+			e.time = event.time;
+			e.detail = event.detail;
+			e.doit = event.doit;
+			e.keyCode = event.keyCode;
+			notifyListeners(SWT.Traverse, e);
+			event.doit = e.doit;
+			break;
+		}
+	}
+}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ElementPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ElementPropertySource.java
new file mode 100644
index 0000000..65416ac
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ElementPropertySource.java
@@ -0,0 +1,545 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalElementRenamer;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class ElementPropertySource extends BasePropertySource implements IPropertySource
+{
+  private String[] blockComboValues =
+    { "", "#all", "extension", "restriction", "substitution" };
+  private String[] finalComboValues =
+    { "", "#all", "extension", "restriction" };
+  private String[] substitutionGroupComboValues = { "" };
+  private String[] formComboValues =
+  {
+      "",
+      XSDEditorPlugin.getXSDString("_UI_COMBO_UNQUALIFIED"),
+      XSDEditorPlugin.getXSDString("_UI_COMBO_QUALIFIED")
+  };
+
+  public ElementPropertySource()
+  {
+    super();
+  }
+
+  public ElementPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  
+  public ElementPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+
+  public void setInput(Element element)
+  {
+    this.element = element;
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    List globals = helper.getGlobalElements();
+    int size = globals.size() + 1;
+    substitutionGroupComboValues = new String[size];
+    substitutionGroupComboValues[0] = "";
+    if (globals != null)
+    {
+      for (int k = 0; k < globals.size(); k++)
+      {
+        substitutionGroupComboValues[k + 1] = (String) globals.get(k);
+      }
+    }
+  }
+
+  /*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+	 */
+  public Object getEditableValue()
+  {
+//    return element.getNodeName();
+    return null;
+  }
+
+  /*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+	 */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    Object parentNode = element.getParentNode();
+    boolean isGlobalElement = XSDDOMHelper.inputEquals(parentNode, XSDConstants.SCHEMA_ELEMENT_TAG, false);
+    
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+//  These have been moved to the general tab
+//    PropertyDescriptor nameDescriptor =
+//      new TextPropertyDescriptor(
+//        XSDConstants.NAME_ATTRIBUTE,
+//        XSDConstants.NAME_ATTRIBUTE);
+//    list.add(nameDescriptor);
+//    TypesPropertyDescriptor typeDescriptor = new TypesPropertyDescriptor(
+//        XSDConstants.TYPE_ATTRIBUTE,
+//        XSDConstants.TYPE_ATTRIBUTE,
+//        element, xsdSchema);
+//    list.add(typeDescriptor);
+    if (isGlobalElement)
+    {
+      XSDComboBoxPropertyDescriptor abstractDescriptor =
+        new XSDComboBoxPropertyDescriptor(
+          XSDConstants.ABSTRACT_ATTRIBUTE,
+          XSDConstants.ABSTRACT_ATTRIBUTE,
+          trueFalseComboValues);
+      list.add(abstractDescriptor);
+    }
+    if (!isGlobalElement)
+    {
+      PropertyDescriptor minOccursDescriptor =
+        new TextPropertyDescriptor(
+          XSDConstants.MINOCCURS_ATTRIBUTE,
+          XSDConstants.MINOCCURS_ATTRIBUTE);
+      list.add(minOccursDescriptor);
+    
+      PropertyDescriptor maxOccursDescriptor =
+        new TextPropertyDescriptor(
+          XSDConstants.MAXOCCURS_ATTRIBUTE,
+          XSDConstants.MAXOCCURS_ATTRIBUTE);
+      list.add(maxOccursDescriptor);
+    }
+    XSDComboBoxPropertyDescriptor nillableDescriptor =
+      new XSDComboBoxPropertyDescriptor(
+        XSDConstants.NILLABLE_ATTRIBUTE,
+        XSDConstants.NILLABLE_ATTRIBUTE,
+        trueFalseComboValues);
+    list.add(nillableDescriptor);
+    XSDComboBoxPropertyDescriptor blockDescriptor =
+      new XSDComboBoxPropertyDescriptor(
+        XSDConstants.BLOCK_ATTRIBUTE,
+        XSDConstants.BLOCK_ATTRIBUTE,
+        blockComboValues);
+    list.add(blockDescriptor);
+    if (isGlobalElement)
+    {      
+      XSDComboBoxPropertyDescriptor finalDescriptor =
+        new XSDComboBoxPropertyDescriptor(
+          XSDConstants.FINAL_ATTRIBUTE,
+          XSDConstants.FINAL_ATTRIBUTE,
+          finalComboValues);
+      list.add(finalDescriptor);
+      XSDComboBoxPropertyDescriptor substitutionGroupDescriptor =
+        new XSDComboBoxPropertyDescriptor(
+          XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE,
+          XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE,
+          substitutionGroupComboValues);
+      list.add(substitutionGroupDescriptor);
+    }
+    if (!isGlobalElement)
+    {
+      XSDComboBoxPropertyDescriptor formDescriptor =
+        new XSDComboBoxPropertyDescriptor(
+          XSDConstants.FORM_ATTRIBUTE,
+          XSDConstants.FORM_ATTRIBUTE,
+          formComboValues);
+      list.add(formDescriptor);
+    }
+
+    Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
+    Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
+    String str;
+    if (fixedAttr != null)
+    {
+      str = XSDConstants.FIXED_ATTRIBUTE;
+    }
+    else if (defaultAttr != null)
+    {
+      str = XSDConstants.DEFAULT_ATTRIBUTE;
+    }
+    else
+    {
+      str = XSDConstants.FIXED_ATTRIBUTE + "/" + XSDConstants.DEFAULT_ATTRIBUTE;
+    }
+    
+    FixedOrDefaultTextPropertyDescriptor fixedOrDefaultDescriptor =
+      new FixedOrDefaultTextPropertyDescriptor(
+        str, 
+        str,
+        element);
+    list.add(fixedOrDefaultDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+    //    return propertyDescriptors;
+  }
+
+  /*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+	 */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      String attributeName = (String)id;
+      result = element.getAttribute(attributeName);
+      if (result == null)
+      {
+        result = "";
+      }
+      if (attributeName.equals(XSDConstants.TYPE_ATTRIBUTE))
+      {
+        boolean isAnonymous = checkForAnonymousType(element);
+        if (isAnonymous)
+        {
+          return "**anonymous**";
+        }
+        if (result.equals(""))
+        {
+          result = XSDEditorPlugin.getXSDString("_UI_NO_TYPE");
+        }
+        return result;
+      }
+      else if (attributeName.equals(XSDConstants.MAXOCCURS_ATTRIBUTE) 
+        || attributeName.equals(XSDConstants.MINOCCURS_ATTRIBUTE)
+        || attributeName.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE)
+        || attributeName.equals(XSDConstants.FORM_ATTRIBUTE)
+        || attributeName.equals(XSDConstants.ABSTRACT_ATTRIBUTE)
+        || attributeName.equals(XSDConstants.NILLABLE_ATTRIBUTE)
+        || attributeName.equals(XSDConstants.BLOCK_ATTRIBUTE)
+        || attributeName.equals(XSDConstants.FINAL_ATTRIBUTE)
+        || attributeName.equals(XSDConstants.FIXED_ATTRIBUTE) 
+        || attributeName.equals(XSDConstants.DEFAULT_ATTRIBUTE)
+        || attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
+      {
+        return result;
+      }
+    }
+    return "";
+  }
+
+  /*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+	 */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+
+  /*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+	 */
+  public void resetPropertyValue(Object id)
+  {
+  }
+
+  /*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object,
+	 *      java.lang.Object)
+	 */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      String attributeName = (String)id;
+      
+      if (attributeName.equals(XSDConstants.MAXOCCURS_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.MINOCCURS_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element);      
+      }
+      else if (attributeName.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_SUBSTITUTIONGROUP_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.FORM_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_FORM_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.ABSTRACT_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_ABSTRACT_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.NILLABLE_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_NILLABLE_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.BLOCK_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_BLOCK_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.FINAL_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_FINAL_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.FIXED_ATTRIBUTE) || attributeName.equals(XSDConstants.DEFAULT_ATTRIBUTE))
+      {  
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_VALUE_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
+      {
+        if (validateName(newValue))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_NAME_CHANGE"), element);
+          // now rename any references to this element
+          if (xsdSchema != null)
+          {
+            XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+            if (comp != null && comp instanceof XSDElementDeclaration && comp.getContainer().equals(xsdSchema))
+            {
+              GlobalElementRenamer renamer = new GlobalElementRenamer((XSDNamedComponent)comp, newValue);
+              renamer.visitSchema(xsdSchema);
+            }
+          }
+        }
+      }
+      else if (attributeName.equals(XSDConstants.TYPE_ATTRIBUTE))
+      {
+        // put logic in descriptor/cell editor
+//          beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_TYPE_CHANGE"), element);
+      }
+    
+      if (newValue.length() > 0)
+      {
+        element.setAttribute((String) id, (String) value);
+      }
+      else
+      {
+        if (!attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
+        {
+          element.removeAttribute((String) id);
+        }
+      }
+      endRecording(element);
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+
+  }
+
+  boolean checkForAnonymousType(Element element)
+  {
+    /* Using Ed's model to check
+     boolean isAnonymous = false;
+
+     XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
+     if (component instanceof XSDElementDeclaration)
+     {
+     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
+     isAnonymous = xsdElem.isSetAnonymousTypeDefinition();
+     }
+     return isAnonymous;
+     */
+
+    boolean isAnonymous = false;
+
+    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+    if (aNode != null)
+     {
+      return true;
+    }
+    aNode = getDomHelper().getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+    if (aNode != null)
+     {
+      isAnonymous = true;
+    }
+    return isAnonymous;
+  }
+  
+  
+//  void updateElementToAnonymous(Element element, String xsdType)
+//  {
+//    String prefix = element.getPrefix();
+//    prefix = (prefix == null) ? "" : (prefix + ":");
+//
+//    updateElementToNotAnonymous(element);
+//    boolean hasChildrenElements = hasElementChildren(element);
+//
+//    Element childNode = null;
+//    if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+//     {
+//      childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+//    }
+//    else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
+//     {
+//      childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+//    }
+//
+//    element.appendChild(childNode);
+//    formatChild(childNode, hasChildrenElements);    
+//
+//
+//    /* Using Ed's model to do the above
+//     XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
+//     if (component instanceof XSDElementDeclaration)
+//     {
+//     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
+//     XSDFactoryImpl factory = new XSDFactoryImpl();
+//     XSDComplexTypeDefinition complex = factory.createXSDComplexTypeDefinition();
+//     XSDSimpleTypeDefinition simple = factory.createXSDSimpleTypeDefinition();
+//
+//     Node child = element.getFirstChild();
+//     if (XSDDOMHelper.inputEquals(child, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false) ||
+//     XSDDOMHelper.inputEquals(child, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+//     {
+//     element.removeChild(child);
+//     }
+//     
+//     FormatProcessor formatProcessor = new FormatProcessor();
+//     if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+//     {
+//     xsdElem.setAnonymousTypeDefinition(complex);
+//     Element elem = complex.getElement();
+//     formatProcessor.formatWithSiblingIndent((XMLNode)elem);
+//     }
+//     else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
+//     {
+//     xsdElem.setAnonymousTypeDefinition(simple);
+//     Element elem = simple.getElement();  
+//     formatProcessor.formatWithSiblingIndent((XMLNode)elem);
+//     }
+//     }
+//     component.updateElement();
+//     */
+//  }
+//
+//  boolean isSTAnonymous(Element element)
+//  {
+//    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+//    if (aNode != null)
+//     {
+//      if (XSDDOMHelper.inputEquals(aNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+//       {
+//        return true;
+//      }
+//    }
+//    return false;
+//  }  
+//
+//  boolean isCTAnonymous(Element element)
+//  {
+//    Node aNode = getDomHelper().getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+//    if (aNode != null)
+//     {
+//      if (XSDDOMHelper.inputEquals(aNode, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+//       {
+//        return true;
+//      }
+//    }
+//    return false;
+//  }  
+//
+//  XSDTypeDefinition getAnonymousTypeDefinition(Element element)
+//  {
+//    Node typeDefinitionNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+//    if (typeDefinitionNode == null)
+//     {
+//      typeDefinitionNode = getDomHelper().getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+//    }
+//    if (typeDefinitionNode != null)
+//     {
+//      XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(typeDefinitionNode);
+//      if (component instanceof XSDTypeDefinition)
+//       {
+//        return (XSDTypeDefinition)component;
+//      }
+//    }
+//    return null;    
+//
+//    /*    XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
+//     if (component instanceof XSDElementDeclaration)
+//     {
+//     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
+//
+//     return xsdElem.getAnonymousTypeDefinition();
+//     }
+//     return null;
+//     */
+//  }
+//
+//  void updateElementToNotAnonymous(Element element)
+//  {
+//    NodeList children = element.getChildNodes();
+//    if (children != null)
+//     {
+//      for (int i = 0; i < children.getLength(); i++)
+//       {
+//        Node node = (Node)children.item(i);
+//        if (node instanceof Element)
+//         {
+//          if (node.getLocalName().equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG) ||
+//              node.getLocalName().equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+//           {
+//            XSDDOMHelper.removeNodeAndWhitespace(node);
+//            i=0;
+//          }
+//        }
+//      }
+//    }
+//    /*    XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
+//     if (component instanceof XSDElementDeclaration)
+//     {
+//     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
+//     if (xsdElem.isSetAnonymousTypeDefinition())
+//     {
+//     xsdElem.unsetAnonymousTypeDefinition();
+//     xsdElem.setAnonymousTypeDefinition(null);
+//     }
+//     }
+//     component.updateElement();
+//     */
+//  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/EnumerationPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/EnumerationPropertySource.java
new file mode 100644
index 0000000..65124f7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/EnumerationPropertySource.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+public class EnumerationPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  /**
+   * 
+   */
+  public EnumerationPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public EnumerationPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public EnumerationPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    PropertyDescriptor nameDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.VALUE_ATTRIBUTE,
+        XSDConstants.VALUE_ATTRIBUTE);
+    list.add(nameDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+     {
+      result = element.getAttribute((String) id);
+    }
+    if (result == null)
+     {
+      result = "";
+    }
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value != null)
+    {
+      if (value instanceof String)
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ENUM_VALUE_CHANGE"), element);
+        element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, (String)value);
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/FixedOrDefaultTextPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/FixedOrDefaultTextPropertyDescriptor.java
new file mode 100644
index 0000000..1cdced0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/FixedOrDefaultTextPropertyDescriptor.java
@@ -0,0 +1,304 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.DialogCellEditor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+
+public class FixedOrDefaultTextPropertyDescriptor extends PropertyDescriptor
+{
+  protected static String choice = "";
+  Element element;
+  /**
+   * @param id
+   * @param displayName
+   */
+  public FixedOrDefaultTextPropertyDescriptor(Object id, String displayName, Element element)
+  {
+    super(id, displayName);
+    this.element = element;
+  }
+  
+  public CellEditor createPropertyEditor(Composite parent)
+  {
+    CellEditor editor = new FixedOrDefaultTextCellEditor(parent);
+    if (getValidator() != null)
+      editor.setValidator(getValidator());
+    return editor;
+  }
+
+//    public void setChoice(String newChoice)
+//    {
+//      choice = newChoice;
+//    }
+
+  public Object getId()
+  {
+    Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
+    Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
+    if (fixedAttr != null)
+    {
+      choice = "fixed";
+    }
+    else if (defaultAttr != null) // what if both attributes were specified?  Use default...
+    {
+      choice = "default";
+    }
+    else
+    {
+      choice = "";
+    }
+
+    if (choice.equals("fixed"))
+     {
+      return "fixed";
+    }
+    else if (choice.equals("default"))
+     {
+      return "default";
+    }
+    else
+     {
+      return super.getId();
+    }
+  }
+  
+  public String getDisplayName()
+  {
+    Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
+    Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
+    if (fixedAttr != null)
+    {
+      choice = "fixed";
+    }
+    else if (defaultAttr != null) // what if both attributes were specified?  Use default...
+     {
+      choice = "default";
+    }
+    else
+    {
+      choice = "fixed/default";
+    }
+
+    if (choice.equals("fixed"))
+     {
+      return "fixed";
+    }
+    else if (choice.equals("default"))
+     {
+      return "default";
+    }
+    else
+     {
+      return super.getDisplayName();
+    }
+  }
+
+  class FixedOrDefaultTextCellEditor extends DialogCellEditor
+  {
+    public FixedOrDefaultTextCellEditor(Composite parent)
+    {
+      super(parent);
+    }
+
+    protected Object openDialogBox(Control cellEditorWindow)
+    {
+	    Shell shell = Display.getCurrent().getActiveShell();
+	    
+	    FixedOrDefaultDialog dialog = new FixedOrDefaultDialog(shell);
+
+	    dialog.setBlockOnOpen(true);
+	    dialog.create();
+	    
+	    int result = dialog.open();
+	    
+	    if (result == Window.OK)
+	    {
+	      dialog.getValue();
+          fireApplyEditorValue();
+	    }
+	    deactivate();
+        return null;
+	  }
+  }
+  
+  class FixedOrDefaultDialog extends Dialog implements SelectionListener
+  {
+    private int FIXED = 0;
+    private int DEFAULT = 1;
+    private int type;
+    protected Button fixedButton, defaultButton;
+    protected Text valueField;
+    protected String valueString = "";
+    
+    public FixedOrDefaultDialog(Shell shell)
+    {
+      super(shell);
+    }
+
+    protected void configureShell(Shell shell)
+    {
+      super.configureShell(shell);
+    }
+
+    protected void buttonPressed(int buttonId)
+    {
+      if (buttonId == Dialog.OK)
+      {
+        valueString = valueField.getText();
+        applyEditorValueAndDeactivate();
+      }
+      super.buttonPressed(buttonId);
+    }
+
+    public String getValue() { return valueString; }
+    public String getType() { return type == FIXED? "fixed" : "default"; }
+
+    //
+    // Create the controls
+    //
+    public Control createDialogArea(Composite parent)
+    {
+      Composite client = (Composite)super.createDialogArea(parent);
+      getShell().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_FIXEDORDEFAULT_VALUE"));
+
+      GridLayout gl = new GridLayout(1, true);
+//      gl.marginHeight = 0;
+//      gl.marginWidth = 0;
+//      gl.horizontalSpacing = 0;
+//      gl.verticalSpacing = 0;
+      client.setLayout(gl);
+
+      GridData gd = new GridData();
+      gd.grabExcessHorizontalSpace = true;
+      gd.grabExcessVerticalSpace = true;
+      gd.horizontalAlignment = GridData.FILL;
+      gd.verticalAlignment = GridData.FILL;
+      gd.horizontalIndent = 0;
+      client.setLayoutData(gd);
+      
+//      isTextReadOnly = false;
+
+      fixedButton = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_FIXED"));
+//    WorkbenchHelp.setHelp(fixedButton, XSDEditorContextIds.XSDE_ELEMENT_FIXED);
+      
+      defaultButton = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_DEFAULT"));
+//    WorkbenchHelp.setHelp(defaultButton, XSDEditorContextIds.XSDE_ELEMENT_DEFAULT);
+
+      valueField = ViewUtility.createTextField(client, 30);
+      
+//    WorkbenchHelp.setHelp(valueField, XSDEditorContextIds.XSDE_ELEMENT_VALUE);
+//    valueField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_VALUE"));
+
+      WorkbenchHelp.setHelp(fixedButton, XSDEditorContextIds.XSDE_ATTRIBUTE_FIXED);
+      WorkbenchHelp.setHelp(defaultButton, XSDEditorContextIds.XSDE_ATTRIBUTE_DEFAULT);
+      // WorkbenchHelp.setHelp(valueField, XSDEditorContextIds.XSDE_ATTRIBUTE_VALUE);
+      
+      Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
+      Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
+
+      if (fixedAttr != null)
+      {
+        fixedButton.setSelection(true);
+        defaultButton.setSelection(false);
+        choice = "fixed";
+        type = FIXED;
+        valueField.setText(element.getAttribute("fixed"));
+        valueField.setFocus();
+        valueField.selectAll();
+      }
+      if (defaultAttr != null) // what if both attributes were specified?  Use default...
+       {
+        fixedButton.setSelection(false);
+        defaultButton.setSelection(true);
+        choice = "default";
+        type = DEFAULT;
+        valueField.setText(element.getAttribute("default"));
+        valueField.setFocus();
+        valueField.selectAll();
+      }
+
+      fixedButton.addSelectionListener(this);
+      defaultButton.addSelectionListener(this);
+      return client;
+    }
+
+    void applyEditorValueAndDeactivate()
+    {
+      String value = valueField.getText();
+      if (value != null && value.length() > 0)
+      {
+        choice = type == FIXED? "fixed" : "default";
+      }
+      if (value != null && value.length() > 0)
+      {
+        if (choice.equals("fixed"))
+        {
+          element.removeAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
+          element.setAttribute(XSDConstants.FIXED_ATTRIBUTE, value);
+        }
+        else if (choice.equals("default"))
+        {
+          element.removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
+          element.setAttribute(XSDConstants.DEFAULT_ATTRIBUTE, value);
+        }
+      }
+      if (value.equals(""))
+      {
+        choice = "";
+        element.removeAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
+        element.removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
+      }
+    }
+
+    public void widgetSelected(SelectionEvent e)
+    {
+      if (e.widget == fixedButton && fixedButton.getSelection())
+      {
+        type = FIXED;
+        choice = "fixed";
+      }
+      else if (e.widget == defaultButton && defaultButton.getSelection())
+      {
+        type = DEFAULT;
+        choice = "default";
+      }
+    }
+
+  	public void widgetDefaultSelected(SelectionEvent e)
+    {
+    }
+
+  }
+  
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/GroupRefPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/GroupRefPropertySource.java
new file mode 100644
index 0000000..0067c48
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/GroupRefPropertySource.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class GroupRefPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String[] refComboValues = { "" };
+  /**
+   * 
+   */
+  public GroupRefPropertySource()
+  {
+    super();
+  }
+  
+//  public void setReferenceComboContextHelp(String contextId)
+//  {
+//    WorkbenchHelp.setHelp(refCombo, contextId);
+//  }
+  
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public GroupRefPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public GroupRefPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  
+  public void setInput(Element element)
+  {
+    this.element = element;
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    java.util.List items = helper.getGlobalElements();
+    if (XSDDOMHelper.inputEquals(element, XSDConstants.GROUP_ELEMENT_TAG, true))
+    {
+      items = helper.getModelGroups();
+      // Need tooltip for Group Ref
+//        minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
+//        WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_GROUP_REF_MINIMUM);
+//        maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
+//        WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_GROUP_REF_MAXIMUM);
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, true))
+    {
+      items = helper.getGlobalElements();
+//        minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
+//        WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MINIMUM);
+//        maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
+//        WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MAXIMUM);
+    }
+    
+    int size = items.size() + 1;
+    refComboValues = new String[size];
+    refComboValues[0] = "";
+    if (items != null)
+     {
+      for (int i = 0; i < items.size(); i++)
+       {
+        refComboValues[i + 1] = (String) items.get(i);
+      }
+    }
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    XSDComboBoxPropertyDescriptor refDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.REF_ATTRIBUTE,
+        XSDConstants.REF_ATTRIBUTE,
+        refComboValues);
+    list.add(refDescriptor);
+    
+    PropertyDescriptor minOccursDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.MINOCCURS_ATTRIBUTE,
+        XSDConstants.MINOCCURS_ATTRIBUTE);
+    list.add(minOccursDescriptor);
+    PropertyDescriptor maxOccursDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.MAXOCCURS_ATTRIBUTE,
+        XSDConstants.MAXOCCURS_ATTRIBUTE);
+    list.add(maxOccursDescriptor);
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      if (result == null)
+      {
+        result = "";
+      }
+      return result;
+      
+//      if (((String) id).equals(XSDConstants.REF_ATTRIBUTE))
+//      {
+//        return result;
+//      }
+    }
+    return "";
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      if (((String) id).equals(XSDConstants.MAXOCCURS_ATTRIBUTE))
+      {
+        String max = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element);
+        if (max.length() > 0)
+        {
+          element.setAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE, max);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.MINOCCURS_ATTRIBUTE))
+      {
+        String min = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element);
+        if (min.length() > 0)
+        {
+          element.setAttribute(XSDConstants.MINOCCURS_ATTRIBUTE, min);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.REF_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_REF_CHANGE"), element);
+        element.setAttribute((String) id, newValue);
+        endRecording(element);
+      }
+    }
+//    Runnable delayedUpdate = new Runnable()
+//    {
+//      public void run()
+//      {
+        if (viewer != null)
+          viewer.refresh();
+//      }
+//    };
+//    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ImportPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ImportPropertySource.java
new file mode 100644
index 0000000..cadd611
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ImportPropertySource.java
@@ -0,0 +1,310 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class ImportPropertySource
+  extends SchemaDirectiveHelperPropertySource
+  implements IPropertySource
+{
+  boolean isSetNamespace = false;
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public ImportPropertySource(Viewer viewer, XSDSchema xsdSchema, IFile currentIFile)
+  {
+    super(viewer, xsdSchema, false);
+    this.currentIFile = currentIFile;
+//     WorkbenchHelp.setHelp(controlsContainer, XSDEditorContextIds.XSDE_IMPORT_DESIGN_VIEW);
+//WorkbenchHelp.setHelp(selectButton, XSDEditorContextIds.XSDE_INCLUDE_HELPER_SELECT);
+//WorkbenchHelp.setHelp(prefixField, XSDEditorContextIds.XSDE_IMPORT_PREFIX);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public ImportPropertySource(XSDSchema xsdSchema, IFile currentIFile)
+  {
+    super(xsdSchema, false);
+    this.currentIFile = currentIFile;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    
+    SchemaLocationPropertyDescriptor schemaLocationDescriptor =
+    new SchemaLocationPropertyDescriptor(
+      XSDConstants.SCHEMALOCATION_ATTRIBUTE,
+      XSDConstants.SCHEMALOCATION_ATTRIBUTE
+      );
+    schemaLocationDescriptor.setHelpContextIds(XSDEditorContextIds.XSDE_INCLUDE_HELPER_SELECT);
+    list.add(schemaLocationDescriptor);
+    
+    if (isSetNamespace)
+    {
+      PropertyDescriptor prefixDescriptor = 
+      new TextPropertyDescriptor(
+        "Prefix",
+        "Prefix");
+      prefixDescriptor.setHelpContextIds(XSDEditorContextIds.XSDE_IMPORT_PREFIX);
+      list.add(prefixDescriptor);
+    }
+    else
+    {
+      PropertyDescriptor prefixDescriptor = 
+      new PropertyDescriptor(
+        "Prefix",
+        "Prefix");
+      prefixDescriptor.setHelpContextIds(XSDEditorContextIds.XSDE_IMPORT_PREFIX);
+      list.add(prefixDescriptor);
+    }
+
+    PropertyDescriptor namespaceDescriptor = 
+    new PropertyDescriptor(
+        XSDConstants.NAMESPACE_ATTRIBUTE,
+        XSDConstants.NAMESPACE_ATTRIBUTE);
+    list.add(namespaceDescriptor);  
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      String attributeName = (String)id;
+      if (result == null)
+       {
+        result = "";
+      }
+
+      if (attributeName.equals("Prefix"))
+       {
+        TypesHelper helper = new TypesHelper(xsdSchema);
+        String aPrefix = helper.getPrefix(element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE), false);
+        if (aPrefix != null && aPrefix.length() > 0)
+        {
+          return aPrefix;
+        }
+        return "";        
+      }
+      else
+       {
+        return result;
+      }
+    }
+    return "";
+    
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+     {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      TypesHelper typesHelper = new TypesHelper(xsdSchema);
+      String namespace = element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
+      String oldPrefixValue = typesHelper.getPrefix(namespace, false);
+      
+      String schemaLocation = element.getAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE);
+      if (((String) id).equals("Prefix"))
+      {
+        if (validatePrefix(newValue) &&  schemaLocation.length() > 0)
+        {
+          Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+
+          if (map.containsKey(newValue))
+          {
+//          setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_PREFIX_EXISTS"));
+          }
+          else
+          {
+            beginRecording(XSDEditorPlugin.getXSDString("_UI_PREFIX_CHANGE"), element);
+            map.remove(oldPrefixValue);
+            map.put(newValue, namespace);
+            XSDSchemaHelper.updateElement(xsdSchema);
+
+            endRecording(element);  
+          }
+        }
+      }
+      else if (((String) id).equals(XSDConstants.SCHEMALOCATION_ATTRIBUTE))
+      { 
+        updateExternalModel((String)value, selectedIFile, selectedNamespace, selectedXSDSchema);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+  
+  public void setInput(Element element)
+  {
+    this.element = element;
+    String namespace = element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
+    if (namespace != null && namespace.trim().length() > 0)
+    {
+      isSetNamespace = true;
+    }    
+    
+  }
+
+  protected void updateExternalModel(String newLocation, IFile newFile, String namespace, XSDSchema externalSchema)
+  {
+    if (xsdSchema == null) // in case we have a bad schema
+     {
+      return;
+    }
+    Element importElement = element;
+    if (namespace == null)
+    {
+      namespace = "";
+    }        
+    
+    XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+    if (comp instanceof XSDImport)
+    {
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_IMPORT_CHANGE"), importElement);
+      java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+      
+      // Referential integrity on old import
+      // How can we be sure that if the newlocation is the same as the oldlocation
+      // the file hasn't changed
+      
+      XSDSchema referencedSchema = ((XSDSchemaDirective)comp).getResolvedSchema();
+      if (referencedSchema != null)
+      {
+        XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
+        cleanHelper.visitSchema(xsdSchema);
+      }
+
+      Element schemaElement = xsdSchema.getElement();
+
+      // update the xmlns in the schema element first, and then update the import element next
+      // so that the last change will be in the import element.  This keeps the selection
+      // on the import element
+      TypesHelper helper = new TypesHelper(externalSchema);
+      String prefix = helper.getPrefix(namespace, false);
+      
+      boolean prefixAlreadyExists = false;
+      if (map.containsKey(prefix))
+      {
+        prefixAlreadyExists = true;
+      }
+      
+      if (prefix == null || (prefix !=null && prefix.length() == 0) || prefixAlreadyExists)
+      {
+        prefix = "pref";
+
+        int prefixExtension = 1;
+        while (map.containsKey(prefix) && prefixExtension < 100)
+         {
+          prefix = prefix + String.valueOf(prefixExtension);
+          prefixExtension++;
+        }
+      }
+
+      if (namespace.length() > 0)
+       {
+        // if ns already in map, use its corresponding prefix
+        if (map.containsValue(namespace))
+         {
+          TypesHelper typesHelper = new TypesHelper(xsdSchema);
+          prefix = typesHelper.getPrefix(namespace, false);
+        }
+        else // otherwise add to the map
+        {
+          schemaElement.setAttribute("xmlns:"+prefix, namespace);
+        }
+      }
+
+      // Now update the import element's attributes
+      importElement.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, newLocation);
+      
+      if (!namespace.equals(""))
+       {
+        importElement.setAttribute(XSDConstants.NAMESPACE_ATTRIBUTE, namespace);
+      }
+      else
+       {
+        importElement.removeAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
+      }
+      
+      endRecording(importElement);
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/IncludePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/IncludePropertySource.java
new file mode 100644
index 0000000..b5054ac
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/IncludePropertySource.java
@@ -0,0 +1,237 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class IncludePropertySource
+  extends SchemaDirectiveHelperPropertySource
+  implements IPropertySource
+{
+  /**
+   * 
+   */
+  public IncludePropertySource(IFile currentIFile)
+  {
+    super(true);
+    this.currentIFile = currentIFile;
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public IncludePropertySource(Viewer viewer, XSDSchema xsdSchema, IFile currentIFile)
+  {
+    super(viewer, xsdSchema, true);
+    this.currentIFile = currentIFile;
+  }
+  /**
+   * @param xsdSchema
+   */
+  public IncludePropertySource(XSDSchema xsdSchema, IFile currentIFile)
+  {
+    super(xsdSchema, true);
+    this.currentIFile = currentIFile;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    
+    SchemaLocationPropertyDescriptor schemaLocationDescriptor =
+    new SchemaLocationPropertyDescriptor(
+        XSDConstants.SCHEMALOCATION_ATTRIBUTE,
+        XSDConstants.SCHEMALOCATION_ATTRIBUTE);
+  
+    list.add(schemaLocationDescriptor);
+    
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+     {
+      result = element.getAttribute((String) id);
+      if (result == null)
+       {
+        result = "";
+      }
+      return result;
+    }
+    return "";
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      if (((String) id).equals(XSDConstants.SCHEMALOCATION_ATTRIBUTE))
+      { 
+        //element.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, (String)value);
+        updateExternalModel((String)value, selectedIFile, selectedNamespace, selectedXSDSchema);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+  }
+
+  protected void updateExternalModel(String newLocation, IFile newFile, String namespace, XSDSchema externalSchema)
+  {
+    Element includeElement = element;
+
+    String existingSchemaLocation = includeElement.getAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE);
+
+    beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_INCLUDE_CHANGE"), includeElement);
+    includeElement.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, newLocation);
+    
+    // If there is no existing schemaLocation, then just set it
+    if (existingSchemaLocation == null)
+    {
+      return;
+    }
+
+    XSDConcreteComponent includeComponent = xsdSchema.getCorrespondingComponent(includeElement);
+    if (includeComponent instanceof XSDInclude)
+     {
+      XSDInclude include = (XSDInclude) includeComponent;
+
+      XSDSchema referencedSchema = include.getResolvedSchema();
+      if (referencedSchema != null)
+      {
+        XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
+        cleanHelper.visitSchema(xsdSchema);
+        
+        xsdSchema.update();
+        include.updateElement();
+      }
+      
+    }
+    endRecording(includeElement);    
+  }
+
+  
+// Redefine's version
+//  protected void updateExternalModel(IFile newFile, String namespace, XSDSchema externalSchema)
+//  {
+//    Element redefineElement = (Element) getNode();
+//
+//    redefineElement.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, locationField.getText());
+//
+//    String existingSchemaLocation = redefineElement.getAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE);
+//
+//    // If there is no existing schemaLocation, then just set it and return
+//    if (existingSchemaLocation == null)
+//     {
+//      return;
+//    }
+//
+//    XSDConcreteComponent redefineComponent = getXSDSchema().getCorrespondingComponent(redefineElement);
+//    if (redefineComponent instanceof XSDRedefine)
+//     {
+//      XSDRedefine redefine = (XSDRedefine) redefineComponent;
+//      XSDExternalFileCleanup cleanup = new XSDExternalFileCleanup(redefine.getIncorporatedSchema());
+//      
+//      cleanup.visitSchema(getXSDSchema());
+//      if (getEditor() != null)
+//       {
+//// DisplayErrorInTaskList task = new DisplayErrorInTaskList(getEditor().getEditorIDocument(), getEditor().getFileResource(), cleanup.getMessages());
+//// task.run();
+//        
+//        // Workaround to reset included elements in XSD model
+//        getEditor().reparseSchema();
+//        getEditor().getGraphViewer().setSchema(getXSDSchema());
+//      }
+//    }
+//
+//    /* since we are reparsing, we don't need this
+//
+//     Iterator contents = getXSDSchema().getContents().iterator();
+//     while (contents.hasNext())
+//     {
+//     XSDSchemaContent content = (XSDSchemaContent)contents.next();
+//     if (content instanceof XSDSchemaDirective)
+//     {
+//     XSDSchemaDirective directive = (XSDSchemaDirective)content;
+//
+//     if (directive.getSchemaLocation().equals(oldSchemaLocation) && directive instanceof XSDRedefine)
+//     {
+//     directive.unsetSchemaLocation();
+//     directive.setSchemaLocation(locationField.getText());
+//     directive.unsetResolvedSchema();
+//     redefineElement.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, locationField.getText());
+//     getXSDSchema().updateDocument();
+//     XSDSchemaHelper.updateElement(directive);
+////          directive.updateElement();
+//     break;
+//     }
+//     }
+//     }
+//     */
+//  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/KeyrefPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/KeyrefPropertySource.java
new file mode 100644
index 0000000..19e95ce
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/KeyrefPropertySource.java
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class KeyrefPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String[] refComboValues = { "" };
+  /**
+   * 
+   */
+  public KeyrefPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public KeyrefPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public KeyrefPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  
+  public void setInput(Element element)
+  {
+    this.element = element;
+    java.util.List items = new ArrayList();
+
+    
+    if (xsdSchema != null)
+    {
+      Iterator iter = xsdSchema.getIdentityConstraintDefinitions().iterator();
+      String name = element.getAttribute(XSDConstants.NAME_ATTRIBUTE);
+      while (iter.hasNext())
+      {
+        XSDIdentityConstraintDefinition constraint = (XSDIdentityConstraintDefinition)iter.next();
+        if (name != null && !name.equals(""))
+         {
+          if (constraint.getName() != null)
+           {
+            if (!name.equals(constraint.getQName(xsdSchema)))
+            {
+              items.add(constraint.getQName(xsdSchema));
+            }
+          }
+        }
+        else
+         {
+          if (constraint.getName() != null)
+          {
+            items.add(constraint.getQName(xsdSchema));
+          }
+        }
+      }
+    }   
+    
+    int size = items.size() + 1;
+    refComboValues = new String[size];
+    refComboValues[0] = "";
+    if (items != null)
+     {
+      for (int i = 0; i < items.size(); i++)
+       {
+        refComboValues[i + 1] = (String) items.get(i);
+      }
+    }
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+// This property is moved to the General Tab
+//    PropertyDescriptor nameDescriptor =
+//    new TextPropertyDescriptor(
+//        XSDConstants.NAME_ATTRIBUTE,
+//        XSDConstants.NAME_ATTRIBUTE);
+//    list.add(nameDescriptor);
+    
+    XSDComboBoxPropertyDescriptor refDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.REFER_ATTRIBUTE,
+        XSDConstants.REFER_ATTRIBUTE,
+        refComboValues);
+    list.add(refDescriptor);
+    
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+
+    if (id instanceof String)
+     {
+      result = element.getAttribute((String) id);
+      if (result == null)
+       {
+        result = "";
+      }
+      return result;
+//      if (((String) id).equals(XSDConstants.REFER_ATTRIBUTE))
+//      {
+//        return result;
+//      }
+    }
+    return "";
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      if (((String) id).equals(XSDConstants.NAME_ATTRIBUTE))
+      {  
+        if (validateName(newValue))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_KEYREF_NAME_CHANGE"), element);
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+          endRecording(element);
+        }         
+      }
+      else if (((String) id).equals(XSDConstants.REFER_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_KEYREF_REFER_CHANGE"), element);
+        element.setAttribute((String) id, newValue);
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ModelGroupPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ModelGroupPropertySource.java
new file mode 100644
index 0000000..228860c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ModelGroupPropertySource.java
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class ModelGroupPropertySource  // all or sequence or choice
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String[] modelGroupComboValues = { "sequence", "choice", "all" };
+  /**
+   * 
+   */
+  public ModelGroupPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public ModelGroupPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public ModelGroupPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+
+    XSDComboBoxPropertyDescriptor modelGroupDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        "model group",
+        "model group",
+        modelGroupComboValues);
+    list.add(modelGroupDescriptor);
+    
+    PropertyDescriptor minOccursDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.MINOCCURS_ATTRIBUTE,
+        XSDConstants.MINOCCURS_ATTRIBUTE);
+    list.add(minOccursDescriptor);
+    PropertyDescriptor maxOccursDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.MAXOCCURS_ATTRIBUTE,
+        XSDConstants.MAXOCCURS_ATTRIBUTE);
+    list.add(maxOccursDescriptor);
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      String attributeName = (String)id;
+      if (result == null)
+       {
+        result = "";
+      }
+      if (attributeName.equals("model group"))
+      {
+        result = element.getLocalName();
+        return result;
+      }
+    }
+    return "";
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    String property = (String)id;
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      if (property.equals("model group"))
+       {
+        Element parent = (Element)element.getParentNode();
+        String prefix = element.getPrefix();
+        prefix = prefix == null ? "" : prefix + ":";
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_SCOPE_CHANGE"), parent);
+        changeContentModel(parent, newValue);
+        endRecording(parent);
+        XSDDOMHelper domHelper = new XSDDOMHelper();
+        setInput(domHelper.getContentModelFromParent(parent));
+      }
+      else if (property.equals(XSDConstants.MAXOCCURS_ATTRIBUTE))
+      {
+        String max = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element);
+        if (max.length() > 0)
+        {
+          element.setAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE, max);
+        }
+        else
+         {
+          element.removeAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+      else if (((String) id).equals(XSDConstants.MINOCCURS_ATTRIBUTE))
+       {
+        String min = (String)value;
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element);
+        if (min.length() > 0)
+        {
+          element.setAttribute(XSDConstants.MINOCCURS_ATTRIBUTE, min);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+    }
+
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+
+  public void setInput(Element element)
+  {
+    super.setInput(element);
+    
+    if (element != null)
+    {
+      boolean parentIsSequence = false;
+      boolean parentIsChoice = false;
+     
+      Object parent = element.getParentNode();
+      
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SEQUENCE_ELEMENT_TAG, false))
+       {
+        parentIsSequence = true;
+      }
+      else if (XSDDOMHelper.inputEquals(parent, XSDConstants.CHOICE_ELEMENT_TAG, false))
+       {
+        parentIsChoice = true;
+      }
+      
+      if (parentIsChoice || parentIsSequence)
+      {
+        modelGroupComboValues = new String[2];
+        modelGroupComboValues[0] = XSDConstants.SEQUENCE_ELEMENT_TAG;
+        modelGroupComboValues[1] = XSDConstants.CHOICE_ELEMENT_TAG;
+      }
+      else
+      {
+        modelGroupComboValues = new String[3];
+        modelGroupComboValues[0] = XSDConstants.SEQUENCE_ELEMENT_TAG;
+        modelGroupComboValues[1] = XSDConstants.CHOICE_ELEMENT_TAG;
+        modelGroupComboValues[2] = XSDConstants.ALL_ELEMENT_TAG;
+      }
+    }      
+  }
+  
+  private void changeContentModel(Element parent, String contentModel)
+  {
+    Document doc = parent.getOwnerDocument();
+    XSDDOMHelper domHelper = new XSDDOMHelper();
+  
+    String prefix = parent.getPrefix();
+    prefix = prefix == null ? "" : prefix + ":";
+    
+    Element contentModelElement = domHelper.getContentModelFromParent(parent);
+  
+    if (contentModelElement.getLocalName().equals(contentModel))
+    {
+      return; // it's already the content model 
+    }
+  
+    Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
+  
+    if (contentModelElement.hasChildNodes())
+    {        
+      NodeList nodes = contentModelElement.getChildNodes();
+      // use clones so we don't have a refresh problem
+      for (int i = 0; i < nodes.getLength(); i++)
+      {
+        Node node = nodes.item(i);
+        newNode.appendChild(node.cloneNode(true)); 
+      }
+    }
+    parent.replaceChild(newNode, contentModelElement);
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NamePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NamePropertySource.java
new file mode 100644
index 0000000..bbfb786
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NamePropertySource.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalAttributeGroupRenamer;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalGroupRenamer;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class NamePropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  /**
+   * 
+   */
+  public NamePropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public NamePropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public NamePropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+
+// From attribute group    
+//    WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_DESIGN_VIEW);
+//    WorkbenchHelp.setHelp(nameField, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_NAME);
+
+// From unique
+//    WorkbenchHelp.setHelp(nameField, XSDEditorContextIds.XSDE_UNIQUE_BASE_NAME);
+
+// From key
+//    WorkbenchHelp.setHelp(nameField, XSDEditorContextIds.XSDE_UNIQUE_BASE_NAME);
+    
+// From group
+//     WorkbenchHelp.setHelp(controlsContainer, XSDEditorContextIds.XSDE_GROUP_DESIGN_VIEW);
+//     WorkbenchHelp.setHelp(nameField, XSDEditorContextIds.XSDE_GROUP_NAME);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    PropertyDescriptor nameDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.NAME_ATTRIBUTE,
+        XSDConstants.NAME_ATTRIBUTE);
+    list.add(nameDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+    }
+    if (result == null)
+    {
+      result = "";
+    }
+    return result;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value != null)
+    {
+      if (value instanceof String)
+      {
+        String newValue = (String)value;
+        if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
+        {  
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_NAME_CHANGE"), element);
+
+          // now rename any references to this element
+          if (xsdSchema != null)
+          {
+            XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+            if (comp != null && comp instanceof XSDAttributeGroupDefinition && comp.getContainer().equals(xsdSchema))
+            {
+              GlobalAttributeGroupRenamer renamer = new GlobalAttributeGroupRenamer((XSDNamedComponent)comp, (String)value);
+              renamer.visitSchema(xsdSchema);
+            }
+          }
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, (String)value);
+          endRecording(element);
+        }
+        else if (XSDDOMHelper.inputEquals(element, XSDConstants.UNIQUE_ELEMENT_TAG, false))
+        {
+          if (validateName(newValue))
+           {
+            beginRecording(XSDEditorPlugin.getXSDString("_UI_UNIQUE_NAME_CHANGE"), element);
+            if (newValue.length() > 0)
+            {
+              element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+            }
+            else
+            {
+              element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
+            }
+            endRecording(element);
+          }
+        }
+        else if (XSDDOMHelper.inputEquals(element, XSDConstants.KEY_ELEMENT_TAG, false))
+        {
+          if (validateName(newValue))
+          {
+            beginRecording(XSDEditorPlugin.getXSDString("_UI_KEY_NAME_CHANGE"), element);
+            if (newValue.length() > 0)
+            {
+              element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+            }
+            else
+            {
+              element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
+            }
+            endRecording(element);
+          }
+        }
+        else if (XSDDOMHelper.inputEquals(element, XSDConstants.GROUP_ELEMENT_TAG, false))
+        {
+          if (validateName(newValue))
+           {
+            beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_NAME_CHANGE"), element);
+            // now rename any references to this element
+            if (xsdSchema != null)
+             {
+              XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+              if (comp != null && comp instanceof XSDModelGroupDefinition && comp.getContainer().equals(xsdSchema))
+              {
+                GlobalGroupRenamer renamer = new GlobalGroupRenamer((XSDNamedComponent)comp, newValue);
+                renamer.visitSchema(xsdSchema);
+              }
+            }
+            element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+            endRecording(element);
+          }
+          
+        }
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NotationPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NotationPropertySource.java
new file mode 100644
index 0000000..573d83d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NotationPropertySource.java
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+public class NotationPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  /**
+   * 
+   */
+  public NotationPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public NotationPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public NotationPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+// Removed for tabbed properties
+//    PropertyDescriptor nameDescriptor =
+//    new TextPropertyDescriptor(
+//        XSDConstants.NAME_ATTRIBUTE,
+//        XSDConstants.NAME_ATTRIBUTE);
+//    list.add(nameDescriptor);
+
+    PropertyDescriptor publicDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.PUBLIC_ATTRIBUTE,
+        XSDConstants.PUBLIC_ATTRIBUTE);
+    list.add(publicDescriptor);
+    
+    PropertyDescriptor systemDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.SYSTEM_ATTRIBUTE,
+        XSDConstants.SYSTEM_ATTRIBUTE);
+    list.add(systemDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+    
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+    }
+    if (result == null)
+    {
+      result = "";
+    }
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      if (((String)id).equals(XSDConstants.NAME_ATTRIBUTE))
+      {
+        if (validateName(newValue))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_NOTATION_NAME_CHANGE"), element);
+          if (newValue.length() > 0)
+          {
+            element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+          }
+          else
+          {
+            element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
+          }
+          endRecording(element);
+        }
+      }
+      else if (((String)id).equals(XSDConstants.PUBLIC_ATTRIBUTE))
+       {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_NOTATION_PUBLIC_CHANGE"), element);
+        if (newValue.length() > 0)
+        {
+          element.setAttribute(XSDConstants.PUBLIC_ATTRIBUTE, newValue);
+        }
+        else
+        {
+          element.setAttribute(XSDConstants.PUBLIC_ATTRIBUTE, "");
+        }
+        endRecording(element);
+      }
+      else if (((String)id).equals(XSDConstants.SYSTEM_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_NOTATION_SYSTEM_CHANGE"), element);
+        if (newValue.length() > 0)
+        {
+          element.setAttribute(XSDConstants.SYSTEM_ATTRIBUTE, newValue);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.SYSTEM_ATTRIBUTE);
+        }
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/OptionsTextCellEditor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/OptionsTextCellEditor.java
new file mode 100644
index 0000000..d61142e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/OptionsTextCellEditor.java
@@ -0,0 +1,239 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+
+
+public abstract class OptionsTextCellEditor extends CellEditor implements SelectionListener, KeyListener
+{
+	private Composite fEditor;
+	protected Text fText;
+  protected boolean isTextReadOnly;
+	Button moreButton;
+	Shell dialog;
+
+	protected Object fValue;
+	int selection;
+	Object typeObject;
+		
+	private class ComboCellLayout extends Layout 
+	{
+		public void layout(Composite editor, boolean force)
+		{
+			Rectangle bounds= editor.getClientArea();
+			Point size= moreButton.computeSize(SWT.DEFAULT, bounds.height, force);
+			fText.setBounds(0, 0, bounds.width - size.x, bounds.height);
+			moreButton.setBounds(bounds.width - size.x, 0, size.x, size.y);
+		}
+		
+		public Point computeSize(Composite editor, int wHint, int hHint, boolean force)
+		{
+			if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
+			{
+				return new Point(wHint, hHint);
+			}
+			Point size= fText.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
+//			size.x += moreButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, force).x;
+			return size;
+		}
+	}
+
+/**
+ * Creates a new combo box cell editor with the given choices.
+ */
+	 public OptionsTextCellEditor(Composite parent)
+	 {
+		 super(parent);
+	 }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.CellEditor#createControl(org.eclipse.swt.widgets.Composite)
+   */
+	protected Control createControl(Composite parent)
+	{
+		fEditor = ViewUtility.createComposite(parent, 2);
+		fEditor.setLayout(new ComboCellLayout());
+ 
+    if (isTextReadOnly)
+    {
+		  fText = new Text(fEditor, SWT.LEFT | SWT.READ_ONLY);
+    }
+    else
+    {
+      fText = new Text(fEditor, SWT.LEFT);
+    }
+//    fText.setEnabled(false);
+
+		fText.setBackground(parent.getBackground());
+		fText.setText("");
+    fText.addKeyListener(this);
+		fText.addFocusListener(new FocusAdapter()
+    {
+			public void focusLost(FocusEvent e)
+      {
+				if (!moreButton.isFocusControl())
+				{
+					OptionsTextCellEditor.this.focusLost();
+				}
+			}
+		});
+			
+		moreButton = ViewUtility.createPushButton(fEditor, "...");
+		moreButton.addSelectionListener(new SelectionAdapter()
+		{
+			public void widgetSelected(SelectionEvent e)
+			{
+				// System.out.println("More Button Clicked");
+				openDialog();
+			}
+		});
+    moreButton.addKeyListener(this);
+		moreButton.addFocusListener(new FocusAdapter() {
+			public void focusLost(FocusEvent e) {
+				if (!fText.isFocusControl() && (dialog==null || 
+								dialog.isDisposed() || 
+								(dialog!=null && !dialog.isFocusControl())))
+				{
+          // System.out.println("MoreButton focusLost");
+					OptionsTextCellEditor.this.focusLost();
+				}
+			}
+		});
+
+
+		setValueValid(true);
+
+		return fEditor;
+	}
+  
+  public void activate()
+  {
+    // System.out.println("Cell editor activated");
+    fText.setText(fValue == null ? "" : fValue.toString());
+  }
+
+	protected void focusLost() {
+		// System.out.println("CELLEDITOR FOCUS LOST");
+		if (isActivated()) {
+			applyEditorValueAndDeactivate();
+		}
+	}
+
+	void applyEditorValueAndDeactivate() {
+		//	must set the selection before getting value
+//		if (dialog != null  && !dialog.isDisposed())
+//		{
+//			dialog.close();
+//			dialog.dispose();
+//		}
+		fireApplyEditorValue();
+		deactivate();
+	}
+
+  public void keyPressed(KeyEvent e)
+  {
+    if (e.character == SWT.ESC)
+     { // Escape character
+      fireCancelEditor();
+    }
+    else if ((e.character == SWT.CR) || (e.character == SWT.LF))
+     { // Return key
+      applyEditorValueAndDeactivate();
+    }
+  }
+  
+  public void keyReleased(KeyEvent e)
+  {
+    
+  }
+  
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.CellEditor#doGetValue()
+   * Returns the cell editor's value.
+	 */
+	protected Object doGetValue() 
+	{
+		return fValue;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.CellEditor#doSetFocus()
+   * Set the focus to the cell editor's UI representation.
+   */
+	protected void doSetFocus()
+	{
+//		fButton.setFocus();
+//		System.out.println("doSetFocus() " + moreButton.setFocus());
+		fText.setFocus();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.CellEditor#doSetValue(java.lang.Object)
+	 * Sets the value of the cell editor to the given value.
+   */
+	protected void doSetValue(Object value)
+	{
+		fValue = value;
+	}
+
+  protected Point getButtonAbsoluteLocation()
+  {
+    Rectangle buttonBounds = moreButton.getBounds();
+    int x = buttonBounds.x;
+    int y = buttonBounds.y;
+    Control c = moreButton;
+    while (c != null)
+     {
+      c = c.getParent();
+      if (c == null)
+        break;
+      x += c.getBounds().x;
+      y += c.getBounds().y;
+    }
+    x += buttonBounds.width + 5;
+    y += buttonBounds.height;
+    Point p = new Point(x,y);
+    return p;
+  }
+  
+  protected void cancel()
+  {
+    dialog.close();
+    dialog.dispose();
+  }
+
+	protected abstract void openDialog();	
+  
+	public void widgetSelected(SelectionEvent e)
+	{
+	}
+	public void widgetDefaultSelected(SelectionEvent e)
+  {
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/PatternPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/PatternPropertySource.java
new file mode 100644
index 0000000..38f166a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/PatternPropertySource.java
@@ -0,0 +1,272 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.DialogCellEditor;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.wizards.RegexWizard;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+public class PatternPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  /**
+   * 
+   */
+  public PatternPropertySource()
+  {
+    super();
+//    expressionField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_PATTERN"));    
+//    WorkbenchHelp.setHelp(expressionField, XSDEditorContextIds.XSDE_PATTERN_VALUE);
+//    WorkbenchHelp.setHelp(activateWizardButton, XSDEditorContextIds.XSDE_PATTERN_REGULAR);
+//    activateWizardButton.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_BUTTON"));
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public PatternPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public PatternPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+
+    PatternTextPropertyDescriptor patternDescriptor =
+    new PatternTextPropertyDescriptor(
+        XSDConstants.VALUE_ATTRIBUTE, 
+        XSDConstants.VALUE_ATTRIBUTE);
+    list.add(patternDescriptor);
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+    }
+    if (result == null)
+    {
+      result = "";
+    }
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      if (((String) id).equals(XSDConstants.VALUE_ATTRIBUTE))
+      { 
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_PATTERN_VALUE_CHANGE"), element);
+        element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, (String)value);
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+
+  public class PatternTextPropertyDescriptor extends PropertyDescriptor
+  {
+    /**
+     * @param id
+     * @param displayName
+     */
+    public PatternTextPropertyDescriptor(Object id, String displayName)
+    {
+      super(id, displayName);
+    }
+    
+    public CellEditor createPropertyEditor(Composite parent)
+    {
+      // CellEditor editor = new PatternTextCellEditor(parent);
+      CellEditor editor = new PatternDialogCellEditor(parent);
+      if (getValidator() != null)
+        editor.setValidator(getValidator());
+      return editor;
+    }
+  }   
+
+  public class PatternDialogCellEditor extends DialogCellEditor {
+
+    /**
+     * Creates a new Font dialog cell editor parented under the given control.
+     * The cell editor value is <code>null</code> initially, and has no 
+     * validator.
+     *
+     * @param parent the parent control
+     */
+    protected PatternDialogCellEditor(Composite parent) {
+      super(parent);
+    }
+
+    /**
+     * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(Control)
+     */
+    protected Object openDialogBox(Control cellEditorWindow)
+    {
+      String initialValue = element.getAttribute(XSDConstants.VALUE_ATTRIBUTE);
+      if (initialValue == null)
+      {
+        initialValue = "";
+      }
+      RegexWizard wizard = new RegexWizard(initialValue);
+      Shell shell = Display.getCurrent().getActiveShell();
+      WizardDialog wizardDialog = new WizardDialog(shell, wizard);
+      wizardDialog.create();
+      
+      String value = (String)getValue();
+
+      int result = wizardDialog.open();
+
+      if (result == Window.OK)
+      {
+        return wizard.getPattern();
+      }
+      return value;
+    }
+
+  }
+  
+//  class PatternTextCellEditor extends OptionsTextCellEditor
+//  {
+//    protected Button fixedButton, defaultButton;
+//    
+//    public PatternTextCellEditor(Composite parent)
+//    {
+//      super(parent);
+//    }
+//
+//    protected Control createControl(Composite parent)
+//    {
+//      isTextReadOnly = false;
+//      return super.createControl(parent);
+//    }
+//
+//    protected void openDialog()
+//    {
+//      RegexWizard wizard = new RegexWizard(element.getAttribute(XSDConstants.VALUE_ATTRIBUTE));
+//      Shell shell = Display.getCurrent().getActiveShell();
+//      WizardDialog wizardDialog = new WizardDialog(shell, wizard);
+//      wizardDialog.create();
+//      
+//      dialog = wizardDialog.getShell();
+//      Display display = dialog.getDisplay();
+//      dialog.addShellListener(new ShellAdapter()
+//      {
+//        public void shellDeactivated(ShellEvent e)
+//        {
+//          cancel();
+//        }
+//      });
+//
+//      int result = wizardDialog.open();
+//
+//      if (result == Window.OK)
+//      {
+//        fText.setText(wizard.getPattern());
+//        applyEditorValueAndDeactivate();
+//      }
+//      
+//    }
+//
+//    protected void cancel()
+//    {
+//      super.cancel();
+//    }
+//
+//    void applyEditorValueAndDeactivate()
+//    {
+//      String value = fText.getText();
+//      doSetValue(value);
+//      fireApplyEditorValue();
+//      deactivate();
+//    }
+//    
+//    protected Object doGetValue()
+//    { 
+//      fValue = fText.getText();
+//      return fText.getText();
+//    }
+//
+//  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ReadOnlyPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ReadOnlyPropertySource.java
new file mode 100644
index 0000000..0f5cb7f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ReadOnlyPropertySource.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
+public class ReadOnlyPropertySource implements IPropertySource
+{
+	protected Element element;
+
+	public ReadOnlyPropertySource(IEditorPart editPart, Element element)
+	{
+			this.element = element;
+	}
+
+	public Object getEditableValue()
+	{
+			return null;
+	}
+
+	public IPropertyDescriptor[] getPropertyDescriptors()
+	{
+			List list = new ArrayList();
+			NamedNodeMap map = element.getAttributes();
+			int mapLength = map.getLength();
+			for (int i = 0; i < mapLength; i++)
+			{
+					Attr attr = (Attr) map.item(i);
+					list.add(new PropertyDescriptor(attr.getName(), attr.getName()));
+			}
+			IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+			list.toArray(result);
+			return result;
+	}
+
+	public Object getPropertyValue(Object id)
+	{
+			Object result = null;
+			if (id instanceof String)
+			{
+					result = element.getAttribute((String) id);
+			}
+			return result != null ? result : "";
+	}
+
+	public boolean isPropertySet(Object id)
+	{
+			return false;
+	}
+
+	public void resetPropertyValue(Object id)
+	{
+	}
+
+	public void setPropertyValue(Object id, Object value)
+	{
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaDirectiveHelperPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaDirectiveHelperPropertySource.java
new file mode 100644
index 0000000..43780f8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaDirectiveHelperPropertySource.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.DialogCellEditor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.navigator.ResourceNavigator;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
+import org.eclipse.xsd.XSDSchema;
+
+public abstract class SchemaDirectiveHelperPropertySource
+  extends BasePropertySource
+{
+  protected IFile currentIFile;
+
+  IFile selectedIFile;
+  String selectedNamespace;
+  XSDSchema selectedXSDSchema;
+  boolean isInclude;
+  /**
+   * 
+   */
+  public SchemaDirectiveHelperPropertySource(boolean isInclude)
+  {
+    super();
+    this.isInclude = isInclude;
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public SchemaDirectiveHelperPropertySource(
+    Viewer viewer,
+    XSDSchema xsdSchema,
+    boolean isInclude)
+  {
+    super(viewer, xsdSchema);
+    this.isInclude = isInclude;
+  }
+  /**
+   * @param xsdSchema
+   */
+  public SchemaDirectiveHelperPropertySource(XSDSchema xsdSchema, boolean isInclude)
+  {
+    super(xsdSchema);
+    this.isInclude = isInclude;
+  }
+
+  
+  public class SchemaLocationPropertyDescriptor extends PropertyDescriptor
+  {
+    /**
+     * @param id
+     * @param displayName
+     */
+    public SchemaLocationPropertyDescriptor(Object id, String displayName)
+    {
+      super(id, displayName);
+    }
+    
+    public CellEditor createPropertyEditor(Composite parent)
+    {
+      CellEditor editor = new SchemaLocationDialogCellEditor(parent);
+      if (getValidator() != null)
+        editor.setValidator(getValidator());
+      return editor;
+    }
+  }
+
+  public class SchemaLocationDialogCellEditor extends DialogCellEditor {
+
+    /**
+     * Creates a new Font dialog cell editor parented under the given control.
+     * The cell editor value is <code>null</code> initially, and has no 
+     * validator.
+     *
+     * @param parent the parent control
+     */
+    protected SchemaLocationDialogCellEditor(Composite parent) {
+      super(parent);
+    }
+
+    /**
+     * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(Control)
+     */
+    protected Object openDialogBox(Control cellEditorWindow)
+    {
+      Shell shell = Display.getCurrent().getActiveShell();
+      
+//      oldSchemaLocation = locationField.getText().trim();
+//      IFile currentIFile = ((IFileEditorInput)getIEditorPart().getEditorInput()).getFile();
+      ViewerFilter filter = new ResourceFilter(new String[] { ".xsd" }, 
+      new IFile[] { currentIFile },
+      null);
+//
+
+      IViewPart viewParts[] = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViews();
+      ResourceNavigator resourceNav = null;
+      for (int i = 0; i < viewParts.length; i++) 
+       {
+        if (viewParts[i] instanceof ResourceNavigator) 
+         {
+          resourceNav = (ResourceNavigator) viewParts[i];
+          break;
+        }
+      }
+      IStructuredSelection selection = StructuredSelection.EMPTY;
+      if (resourceNav != null)
+       {
+        selection = (IStructuredSelection)resourceNav.getViewSite().getSelectionProvider().getSelection();
+      }
+      
+      XSDSelectIncludeFileWizard fileSelectWizard = 
+      new XSDSelectIncludeFileWizard(xsdSchema, isInclude,
+          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"),
+          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"),
+          filter,
+          selection);
+
+      WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
+      wizardDialog.create();
+      wizardDialog.setBlockOnOpen(true);
+      int result = wizardDialog.open();
+
+      
+      String value = (String)getValue();
+      // System.out.println("VALUE IS *** = " + value);
+      if (result == Window.OK)
+      {
+        selectedIFile = fileSelectWizard.getResultFile();
+        String schemaFileString = value;
+        if (selectedIFile != null) 
+         {
+          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
+        }
+        else
+         {
+          schemaFileString = fileSelectWizard.getURL();
+        }
+
+//        updateExternalModel(selectedIFile, fileSelectWizard.getNamespace(), fileSelectWizard.getExternalSchema());
+        selectedNamespace = fileSelectWizard.getNamespace();
+        selectedXSDSchema = fileSelectWizard.getExternalSchema();
+        
+        return schemaFileString;
+      }
+      return value;
+    }
+  }
+
+  public IFile getSelectedIFile()
+  {
+    return selectedIFile;
+  }
+  
+  public String getSelectedNamespace()
+  {
+    return selectedNamespace;
+  }
+  
+  public XSDSchema getSelectedXSDSchema()
+  {
+    return selectedXSDSchema;
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaPropertySource.java
new file mode 100644
index 0000000..2d8b402
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaPropertySource.java
@@ -0,0 +1,520 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.TargetNamespaceChangeHandler;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class SchemaPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String oldPrefix = "";
+  private String oldNamespace = "";
+  
+  private String[] attributeFormDefaultComboValues =
+  { 
+    "",
+    XSDEditorPlugin.getXSDString("_UI_COMBO_UNQUALIFIED"),
+    XSDEditorPlugin.getXSDString("_UI_COMBO_QUALIFIED")
+  };
+  
+  private String[] elementFormDefaultComboValues =
+  {
+    "",
+    XSDEditorPlugin.getXSDString("_UI_COMBO_UNQUALIFIED"),
+    XSDEditorPlugin.getXSDString("_UI_COMBO_QUALIFIED")
+  };
+
+  private String[] blockDefaultComboValues =
+  {
+    "",
+    "#all",
+    "extension",
+    "restriction",
+    "substitution"
+  };
+
+  private String[] finalDefaultComboValues =
+  {
+    "",
+    "#all",
+    "extension",
+    "restriction"
+  };
+  
+  /**
+   * 
+   */
+  public SchemaPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public SchemaPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public SchemaPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+// These have been moved to the General tab    
+//    PropertyDescriptor prefixDescriptor = 
+//    new TextPropertyDescriptor(
+//        "prefix",
+//        "prefix");
+//    list.add(prefixDescriptor);
+//    prefixDescriptor.setCategory("Namespace");
+//
+//    PropertyDescriptor targetNamespaceDescriptor = 
+//    new TextPropertyDescriptor(
+//        XSDConstants.TARGETNAMESPACE_ATTRIBUTE,
+//        XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
+//    list.add(targetNamespaceDescriptor);
+//    targetNamespaceDescriptor.setCategory("Namespace");
+    
+    PropertyDescriptor versionDescriptor = 
+    new TextPropertyDescriptor(
+        XSDConstants.VERSION_ATTRIBUTE,
+        XSDConstants.VERSION_ATTRIBUTE);
+//    versionDescriptor.setDescription("Version attribute"); // XSDEditorPlugin.getXSDString("_UI_TOOLTIP_VERSION"));
+    list.add(versionDescriptor);
+    PropertyDescriptor xmlLangDescriptor = 
+    new TextPropertyDescriptor(
+        "xml:lang",
+        "xml:lang");
+    list.add(xmlLangDescriptor);
+    
+    XSDComboBoxPropertyDescriptor attributeFormDefaultDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE,
+        XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE,
+        attributeFormDefaultComboValues);
+    list.add(attributeFormDefaultDescriptor);
+    
+    
+    XSDComboBoxPropertyDescriptor elementFormDefaultDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE,
+        XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE,
+        elementFormDefaultComboValues);
+    list.add(elementFormDefaultDescriptor);
+    
+    XSDComboBoxPropertyDescriptor blockDefaultDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.BLOCKDEFAULT_ATTRIBUTE,
+        XSDConstants.BLOCKDEFAULT_ATTRIBUTE,
+        blockDefaultComboValues);
+    list.add(blockDefaultDescriptor);
+    XSDComboBoxPropertyDescriptor finalDefaultDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        XSDConstants.FINALDEFAULT_ATTRIBUTE,
+        XSDConstants.FINALDEFAULT_ATTRIBUTE,
+        finalDefaultComboValues);
+    list.add(finalDefaultDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+    //    return propertyDescriptors;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      String attributeName = (String)id;
+      if (result == null)
+      {
+        result = "";
+      }
+
+      if (attributeName.equals("prefix"))
+      {
+        TypesHelper helper = new TypesHelper(xsdSchema);
+        String aPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
+        // System.out.println("schema targetNS is " + xsdSchema.getTargetNamespace());
+        if (aPrefix != null && aPrefix.length() > 0)
+        {
+          return aPrefix;
+        }
+        return "";        
+      }
+      else
+      {
+        return result;
+      }
+    }
+    return "";
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      String attributeName = (String)id;
+      if (attributeName.equals("prefix"))
+      {
+        updatePrefix(newValue); 
+      }
+      else if (attributeName.equals(XSDConstants.TARGETNAMESPACE_ATTRIBUTE))
+      {
+        updateTargetNamespace(newValue);
+      }
+      else if (attributeName.equals("xml:lang"))
+      {
+        validateLanguage(newValue);
+        // return;  // we will accept the value even though it does not conform
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_LANG_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.VERSION_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_VERSION_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_ATTRIBUTEFORMDEFAULT_CHANGE"), element);
+      }
+      else if (attributeName.equals(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_ELEMENTFORMDEFAULT_CHANGE"), element); 
+      }
+      else if (attributeName.equals(XSDConstants.BLOCKDEFAULT_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_BLOCKDEFAULT_CHANGE"), element); 
+      }
+      else if (attributeName.equals(XSDConstants.FINALDEFAULT_ATTRIBUTE))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_FINALDEFAULT_CHANGE"), element);
+      }
+
+      if (!attributeName.equals("prefix") && !attributeName.equals(XSDConstants.TARGETNAMESPACE_ATTRIBUTE))
+      {        
+        if (newValue.equals(""))
+        {
+          element.removeAttribute(attributeName); 
+        }
+        else
+        {
+          element.setAttribute(attributeName, newValue);
+        }
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+        viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+
+  public void setInput(Element element)
+  {
+    super.setInput(element);
+    
+    oldNamespace = "";
+    oldPrefix = "";
+    
+    if (element!= null)
+    {
+      String targetNamespace = element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
+      oldNamespace = targetNamespace;
+
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      String aPrefix = helper.getPrefix(targetNamespace, false);
+      if (aPrefix != null && aPrefix.length() > 0)
+      {
+        oldPrefix = aPrefix;
+      }
+    }
+  }
+  
+  
+  private void updatePrefix(String newPrefix)
+  {
+    updateNamespaceInfo(newPrefix, oldNamespace);  
+  }
+  
+  private void updateTargetNamespace(String newTargetNamespace)
+  {
+    updateNamespaceInfo(oldPrefix, newTargetNamespace);
+  }
+  
+  private void updateNamespaceInfo(String newPrefix, String newTargetNamespace)
+  {
+//    System.out.println("\nold Prefix is " + oldPrefix);
+//    System.out.println("old NS is " + oldNamespace);
+//    System.out.println("new Prefix is " + newPrefix);
+//    System.out.println("new NS is " + newTargetNamespace);
+    
+    DocumentImpl doc = (DocumentImpl)element.getOwnerDocument();
+
+    String modelTargetNamespace = xsdSchema.getTargetNamespace();
+//    System.out.println("Model TargetNS is " + modelTargetNamespace);
+    if (modelTargetNamespace == null)
+    {
+      modelTargetNamespace = "";
+    }
+        
+    String targetNamespace = newTargetNamespace.trim(); 
+    String prefix = newPrefix.trim();
+
+    if (!validatePrefix(prefix) || !validateTargetNamespace(targetNamespace))
+    {
+      return;
+    }
+        
+    if (prefix.length() > 0 && targetNamespace.length() == 0)
+    {
+       // can't have blank targetnamespace and yet specify a prefix
+       return;
+    }
+
+    doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_LABEL_TARGETNAMESPACE_CHANGE"));
+    String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
+    Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+
+// For debugging
+//        System.out.println("1. SW Map is " + map.values());
+//        System.out.println("1. SW Map keys are " + map.keySet());
+
+    // Check if prefix is blank
+    // if it is, then make sure we have a prefix 
+    // for schema for schema
+    if (prefix.length() == 0)
+    {
+      // if prefix for schema for schema is blank
+      // then set it to value specified in preference
+      // and update ALL nodes with this prefix
+      if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
+      {
+        // get preference prefix
+        xsdForXSDPrefix = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
+        // get a unique prefix by checking what's in the map
+
+        xsdForXSDPrefix = getUniqueSchemaForSchemaPrefix(xsdForXSDPrefix, map);
+        element.setAttribute("xmlns:" + xsdForXSDPrefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
+
+        updateAllNodes(element, xsdForXSDPrefix);
+            
+        // remove the old xmlns attribute for the schema for schema
+        if (element.getAttribute("xmlns") != null &&
+            element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+        {
+          element.removeAttribute("xmlns");
+        }
+      }
+    }
+
+    if (targetNamespace.length() > 0 ||
+       (targetNamespace.length() == 0 && prefix.length() == 0))
+    {
+      // clean up the old prefix for this schema
+      if (oldPrefix != null && oldPrefix.length() > 0)
+      {
+        element.removeAttribute("xmlns:"+oldPrefix);
+//            element.setAttribute("xmlns:" + prefix, targetNamespace);
+//            java.util.Map prefixToNameSpaceMap = xsdSchema.getQNamePrefixToNamespaceMap();
+//            prefixToNameSpaceMap.remove(oldPrefix);
+      }
+      else // if no prefix
+      {
+        if (element.getAttribute("xmlns") != null)
+        {
+          if (!element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+           {
+            element.removeAttribute("xmlns");
+          }
+        }
+      }
+    }
+
+    if (targetNamespace.length() > 0)
+    {
+      if (!modelTargetNamespace.equals(targetNamespace))
+      {
+        element.setAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE, targetNamespace);
+      }
+      // now set the new xmlns:prefix attribute
+      if (prefix.length() > 0)
+      {
+        element.setAttribute("xmlns:" + prefix, targetNamespace);
+      }
+      else
+      {
+        element.setAttribute("xmlns", targetNamespace);
+      }
+      // set the targetNamespace attribute
+    }
+    else // else targetNamespace is blank
+    {
+      if (prefix.length() == 0)
+      {
+        element.removeAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
+      }
+    }
+
+//    System.out.println("1.5 SW Map is " + map.values());
+//    System.out.println("1.5 SW Map keys are " + map.keySet());
+    
+    // do our own referential integrity
+    TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, oldNamespace, targetNamespace);
+    targetNamespaceChangeHandler.resolve();
+
+    oldPrefix = prefix;
+    oldNamespace = targetNamespace;
+    
+    XSDSchemaHelper.updateElement(xsdSchema);
+    
+    doc.getModel().endRecording(this);
+
+// For debugging
+        map = xsdSchema.getQNamePrefixToNamespaceMap();
+//        System.out.println("2. SW Map is " + map.values());
+//        System.out.println("2. SW Map keys are " + map.keySet());
+  }
+
+
+  private String getUniqueSchemaForSchemaPrefix(String xsdForXSDPrefix, Map map)
+  {
+    if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
+     {       
+      xsdForXSDPrefix = "xsd";
+    }
+    // ensure prefix is unique
+    int prefixExtension = 1;
+    while (map.containsKey(xsdForXSDPrefix) && prefixExtension < 100)
+     {
+      xsdForXSDPrefix = xsdForXSDPrefix + String.valueOf(prefixExtension);
+      prefixExtension++;
+    }
+    return xsdForXSDPrefix;
+  }
+
+  private void updateAllNodes(Element element, String prefix)
+  {
+    element.setPrefix(prefix);
+    NodeList list = element.getChildNodes();
+    if (list != null)
+    {
+      for (int i=0; i < list.getLength(); i++)
+      {
+        Node child = list.item(i);
+        if (child != null && child instanceof Element)
+        {
+          child.setPrefix(prefix);
+          if (child.hasChildNodes())
+          {
+            updateAllNodes((Element)child, prefix);
+          }
+        }
+      }
+    }   
+  }
+
+  protected boolean validateTargetNamespace(String ns)
+  {
+    // will allow blank namespace !!
+    if (ns.equals(""))
+     {
+      return true;
+    }
+    
+    String errorMessage = null;
+    try
+    {
+      URI testURI = new URI(ns);
+      testURI.isAbsolute();
+    }
+    catch (URISyntaxException e)
+    {
+      errorMessage = XSDEditorPlugin.getXSDString("_WARN_INVALID_TARGET_NAMESPACE");
+    }
+    
+    if (errorMessage == null || errorMessage.length() == 0)
+     {
+      return true;
+    }
+    return false;
+  }
+  
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertyDescriptor.java
new file mode 100644
index 0000000..1948146
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertyDescriptor.java
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.xsd.ui.internal.properties.section.SimpleContentBaseTypeOptionsDialog;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Element;
+
+public class SimpleContentPropertyDescriptor extends TypesPropertyDescriptor
+{
+  public SimpleContentPropertyDescriptor(Object id, String displayName, Element element, XSDSchema xsdSchema)
+  {
+    super(id, displayName, element, xsdSchema);
+  }
+  
+  public CellEditor createPropertyEditor(Composite parent)
+  {
+    // CellEditor editor = new SimpleContentBaseTypeOptionsTextCellEditor(parent);
+    CellEditor editor = new SimpleContentBaseTypeDialogCellEditor(parent);
+    if (getValidator() != null)
+      editor.setValidator(getValidator());
+    return editor;
+  }
+  
+  public class SimpleContentBaseTypeDialogCellEditor extends TypesDialogCellEditor
+  {
+
+    /**
+     * Creates a new Font dialog cell editor parented under the given control.
+     * The cell editor value is <code>null</code> initially, and has no 
+     * validator.
+     *
+     * @param parent the parent control
+     */
+    protected SimpleContentBaseTypeDialogCellEditor(Composite parent)
+    {
+      super(parent);
+    }
+
+    protected Object openDialogBox(Control cellEditorWindow)
+    {
+	    Shell shell = Display.getCurrent().getActiveShell();
+	    
+	    // SimpleContentBaseTypeOptionsDialog dialog = new SimpleContentBaseTypeOptionsDialog(shell);
+	    SimpleContentBaseTypeOptionsDialog dialog = new SimpleContentBaseTypeOptionsDialog(shell, element, property, xsdSchema);
+
+	    dialog.setBlockOnOpen(true);
+	    dialog.create();
+	    
+	    String value = (String)getValue();
+	
+	    int result = dialog.open();
+	
+	    if (result == Window.OK)
+	    {
+	      value = dialog.getType();
+	      return value;
+	    }
+	    deactivate();
+	    return value;
+	  }
+  }
+
+//  class SimpleContentBaseTypeOptionsDialog extends TypesDialog
+//  {
+//    public SimpleContentBaseTypeOptionsDialog(Shell shell)
+//    {
+//      super(shell);
+//      showAnonymous = false;
+//    }
+//
+////    protected void ok()
+////    {
+////      TableItem[] items = table.getItems();
+////      selection = table.getSelectionIndex();
+////      if (items != null && items.length > 0 && selection >= 0)
+////       {
+////        typeObject = items[selection].getData();
+////      }
+////      System.out.println("typeObject is " + typeObject);
+////
+////      doSetValue(typeObject);
+////      applyEditorValueAndDeactivate();
+////      dialog.close();
+////    }
+//    
+//    public void handleSetInput()
+//    {
+//      XSDDOMHelper domHelper = new XSDDOMHelper();
+//      typeSection.getSimpleType().setSelection(false);
+//      typeSection.getUserSimpleType().setSelection(false);
+//      typeSection.getUserComplexType().setSelection(false);
+//      showAnonymous = false;
+//      if (element != null)
+//      {
+//        String derivedBy = domHelper.getDerivedByName(element);
+//        String baseType = domHelper.getBaseType(element);
+//        boolean derivedByRestriction = true;
+//        
+//        if (XSDDOMHelper.inputEquals(element, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+//        {
+//          typeSection.getSimpleType().setEnabled(false);
+//          typeSection.getUserSimpleType().setEnabled(false);
+//          typeSection.getUserComplexType().setSelection(true);
+//
+//          previousType = 3;
+//        }
+//        else if (XSDDOMHelper.inputEquals(element, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+//        {
+//          typeSection.getSimpleType().setEnabled(false);
+//          typeSection.getUserSimpleType().setEnabled(false);
+//
+//          if (derivedBy.equals("restriction"))
+//          {
+//            typeSection.getSimpleType().setEnabled(false);
+//            typeSection.getUserSimpleType().setEnabled(false);
+//            typeSection.getUserComplexType().setEnabled(true);
+//          }
+//          else if (derivedBy.equals("extension"))
+//          {
+//            derivedByRestriction = false;
+//            typeSection.getSimpleType().setEnabled(true);
+//            typeSection.getUserSimpleType().setEnabled(true);
+//            typeSection.getUserComplexType().setEnabled(true);
+//          }
+//        }
+//          
+//        if (derivedBy != null)
+//        {
+//            if (baseType != null && !baseType.equals(""))
+//            {
+//              Element parent = (Element)element.getParentNode();
+//              XSDConcreteComponent component = null;
+//              if (parent != null)
+//              {
+//                component = xsdSchema.getCorrespondingComponent(parent);
+//              }
+//              XSDTypeDefinition baseTypeDefinition = null;
+//              if (component instanceof XSDComplexTypeDefinition)
+//              {
+//                XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition)component;
+//                baseTypeDefinition = complexType.getBaseTypeDefinition();
+//              }               
+//
+//              if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(baseType) && !derivedByRestriction)
+//              {
+//                typeSection.getSimpleType().setSelection(true);
+//                populateBuiltInType();
+//                int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(baseType);
+//                table.setSelection(i);
+//                previousType = 1;
+//              }
+//              else if (baseTypeDefinition instanceof XSDSimpleTypeDefinition && !derivedByRestriction)
+//              {
+//                typeSection.getUserSimpleType().setSelection(true);
+//                populateUserSimpleType();
+//                int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(baseType);
+//                if (showAnonymous)
+//                 {
+//                  table.setSelection(i + 1);
+//                }
+//                else
+//                 {
+//                  table.setSelection(i);
+//                }
+//                previousType = 2;
+//              }
+//              else if (baseTypeDefinition instanceof XSDComplexTypeDefinition)
+//              {
+//                typeSection.getUserComplexType().setSelection(true);
+//                populateUserComplexType();
+//                int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(baseType);
+//                if (showAnonymous)
+//                 {
+//                  table.setSelection(i + 1);
+//                }
+//                else
+//                 {
+//                  table.setSelection(i);
+//                }
+//                previousType = 3;
+//              }
+//            }
+//            else
+//            {
+//              typeSection.getUserComplexType().setSelection(true);
+//              populateUserComplexType();
+//              table.setSelection(0);
+//            }
+//          }
+//
+//      }
+//    }
+//  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertySource.java
new file mode 100644
index 0000000..6b33262
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertySource.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class SimpleContentPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String DERIVED_BY_ID = "derived by";  // XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY"); //$NON-NLS-1$ 
+  private String BASE_TYPE_ID = "base";  // XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE"); //$NON-NLS-1$
+  
+  private String derivedByChoicesComboValues[] =
+  {
+     "",  //$NON-NLS-1$
+     XSDConstants.RESTRICTION_ELEMENT_TAG,
+     XSDConstants.EXTENSION_ELEMENT_TAG
+  };
+  
+  /**
+   * 
+   */
+  public SimpleContentPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public SimpleContentPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public SimpleContentPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    
+    SimpleContentPropertyDescriptor typeDescriptor = new SimpleContentPropertyDescriptor(
+        BASE_TYPE_ID,
+        BASE_TYPE_ID,
+        element, xsdSchema);
+    list.add(typeDescriptor);
+    XSDComboBoxPropertyDescriptor derivedByDescriptor =
+    new XSDComboBoxPropertyDescriptor(
+        DERIVED_BY_ID,
+        DERIVED_BY_ID,
+        derivedByChoicesComboValues);
+    list.add(derivedByDescriptor);
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    if (id instanceof String)
+     {
+      if (((String) id).equals(DERIVED_BY_ID))
+      {
+        String derivedBy = getDomHelper().getDerivedByName(element);
+        if (derivedBy == null)
+         {
+          derivedBy = ""; //$NON-NLS-1$
+        }
+        return derivedBy;
+      }
+      else if (((String) id).equals(BASE_TYPE_ID))
+      {
+        String baseType = getDomHelper().getBaseType(element);
+        if (baseType == null)
+        {
+          baseType = ""; //$NON-NLS-1$
+        }
+        return baseType;
+      }
+    }
+    return ""; //$NON-NLS-1$
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value != null)
+    {
+      if (value instanceof String)
+      {
+        String origBaseType = getDomHelper().getBaseType(element);
+        String derivedBy = getDomHelper().getDerivedByName(element);
+        
+        if (((String) id).equals(BASE_TYPE_ID))
+        {            
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element); //$NON-NLS-1$        
+          getDomHelper().setDerivedByBaseType(element, derivedBy, (String)value);
+          endRecording(element);
+        }
+        else if (((String) id).equals(DERIVED_BY_ID))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_DERIVEDBY_CHANGE"), element); //$NON-NLS-1$
+          String newDerivedBy = (String)value;
+          if (newDerivedBy.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
+          {
+            String prefix = element.getPrefix();
+            String anyType = prefix == null? "anyType" : prefix + ":anyType";  //$NON-NLS-1$ $NON-NLS-2$
+            getDomHelper().changeDerivedByType(element, (String)value, anyType);
+          }
+          else
+          {
+            Element derivedByElem = getDomHelper().getDerivedByElement(element);
+            if (checkForAnonymousType(derivedByElem))
+            {            
+// KCPort
+//            ArrayList message = new ArrayList();
+//            ErrorMessage aTask = new ErrorMessage();
+//            Node aNode = getDomHelper().getChildNode(derivedByElem, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+////////////// shall we remove the node and its children??
+////            getDomHelper().removeNodeAndWhitespace(aNode);
+//////////////
+////            if (aNode instanceof Element)
+////            {
+////              Element st = (Element)aNode;
+////             if (st instanceof NodeImpl)
+////              {
+////                aTask.setNode((NodeImpl)st);
+////              }
+////            }
+//            if (derivedByElem instanceof NodeImpl)
+//            {
+//              aTask.setModelObject(derivedByElem);
+//            }
+//            aTask.setLocalizedMessage(XSDEditorPlugin.getXSDString("_ERROR_REMOVE_LOCAL_SIMPLETYPE"));
+//            message.add(aTask);
+//            if (getEditor() != null)
+//            {
+//              getEditor().createTasksInTaskList(message);
+//            }
+            }   
+            getDomHelper().changeDerivedByType(element, (String)value, origBaseType);
+          }
+
+          
+          endRecording(element);
+//        setInput(element);
+        }
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+  }
+
+  boolean checkForAnonymousType(Element element)
+  {
+    boolean isAnonymous = false;
+
+    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+    if (aNode != null)
+     {
+      return true;
+    }
+    return isAnonymous;
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleRestrictPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleRestrictPropertySource.java
new file mode 100644
index 0000000..4d07c0b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleRestrictPropertySource.java
@@ -0,0 +1,328 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDFacet;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.impl.XSDFactoryImpl;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SimpleRestrictPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private String [] whiteSpaceComboChoices = { "", "preserve", "replace", "collapse" };
+  /**
+   * 
+   */
+  public SimpleRestrictPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public SimpleRestrictPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public SimpleRestrictPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    
+    SimpleContentPropertyDescriptor typeDescriptor = new SimpleContentPropertyDescriptor(
+        XSDConstants.BASE_ATTRIBUTE,
+        XSDConstants.BASE_ATTRIBUTE,
+        (Element)element.getParentNode(), xsdSchema);  // get the parent node!
+    list.add(typeDescriptor);
+    
+    Iterator facets = xsdSimpleType.getValidFacets().iterator();
+    
+    while(facets.hasNext())
+    {
+      String aValidFacet = (String)facets.next();
+      if (!(aValidFacet.equals(XSDConstants.PATTERN_ELEMENT_TAG) || aValidFacet.equals(XSDConstants.ENUMERATION_ELEMENT_TAG)))
+      {
+        if (aValidFacet.equals(XSDConstants.WHITESPACE_ELEMENT_TAG))
+        {
+          XSDComboBoxPropertyDescriptor whitespaceDescriptor = new XSDComboBoxPropertyDescriptor(
+              aValidFacet, aValidFacet, whiteSpaceComboChoices);
+          list.add(whitespaceDescriptor);
+        }
+        else
+        {  
+          list.add(new TextPropertyDescriptor(aValidFacet, aValidFacet));
+        }
+      }
+    }
+    
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      if (((String) id).equals(XSDConstants.BASE_ATTRIBUTE))
+      {
+        String baseType = element.getAttribute(XSDConstants.BASE_ATTRIBUTE);
+        if (baseType == null)
+        {
+          baseType = "";
+        }
+        return baseType;
+      }
+      else
+      {
+        String aFacet = (String)id;
+        Iterator facets = xsdSimpleType.getFacets().iterator();
+        
+        while(facets.hasNext())
+        {
+          XSDFacet aValidFacet = (XSDFacet)facets.next();
+          if (aValidFacet.getFacetName().equals(aFacet))
+          {
+            result = aValidFacet.getLexicalValue();
+            if (result == null)
+            {
+              result = "";
+            }
+            return result;
+          }
+        }
+      }
+    }
+    return "";
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value != null)
+     {
+      if (value instanceof String)
+      {
+        String newValue = (String)value;
+        
+        if (((String) id).equals(XSDConstants.BASE_ATTRIBUTE))
+        {            
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);        
+
+          Element parent = (Element)element.getParentNode();
+          if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+          {
+//            updateElementToNotAnonymous(element);
+          }
+          getDomHelper().setSimpleContentType(element, newValue);
+          endRecording(element);
+        }
+        else
+        {
+          Element simpleTypeElement = xsdSimpleType.getElement();
+          XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
+          Element derivedByElement = xsdDOMHelper.getDerivedByElement(simpleTypeElement);
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_FACET_CHANGE"), simpleTypeElement);
+          String prefix = simpleTypeElement.getPrefix();
+          prefix = (prefix == null) ? "" : (prefix + ":");
+
+          String aFacet = (String)id;
+          XSDFactoryImpl factory = new XSDFactoryImpl();
+
+          Element childNodeElement = null;
+          DOMAttribute valueAttr = null;
+          XSDFacet facet = null;
+          if (aFacet.equals(XSDConstants.TOTALDIGITS_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getTotalDigitsFacet();
+          }
+          else if (aFacet.equals(XSDConstants.FRACTIONDIGITS_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getFractionDigitsFacet();
+          }
+          else if (aFacet.equals(XSDConstants.WHITESPACE_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getWhiteSpaceFacet();
+          }
+          else if (aFacet.equals(XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getMaxExclusiveFacet();
+          }
+          else if (aFacet.equals(XSDConstants.MAXINCLUSIVE_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getMaxInclusiveFacet();
+          }
+          else if (aFacet.equals(XSDConstants.MINEXCLUSIVE_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getMinExclusiveFacet();
+          }
+          else if (aFacet.equals(XSDConstants.MININCLUSIVE_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getMinInclusiveFacet();
+          }
+          else if (aFacet.equals(XSDConstants.LENGTH_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getLengthFacet();
+          }
+          else if (aFacet.equals(XSDConstants.MAXLENGTH_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getMaxLengthFacet();
+          }
+          else if (aFacet.equals(XSDConstants.MINLENGTH_ELEMENT_TAG))
+          {
+            facet = xsdSimpleType.getMinLengthFacet();
+          }
+          
+          if (facet != null)
+          {
+            facet.setLexicalValue(newValue);
+          }
+          else
+          {
+            facet = (XSDFacet)factory.createXSDTotalDigitsFacet();
+            childNodeElement = (derivedByElement.getOwnerDocument()).createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + aFacet);
+            valueAttr = new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, "");
+            childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());
+            valueAttr.setValue(newValue);
+            childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());  
+            element.appendChild(childNodeElement);
+          //formatChild(childNodeElement, hasChildrenElements);    
+          }
+          XSDSchemaHelper.updateElement(xsdSimpleType);
+          if (facet != null)
+          {
+            XSDSchemaHelper.updateElement(facet);
+          }
+        }
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+
+  }
+
+  protected boolean isAnonymous;
+  protected XSDSimpleTypeDefinition xsdSimpleType;
+
+  public void setInput(Element element)
+  {
+    this.element = element;
+    if (xsdSchema == null)
+    {
+      return;
+    }
+
+    isAnonymous = checkForAnonymousType(element);
+    
+    if (XSDDOMHelper.inputEquals(element, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
+    {
+      Element parent = (Element)element.getParentNode();
+      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+      {
+        XSDConcreteComponent component = null;
+        if (parent != null)
+        {
+          component = xsdSchema.getCorrespondingComponent(parent);
+        }
+        if (component instanceof XSDSimpleTypeDefinition)
+        {
+          xsdSimpleType = (XSDSimpleTypeDefinition)component;
+        }
+      }
+
+      XSDConcreteComponent xsdConcreteComponent = null;
+      if (element.getParentNode() != null)
+      {
+        xsdConcreteComponent = xsdSchema.getCorrespondingComponent(element.getParentNode());
+      }
+
+      if (xsdConcreteComponent instanceof XSDSimpleTypeDefinition)
+      {
+        xsdSimpleType = (XSDSimpleTypeDefinition)xsdConcreteComponent;
+      }
+    }
+  }
+
+  boolean checkForAnonymousType(Element element)
+  {
+    boolean isAnonymous = false;
+
+    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+    if (aNode != null)
+    {
+      return true;
+    }
+    return isAnonymous;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeListPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeListPropertySource.java
new file mode 100644
index 0000000..b49ceb1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeListPropertySource.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class SimpleTypeListPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  /**
+   * 
+   */
+  public SimpleTypeListPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public SimpleTypeListPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public SimpleTypeListPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    TypesPropertyDescriptor typeDescriptor = new TypesPropertyDescriptor(
+          XSDConstants.ITEMTYPE_ATTRIBUTE,
+          XSDConstants.ITEMTYPE_ATTRIBUTE,
+          element, xsdSchema);
+        
+    typeDescriptor.setLabelProvider(new LabelProvider()
+    {
+      public String getText(Object element)
+      {
+        return (String) element;
+      }
+    });
+    list.add(typeDescriptor);
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      if (((String) id).equals(XSDConstants.ITEMTYPE_ATTRIBUTE))
+      {
+        result = element.getAttribute((String) id);
+        if (result == null)
+        {
+          result = "**anonymous**"; //$NON-NLS-1$
+        }
+        return result;
+      }
+    }
+    return ""; //$NON-NLS-1$
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value != null)
+     {
+      if (value instanceof String)
+      {
+        if (((String) id).equals(XSDConstants.ITEMTYPE_ATTRIBUTE))
+        { 
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE_CHANGE"), element); //$NON-NLS-1$
+          element.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, (String)value);
+          endRecording(element);
+        }
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypePropertySource.java
new file mode 100644
index 0000000..99885fa
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypePropertySource.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalSimpleOrComplexTypeRenamer;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Node;
+
+public class SimpleTypePropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  private boolean isAnonymous = false;
+  /**
+   * 
+   */
+  public SimpleTypePropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public SimpleTypePropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public SimpleTypePropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    Node parent = element.getParentNode();
+    if (XSDDOMHelper.inputEquals(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(parent, XSDConstants.ELEMENT_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(parent, XSDConstants.UNION_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(parent, XSDConstants.LIST_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+    {
+      isAnonymous = true;
+    }
+
+    List list = new ArrayList();
+    if (!isAnonymous)
+    {
+      // Create a descriptor and set a category
+      PropertyDescriptor nameDescriptor =
+      new TextPropertyDescriptor(
+          XSDConstants.NAME_ATTRIBUTE,
+          XSDConstants.NAME_ATTRIBUTE);
+      list.add(nameDescriptor);
+    }
+    else
+    {
+      PropertyDescriptor readOnly = new PropertyDescriptor(XSDConstants.NAME_ATTRIBUTE, XSDConstants.NAME_ATTRIBUTE);
+      list.add(readOnly);
+    }
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+    {
+      result = element.getAttribute((String) id);
+      if (isAnonymous)
+      {
+        result = "**anonymous**";
+      }
+    }
+    if (result == null)
+     {
+      result = "";
+    }
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = "";
+    }
+    if (value instanceof String)
+    {
+      String name = (String)value;
+      if (validateName(name))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_SIMPLETYPE_NAME_CHANGE"), element);
+        if (name != null && name.length() > 0)
+        {
+          // now rename any references to this type
+          if (xsdSchema != null)
+          {
+            XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+            if (comp != null && comp instanceof XSDSimpleTypeDefinition && comp.getContainer().equals(xsdSchema))
+            {
+//                ((XSDNamedComponent)comp).setName(name);
+              GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, name);
+              renamer.visitSchema(xsdSchema);
+            }
+          }
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, name);
+        }
+        else
+        {
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
+        }
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeUnionPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeUnionPropertySource.java
new file mode 100644
index 0000000..68584b4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeUnionPropertySource.java
@@ -0,0 +1,493 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.DialogCellEditor;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+public class SimpleTypeUnionPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  /**
+   * 
+   */
+  public SimpleTypeUnionPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public SimpleTypeUnionPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+  }
+  /**
+   * @param xsdSchema
+   */
+  public SimpleTypeUnionPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    SimpleUnionMemberTypesPropertyDescriptor typeDescriptor = new SimpleUnionMemberTypesPropertyDescriptor(
+        XSDConstants.MEMBERTYPES_ATTRIBUTE,
+        XSDConstants.MEMBERTYPES_ATTRIBUTE);
+    
+    typeDescriptor.setLabelProvider(new LabelProvider()
+        {
+      public String getText(Object element)
+      {
+        return (String) element;
+      }
+    });
+    list.add(typeDescriptor);
+    
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+     {
+      if (((String) id).equals(XSDConstants.MEMBERTYPES_ATTRIBUTE))
+       {
+        result = element.getAttribute((String) id);
+        if (result == null)
+        { 
+          result = ""; //$NON-NLS-1$
+        }
+        return result;
+      }
+    }
+    return ""; //$NON-NLS-1$
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value == null)
+    {
+      value = ""; //$NON-NLS-1$
+    }
+    
+    if (value instanceof String)
+    {
+      String newValue = (String)value;
+      if (((String) id).equals(XSDConstants.MEMBERTYPES_ATTRIBUTE))
+      { 
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_CHANGE"), element); //$NON-NLS-1$
+        if (newValue.length() > 0)
+        {
+          element.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, (String)value);
+        }
+        else
+        {
+          element.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);  
+        }
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+
+  
+  public class SimpleUnionMemberTypesPropertyDescriptor extends PropertyDescriptor
+  {
+    /**
+     * @param id
+     * @param displayName
+     */
+    public SimpleUnionMemberTypesPropertyDescriptor(Object id, String displayName)
+    {
+      super(id, displayName);
+    }
+    
+    public CellEditor createPropertyEditor(Composite parent)
+    {
+      CellEditor editor = new SimpleTypeUnionMemberTypesDialogCellEditor(parent);
+      if (getValidator() != null)
+        editor.setValidator(getValidator());
+      return editor;
+    }
+  }
+  
+  public class SimpleTypeUnionMemberTypesDialogCellEditor extends DialogCellEditor {
+
+    /**
+     * Creates a new Font dialog cell editor parented under the given control.
+     * The cell editor value is <code>null</code> initially, and has no 
+     * validator.
+     *
+     * @param parent the parent control
+     */
+    protected SimpleTypeUnionMemberTypesDialogCellEditor(Composite parent) {
+      super(parent);
+    }
+
+    /**
+     * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(Control)
+     */
+    protected Object openDialogBox(Control cellEditorWindow)
+    {
+      Shell shell = Display.getCurrent().getActiveShell();
+      
+      SimpleContentUniontMemberTypesDialog dialog = new SimpleContentUniontMemberTypesDialog(shell);
+      dialog.setBlockOnOpen(true);
+      dialog.create();
+      
+      String value = (String)getValue();
+
+      int result = dialog.open();
+
+      if (result == Window.OK)
+       {
+        return dialog.getResult();
+      }
+      return value;
+    }
+
+  }
+
+  public class SimpleContentUniontMemberTypesDialog extends org.eclipse.jface.dialogs.Dialog implements SelectionListener
+  {
+    Table table;
+    TypeSection typeSection;
+    Button addButton, removeButton;
+    org.eclipse.swt.widgets.List memberTypesList;
+    
+    private String result;
+    
+    public SimpleContentUniontMemberTypesDialog(Shell shell)
+    {
+      super(shell);
+    }
+
+    protected void configureShell(Shell shell)
+    {
+      super.configureShell(shell);
+    }
+
+    protected void buttonPressed(int buttonId)
+    {
+      if (buttonId == Dialog.OK)
+      {
+        StringBuffer sb = new StringBuffer();
+        int length = memberTypesList.getItemCount();
+        for (int i=0 ; i < length; i++)
+        {
+          sb.append(memberTypesList.getItem(i));
+          if (i < length - 1)
+          {
+            sb.append(" "); //$NON-NLS-1$
+          }
+        }
+        result = sb.toString();
+      }
+      super.buttonPressed(buttonId);
+    }
+
+    public String getResult() { return result; }
+
+    //
+    // Create the controls
+    //
+    public Control createDialogArea(Composite parent)
+    {
+      Composite client = (Composite)super.createDialogArea(parent);
+      getShell().setText("Union " + XSDConstants.MEMBERTYPES_ATTRIBUTE); //$NON-NLS-1$ 
+      
+      Label instructions = new Label(client, SWT.LEFT | SWT.WRAP);
+      instructions.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SELECT_MEMBERTYPES")); //$NON-NLS-1$
+      
+      Composite columnsComposite = new Composite(client, SWT.NONE);
+      GridLayout ccGL = new GridLayout();
+      ccGL.verticalSpacing = 0;
+      ccGL.horizontalSpacing = 0;
+      ccGL.marginHeight = 0;
+      ccGL.marginWidth = 0;
+      ccGL.makeColumnsEqualWidth = true;
+      ccGL.numColumns = 3;
+      columnsComposite.setLayout(ccGL);
+      
+      GridData ccGD = new GridData();
+      ccGD.grabExcessHorizontalSpace = true;
+      ccGD.horizontalAlignment = GridData.FILL;
+      columnsComposite.setLayoutData(ccGD);     
+                             
+      typeSection = new TypeSection(columnsComposite);
+      typeSection.setShowUserComplexType(false);
+
+      typeSection.createClient(columnsComposite);
+      typeSection.getSimpleType().setSelection(false);
+      typeSection.getSimpleType().addSelectionListener(this);
+      typeSection.getUserSimpleType().addSelectionListener(this);
+      
+      ViewUtility.createHorizontalFiller(columnsComposite, 1);
+      
+      Label memberListLabel = new Label(columnsComposite, SWT.LEFT);
+      memberListLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_VALUE")); //$NON-NLS-1$  
+      
+      Composite dataComposite = new Composite(client, SWT.NONE);
+      GridLayout dcGL = new GridLayout();
+      dcGL.verticalSpacing = 0;
+      dcGL.marginHeight = 0;
+      dcGL.marginWidth = 0;
+      dcGL.numColumns = 3;
+      dataComposite.setLayout(dcGL);
+      
+      GridData dcGD = new GridData();
+      dcGD.grabExcessHorizontalSpace = true;
+      dcGD.grabExcessVerticalSpace = true;
+      dataComposite.setLayoutData(dcGD);
+      
+      table = new Table(dataComposite,
+          SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); 
+      table.setHeaderVisible(false);
+      table.setLinesVisible(true);
+      GridData gd2 = new GridData();
+      gd2.grabExcessHorizontalSpace = true;
+      gd2.grabExcessVerticalSpace = true;
+      gd2.horizontalAlignment = GridData.FILL;
+      gd2.verticalAlignment = GridData.FILL;
+      gd2.heightHint = 200;
+      gd2.widthHint = 200;
+      table.setLayoutData(gd2);
+
+      // Fill table
+      handleSetInput();
+      table.getItemCount();
+
+      TableColumn tc = new TableColumn(table, SWT.LEFT);
+//      tc.setImage(XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"));
+      //tc.setText("Available types:");
+      tc.setWidth(200);
+      tc.setResizable(true);
+      
+      Composite buttonComposite = new Composite(dataComposite, SWT.NONE);
+      GridLayout bcGL = new GridLayout();
+      bcGL.numColumns = 1;
+      buttonComposite.setLayout(bcGL);
+      addButton = new Button(buttonComposite, SWT.PUSH);
+      addButton.setText(">"); //$NON-NLS-1$
+      addButton.addSelectionListener(this);
+      removeButton = new Button(buttonComposite, SWT.PUSH);
+      removeButton.setText("<"); //$NON-NLS-1$
+      removeButton.addSelectionListener(this);
+      
+      Composite listComposite = new Composite(dataComposite, SWT.NONE);
+      GridLayout mtGL = new GridLayout();
+      mtGL.numColumns = 1;
+      mtGL.marginHeight = 0;
+      mtGL.marginWidth = 0;
+      mtGL.horizontalSpacing = 0;
+      mtGL.verticalSpacing = 0;
+      listComposite.setLayout(mtGL);
+
+      GridData mtGD = new GridData();
+      mtGD.grabExcessHorizontalSpace = true;
+      mtGD.grabExcessVerticalSpace = true;
+      mtGD.verticalAlignment = GridData.FILL;
+      mtGD.horizontalAlignment = GridData.FILL;
+      listComposite.setLayoutData(mtGD);
+      
+      memberTypesList = new org.eclipse.swt.widgets.List(listComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+      GridData mtlGD = new GridData();
+      mtlGD.grabExcessHorizontalSpace = true;
+      mtlGD.grabExcessVerticalSpace = true;
+      mtlGD.verticalAlignment = GridData.FILL;
+      mtlGD.horizontalAlignment = GridData.FILL;
+      mtlGD.heightHint = 200;
+      mtlGD.widthHint = 200;
+      memberTypesList.setLayoutData(mtlGD);
+      
+      initializeMemberListContent();
+      return client;
+    }
+
+    private void initializeMemberListContent()
+    {
+      String result = element.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
+      if (result == null)
+      {
+        return;
+      }
+      StringTokenizer token = new StringTokenizer(result);
+      while (token.hasMoreTokens())
+      {
+        memberTypesList.add(token.nextToken());
+      }
+    }
+  
+    public void widgetSelected(SelectionEvent e)
+    {
+      if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
+       {
+        populateBuiltInType();
+      }
+      else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
+       {
+        populateUserSimpleType(false);
+      }
+      else if (e.widget == addButton)
+      {
+        TableItem[] items = table.getItems();
+        int selection = table.getSelectionIndex();
+        if (items != null && items.length > 0 && selection >= 0)
+        {
+          String typeToAdd = items[selection].getData().toString();
+          if (memberTypesList.indexOf(typeToAdd) < 0)
+          {
+            memberTypesList.add(items[selection].getData().toString());
+          }
+        }
+      }
+      else if (e.widget == removeButton)
+      {
+        String[] typesToRemove = memberTypesList.getSelection();
+        for (int i=0; i < typesToRemove.length; i++)
+        {
+          memberTypesList.remove(typesToRemove[i]);
+        }
+      }
+    }
+    
+    public void widgetDefaultSelected(SelectionEvent e)
+    {
+    }
+    
+    public void handleSetInput()
+    {
+      populateBuiltInType();
+    }
+    
+    public void populateBuiltInType()
+    {
+      table.removeAll();
+      List items = getBuiltInTypeNamesList();
+      for (int i = 0; i < items.size(); i++)
+       {
+        TableItem item = new TableItem(table, SWT.NONE);
+        item.setText(items.get(i).toString());
+        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif")); //$NON-NLS-1$
+        item.setData(items.get(i));
+      }
+    }
+
+    public void populateUserSimpleType(boolean showAnonymous)
+    {
+      table.removeAll();
+      if (showAnonymous)
+       {
+        TableItem anonymousItem = new TableItem(table, SWT.NONE);
+        anonymousItem.setText("**anonymous**"); //$NON-NLS-1$
+        anonymousItem.setData("**anonymous**"); //$NON-NLS-1$
+      }
+      List items = getUserSimpleTypeNamesList();
+      for (int i = 0; i < items.size(); i++)
+       {
+        TableItem item = new TableItem(table, SWT.NONE);
+        item.setText(items.get(i).toString());
+        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif")); //$NON-NLS-1$
+        item.setData(items.get(i));
+      }
+    }
+    
+    public java.util.List getBuiltInTypeNamesList()
+    {
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      return helper.getBuiltInTypeNamesList();
+    }
+
+    public java.util.List getUserSimpleTypeNamesList()
+    {
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      return helper.getUserSimpleTypeNamesList();
+    }
+  }
+  
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/TypesPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/TypesPropertyDescriptor.java
new file mode 100644
index 0000000..60e238a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/TypesPropertyDescriptor.java
@@ -0,0 +1,1145 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.DialogCellEditor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class TypesPropertyDescriptor extends PropertyDescriptor
+{
+  Element element;
+  XSDSchema xsdSchema;
+  String property;
+  /**
+   * @param id
+   * @param displayName
+   */
+  public TypesPropertyDescriptor(Object id, String displayName, Element element, XSDSchema xsdSchema)
+  {
+    super(id, displayName);
+    this.property = (String)id;
+    this.element = element;
+    this.xsdSchema = xsdSchema;
+  }
+  
+  boolean showComplexTypes = true;
+
+  public CellEditor createPropertyEditor(Composite parent)
+  {
+    if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+    {
+      showComplexTypes = true;
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) ||
+      XSDDOMHelper.inputEquals(element, XSDConstants.LIST_ELEMENT_TAG, false) ||
+      XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
+    {
+      showComplexTypes = false;
+    }
+    // CellEditor editor = new TypesOptionsTextCellEditor(parent);
+    CellEditor editor = new TypesDialogCellEditor(parent);
+    if (getValidator() != null)
+      editor.setValidator(getValidator());
+    return editor;
+  }
+
+  
+  public class TypesDialogCellEditor extends DialogCellEditor
+  {
+
+    /**
+     * Creates a new Font dialog cell editor parented under the given control.
+     * The cell editor value is <code>null</code> initially, and has no 
+     * validator.
+     *
+     * @param parent the parent control
+     */
+    protected TypesDialogCellEditor(Composite parent)
+    {
+      super(parent);
+    }
+
+    protected Object openDialogBox(Control cellEditorWindow)
+    {
+	    Shell shell = Display.getCurrent().getActiveShell();
+	    
+	    TypesDialog dialog = new TypesDialog(shell);
+
+	    dialog.setBlockOnOpen(true);
+	    dialog.create();
+	    
+	    String value = (String)getValue();
+	
+	    int result = dialog.open();
+	    
+	    if (result == Window.OK)
+	    {
+	      value = dialog.getType();
+        doSetValue(value);
+        fireApplyEditorValue();
+	    }
+	    deactivate();
+	    return null;
+	  }
+  }
+
+  public class TypesDialog extends org.eclipse.jface.dialogs.Dialog implements SelectionListener
+  {
+    String type;
+    Object typeObject;
+    Table table;
+
+    TypeSection typeSection;
+    boolean showAnonymous = true;
+    String previousStringType = "";
+    boolean isAnonymous;
+    int previousType;
+
+    
+    public TypesDialog(Shell shell)
+    {
+      super(shell);
+    }
+
+    protected void configureShell(Shell shell)
+    {
+      super.configureShell(shell);
+    }
+
+    protected void buttonPressed(int buttonId)
+    {
+      if (buttonId == Dialog.OK)
+      {
+        type = table.getItem(table.getSelectionIndex()).getText();
+        ok();
+      }
+      super.buttonPressed(buttonId);
+    }
+
+    public Object getTypeObject() { return typeObject; }
+    public String getType() { return type; }
+
+    //
+    // Create the controls
+    //
+    public Control createDialogArea(Composite parent)
+    {
+      Composite client = (Composite)super.createDialogArea(parent);
+      getShell().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_AVAILABLE_TYPES"));
+
+      typeObject = null;
+      
+      GridLayout gl = new GridLayout(1, true);
+      client.setLayout(gl);
+
+      GridData gd = new GridData();
+      gd.grabExcessHorizontalSpace = true;
+      gd.grabExcessVerticalSpace = true;
+      gd.horizontalAlignment = GridData.FILL;
+      gd.verticalAlignment = GridData.FILL;
+      gd.horizontalIndent = 0;
+      client.setLayoutData(gd);
+      
+      typeSection = new TypeSection(client);
+      typeSection.setShowUserComplexType(showComplexTypes);
+
+      typeSection.createClient(client);
+      typeSection.getSimpleType().setSelection(false);
+      typeSection.getSimpleType().addSelectionListener(this);
+      typeSection.getUserSimpleType().addSelectionListener(this);
+      if (showComplexTypes)
+      {
+        typeSection.getUserComplexType().addSelectionListener(this);
+      }
+
+      table = new Table(client,
+                        SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); 
+      table.setHeaderVisible(false);
+      table.setLinesVisible(true);
+      
+      GridData gd2 = new GridData();
+      gd2.grabExcessHorizontalSpace = true;
+      gd2.grabExcessVerticalSpace = true;
+      gd2.horizontalAlignment = GridData.FILL;
+      gd2.heightHint = 200;
+      table.setLayoutData(gd2);
+
+      TableColumn tableColumn = new TableColumn(table, SWT.LEFT);
+//      tableColumn.setImage(XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"));
+      tableColumn.setResizable(true);
+      tableColumn.setWidth(200);
+      
+
+      // Fill table and select input type
+      handleSetInput();
+
+      return client;
+    }
+    
+    public void widgetSelected(SelectionEvent e)
+    {
+      if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
+      {
+        populateBuiltInType();
+      }
+      else if (e.widget == typeSection.getUserComplexType() && typeSection.getUserComplexType().getSelection())
+      {
+        populateUserComplexType();
+      }
+      else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
+      {
+        populateUserSimpleType();
+      }
+
+    }
+    
+  	public void widgetDefaultSelected(SelectionEvent e)
+    {
+    }
+
+    protected void ok()
+    {
+      TableItem[] items = table.getItems();
+      int selection = table.getSelectionIndex();
+      if (items != null && items.length > 0 && selection >= 0)
+      {
+        typeObject = items[selection].getData();
+      }
+//      System.out.println("typeObject is " + typeObject);
+
+//      beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_TYPE_CHANGE"), element);
+//      beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);
+//      doSetValue(typeObject);
+//      applyEditorValueAndDeactivate();
+//      dialog.close();
+
+      if (!XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
+      {
+      if (typeObject.equals("**anonymous**"))
+      {
+        if (typeSection.getUserSimpleType().getSelection())
+        {
+          if (!previousStringType.equals("**anonymous**"))
+          {
+            updateElementToAnonymous(
+              element,
+              XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+          }
+        }
+        else
+        {
+          if (!previousStringType.equals("**anonymous**"))
+          {
+            updateElementToAnonymous(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+          }
+        }
+        // element.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
+        element.removeAttribute(property);
+      }
+      else
+      {
+        updateElementToNotAnonymous(element);
+        //element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, typeObject.toString());
+        element.setAttribute(property, typeObject.toString());
+      }
+      }
+//      endRecording(element);
+
+      //implement dispose();
+//      table.removeAll();
+//      table.dispose();
+    }
+
+  	
+    public void handleSetInput()
+    {
+      table.removeAll();
+      isAnonymous = checkForAnonymousType(element);
+      // Attr attr = element.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
+      Attr attr = element.getAttributeNode(property);
+      if (attr != null)
+      {
+        String value = attr.getValue();
+        if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(value))
+        {
+          typeSection.getSimpleType().setSelection(true);
+          populateBuiltInType();
+          int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(value);
+          table.setSelection(i);
+          previousType = 1;
+        }
+        else if (typeSection.getUserSimpleTypeNamesList(xsdSchema).contains(value))
+        {
+          typeSection.getUserSimpleType().setSelection(true);
+          populateUserSimpleType();
+          int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(value);
+          if (showAnonymous)
+          {
+            table.setSelection(i + 1);
+          }
+          else
+          {
+            table.setSelection(i);
+          }
+          previousType = 2;
+        }
+        else if (typeSection.getUserComplexTypeNamesList(xsdSchema).contains(value))
+        {
+          typeSection.getUserComplexType().setSelection(true);
+          populateUserComplexType();
+          int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(value);
+          if (showAnonymous)
+           {
+            table.setSelection(i + 1);
+          }
+          else
+           {
+            table.setSelection(i);
+          }
+          previousType = 3;
+        }
+        else // if it is type="" for an empty list of simple types
+          {
+          typeSection.getUserSimpleType().setSelection(true);
+          populateUserSimpleType();
+          previousType = 2;
+        }
+      }
+      else
+      {
+        if (isAnonymous)
+        {
+          if (isSTAnonymous(element))
+          {
+            typeSection.getUserSimpleType().setSelection(true);
+            populateUserSimpleType();
+            previousType = 2;
+          }
+          else
+          {
+            typeSection.getUserComplexType().setSelection(true);
+            populateUserComplexType();
+            previousType = 3;
+          }
+          table.setSelection(0); // anonymous
+          //        typeSection.getTypeList().setText("**anonymous**");
+        }
+        else
+        {
+          typeSection.getSimpleType().setSelection(true);
+          populateBuiltInType();
+          table.setSelection(0);
+          
+          //        typeSection.getTypeList().setEnabled(true);
+          //        typeSection.getSimpleType().setSelection(true);
+          //        typeSection.populateBuiltInType(xsdSchema);
+          //        typeSection.getTypeList().setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE"));
+          previousType = 1;
+        }
+      }
+      if (table.getSelection() != null && table.getSelection().length > 0)
+      {
+        previousStringType = (table.getSelection()[0]).getText();
+      }
+    }
+    
+    public void populateBuiltInType()
+    {
+      table.removeAll();
+      List items = getBuiltInTypeNamesList();
+      for (int i = 0; i < items.size(); i++)
+      {
+        TableItem item = new TableItem(table, SWT.NONE);
+        item.setText(items.get(i).toString());
+        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+        item.setData(items.get(i));
+      }
+    }
+
+    public void populateUserComplexType()
+    {
+      table.removeAll();
+      if (showAnonymous)
+      {
+        TableItem anonymousItem = new TableItem(table, SWT.NONE);
+        anonymousItem.setText("**anonymous**");
+        anonymousItem.setData("**anonymous**");
+      }
+      List items = getUserComplexTypeNamesList();
+      for (int i = 0; i < items.size(); i++)
+      {
+        TableItem item = new TableItem(table, SWT.NONE);
+//        System.out.println("item " + i + " is " + item);
+        item.setText(items.get(i).toString());
+        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"));
+        item.setData(items.get(i));
+      }
+    }
+
+    public void populateUserSimpleType()
+    {
+      table.removeAll();
+      if (showAnonymous)
+       {
+        TableItem anonymousItem = new TableItem(table, SWT.NONE);
+        anonymousItem.setText("**anonymous**");
+        anonymousItem.setData("**anonymous**");
+      }
+      List items = getUserSimpleTypeNamesList();
+      for (int i = 0; i < items.size(); i++)
+       {
+        TableItem item = new TableItem(table, SWT.NONE);
+        item.setText(items.get(i).toString());
+        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+        item.setData(items.get(i));
+      }
+    }
+
+    boolean checkForAnonymousType(Element element)
+    {
+      /*
+       * Using Ed's model to check boolean isAnonymous = false;
+       * 
+       * XSDConcreteComponent component =
+       * getXSDSchema().getCorrespondingComponent(element); if (component
+       * instanceof XSDElementDeclaration) { XSDElementDeclaration xsdElem =
+       * (XSDElementDeclaration)component; isAnonymous =
+       * xsdElem.isSetAnonymousTypeDefinition(); } return isAnonymous;
+       */
+      XSDDOMHelper helper = new XSDDOMHelper();
+      boolean isAnonymous = false;
+      Node aNode =
+      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      if (aNode != null)
+       {
+        return true;
+      }
+      aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      if (aNode != null)
+       {
+        isAnonymous = true;
+      }
+      return isAnonymous;
+    }
+
+    void updateElementToAnonymous(Element element, String xsdType)
+    {
+      String prefix = element.getPrefix();
+      prefix = (prefix == null) ? "" : (prefix + ":");
+      updateElementToNotAnonymous(element);
+      Element childNode = null;
+      if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+       {
+        childNode = element.getOwnerDocument().createElementNS(
+            XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
+            prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      }
+      else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
+       {
+        childNode =
+        element.getOwnerDocument().createElementNS(
+            XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
+            prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      }
+      element.appendChild(childNode);
+    }
+
+    boolean isSTAnonymous(Element element)
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      Node aNode =
+      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      if (aNode != null)
+       {
+        if (XSDDOMHelper
+            .inputEquals(aNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+         {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    boolean isCTAnonymous(Element element)
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      Node aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      if (aNode != null)
+       {
+        if (XSDDOMHelper.inputEquals(aNode, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+         {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    XSDTypeDefinition getAnonymousTypeDefinition(Element element)
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      Node typeDefinitionNode =
+      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      if (typeDefinitionNode == null)
+       {
+        typeDefinitionNode =
+        helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      }
+      if (typeDefinitionNode != null)
+       {
+        XSDConcreteComponent component =
+        xsdSchema.getCorrespondingComponent(typeDefinitionNode);
+        if (component instanceof XSDTypeDefinition)
+         {
+          return (XSDTypeDefinition) component;
+        }
+      }
+      return null;
+    }
+
+    void updateElementToNotAnonymous(Element element)
+    {
+      if (element != null)
+      {
+	      NodeList children = element.getChildNodes();
+	      if (children != null)
+	       {
+	        for (int i = 0; i < children.getLength(); i++)
+	         {
+	          Node node = (Node) children.item(i);
+	          if (node instanceof Element)
+	           {
+	            if (node.getLocalName().equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG)
+	                || node.getLocalName().equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+	             {
+	              XSDDOMHelper.removeNodeAndWhitespace(node);
+	              i = 0;
+	            }
+	          }
+	        }
+	      }
+      }
+    }
+
+    public java.util.List getBuiltInTypeNamesList()
+    {
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      return helper.getBuiltInTypeNamesList();
+    }
+
+    public java.util.List getUserSimpleTypeNamesList()
+    {
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      return helper.getUserSimpleTypeNamesList();
+    }
+    
+    public java.util.List getUserComplexTypeNamesList()
+    {
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      return helper.getUserComplexTypeNamesList();
+    }
+    
+	  protected boolean hasElementChildren(Node parentNode)
+	  {
+	    boolean hasChildrenElements = false;
+	    if (parentNode != null && parentNode.hasChildNodes())
+	    {
+	      NodeList nodes = parentNode.getChildNodes();
+	      for (int i = 0; i < nodes.getLength(); i++)
+	      {
+	        if (nodes.item(i) instanceof Element)
+	        {
+	          hasChildrenElements = true;
+	          break;
+	        }
+	      }
+	    }
+	    return hasChildrenElements;
+	  }
+
+  }
+
+  
+  
+  
+  
+  
+  
+  
+  class TypesOptionsTextCellEditor extends OptionsTextCellEditor
+  {
+    boolean showAnonymous = true;
+    
+    public TypesOptionsTextCellEditor(Composite parent)
+    {
+      super(parent);
+    }
+
+    protected Control createControl(Composite parent)
+    {
+      isTextReadOnly = true;
+      return super.createControl(parent);
+    }
+
+    Table table;
+    TypeSection typeSection;
+
+    protected void openDialog()
+    {
+      typeObject = null;
+      dialog = new Shell(XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.MODELESS);
+      Display display = dialog.getDisplay();
+      GridLayout gl = new GridLayout(1, true);
+      gl.marginHeight = 0;
+      gl.marginWidth = 0;
+      gl.horizontalSpacing = 0;
+      gl.verticalSpacing = 0;
+      dialog.setLayout(gl);
+      GridData gd = new GridData();
+      gd.grabExcessHorizontalSpace = true;
+      gd.grabExcessVerticalSpace = true;
+      gd.horizontalAlignment = GridData.FILL;
+      gd.verticalAlignment = GridData.FILL;
+      gd.horizontalIndent = 0;
+      dialog.setLayoutData(gd);
+
+      
+      
+      typeSection = new TypeSection(dialog);
+      typeSection.setShowUserComplexType(showComplexTypes);
+
+      typeSection.createClient(dialog);
+      typeSection.getSimpleType().setSelection(false);
+      typeSection.getSimpleType().addSelectionListener(this);
+      typeSection.getUserSimpleType().addSelectionListener(this);
+      if (showComplexTypes)
+      {
+        typeSection.getUserComplexType().addSelectionListener(this);
+      }
+
+      table = new Table(dialog,
+                        SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); 
+      table.setHeaderVisible(false);
+      table.setLinesVisible(true);
+      GridData gd2 = new GridData();
+      gd2.grabExcessHorizontalSpace = true;
+      gd2.grabExcessVerticalSpace = true;
+      gd2.horizontalAlignment = GridData.FILL;
+      gd2.verticalAlignment = GridData.FILL;
+      table.setLayoutData(gd2);
+
+      // Fill table and select input type
+      handleSetInput();
+
+      TableColumn tc = new TableColumn(table, SWT.LEFT);
+      tc.setImage(XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"));
+      tc.setResizable(false);
+
+      int MAX_ITEMS = 23;
+      Rectangle tableBounds = table.getBounds();
+      tableBounds.height = Math.min(tableBounds.height, table.getItemHeight()*MAX_ITEMS);
+      table.setBounds(tableBounds);
+      dialog.pack();
+      
+      dialog.addShellListener(new ShellAdapter()
+      {
+        public void shellDeactivated(ShellEvent e)
+        {
+          cancel();
+        }
+      });
+
+      Rectangle dialogBounds = dialog.getBounds();
+      Point buttonLocation = getButtonAbsoluteLocation();
+      dialogBounds.x = buttonLocation.x;
+      dialogBounds.y = buttonLocation.y;
+
+      if (dialogBounds.height > 200)
+      {        
+        dialogBounds.height = 200;
+      }
+      if (dialogBounds.height < 100)
+      {
+        dialogBounds.height = 200;
+      }
+      if (dialogBounds.width > 200)
+      {
+        dialogBounds.width = typeSection.getUserComplexType().getBounds().width + 30;
+      }
+      dialog.setBounds(dialogBounds);
+      tc.setWidth(dialogBounds.width);
+
+      table.addKeyListener(new KeyAdapter()
+      {
+        public void keyPressed(KeyEvent e)
+        {
+          char character = e.character;
+          if (character == SWT.CR || character == SWT.LF)
+            ok();
+          else if (character == SWT.ESC)
+            cancel();
+        }
+      });
+
+      table.addMouseListener(new MouseAdapter()
+      {
+        public void mouseDoubleClick(MouseEvent e)
+        {
+          ok();
+        }
+        public void mouseDown(MouseEvent e)
+        {
+          ok();
+        }
+      });
+
+      try
+      {
+        dialog.open();
+        table.setFocus();
+        table.showSelection();
+        
+        while (!dialog.isDisposed())
+        {
+          if (!display.readAndDispatch())
+          {
+            display.sleep();
+          }
+        }
+      }
+      finally
+      {
+        if (!dialog.isDisposed())
+          cancel();
+      }
+    }
+    
+    public void widgetSelected(SelectionEvent e)
+    {
+      if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
+      {
+        populateBuiltInType();
+      }
+      else if (e.widget == typeSection.getUserComplexType() && typeSection.getUserComplexType().getSelection())
+      {
+        populateUserComplexType();
+      }
+      else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
+      {
+        populateUserSimpleType();
+      }
+    }
+    
+    protected void cancel()
+    {
+      super.cancel();
+      table.dispose();
+    }
+
+    protected void ok()
+    {
+      TableItem[] items = table.getItems();
+      selection = table.getSelectionIndex();
+      if (items != null && items.length > 0 && selection >= 0)
+      {
+        typeObject = items[selection].getData();
+      }
+//      System.out.println("typeObject is " + typeObject);
+
+//      beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_TYPE_CHANGE"), element);
+//      beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);
+      doSetValue(typeObject);
+      applyEditorValueAndDeactivate();
+      dialog.close();
+
+      if (!XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
+      {
+      if (typeObject.equals("**anonymous**"))
+      {
+        if (typeSection.getUserSimpleType().getSelection())
+        {
+          if (!previousStringType.equals("**anonymous**"))
+          {
+            updateElementToAnonymous(
+              element,
+              XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+          }
+        }
+        else
+        {
+          if (!previousStringType.equals("**anonymous**"))
+          {
+            updateElementToAnonymous(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+          }
+        }
+        // element.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
+        element.removeAttribute(property);
+      }
+      else
+      {
+        updateElementToNotAnonymous(element);
+        //element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, typeObject.toString());
+        element.setAttribute(property, typeObject.toString());
+      }
+      }
+//      endRecording(element);
+
+      //implement dispose();
+      table.removeAll();
+      table.dispose();
+    }
+
+    String previousStringType = "";
+    boolean isAnonymous;
+    int previousType;
+
+    public void handleSetInput()
+    {
+      table.removeAll();
+      isAnonymous = checkForAnonymousType(element);
+      // Attr attr = element.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
+      Attr attr = element.getAttributeNode(property);
+      if (attr != null)
+      {
+        String value = attr.getValue();
+        if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(value))
+        {
+          typeSection.getSimpleType().setSelection(true);
+          populateBuiltInType();
+          int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(value);
+          table.setSelection(i);
+          previousType = 1;
+        }
+        else if (typeSection.getUserSimpleTypeNamesList(xsdSchema).contains(value))
+        {
+          typeSection.getUserSimpleType().setSelection(true);
+          populateUserSimpleType();
+          int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(value);
+          if (showAnonymous)
+          {
+            table.setSelection(i + 1);
+          }
+          else
+          {
+            table.setSelection(i);
+          }
+          previousType = 2;
+        }
+        else if (typeSection.getUserComplexTypeNamesList(xsdSchema).contains(value))
+        {
+          typeSection.getUserComplexType().setSelection(true);
+          populateUserComplexType();
+          int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(value);
+          if (showAnonymous)
+           {
+            table.setSelection(i + 1);
+          }
+          else
+           {
+            table.setSelection(i);
+          }
+          previousType = 3;
+        }
+        else // if it is type="" for an empty list of simple types
+          {
+          typeSection.getUserSimpleType().setSelection(true);
+          populateUserSimpleType();
+          previousType = 2;
+        }
+      }
+      else
+      {
+        if (isAnonymous)
+        {
+          if (isSTAnonymous(element))
+          {
+            typeSection.getUserSimpleType().setSelection(true);
+            populateUserSimpleType();
+            previousType = 2;
+          }
+          else
+          {
+            typeSection.getUserComplexType().setSelection(true);
+            populateUserComplexType();
+            previousType = 3;
+          }
+          table.setSelection(0); // anonymous
+          //        typeSection.getTypeList().setText("**anonymous**");
+        }
+        else
+        {
+          typeSection.getSimpleType().setSelection(true);
+          populateBuiltInType();
+          table.setSelection(0);
+          
+          //        typeSection.getTypeList().setEnabled(true);
+          //        typeSection.getSimpleType().setSelection(true);
+          //        typeSection.populateBuiltInType(xsdSchema);
+          //        typeSection.getTypeList().setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE"));
+          previousType = 1;
+        }
+      }
+      if (table.getSelection() != null && table.getSelection().length > 0)
+      {
+        previousStringType = (table.getSelection()[0]).getText();
+      }
+    }
+    
+    public void populateBuiltInType()
+    {
+      table.removeAll();
+      List items = getBuiltInTypeNamesList();
+      for (int i = 0; i < items.size(); i++)
+      {
+        TableItem item = new TableItem(table, SWT.NONE);
+        item.setText(items.get(i).toString());
+        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+        item.setData(items.get(i));
+      }
+    }
+
+    public void populateUserComplexType()
+    {
+      table.removeAll();
+      if (showAnonymous)
+      {
+        TableItem anonymousItem = new TableItem(table, SWT.NONE);
+        anonymousItem.setText("**anonymous**");
+        anonymousItem.setData("**anonymous**");
+      }
+      List items = getUserComplexTypeNamesList();
+      for (int i = 0; i < items.size(); i++)
+      {
+        TableItem item = new TableItem(table, SWT.NONE);
+//        System.out.println("item " + i + " is " + item);
+        item.setText(items.get(i).toString());
+        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"));
+        item.setData(items.get(i));
+      }
+    }
+
+    public void populateUserSimpleType()
+    {
+      table.removeAll();
+      if (showAnonymous)
+       {
+        TableItem anonymousItem = new TableItem(table, SWT.NONE);
+        anonymousItem.setText("**anonymous**");
+        anonymousItem.setData("**anonymous**");
+      }
+      List items = getUserSimpleTypeNamesList();
+      for (int i = 0; i < items.size(); i++)
+       {
+        TableItem item = new TableItem(table, SWT.NONE);
+        item.setText(items.get(i).toString());
+        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+        item.setData(items.get(i));
+      }
+    }
+
+    boolean checkForAnonymousType(Element element)
+    {
+      /*
+       * Using Ed's model to check boolean isAnonymous = false;
+       * 
+       * XSDConcreteComponent component =
+       * getXSDSchema().getCorrespondingComponent(element); if (component
+       * instanceof XSDElementDeclaration) { XSDElementDeclaration xsdElem =
+       * (XSDElementDeclaration)component; isAnonymous =
+       * xsdElem.isSetAnonymousTypeDefinition(); } return isAnonymous;
+       */
+      XSDDOMHelper helper = new XSDDOMHelper();
+      boolean isAnonymous = false;
+      Node aNode =
+      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      if (aNode != null)
+       {
+        return true;
+      }
+      aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      if (aNode != null)
+       {
+        isAnonymous = true;
+      }
+      return isAnonymous;
+    }
+
+    void updateElementToAnonymous(Element element, String xsdType)
+    {
+      String prefix = element.getPrefix();
+      prefix = (prefix == null) ? "" : (prefix + ":");
+      updateElementToNotAnonymous(element);
+      Element childNode = null;
+      if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+       {
+        childNode = element.getOwnerDocument().createElementNS(
+            XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
+            prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      }
+      else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
+       {
+        childNode =
+        element.getOwnerDocument().createElementNS(
+            XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
+            prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      }
+      element.appendChild(childNode);
+    }
+
+    boolean isSTAnonymous(Element element)
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      Node aNode =
+      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      if (aNode != null)
+       {
+        if (XSDDOMHelper
+            .inputEquals(aNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+         {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    boolean isCTAnonymous(Element element)
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      Node aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      if (aNode != null)
+       {
+        if (XSDDOMHelper.inputEquals(aNode, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+         {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    XSDTypeDefinition getAnonymousTypeDefinition(Element element)
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      Node typeDefinitionNode =
+      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      if (typeDefinitionNode == null)
+       {
+        typeDefinitionNode =
+        helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+      }
+      if (typeDefinitionNode != null)
+       {
+        XSDConcreteComponent component =
+        xsdSchema.getCorrespondingComponent(typeDefinitionNode);
+        if (component instanceof XSDTypeDefinition)
+         {
+          return (XSDTypeDefinition) component;
+        }
+      }
+      return null;
+    }
+
+    void updateElementToNotAnonymous(Element element)
+    {
+      NodeList children = element.getChildNodes();
+      if (children != null)
+       {
+        for (int i = 0; i < children.getLength(); i++)
+         {
+          Node node = (Node) children.item(i);
+          if (node instanceof Element)
+           {
+            if (node.getLocalName().equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG)
+                || node.getLocalName().equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+             {
+              XSDDOMHelper.removeNodeAndWhitespace(node);
+              i = 0;
+            }
+          }
+        }
+      }
+    }
+
+    public java.util.List getBuiltInTypeNamesList()
+    {
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      return helper.getBuiltInTypeNamesList();
+    }
+
+    public java.util.List getUserSimpleTypeNamesList()
+    {
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      return helper.getUserSimpleTypeNamesList();
+    }
+    
+    public java.util.List getUserComplexTypeNamesList()
+    {
+      TypesHelper helper = new TypesHelper(xsdSchema);
+      return helper.getUserComplexTypeNamesList();
+    }
+    
+	  protected boolean hasElementChildren(Node parentNode)
+	  {
+	    boolean hasChildrenElements = false;
+	    if (parentNode != null && parentNode.hasChildNodes())
+	    {
+	      NodeList nodes = parentNode.getChildNodes();
+	      for (int i = 0; i < nodes.getLength(); i++)
+	      {
+	        if (nodes.item(i) instanceof Element)
+	        {
+	          hasChildrenElements = true;
+	          break;
+	        }
+	      }
+	    }
+	    return hasChildrenElements;
+	  }
+
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XPathPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XPathPropertySource.java
new file mode 100644
index 0000000..9a5d893
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XPathPropertySource.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+public class XPathPropertySource
+  extends BasePropertySource
+  implements IPropertySource
+{
+  /**
+   * 
+   */
+  public XPathPropertySource()
+  {
+    super();
+  }
+  /**
+   * @param viewer
+   * @param xsdSchema
+   */
+  public XPathPropertySource(Viewer viewer, XSDSchema xsdSchema)
+  {
+    super(viewer, xsdSchema);
+// From Field     
+// WorkbenchHelp.setHelp(comp, XSDEditorContextIds.XSDE_UNIQUE_BASE_FIELDS_GROUP);
+//    fieldField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_FIELD_TEXT"));
+//    WorkbenchHelp.setHelp(fieldField, XSDEditorContextIds.XSDE_UNIQUE_BASE_SOURCE);
+
+// From Selector
+// WorkbenchHelp.setHelp(comp, XSDEditorContextIds.XSDE_UNIQUE_BASE_SELECTOR_GROUP);
+// WorkbenchHelp.setHelp(selectorField, XSDEditorContextIds.XSDE_UNIQUE_BASE_SELECTOR);
+// selectorField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_SELECTOR_TEXT"));
+    
+  }
+  /**
+   * @param xsdSchema
+   */
+  public XPathPropertySource(XSDSchema xsdSchema)
+  {
+    super(xsdSchema);
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+   */
+  public Object getEditableValue()
+  {
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+   */
+  public IPropertyDescriptor[] getPropertyDescriptors()
+  {
+    List list = new ArrayList();
+    // Create a descriptor and set a category
+    PropertyDescriptor xpathDescriptor =
+    new TextPropertyDescriptor(
+        XSDConstants.XPATH_ATTRIBUTE,
+        XSDConstants.XPATH_ATTRIBUTE);
+    list.add(xpathDescriptor);
+
+    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
+    list.toArray(result);
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+   */
+  public Object getPropertyValue(Object id)
+  {
+    Object result = null;
+    if (id instanceof String)
+     {
+      result = element.getAttribute((String) id);
+    }
+    if (result == null)
+     {
+      result = "";
+    }
+    return result;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+   */
+  public boolean isPropertySet(Object id)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+   */
+  public void resetPropertyValue(Object id)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+   */
+  public void setPropertyValue(Object id, Object value)
+  {
+    if (value != null)
+     {
+      if (value instanceof String)
+      {
+        if (XSDDOMHelper.inputEquals(element, XSDConstants.FIELD_ELEMENT_TAG, false))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_FIELD_XPATH_CHANGE"), element);
+        }
+        else if (XSDDOMHelper.inputEquals(element, XSDConstants.SELECTOR_ELEMENT_TAG, false))
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_SELECTOR_XPATH_CHANGE"), element);
+        }
+        
+        element.setAttribute(XSDConstants.XPATH_ATTRIBUTE, (String)value);
+        endRecording(element);
+      }
+    }
+    Runnable delayedUpdate = new Runnable()
+    {
+      public void run()
+      {
+        if (viewer != null)
+          viewer.refresh();
+      }
+    };
+    Display.getCurrent().asyncExec(delayedUpdate);
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDComboBoxPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDComboBoxPropertyDescriptor.java
new file mode 100644
index 0000000..b4d9cc2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDComboBoxPropertyDescriptor.java
@@ -0,0 +1,304 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import java.text.MessageFormat;
+
+import org.eclipse.jface.util.Assert;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.PopupList;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class XSDComboBoxPropertyDescriptor extends PropertyDescriptor
+{
+	private String[] values;
+	
+	public XSDComboBoxPropertyDescriptor(Object id, String displayName, String[] valuesArray) {
+		super(id, displayName);
+		values = valuesArray;
+	}
+	/**
+	 * The <code>ComboBoxPropertyDescriptor</code> implementation of this 
+	 * <code>IPropertyDescriptor</code> method creates and returns a new
+	 * <code>ComboBoxCellEditor</code>.
+	 * <p>
+	 * The editor is configured with the current validator if there is one.
+	 * </p>
+	 */
+	public CellEditor createPropertyEditor(Composite parent) {
+    CellEditor editor = new XSDComboBoxCellEditor(parent, values);
+    //CellEditor editor = new StringComboBoxCellEditor(parent, values);
+		if (getValidator() != null)
+			editor.setValidator(getValidator());
+		return editor;
+	}
+	
+	public class XSDComboBoxCellEditor extends CellEditor
+	{
+		DynamicCellEditor comboBox;
+
+		private String fSelection;
+		protected String[] fItems;
+		protected Object fValue;
+		int selection;
+		Object typeObject;
+		
+		public void createItems(String[] items)
+		{
+			fItems = items;
+		}
+
+		public String[] getComboBoxItems()
+		{
+			return fItems;
+		}
+
+	/**
+	 * Creates a new combo box cell editor with the given choices.
+	 */
+		 public XSDComboBoxCellEditor(Composite parent, String[] items)
+		 {
+			 super(parent);
+			 fSelection = "";
+			 setItems(items);
+//			 fText.setText("");
+		 }
+
+		public void activate() {
+      if (doGetValue() != null)
+      {
+//			  int i = ((Integer)doGetValue()).intValue();
+//			  if (i >= 0)
+//		  	{
+//		  	  comboBox.setText(fItems[i]);
+//		  	}
+        comboBox.setText((String)fValue);
+			}
+		}
+
+		public void deactivate() {
+		  super.deactivate();
+		}
+
+		public void setItems(String[] items) {
+			Assert.isNotNull(items);
+			this.fItems = items;
+			populateComboBoxItems();
+		}
+
+		private void populateComboBoxItems() {
+			if (comboBox != null && fItems != null) {
+				comboBox.removeAll();
+				for (int i = 0; i < fItems.length; i++)
+					comboBox.add(fItems[i], i);
+
+				setValueValid(true);
+				selection = 0;
+			}
+		}
+
+	/**
+	 * Creates the actual UI representation.
+	 */
+
+		protected Control createControl(Composite parent)
+		{
+			comboBox = new DynamicCellEditor(parent, SWT.READ_ONLY |SWT.NONE | SWT.NO_TRIM);
+			comboBox.addKeyListener(new KeyAdapter() {
+				// hook key pressed - see PR 14201  
+				public void keyPressed(KeyEvent e) {
+//					System.out.println("Key e " + e);
+					keyReleaseOccured(e);
+				}
+			});
+
+			comboBox.addSelectionListener(new SelectionAdapter() {
+				public void widgetDefaultSelected(SelectionEvent event) {
+				}
+		
+				public void widgetSelected(SelectionEvent event) {
+//				  System.out.println("combo selected");
+					selection = comboBox.getSelectionIndex();
+					if (!comboBox.isDropped()) // allows user to traverse list using keyboard without applying value
+					applyEditorValueAndDeactivate();
+				}
+			});
+
+			comboBox.addTraverseListener(new TraverseListener() {
+				public void keyTraversed(TraverseEvent e) {
+//				  System.out.println("TRAVERSE e " + e);
+					if (e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN) {
+						e.doit = false;
+					}
+				}
+			});
+			
+      
+			comboBox.addFocusListener(new FocusAdapter() {
+				public void focusLost(FocusEvent e) {
+					XSDComboBoxCellEditor.this.focusLost();
+				}
+				public void focusGained(FocusEvent e) {
+//				  System.out.println("focusGained");
+				}
+			});
+		  setValueValid(true);
+			return comboBox;
+		}
+
+		protected void focusLost() {
+//		  System.out.println("CELLEDITOR FOCUS LOST");
+			if (isActivated()) {
+				applyEditorValueAndDeactivate();
+			}
+		}
+		
+		protected void keyReleaseOccured(KeyEvent keyEvent) {
+			if (keyEvent.character == '\u001b') { // Escape character
+			  comboBox.setText(""); // clear text
+				fireCancelEditor();
+			} else if (keyEvent.character == '\r') { // Return key
+				//fireApplyEditorValue();
+				applyEditorValueAndDeactivate();
+				deactivate();
+			}
+		}
+
+		void applyEditorValueAndDeactivate() {
+			//	must set the selection before getting value
+			selection = comboBox.getSelectionIndex();
+			if (selection < 0)
+			{
+			  deactivate();
+			  return;
+			}
+			// Object newValue = new Integer(selection);
+      Object newValue = fItems[selection];
+			markDirty();
+			boolean isValid = isCorrect(newValue);
+			setValueValid(isValid);
+			if (!isValid) {
+				// try to insert the current value into the error message.
+				setErrorMessage(
+					MessageFormat.format(getErrorMessage(), new Object[] {fItems[selection]})); 
+			}
+			doSetValue(newValue);
+			fireApplyEditorValue();
+			deactivate();
+		}
+
+    protected Object doGetValue() {
+      return fValue;
+      // otherwise limits to set of valid values
+//      Object index = super.doGetValue();
+//      int selection = -1;
+//      if (index instanceof Integer)
+//        selection = ((Integer) index).intValue();
+//      if (selection >= 0)
+//        return fItems[selection];
+//      else if (getControl() instanceof CCombo) {
+//        // retrieve the actual text as the list of valid items doesn't contain the value
+//        return ((CCombo) getControl()).getText();
+//      }
+//      return null;
+    }
+    private boolean fSettingValue = false;
+    protected void doSetValue(Object value) {
+      if (fSettingValue)
+        return;
+      fSettingValue = true;
+      if (value instanceof Integer) {
+        //super.doSetValue(value);
+        fValue = value;
+      }
+      else {
+        String stringValue = value.toString();
+        int selection = -1;
+        for (int i = 0; i < fItems.length; i++)
+          if (fItems[i].equals(stringValue))
+            selection = i;
+        if (selection >= 0)
+          //super.doSetValue(new Integer(selection));
+          fValue = stringValue;
+        else {
+          // super.doSetValue(new Integer(-1));
+          // fValue = new Integer(-1);
+          fValue = stringValue;
+          if (getControl() instanceof CCombo && !stringValue.equals(((CCombo) getControl()).getText())) {
+            // update the Text widget
+            ((CCombo) getControl()).setText(stringValue);
+          }
+        }
+      }
+      fSettingValue = false;
+    }		
+		
+	/**
+		* Returns the cell editor's value.
+		*/
+//		protected Object doGetValue() 
+//		{
+//			return fValue;
+//		}
+
+	/**
+	 * Set the focus to the cell editor's UI representation.
+	 */
+		protected void doSetFocus()
+		{
+//			fButton.setFocus();
+//      System.out.println("doSetFocus() " + moreButton.setFocus());
+      comboBox.setFocus();
+		}
+
+	/**
+	 * Sets the value of the cell editor to the given value.
+	 */
+//		protected void doSetValue(Object value)
+//		{
+//			fValue = value;
+//		}
+
+		protected void fillPopupList(PopupList list) 
+		{
+			String[] labels= new String[fItems.length];
+			for (int i= 0; i < labels.length; i++)
+			{
+				String item= fItems[i];
+				labels[i]= item;
+//				System.out.println(fItems[i]);
+				if (fSelection == null && fValue != null && fValue.equals(item)) 
+				{
+					fSelection = item;
+				}
+			}
+
+			list.setItems(labels);
+			if (fSelection != null) 
+			{
+//				fText.setText(fSelection);
+				list.select(fSelection);
+			}	
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDPropertySourceProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDPropertySourceProvider.java
new file mode 100644
index 0000000..78e790b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDPropertySourceProvider.java
@@ -0,0 +1,285 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties;
+
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.IPropertySourceProvider;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class XSDPropertySourceProvider implements IPropertySourceProvider
+{
+  XSDSchema xsdSchema;
+  /**
+   * 
+   * @todo Generated comment
+   */
+  public XSDPropertySourceProvider()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.views.properties.IPropertySourceProvider#getPropertySource(java.lang.Object)
+   */
+  public IPropertySource getPropertySource(Object object)
+  {
+    if (object == null) return null;
+    
+    if (object instanceof XSDConcreteComponent)
+    {
+      XSDConcreteComponent component = (XSDConcreteComponent)object;
+      
+      xsdSchema = component.getSchema();
+      
+      if (component instanceof XSDElementDeclaration)
+      {
+        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)component;
+        if (elementDeclaration.isElementDeclarationReference())
+        {
+          component = elementDeclaration.getResolvedElementDeclaration();
+        }
+      }
+      
+      Element input = component.getElement(); 
+      
+      BasePropertySource bps = (BasePropertySource)getXSDPropertySource(input);
+      if (bps == null) return null;
+      
+      bps.setInput(input);
+      return bps;
+    }
+    return null;
+  }
+  
+  boolean showParent = false;
+  
+  public IPropertySource getXSDPropertySource(Object object)
+  {
+    Element input = (Element)object;
+
+    showParent = false;
+  
+    if (inputEquals(input, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+    {
+      return new ElementPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.ELEMENT_ELEMENT_TAG, true))
+    {
+      return new GroupRefPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
+              inputEquals(input, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
+              inputEquals(input, XSDConstants.ALL_ELEMENT_TAG, false))
+    {
+      return new ModelGroupPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+    {
+      return new AttributePropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
+    {
+      return new AttributeGroupRefPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
+    {
+      return new NamePropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
+    {
+      return new AttributeGroupRefPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.NOTATION_ELEMENT_TAG, false))
+    {
+      return new NotationPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+    {
+      return new SimpleTypePropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.GROUP_ELEMENT_TAG, false))
+    {
+      return new NamePropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.GROUP_ELEMENT_TAG, true))
+    {
+      return new GroupRefPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.SCHEMA_ELEMENT_TAG, false))
+    {
+      return new SchemaPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+    {
+      return new ComplexTypePropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.DOCUMENTATION_ELEMENT_TAG, false))
+    {
+      return new DocumentationPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.APPINFO_ELEMENT_TAG, false))
+    {
+      return new AppInfoPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+    {
+      if (input != null && input instanceof Element)
+      {
+        Element parent = (Element)input;
+        XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
+        Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
+        if (derivedByNode != null)
+        {
+          if (inputEquals(derivedByNode, XSDConstants.RESTRICTION_ELEMENT_TAG, false) || 
+              inputEquals(derivedByNode, XSDConstants.EXTENSION_ELEMENT_TAG, false))
+          {
+            return new SimpleContentPropertySource(xsdSchema);
+          }
+        }
+        else
+        {
+          return null;
+        }
+      }
+    }
+    else if (inputEquals(input, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+    {
+      if (input != null && input instanceof Element)
+      {
+        Element parent = (Element)input;
+        XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
+        Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
+        if (derivedByNode != null)
+        {
+          return new SimpleContentPropertySource(xsdSchema);
+        }
+        else
+        {
+          return null;
+        }
+      }
+    }
+    else if (inputEquals(input, XSDConstants.LIST_ELEMENT_TAG, false))
+    {
+      return new SimpleTypeListPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.UNION_ELEMENT_TAG, false))
+    {
+      return new SimpleTypeUnionPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
+    {
+      return createRestrictWindow(input, xsdSchema);
+    }
+    else if (XSDDOMHelper.isFacet(input))
+    {
+      if (input != null && input instanceof Element)
+      {
+        Node parent = ((Element)input).getParentNode();
+        if (inputEquals(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
+        {
+          return createRestrictWindow(input, xsdSchema);
+        } 
+      }
+    }
+    else if (inputEquals(input, XSDConstants.EXTENSION_ELEMENT_TAG, false))
+    {
+      if (input != null && input instanceof Element)
+      {
+        Node parent = ((Element)input).getParentNode();
+        if (inputEquals(parent, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false)
+            || inputEquals(parent, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+        {
+          showParent = true;
+          return new SimpleContentPropertySource(xsdSchema);
+        }
+      }
+    }
+    else if (inputEquals(input, XSDConstants.PATTERN_ELEMENT_TAG, false))
+    {
+      return new PatternPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.ENUMERATION_ELEMENT_TAG, false))
+    {
+      return new EnumerationPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.ANY_ELEMENT_TAG, false))
+    {
+      return new AnyElementPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
+    {
+      return new AnyAttributePropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.UNIQUE_ELEMENT_TAG, false))
+    {
+      return new NamePropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.KEYREF_ELEMENT_TAG, false))
+    {
+      return new KeyrefPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.SELECTOR_ELEMENT_TAG, false))
+    {
+      return new XPathPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.FIELD_ELEMENT_TAG, false))
+    {
+      return new XPathPropertySource(xsdSchema);
+    }
+    else if (inputEquals(input, XSDConstants.KEY_ELEMENT_TAG, false))
+    {
+      return new NamePropertySource(xsdSchema);
+    }
+    else
+    {
+      return null;
+    }
+    return null;
+  }
+
+  protected IPropertySource createRestrictWindow(Object input, XSDSchema xsdSchema)
+  {
+    // special case where SimpleType restriction is different than SimpleContent restriction
+
+    if (input != null && input instanceof Element)
+    {
+      Node parent = ((Element)input).getParentNode();
+      if (inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+      {
+        return new SimpleRestrictPropertySource(xsdSchema);
+      }
+      else if (inputEquals(parent, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+      {
+        return new SimpleRestrictPropertySource(xsdSchema);
+      }
+      else if (inputEquals(parent, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+      {
+        showParent = true;
+        return new SimpleContentPropertySource(xsdSchema);
+      }
+    }
+    return null;
+  }
+
+
+  protected boolean inputEquals(Object input, String tagname, boolean isRef)
+  {
+    return XSDDOMHelper.inputEquals(input, tagname, isRef);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSection.java
new file mode 100644
index 0000000..9f4bd90
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSection.java
@@ -0,0 +1,495 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.part.EditorActionBarContributor;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class AbstractSection implements ISection, IPropertyChangeListener, Listener, SelectionListener
+{
+	private TabbedPropertySheetWidgetFactory factory;
+	protected IWorkbenchPart part;
+	protected ISelection selection;
+	protected Object input;
+  protected boolean doRefresh = true;
+	XSDSchema xsdSchema;
+  protected boolean isReadOnly = false;
+  private IStatusLineManager statusLine;
+  protected Composite composite;
+  protected int rightMarginSpace;
+  protected int tableMinimumWidth = 50;
+ 
+  /**
+   * 
+   */
+  public AbstractSection()
+  {
+    super();
+  }
+  
+  public void createControls(Composite parent,	TabbedPropertySheetPage tabbedPropertySheetPage)
+  {
+    createControls(parent, tabbedPropertySheetPage.getWidgetFactory());
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+   */
+  public void createControls(Composite parent, TabbedPropertySheetWidgetFactory aFactory)
+  {
+		this.factory = aFactory;
+    GC gc = new GC(parent);
+    Point extent = gc.textExtent("  ...  ");
+    rightMarginSpace = extent.x;
+    gc.dispose();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public void setInput(IWorkbenchPart part, ISelection selection)
+  {
+		Assert.isTrue(selection instanceof IStructuredSelection);
+		this.part = part;
+		this.selection = selection;
+		Object input = ((IStructuredSelection)selection).getFirstElement();
+    this.input = input;
+    
+    if (input instanceof XSDConcreteComponent)
+    {
+      xsdSchema = ((XSDConcreteComponent)input).getSchema();
+      
+      Element element = ((XSDConcreteComponent)input).getElement();
+      if (element instanceof IDOMNode)
+      {
+        isReadOnly = false;
+      }
+      else
+      {
+        isReadOnly = true;
+      }
+    }
+    statusLine = getStatusLine();
+    clearErrorMessage();
+
+//		refresh();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeShown()
+   */
+  public void aboutToBeShown()
+  {
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeHidden()
+   */
+  public void aboutToBeHidden()
+  {
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#dispose()
+   */
+  public void dispose()
+  {
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#getMinimumHeight()
+   */
+  public int getMinimumHeight()
+  {
+    return SWT.DEFAULT;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+   */
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#refresh()
+   */
+  public void refresh()
+  {
+  }
+
+  public Object getInput()
+  {
+    if (input instanceof Element)
+    {
+      input = xsdSchema.getCorrespondingComponent((Element)input);
+    }
+    return input;
+  }
+  
+  public XSDSchema getSchema()
+  {
+    return xsdSchema;
+  }
+  
+	/**
+	 * Get the widget factory.
+	 * @return the widget factory.
+	 */
+	public TabbedPropertySheetWidgetFactory getWidgetFactory() {
+		return factory;
+	}
+
+	public void propertyChange(PropertyChangeEvent event)
+	{
+    refresh();
+	}
+
+	
+  public void doWidgetDefaultSelected(SelectionEvent e)
+  {}
+  
+  public void doWidgetSelected(SelectionEvent e)
+  {}
+  
+  /**
+   * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
+   */
+  public void widgetDefaultSelected(SelectionEvent e)
+  {
+    if (isListenerEnabled() &&
+        getInput() != null &&
+        !isInDoHandle &&
+        !isReadOnly) 
+    {
+      isInDoHandle = true;
+      doWidgetDefaultSelected(e);
+      isInDoHandle = false;
+    }
+    
+  }
+
+  /**
+   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
+   */
+  public void widgetSelected(SelectionEvent e)
+  {
+    if (isListenerEnabled() &&
+        getInput() != null &&
+        !isInDoHandle &&
+        !isReadOnly) 
+    {
+      isInDoHandle = true;
+      doWidgetSelected(e);
+      isInDoHandle = false;
+    }
+    
+  }
+  
+  boolean listenerEnabled = true;
+  /**
+   * Get the value of listenerEnabled.
+   * @return value of listenerEnabled.
+   */
+  public boolean isListenerEnabled() 
+  {
+    return listenerEnabled;
+  }
+  
+  /**
+   * Set the value of listenerEnabled.
+   * @param v  Value to assign to listenerEnabled.
+   */
+  public void setListenerEnabled(boolean  v) 
+  {
+    this.listenerEnabled = v;
+  }
+
+  public void handleEvent(Event event)
+  {
+    if (isListenerEnabled() && !isInDoHandle && !isReadOnly) 
+    {
+      isInDoHandle = true;
+      startDelayedEvent(event);
+      isInDoHandle = false;
+    } // end of if ()
+  }
+  
+  public void doHandleEvent(Event event)
+  {
+    
+  }
+  
+  protected DelayedEvent delayedTask;
+  
+  protected void startDelayedEvent(Event e)
+  {
+    if (delayedTask == null ||
+      delayedTask.getEvent() == null)
+    {
+      delayedTask = new DelayedEvent();
+      delayedTask.setEvent(e);
+      Display.getDefault().timerExec(500,delayedTask);
+    }
+    else
+    {
+      Event delayedEvent = delayedTask.getEvent();
+      
+      if (e.widget == delayedEvent.widget &&
+        e.type == delayedEvent.type)
+      {
+        // same event, just different data, delay new event
+        delayedTask.setEvent(null);
+      }
+      delayedTask = new DelayedEvent();
+      delayedTask.setEvent(e);
+      Display.getDefault().timerExec(500,delayedTask);
+    }
+  }
+  
+  class DelayedEvent implements Runnable
+  {
+    protected Event event;
+    
+    /*
+     * @see Runnable#run()
+     */
+    public void run()
+    {
+      if (event != null)
+      {
+        isInDoHandle = true;
+        doHandleEvent(event);
+        isInDoHandle = false;
+        event = null;
+      }
+    }
+    
+    /**
+     * Gets the event.
+     * @return Returns a Event
+     */
+    public Event getEvent()
+    {
+      return event;
+    }
+
+    /**
+     * Sets the event.
+     * @param event The event to set
+     */
+    public void setEvent(Event event)
+    {
+      this.event = event;
+    }
+
+  }
+
+  boolean isInDoHandle;
+  /**
+   * Get the value of isInDoHandle.
+   * @return value of isInDoHandle.
+   */
+  public boolean isInDoHandle() 
+  {
+    return isInDoHandle;
+  }
+
+  
+  protected IEditorPart getActiveEditor()
+  {
+    IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
+    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
+//    IEditorPart editorPart = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
+
+    return editorPart;
+  }
+
+  static protected IStatusLineManager getStatusLineManager(IEditorPart editorPart)
+  { 
+    IStatusLineManager result = null;
+    try
+    {                       
+      EditorActionBarContributor contributor = (EditorActionBarContributor)editorPart.getEditorSite().getActionBarContributor();
+      result = contributor.getActionBars().getStatusLineManager();
+    }
+    catch (Exception e)
+    {
+    }  
+    return result;
+  }
+
+  protected XSDDOMHelper domHelper = new XSDDOMHelper();
+  /**
+   * Gets the domHelper.
+   * @return Returns a XSDDomHelper
+   */
+  public XSDDOMHelper getDomHelper()
+  {
+    return domHelper;
+  }
+  
+  public DocumentImpl getDocument(Element element)
+  {
+    return (DocumentImpl) element.getOwnerDocument();
+  }
+
+  public void beginRecording(String description, Element element)
+  {
+    getDocument(element).getModel().beginRecording(this, description);
+  }
+  
+  public void endRecording(Element element)
+  {
+    DocumentImpl doc = (DocumentImpl) getDocument(element);
+    
+    doc.getModel().endRecording(this);    
+  }
+
+  protected boolean validateName(String name)
+  {
+    try
+    {
+      return NameValidator.isValid(name);
+    }
+    catch (Exception e)
+    {
+      return false;
+    }
+  }
+
+  // TODO
+  protected boolean validateLanguage(String lang)
+  {
+    return true;
+  }
+
+  // TODO
+  protected boolean validatePrefix(String prefix)
+  {
+    return true;
+  }
+
+  
+  protected Action getNewElementAction(String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateElementAction action = new CreateElementAction(label);
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    action.setXSDSchema(getSchema());
+    action.setSelectionProvider(null);
+    return action;
+  }
+
+  public void setErrorMessage(String message)
+  {
+    if (statusLine != null)
+    {
+      statusLine.setErrorMessage(message);
+      statusLine.update(true);
+    }
+  }
+
+  public void clearErrorMessage()
+  {
+    if (statusLine != null)
+    {
+      statusLine.setErrorMessage(null);
+      statusLine.update(false);
+    }
+  }
+
+  EditorActionBarContributor contributor;
+  protected IStatusLineManager getStatusLine()
+  {
+//    IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
+//    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+    IEditorPart editorPart = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
+    
+    if (statusLine == null)
+    {
+      try
+      {                       
+        contributor = (EditorActionBarContributor)editorPart.getEditorSite().getActionBarContributor();
+        statusLine = contributor.getActionBars().getStatusLineManager();
+      }
+      catch (Exception e)
+      {
+      }  
+    }
+    return statusLine;
+  }
+  
+  /**
+   * Get the standard label width when labels for sections line up on the left
+   * hand side of the composite. We line up to a fixed position, but if a
+   * string is wider than the fixed position, then we use that widest string.
+   * 
+   * @param parent
+   *            The parent composite used to create a GC.
+   * @param labels
+   *            The list of labels.
+   * @return the standard label width.
+   */
+  protected int getStandardLabelWidth(Composite parent, String[] labels) {
+    int standardLabelWidth = 100;   // STANDARD_LABEL_WIDTH;
+    GC gc = new GC(parent);
+    int indent = gc.textExtent("XXX").x; //$NON-NLS-1$
+    for (int i = 0; i < labels.length; i++) {
+      int width = gc.textExtent(labels[i]).x;
+      if (width + indent > standardLabelWidth) {
+        standardLabelWidth = width + indent;
+      }
+    }
+    gc.dispose();
+    return standardLabelWidth;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSectionDescriptor.java
new file mode 100644
index 0000000..1cbcf10
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSectionDescriptor.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITypeMapper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.w3c.dom.Element;
+
+public class AbstractSectionDescriptor implements ISectionDescriptor
+{
+  /**
+   * 
+   */
+  public AbstractSectionDescriptor()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getFilter()
+   */
+  public ITypeMapper getFilter()
+  {
+    return null;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDConcreteComponent.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return null;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return null;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDConcreteComponent || object instanceof Element)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
+   */
+  public String getAfterSection()
+  {
+    return "";
+  }
+
+  protected boolean inputEquals(Object input, String tagname, boolean isRef)
+  {
+    return XSDDOMHelper.inputEquals(input, tagname, isRef);
+  }
+  
+  public int getEnablesFor()
+  {
+	return ENABLES_FOR_ANY;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSection.java
new file mode 100644
index 0000000..e756ea7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSection.java
@@ -0,0 +1,592 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAnnotation;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFacet;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.XSDXPathDefinition;
+import org.eclipse.xsd.impl.XSDFactoryImpl;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class AnnotationSection extends AbstractSection
+{
+  DocumentationWorkbookPage documentationPage;
+  AppInfoWorkbookPage appInfoPage;
+  XSDWorkbook workbook;
+  XSDFactory factory;
+  
+  /**
+   * 
+   */
+  public AnnotationSection()
+  {
+    super();
+    factory = new XSDFactoryImpl();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+      super.createControls(parent, factory);
+
+      workbook = new XSDWorkbook(parent, SWT.BOTTOM | SWT.FLAT);
+    
+      documentationPage = new DocumentationWorkbookPage(workbook);
+      appInfoPage = new AppInfoWorkbookPage(workbook);
+
+      documentationPage.activate();
+      appInfoPage.activate();
+      workbook.setSelectedPage(documentationPage);
+    }
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+    if (doRefresh)
+    {
+      if (documentationPage.getDocumentationText().isFocusControl() || appInfoPage.getAppInfoText().isFocusControl())
+      {
+        return;
+      }
+      
+      if (isReadOnly)
+      {
+        documentationPage.setEnabled(false);
+        appInfoPage.setEnabled(false);
+      }
+      else
+      {
+        documentationPage.setEnabled(true);
+        appInfoPage.setEnabled(true);
+      }
+      setListenerEnabled(false);
+	    Object input = getInput();
+	    if (input != null)
+	    {
+	      XSDAnnotation xsdAnnotation = getInputXSDAnnotation(false);
+        setInitialText(xsdAnnotation);
+      }
+      setListenerEnabled(true);
+	  }
+	}
+
+  
+  public void doHandleEvent(Event event)
+  {
+    Object input = getInput();
+    if (input != null)
+    {
+      XSDAnnotation xsdAnnotation = getInputXSDAnnotation(true);
+  
+      if (event.widget == documentationPage.getDocumentationText())
+      {
+        documentationPage.doHandleEvent(xsdAnnotation);
+      }
+      else if (event.widget == appInfoPage.getAppInfoText())
+      {
+        appInfoPage.doHandleEvent(xsdAnnotation);
+      }
+    }
+    
+  }
+  
+  protected XSDAnnotation getInputXSDAnnotation(boolean createIfNotExist)
+  {
+    XSDAnnotation xsdAnnotation = null;
+    
+    if (input instanceof XSDAttributeDeclaration)
+    {
+      XSDAttributeDeclaration xsdComp = (XSDAttributeDeclaration)input; 
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDAttributeGroupDefinition)
+    {
+      XSDAttributeGroupDefinition xsdComp = (XSDAttributeGroupDefinition)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDElementDeclaration)
+    {
+      XSDElementDeclaration xsdComp = (XSDElementDeclaration)input; 
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDNotationDeclaration)
+    {
+      XSDNotationDeclaration xsdComp =(XSDNotationDeclaration)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDXPathDefinition)
+    {
+      XSDXPathDefinition xsdComp = (XSDXPathDefinition)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDModelGroup)
+    {
+      XSDModelGroup xsdComp = (XSDModelGroup)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDModelGroupDefinition)
+    {
+      XSDModelGroupDefinition xsdComp = (XSDModelGroupDefinition)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDIdentityConstraintDefinition)
+    {
+      XSDIdentityConstraintDefinition xsdComp = (XSDIdentityConstraintDefinition)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDWildcard)
+    {
+      XSDWildcard xsdComp = (XSDWildcard)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDSchema)
+    {
+      XSDSchema xsdComp = (XSDSchema)input;
+      List list = xsdComp.getAnnotations();
+      if (list.size() > 0)
+      {
+        xsdAnnotation = (XSDAnnotation)list.get(0);
+      }
+      else
+      {
+        if (createIfNotExist && xsdAnnotation == null)
+        {
+          xsdAnnotation = factory.createXSDAnnotation();
+          if (xsdComp.getContents() != null)
+          {
+            xsdComp.getContents().add(0, xsdAnnotation);
+          }
+        }
+      }
+      return xsdAnnotation;
+    }
+    else if (input instanceof XSDFacet)
+    {
+      XSDFacet xsdComp = (XSDFacet)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDTypeDefinition)
+    {
+      XSDTypeDefinition xsdComp = (XSDTypeDefinition)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDInclude)
+    {
+      XSDInclude xsdComp = (XSDInclude)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDImport)
+    {
+      XSDImport xsdComp = (XSDImport)input;
+      xsdAnnotation = xsdComp.getAnnotation();
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        xsdComp.setAnnotation(xsdAnnotation);
+      }
+    }
+    else if (input instanceof XSDRedefine)
+    {
+      XSDRedefine xsdComp = (XSDRedefine)input;
+      List list = xsdComp.getAnnotations();
+      if (list.size() > 0)
+      {
+        xsdAnnotation = (XSDAnnotation)list.get(0);
+      }
+      else
+      {
+        if (createIfNotExist && xsdAnnotation == null)
+        {
+// ?
+        }
+      }
+      return xsdAnnotation;
+    }
+    else if (input instanceof XSDAnnotation)
+    {
+      xsdAnnotation = (XSDAnnotation)input;
+    }
+    
+    if (createIfNotExist)
+    {
+      formatAnnotation(xsdAnnotation);
+    }
+
+    return xsdAnnotation;
+  }
+  
+  private void formatAnnotation(XSDAnnotation annotation)
+  {
+    Element element = annotation.getElement();
+    XSDDOMHelper.formatChild(element);
+  }
+  
+
+  public boolean shouldUseExtraSpace()
+  {
+    return true;
+  }
+
+  public void dispose()
+  {
+    factory = null;
+  }
+  
+  private void setInitialText(XSDAnnotation an)
+  {
+    if (documentationPage != null)
+    {
+      documentationPage.setText(""); //$NON-NLS-1$
+    }
+    if (appInfoPage != null)
+    {
+      appInfoPage.setText(""); //$NON-NLS-1$
+    }
+
+    if (an != null)
+    {
+      Element element = an.getElement();
+      try
+      {
+        if (element.hasChildNodes())
+         {
+          // if the element is Text
+          Element docElement = (Element)domHelper.getChildNode(element, XSDConstants.DOCUMENTATION_ELEMENT_TAG);
+          if (docElement != null)
+          {
+            Node node = docElement.getFirstChild();
+            if (node instanceof CharacterData)
+            {
+              documentationPage.setText( ((CharacterData)node).getData());
+            }
+          }
+          
+          Element appInfoElement = (Element)domHelper.getChildNode(element, XSDConstants.APPINFO_ELEMENT_TAG);
+          if (appInfoElement != null)
+          {
+            Node node = appInfoElement.getFirstChild();
+            if (node instanceof CharacterData)
+            {
+              appInfoPage.setText( ((CharacterData)node).getData());
+            }
+          }
+
+        }
+      }
+      catch (Exception e)
+      {
+        
+      }
+    }
+  }
+  
+ 
+  class DocumentationWorkbookPage extends XSDWorkbookPage
+  {
+    Text documentationText;
+    Composite page1;
+    
+    public DocumentationWorkbookPage(XSDWorkbook workbook)
+    {
+      super(workbook);
+      this.getTabItem().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_DOCUMENTATION")); 
+    }
+
+    public void setText(String value)
+    {
+      documentationText.setText(value);
+    }
+    
+    public void setEnabled(boolean state)
+    {
+      page1.setEnabled(state);
+    }
+    
+    public String getText()
+    {
+      return documentationText.getText();
+    }
+    
+    public Text getDocumentationText()
+    {
+      return documentationText;
+    }
+    
+    public Control createControl (Composite parent)
+    {
+      page1 = getWidgetFactory().createFlatFormComposite(parent);
+      documentationText = getWidgetFactory().createText(page1, "", SWT.V_SCROLL | SWT.H_SCROLL); //$NON-NLS-1$
+      documentationText.addListener(SWT.Modify, AnnotationSection.this);
+
+      FormData data = new FormData();
+      data.left = new FormAttachment(0, 0);
+      data.right = new FormAttachment(100, 0);
+      data.top = new FormAttachment(0, 0);
+      data.bottom = new FormAttachment(100, 0);
+      documentationText.setLayoutData(data);
+                  
+      return page1;
+    }
+    
+    public void doHandleEvent(XSDAnnotation xsdAnnotation)
+    {
+      if (xsdAnnotation != null)
+      {
+        Element element = xsdAnnotation.getElement();
+        List documentationList = xsdAnnotation.getUserInformation();
+        Element documentationElement = null;
+        if (documentationList.size() > 0)
+        {
+          documentationElement = (Element)documentationList.get(0);
+        }
+        
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_DOCUMENTATION_COMMENT_CHANGE"), element); //$NON-NLS-1$
+        
+        if (documentationElement == null)
+        {
+          documentationElement = xsdAnnotation.createUserInformation(null);
+          element.appendChild(documentationElement);
+          XSDDOMHelper.formatChild(documentationElement);
+          // Defect in model....I create it but the model object doesn't appear to be updated
+          // Notice that it is fine for appinfo
+          xsdAnnotation.updateElement();
+          xsdAnnotation.setElement(element);
+        }
+        
+        String newValue = documentationText.getText();
+        if (documentationElement != null)
+        {
+          try
+          {
+            if (documentationElement.hasChildNodes())
+            {
+            // if the element is Text
+              Node node = documentationElement.getFirstChild();
+              if (node instanceof CharacterData)
+              {
+                ((CharacterData)node).setData(newValue);
+              }
+            }
+            else
+            {
+              if (newValue.length() > 0)
+              {
+                Node childNode = documentationElement.getOwnerDocument().createTextNode(newValue);
+                documentationElement.appendChild(childNode);
+              }
+            }
+          }
+          catch (Exception e)
+          {
+          
+          }
+        }
+        endRecording(element);
+      }    
+    }
+  }
+  
+  class AppInfoWorkbookPage extends XSDWorkbookPage
+  {
+    Text appInfoText;
+    Composite page2;
+    
+    public AppInfoWorkbookPage(XSDWorkbook workbook)
+    {
+      super(workbook);
+      this.getTabItem().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_APP_INFO"));
+    }
+    
+    public void setText(String value)
+    {
+      appInfoText.setText(value);
+    }
+
+    public String getText()
+    {
+      return appInfoText.getText();
+    }
+
+    public Text getAppInfoText()
+    {
+      return appInfoText;
+    }
+
+    public void setEnabled(boolean state)
+    {
+      page2.setEnabled(state);
+    }
+
+    public Control createControl (Composite parent)
+    {
+      page2 = getWidgetFactory().createFlatFormComposite(parent);
+      appInfoText = getWidgetFactory().createText(page2, "", SWT.V_SCROLL | SWT.H_SCROLL); //$NON-NLS-1$
+      appInfoText.addListener(SWT.Modify, AnnotationSection.this);
+      
+      FormData data = new FormData();
+      data.left = new FormAttachment(0, 0);
+      data.right = new FormAttachment(100, 0);
+      //data.top = new FormAttachment(documentationText, +ITabbedPropertyConstants.HSPACE);
+      data.top = new FormAttachment(0, 0);
+      data.bottom = new FormAttachment(100, 0);
+      appInfoText.setLayoutData(data);
+
+      return page2;
+    }
+    
+    public void doHandleEvent(XSDAnnotation xsdAnnotation)
+    {
+      if (xsdAnnotation != null)
+      {
+        Element element = xsdAnnotation.getElement();
+        List appInfoList = xsdAnnotation.getApplicationInformation();
+        
+        Element appInfoElement = null;
+        if (appInfoList.size() > 0)
+        {
+          appInfoElement = (Element)appInfoList.get(0);
+        }
+
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_COMMENT_CHANGE"), element); //$NON-NLS-1$
+        if (appInfoElement == null)
+        {
+          appInfoElement = xsdAnnotation.createApplicationInformation(null);
+          element.appendChild(appInfoElement);
+          XSDDOMHelper.formatChild(appInfoElement);
+        }
+        
+        String newValue = appInfoText.getText();
+        if (appInfoElement != null)
+        {
+          try
+          {
+            if (appInfoElement.hasChildNodes())
+            {
+              // if the element is Text
+              Node node = appInfoElement.getFirstChild();
+              if (node instanceof CharacterData)
+              {
+                ((CharacterData)node).setData(newValue);
+              }
+            }
+            else
+            {
+              if (newValue.length() > 0)
+              {
+                Node childNode = appInfoElement.getOwnerDocument().createTextNode(newValue);
+                appInfoElement.appendChild(childNode);
+              }
+            }
+          }
+          catch (Exception e)
+          {
+
+          }
+          endRecording(element);          
+        }
+      }    
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSectionDescriptor.java
new file mode 100644
index 0000000..93bd523
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSectionDescriptor.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDAnnotation;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFacet;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.XSDXPathDefinition;
+
+public class AnnotationSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public AnnotationSectionDescriptor()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.annotation";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDAnnotation.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new AnnotationSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.documentation";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDAttributeDeclaration ||
+          object instanceof XSDAttributeGroupDefinition ||
+          object instanceof XSDElementDeclaration ||
+          object instanceof XSDNotationDeclaration ||
+          object instanceof XSDXPathDefinition ||
+          object instanceof XSDModelGroup ||
+          object instanceof XSDModelGroupDefinition ||
+          object instanceof XSDIdentityConstraintDefinition ||
+          object instanceof XSDWildcard ||
+          object instanceof XSDSchema ||
+          object instanceof XSDFacet || 
+          object instanceof XSDTypeDefinition ||
+          object instanceof XSDAnnotation ||
+          object instanceof XSDSchemaDirective)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewContentProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewContentProvider.java
new file mode 100644
index 0000000..b5ffe41
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewContentProvider.java
@@ -0,0 +1,289 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDAbstractAdapter;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+
+
+public class AttributesViewContentProvider implements ITreeContentProvider, ITableLabelProvider, ILabelProvider, INotifyChangedListener
+{
+  IEditorPart editorPart;
+
+  static XSDModelAdapterFactoryImpl xsdModelAdapterFactory = XSDModelAdapterFactoryImpl.getInstance();
+  static XSDAdapterFactoryLabelProvider adapterFactoryLabelProvider = new XSDAdapterFactoryLabelProvider(xsdModelAdapterFactory);  // XSDTextEditor.getLabelProvider();
+  
+  XSDAbstractAdapter elementAdapter;
+  XSDAbstractAdapter ctAdapter;
+  XSDComplexTypeDefinition ct;
+  
+  /**
+   * 
+   */
+  public AttributesViewContentProvider()
+  {
+    super();
+//    if (xsdModelAdapterFactory instanceof IChangeNotifier)
+//    {
+//      ((IChangeNotifier)xsdModelAdapterFactory).addListener(this);
+//    }
+
+  }
+  
+  Viewer attributesViewer;
+  public AttributesViewContentProvider(IEditorPart editorPart, Viewer viewer)
+  {
+    super();
+    this.editorPart = editorPart;
+    this.attributesViewer = viewer;
+  }
+  
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+   */
+  public Object[] getChildren(Object inputElement)
+  {
+    List list = new ArrayList();
+    ct = null;
+    if (inputElement instanceof XSDElementDeclaration)
+    {
+      XSDElementDeclaration xsdElement = (XSDElementDeclaration)inputElement;
+      
+      if (elementAdapter != null)
+      {
+        elementAdapter.removeListener((INotifyChangedListener)this);
+      }
+      elementAdapter = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(xsdElement, xsdModelAdapterFactory);
+      elementAdapter.addListener((INotifyChangedListener)this);
+
+      if (xsdElement.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)
+      {
+        ct = (XSDComplexTypeDefinition)xsdElement.getAnonymousTypeDefinition();
+      }
+      else
+      {
+        XSDTypeDefinition xsdType = xsdElement.getTypeDefinition();
+        if (xsdType instanceof XSDComplexTypeDefinition)
+        {
+          ct = (XSDComplexTypeDefinition)xsdType;
+        }
+      }
+    }
+    else if (inputElement instanceof XSDComplexTypeDefinition)
+    {
+      ct = (XSDComplexTypeDefinition)inputElement;
+    }
+
+    if (ct != null)
+    {
+      if (ctAdapter != null)
+      {
+        ctAdapter.removeListener((INotifyChangedListener)this);
+      }
+      ctAdapter = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(ct, xsdModelAdapterFactory);
+      ctAdapter.addListener((INotifyChangedListener)this);
+      
+      XSDWildcard wildcard = ct.getAttributeWildcardContent();
+      if (wildcard != null)
+      {
+        list.add(wildcard);
+      }
+      
+      Iterator i = ct.getAttributeContents().iterator();
+      while (i.hasNext())
+      {
+        XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent)i.next();
+        if (attributeGroupContent instanceof XSDAttributeGroupDefinition)
+        {
+          XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition)attributeGroupContent;
+          XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(attributeGroupDefinition, xsdModelAdapterFactory);
+          a.removeListener((INotifyChangedListener)this);
+ 	        a.addListener((INotifyChangedListener)this);
+ 	        list.add(attributeGroupDefinition);
+        }
+        else if (attributeGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attributeUse = (XSDAttributeUse)attributeGroupContent;
+          
+          XSDAttributeDeclaration attribute = attributeUse.getAttributeDeclaration();
+          
+          boolean isRef = XSDDOMHelper.isAttributeRef(ct.getElement(), attribute.getQName(), attribute.getTargetNamespace());
+         
+          if (isRef)
+          {
+            XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(attributeUse, xsdModelAdapterFactory);            
+            a.removeListener((INotifyChangedListener)this);
+   	        a.addListener((INotifyChangedListener)this);
+            list.add(attributeUse);
+          }
+          else
+          {
+            XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(attribute, xsdModelAdapterFactory);            
+            a.removeListener((INotifyChangedListener)this);
+   	        a.addListener((INotifyChangedListener)this);
+            list.add(attribute);
+          }
+        }
+      }
+    }
+    return list.toArray();
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+   */
+  public Object getParent(Object element)
+  {
+    return null;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+   */
+  public boolean hasChildren(Object element)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+   */
+  public Image getColumnImage(Object element, int columnIndex)
+  {
+    if (element instanceof XSDConcreteComponent)
+    {
+	    return adapterFactoryLabelProvider.getImage((XSDConcreteComponent)element);
+    }
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+   */
+  public String getColumnText(Object element, int columnIndex)
+  {
+    if (element instanceof XSDConcreteComponent)
+    {
+	    XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt((XSDConcreteComponent)element, xsdModelAdapterFactory);
+	    return a.getText((XSDConcreteComponent)element);
+    }
+    return ""; 
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+   */
+  public Image getImage(Object element)
+  {
+    if (element instanceof XSDConcreteComponent)
+    {
+	    return adapterFactoryLabelProvider.getImage((XSDConcreteComponent)element);
+    }
+    return null;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+   */
+  public String getText(Object element)
+  {
+    if (element instanceof XSDConcreteComponent)
+    {
+	    XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt((XSDConcreteComponent)element, xsdModelAdapterFactory);
+	    return a.getText((XSDConcreteComponent)element);
+    }
+    return ""; 
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+   */
+  public Object[] getElements(Object inputElement)
+  {
+    return getChildren(inputElement);
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+   */
+  public void dispose()
+  {
+    if (elementAdapter != null)
+    {
+      elementAdapter.removeListener(this);
+    }
+    if (ctAdapter != null)
+    {
+      ctAdapter.removeListener((INotifyChangedListener)this);
+    }
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+   */
+  Viewer viewer;
+  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+  {
+//    System.out.println("input changed " + oldInput + "\n" + newInput);
+    this.viewer = viewer;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+   */
+  public void addListener(ILabelProviderListener listener)
+  {
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+   */
+  public boolean isLabelProperty(Object element, String property)
+  {
+    return false;
+  }
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+   */
+  public void removeListener(ILabelProviderListener listener)
+  {
+  }
+
+  public void notifyChanged(Notification notification)
+  {
+    if (attributesViewer != null && !attributesViewer.getControl().isDisposed())
+    {
+      if (attributesViewer instanceof StructuredViewer)
+      {
+        attributesViewer.refresh();
+      }
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSection.java
new file mode 100644
index 0000000..0c830ff
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSection.java
@@ -0,0 +1,419 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.XSDMenuListener;
+import org.eclipse.wst.xsd.ui.internal.actions.AddAttributeAction;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateAttributeAndRequired;
+import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
+import org.eclipse.wst.xsd.ui.internal.actions.DeleteAction;
+import org.eclipse.wst.xsd.ui.internal.properties.XSDPropertySourceProvider;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class AttributesViewSection extends AbstractSection implements ISelectionChangedListener
+{
+  AttributeTableTreeViewer viewer;
+  AttributesPropertySheetPage propertySheetPage;
+
+  /**
+   * 
+   */
+  public AttributesViewSection()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent,	TabbedPropertySheetWidgetFactory factory) {
+		super.createControls(parent, factory);
+		
+		composite =	getWidgetFactory().createFlatFormComposite(parent);
+    SashForm sashForm = new SashForm(composite, SWT.HORIZONTAL);
+
+    FormData data = new FormData();
+    data.top = new FormAttachment(0, 0);
+    data.left = new FormAttachment(0, 0);
+    data.right = new FormAttachment(100, 0);
+    data.bottom = new FormAttachment(100, 0);
+    sashForm.setLayoutData(data);
+    
+    viewer = new AttributeTableTreeViewer(sashForm);
+    propertySheetPage = new AttributesPropertySheetPage();
+    propertySheetPage.createControl(sashForm);
+
+		AttributesViewContentProvider provider = new AttributesViewContentProvider(getActiveEditor(), viewer); 
+		viewer.setContentProvider(provider);
+
+		viewer.setLabelProvider(provider);
+		viewer.addSelectionChangedListener(this);
+
+    propertySheetPage.setPropertySourceProvider(new XSDPropertySourceProvider());
+	}
+
+  public void setInput(IWorkbenchPart part, ISelection selection)
+  {
+    super.setInput(part, selection);
+    if (input instanceof XSDElementDeclaration)
+    {
+      XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)input;
+      if (elementDeclaration.isElementDeclarationReference())
+      {
+        input = elementDeclaration.getResolvedElementDeclaration();
+        
+        isReadOnly = (!(elementDeclaration.getResolvedElementDeclaration().getRootContainer() == xsdSchema));
+      }
+    }
+  }
+  
+	public void selectionChanged(SelectionChangedEvent event)
+	{
+	  propertySheetPage.selectionChanged(part, event.getSelection());
+	}
+	
+	public void selectionChanged(IWorkbenchPart part, ISelection selection)
+	{
+	}
+
+  public void aboutToBeShown()
+  {
+		refresh();
+  }
+	
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+    if (isReadOnly)
+    {
+      composite.setEnabled(false);
+    }
+    else
+    {
+      composite.setEnabled(true);
+    }
+    setListenerEnabled(false);
+	  if (viewer != null)
+	  {
+      viewer.setInput(getInput());
+      viewer.refresh();
+	  }
+    setListenerEnabled(true);
+	}
+	
+  public void dispose()
+  {
+//    if (propertySheetPage != null)
+//    {
+//      propertySheetPage.dispose();
+//      propertySheetPage = null;
+//    }
+//    if (viewer != null)
+//    {
+//      viewer = null;
+//    }
+  }
+
+  public boolean shouldUseExtraSpace()
+  {
+    return true;
+  }
+
+	
+	class AttributeTableTreeViewer extends TreeViewer // ExtendedTableTreeViewer
+	{
+	  public AttributeTableTreeViewer(Composite c)
+	  {
+	    super(c);
+	    
+	    MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
+	    menuManager.setRemoveAllWhenShown(true);
+	    Menu menu = menuManager.createContextMenu(getTree());
+	    getTree().setMenu(menu);
+
+	    XSDAttributeMenuListener menuListener = new XSDAttributeMenuListener(this);
+	    menuManager.addMenuListener(menuListener);
+
+	  }
+	  
+	  public class XSDAttributeMenuListener extends XSDMenuListener
+	  {
+	    public XSDAttributeMenuListener(TreeViewer viewer)
+	    {
+	      super(viewer);
+        selectionProvider = viewer;
+       
+	      deleteAction = new DeleteAction(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE"), AttributesViewSection.this.getActiveEditor(), getXSDSchema());
+        deleteAction.setSelectionProvider(selectionProvider);
+        selectionProvider.addSelectionChangedListener(deleteAction);
+	    }
+	    
+	    protected XSDSchema getXSDSchema()
+	    {
+        return xsdSchema;
+//        return getSchema();
+//	      XSDConcreteComponent xsdInput = (XSDConcreteComponent)AttributesViewSection.this.getInput();
+//	      return xsdInput.getSchema();
+	    }
+	    
+	    protected Object getSelectedElement()
+	    {
+        XSDComponent xsdInput = (XSDComponent)AttributesViewSection.this.getInput();
+        
+        if (xsdInput instanceof XSDElementDeclaration)
+        {
+          XSDElementDeclaration xsdElement = (XSDElementDeclaration)xsdInput;
+          XSDTypeDefinition xsdType = xsdElement.getType();
+          if (xsdType instanceof XSDComplexTypeDefinition)
+          {
+            XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)xsdType;
+            return ct;
+          }
+          return xsdElement;
+        }
+        else if (xsdInput instanceof XSDComplexTypeDefinition)
+        {
+          return xsdInput;
+        }
+
+        return null;
+	    }
+      
+      public void menuAboutToShow(IMenuManager manager)
+      {
+        updateXSDSchema();
+        if (xsdSchema == null)
+        {
+          return;
+        }
+
+        Object selectedElementObj = getSelectedElement();
+        
+        Element selectedElement = null;
+
+        if (selectedElementObj instanceof XSDComplexTypeDefinition)
+        {
+          selectedElement = ((XSDComplexTypeDefinition)selectedElementObj).getElement();
+        }
+        
+        addContextItems(manager, selectedElement, null);
+
+        if (!selectionProvider.getSelection().isEmpty())
+        {
+          // Add context menu items for selected element
+//          addContextItems(manager, selectedElement, null);
+          
+          manager.add(new Separator());
+          if (deleteAction != null)
+          {
+            deleteAction.setXSDSchema(getXSDSchema());
+            manager.add(deleteAction);
+          }
+        }
+      }
+	    
+	    protected void addContextItems(IMenuManager manager, Element parent, Node relativeNode)
+	    {
+	      ArrayList attributes = null;
+	      if (XSDDOMHelper.inputEquals(parent, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+	      { //
+	        boolean complexOrSimpleContentExists = false;
+	        boolean anyAttributeExists = false;
+	        Element contentNode = null;
+	        Node anyAttributeNode = null;
+	        NodeList children = parent.getChildNodes();
+	        
+	        for (int i=0; i < children.getLength(); i++)
+	        {
+	          Node child = children.item(i);
+	          if (child != null && child instanceof Element)
+	          {
+	            if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
+	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.ALL_ELEMENT_TAG, false) ||
+	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
+	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.GROUP_ELEMENT_TAG, true) ||
+	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false) ||
+	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+	            {
+	              contentNode = (Element)child;
+
+	              if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false) ||
+	                  XSDDOMHelper.inputEquals((Element)child, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+	              {
+	                complexOrSimpleContentExists = true;
+	              }
+	            } 
+	            else if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
+	            {
+	              anyAttributeExists = true;
+	              anyAttributeNode = child;
+	            }
+	          }
+	        }
+
+	        if (anyAttributeExists)
+	        {
+	          if (!complexOrSimpleContentExists)
+	          {
+	            attributes = new ArrayList();
+	            attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
+	                                            getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+	            attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+	            addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
+	            attributes = null;
+//	   ARE ATTRIBUTE GROUPS ALLOWED ?
+//	            addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, "_UI_ACTION_ADD_ATTRIBUTE_GROUP", attributes, parent, anyAttributeNode);
+	            addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
+	            addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
+	          }
+	        }
+	        else
+	        {
+	          if (!complexOrSimpleContentExists)
+	          {
+	            attributes = new ArrayList();
+	            attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
+	                                            getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+	            attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+	            addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+	            attributes = null;
+	            addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
+	            addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
+	            attributes = null;
+	            addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
+	          }
+            else
+            {
+              // new model based add attribute action
+              XSDComplexTypeDefinition xsdCT = (XSDComplexTypeDefinition)getXSDSchema().getCorrespondingComponent(parent);
+              manager.add(new AddAttributeAction(XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), xsdCT));
+
+              Element derivedByElement = domHelper.getDerivedByElement(contentNode);
+              if (derivedByElement != null)
+              {
+                attributes = null;
+                addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), derivedByElement, derivedByElement.getLastChild());
+                addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), derivedByElement, derivedByElement.getLastChild());
+                attributes = null;
+                addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, derivedByElement, derivedByElement.getLastChild());
+              }
+            }
+	        }
+	      }
+	      else if (parent == null) {	      
+	      	XSDElementDeclaration ed = (XSDElementDeclaration)input;      
+	      
+	      	// Add Attribute
+	      	attributes = new ArrayList();
+	      	attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
+                                          getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
+	      	attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
+	      	manager.add(new CreateAttributeAndRequired(XSDConstants.ATTRIBUTE_ELEMENT_TAG,
+					   XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"),
+					   attributes,
+					   getXSDSchema(),
+					   selectionProvider,
+					   ed));
+	      	
+	      	// Add Attribute Reference
+	      	attributes = null;
+	      	attributes = new ArrayList();
+	        String ref = getFirstGlobalElementTagName(XSDConstants.ATTRIBUTE_ELEMENT_TAG);
+	        attributes.add(new DOMAttribute(XSDConstants.REF_ATTRIBUTE, ref));
+	      
+	        Action action = new CreateAttributeAndRequired(XSDConstants.ATTRIBUTE_ELEMENT_TAG,
+					   XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"),
+					   attributes,
+					   getXSDSchema(),
+					   selectionProvider,
+					   ed);
+	        manager.add(action);
+	        action.setEnabled(ref != null);
+
+	        // Add Attribute Group Reference
+	        attributes = null;
+	      	attributes = new ArrayList();
+	        ref = getFirstGlobalElementTagName(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG);
+	        attributes.add(new DOMAttribute(XSDConstants.REF_ATTRIBUTE, ref));
+	        
+	        action = new CreateAttributeAndRequired(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG,
+					   XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"),
+					   attributes,
+					   getXSDSchema(),
+					   selectionProvider,
+					   ed);
+
+	      	manager.add(action);
+	      	action.setEnabled(ref != null);
+	      	
+	      	// Add Any Attribute
+	      	attributes = null;
+	      	if (getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false) == null)
+	        {
+	      		action = new CreateAttributeAndRequired(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG,
+						   XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"),
+						   attributes,
+						   getXSDSchema(),
+						   selectionProvider,
+						   ed);
+	      		manager.add(action);
+	         }
+	      }
+	    }
+	  }
+	}
+	
+	class AttributesPropertySheetPage extends PropertySheetPage implements INotifyChangedListener
+	{
+	  public AttributesPropertySheetPage()
+	  {
+	    super();
+	  }
+	  
+	  public void notifyChanged(Notification notification)
+	  {
+	    System.out.println("Notification");
+	  }
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSectionDescriptor.java
new file mode 100644
index 0000000..2156ff9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSectionDescriptor.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+
+public class AttributesViewSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public AttributesViewSectionDescriptor()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.attributes";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDElementDeclaration.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new AttributesViewSection();
+  }
+
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDElementDeclaration)
+      {
+// Remove this to fix bug 3870 Element references should have the same properties as elements 
+//        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)object;
+//        if (elementDeclaration.isElementDeclarationReference())
+//        {
+//          return false;
+//        }
+        return true;
+      }
+      else if (object instanceof XSDComplexTypeDefinition)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.attributes";
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
+   */
+  public String getAfterSection()
+  {
+    return "";
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/CommonDirectivesSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/CommonDirectivesSection.java
new file mode 100644
index 0000000..6a89da7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/CommonDirectivesSection.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDParser;
+
+public class CommonDirectivesSection extends AbstractSection
+{
+  Text schemaLocationText;
+  Button wizardButton;
+  StyledText errorText;
+  Color red;
+
+  // TODO: common up code with XSDSelectIncludeFileWizard
+  public void doHandleEvent(Event event)
+  {
+    errorText.setText("");
+    if (event.type == SWT.Modify)
+    {
+      if (event.widget == schemaLocationText)
+      {
+        String errorMessage = "";
+        boolean isValidSchemaLocation = true;
+        String xsdModelFile = schemaLocationText.getText();
+        String namespace = "";
+        XSDSchema externalSchema = null;
+        
+        if (xsdModelFile.length() == 0)
+        {
+          handleSchemaLocationChange(xsdModelFile, "", null);
+          return;
+        }
+
+        try
+        {
+          IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
+
+          URI newURI = URI.createURI(xsdModelFile);
+          String xsdFile = URIHelper.getRelativeURI(newURI.toString(), currentIFile.getFullPath().toString());
+          final String normalizedXSDFile = URIHelper.normalize(xsdFile, currentIFile.getLocation().toString(), "");
+          
+          XSDParser parser = new XSDParser();
+          parser.parse(normalizedXSDFile);
+          
+          externalSchema = parser.getSchema();
+
+          if (externalSchema != null)
+          {
+            String extNamespace = externalSchema.getTargetNamespace();
+            if (extNamespace == null) extNamespace = "";
+            namespace = extNamespace;
+            
+            if (externalSchema.getDiagnostics() != null &&
+                externalSchema.getDiagnostics().size() > 0)
+            {
+              isValidSchemaLocation = false;
+              errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdModelFile);
+            }  
+            else
+            {
+              String currentNameSpace = getSchema().getTargetNamespace();
+              if (input instanceof XSDInclude || input instanceof XSDRedefine)
+              {  
+                // Check the namespace to make sure they are the same as current file
+                if (extNamespace != null)
+                {
+                  if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
+                  {
+                    errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_DIFFERENT_NAME_SPACE", xsdModelFile);
+                    isValidSchemaLocation = false;
+                  }
+                }
+              }
+              else
+              {  
+                // Check the namespace to make sure they are different from the current file
+                if (extNamespace != null)
+                {
+                  if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
+                  {
+                    errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_SAME_NAME_SPACE", xsdModelFile);
+                    isValidSchemaLocation = false;
+                  }
+                }
+              }
+            }
+          }
+          else
+          {
+            errorMessage = "Invalid file";
+            isValidSchemaLocation = false;
+          }
+        }
+        catch(Exception e)
+        {
+          errorMessage = "Invalid file";
+          isValidSchemaLocation = false;
+        }
+        finally
+        {
+          if (!isValidSchemaLocation)
+          {
+            errorText.setText(errorMessage);
+            int length = errorText.getText().length();
+            red = new Color(null, 255, 0, 0);
+            StyleRange style = new StyleRange(0, length, red, schemaLocationText.getBackground());
+            errorText.setStyleRange(style);
+          }
+          else
+          {
+            handleSchemaLocationChange(xsdModelFile, namespace, externalSchema);          
+          }
+        }
+      }
+    }
+  }
+  
+  protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
+  {
+    
+  }
+
+  
+  public void dispose()
+  {
+    super.dispose();
+    if (red != null)
+    {
+      red.dispose();
+      red = null;
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSection.java
new file mode 100644
index 0000000..e5e9ca8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSection.java
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.SetBaseTypeAction;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSpecification;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class ComplexTypeSection extends AbstractSection
+{
+  private String derivedByChoicesComboValues[] =
+  {
+        "",
+        XSDConstants.RESTRICTION_ELEMENT_TAG,
+        XSDConstants.EXTENSION_ELEMENT_TAG
+  };
+
+  /**
+   * 
+   */
+  public ComplexTypeSection()
+  {
+    super();
+  }
+
+	Text baseTypeCombo;
+	CCombo derivedByCombo;
+	Button button;
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite =	getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+		String textBaseType = XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON");
+		String textDerivedType = XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY");
+		GC gc = new GC(parent);
+		int xoffset = Math.max(100, gc.textExtent(textBaseType).x + 20); // adds 20 due to borders
+		xoffset = Math.max(xoffset, gc.textExtent(textDerivedType).x + 20); // adds 20 due to borders
+		gc.dispose();
+
+		baseTypeCombo = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
+		CLabel baseTypeLabel = getWidgetFactory().createCLabel(composite, textBaseType); //$NON-NLS-1$ 
+
+    button = getWidgetFactory().createButton(composite, "", SWT.PUSH);
+    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
+    baseTypeCombo.setEditable(false);
+    baseTypeCombo.addListener(SWT.Modify, this);
+
+		data = new FormData();
+		data.left = new FormAttachment(0, xoffset);
+    data.right = new FormAttachment(button, 0);
+		baseTypeCombo.setLayoutData(data);
+
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(baseTypeCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(button, 0, SWT.CENTER);
+		baseTypeLabel.setLayoutData(data);
+
+    button.addSelectionListener(this);
+		data = new FormData();
+    data.left = new FormAttachment(100, -rightMarginSpace + 2);
+		data.right = new FormAttachment(100,0);
+    data.top = new FormAttachment(baseTypeCombo, 0, SWT.CENTER);
+		button.setLayoutData(data);
+		
+		derivedByCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
+		data = new FormData();
+		data.left = new FormAttachment(0, xoffset);
+		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(baseTypeCombo, +ITabbedPropertyConstants.VSPACE);
+		derivedByCombo.setLayoutData(data);
+		derivedByCombo.setItems(derivedByChoicesComboValues);
+		derivedByCombo.addSelectionListener(this);
+
+		CLabel derivedByLabel = getWidgetFactory().createCLabel(composite, textDerivedType); //$NON-NLS-1$
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(derivedByCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(derivedByCombo, 0, SWT.CENTER);
+		derivedByLabel.setLayoutData(data);
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+	  setListenerEnabled(false);
+    
+    if (isReadOnly)
+    {
+      composite.setEnabled(false);
+    }
+    else
+    {
+      composite.setEnabled(true);
+    }
+
+	  Object input = getInput();
+	  baseTypeCombo.setText(""); //$NON-NLS-1$
+	  
+    if (input instanceof XSDComplexTypeDefinition)
+    {
+      XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition)input;
+      Element element = complexType.getElement();
+      Element contentModelElement = getDomHelper().getContentModelFromParent(element);    
+      String baseType = getDomHelper().getBaseType(contentModelElement);
+    
+      derivedByCombo.setText(getDomHelper().getDerivedByName(contentModelElement));
+
+      if (baseType != null)
+      {
+        baseTypeCombo.setText(baseType);
+      }
+    }	  
+	  
+	  setListenerEnabled(true);
+	}
+	
+  /**
+   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
+   */
+  public void widgetSelected(SelectionEvent e)
+  {
+    XSDComplexTypeDefinition xsdComplexType = (XSDComplexTypeDefinition)getInput();
+    Element ctElement = xsdComplexType.getElement();
+    if (e.widget == button)
+    {
+	    Shell shell = Display.getCurrent().getActiveShell();
+	    Element element = null;
+	    if (xsdComplexType.getContent() != null)
+	    {
+  	    element = ((XSDComplexTypeDefinition)getInput()).getContent().getElement();
+	    }
+	    
+//	    SimpleContentBaseTypeOptionsDialog dialog = new SimpleContentBaseTypeOptionsDialog(shell, element, BASE_TYPE_ID, ((XSDConcreteComponent)getInput()).getSchema());
+//	    dialog.setBlockOnOpen(true);
+//	    dialog.create();
+//	    int result = dialog.open();
+        
+        IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
+        
+        Object input = getInput();
+        XSDSchema schema = null;
+        if (input instanceof XSDConcreteComponent) {
+            schema = ((XSDConcreteComponent) input).getSchema();
+        }
+        
+        XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
+        XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
+        provider.setDialog(dialog);
+        dialog.setBlockOnOpen(true);
+        dialog.create();
+        int result = dialog.open();
+   
+	    if (result == Window.OK)
+	    {
+            XMLComponentSpecification spec = dialog.getSelection();            
+            XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
+            helper.addImportIfNecessary(element, spec);
+            
+            String typeString = helper.getPrefixedTypeName(spec);
+            String derivedBy = getDomHelper().getDerivedByName(element);
+            SetBaseTypeAction setBaseTypeAction = new SetBaseTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_BASE_TYPE")); //$NON-NLS-1$
+            setBaseTypeAction.setXSDSchema(xsdSchema);
+            setBaseTypeAction.setComplexTypeElement(ctElement);
+            setBaseTypeAction.setType(typeString);
+            setBaseTypeAction.setDerivedBy(derivedBy);
+            setBaseTypeAction.performAction();
+
+	    }
+
+//      refresh();
+    }
+    else if (e.widget == derivedByCombo)
+    {
+      Element contentModelElement = getDomHelper().getContentModelFromParent(ctElement);
+      String baseType = getDomHelper().getBaseType(contentModelElement);
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_DERIVEDBY_CHANGE"), ctElement); //$NON-NLS-1$
+      if (contentModelElement != null)
+      {
+        getDomHelper().changeDerivedByType(contentModelElement, derivedByCombo.getText(), baseType);
+      }
+      endRecording(ctElement);
+    }
+  }
+
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+   */
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSectionDescriptor.java
new file mode 100644
index 0000000..56979a7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSectionDescriptor.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+
+public class ComplexTypeSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public ComplexTypeSectionDescriptor()
+  {
+    super();
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDComplexTypeDefinition.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new ComplexTypeSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDComplexTypeDefinition)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+  
+  public String getAfterSection()
+  {
+    return "org.eclipse.wst.xsdeditor.section.name";
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSection.java
new file mode 100644
index 0000000..266fb24
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSection.java
@@ -0,0 +1,424 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.AddEnumsAction;
+import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDEnumerationFacet;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDVariety;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class EnumerationsSection extends AbstractSection
+{
+  private EnumerationsTableViewer enumerationsTable;
+  private Button addButton;
+  private Button addManyButton;
+  private Button deleteButton;
+  
+  /**
+   * 
+   */
+  public EnumerationsSection()
+  {
+    super();
+  }
+  
+  public void widgetSelected(SelectionEvent e)
+  {
+    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
+    Element element = st.getElement();
+    if (e.widget == addButton || e.widget == addManyButton)
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      
+      int variety = st.getVariety().getValue();
+      Node varietyElement = null;
+      if (variety == XSDVariety.ATOMIC)
+      {
+        varietyElement = helper.getChildNode(element, XSDConstants.RESTRICTION_ELEMENT_TAG);
+      }
+      else if (variety == XSDVariety.UNION)
+      {
+        varietyElement = helper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
+      }
+      else if (variety == XSDVariety.LIST)
+      {
+        varietyElement = helper.getChildNode(element, XSDConstants.LIST_ELEMENT_TAG);
+      }
+            
+      if (varietyElement != null)
+      {
+        if (e.widget == addButton)
+        {
+          java.util.List attributes = new ArrayList();
+          
+          List enumList = st.getEnumerationFacets();
+          StringBuffer newName = new StringBuffer("value1"); //$NON-NLS-1$
+          int suffix = 1;
+          for (Iterator i = enumList.iterator(); i.hasNext(); )
+          {
+            XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)i.next();
+            String value = enumFacet.getLexicalValue();
+            if (value != null)
+            {
+              if (value.equals(newName.toString()))
+              {
+                suffix++;
+                newName = new StringBuffer("value" + String.valueOf(suffix)); //$NON-NLS-1$
+              }
+            }
+          }
+          attributes.add(new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newName.toString()));
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUM"), element); //$NON-NLS-1$
+          Action action = getNewElementAction(XSDConstants.ENUMERATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUM"), attributes, (Element)varietyElement, null);
+          action.run();
+          st.setElement(element);
+
+          endRecording(element);
+          enumerationsTable.refresh();
+          int newItemIndex = enumerationsTable.getTable().getItemCount() - 1;
+          enumerationsTable.editElement(enumerationsTable.getElementAt(newItemIndex), 0);
+          attributes = null;
+        }
+        else if (e.widget == addManyButton)
+        {
+          AddEnumsAction action = new AddEnumsAction(XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUMS")); //$NON-NLS-1$
+          action.setElementTag(XSDConstants.ENUMERATION_ELEMENT_TAG);
+          action.setAttributes(null);
+          action.setParentNode((Element)varietyElement);
+          action.setRelativeNode(null);
+          action.setDescription(XSDEditorPlugin.getXSDString("_UI_ENUMERATIONS_DIALOG_TITLE")); //$NON-NLS-1$
+          action.run();
+          st.setElement(element);
+          enumerationsTable.refresh();
+        }
+      }
+    }
+    else if (e.widget == deleteButton)
+    {
+      StructuredSelection selection = (StructuredSelection)enumerationsTable.getSelection();
+      if (selection != null)
+      {
+        Iterator i = selection.iterator();
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_ENUMERATION"), element); //$NON-NLS-1$
+        while (i.hasNext())
+        {
+          Object obj = i.next();
+          if (obj != null)
+          {
+            if (obj instanceof XSDEnumerationFacet)
+            {
+              XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)obj;
+    
+              // I have to update using DOM
+              XSDDOMHelper.removeNodeAndWhitespace(enumFacet.getElement());            
+              
+            }
+          }
+        }
+        enumerationsTable.refresh();
+        st.setElement(element);
+        endRecording(element);
+      }
+    }
+    else if (e.widget == enumerationsTable.getTable())
+    {
+      StructuredSelection selection = (StructuredSelection)enumerationsTable.getSelection();
+      if (selection.getFirstElement() != null)
+      {
+        deleteButton.setEnabled(true);
+      }
+      else
+      {
+        deleteButton.setEnabled(false);
+      }
+    }
+
+  }
+
+  public void widgetDefaultSelected(SelectionEvent e)
+  {
+    
+  }
+  
+  /**
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+   */
+  public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+  {
+    super.createControls(parent, factory);
+
+    composite = getWidgetFactory().createFlatFormComposite(parent);
+    FormData data;
+
+    enumerationsTable = new EnumerationsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
+    enumerationsTable.setInput(getInput());
+    Table table = enumerationsTable.getTable();
+    table.addSelectionListener(this);
+    
+    addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"), SWT.PUSH); //$NON-NLS-1$
+    addManyButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL") + "...", SWT.PUSH); //$NON-NLS-1$
+    deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH); //$NON-NLS-1$
+
+    FormData data2 = new FormData();
+    data2.top = new FormAttachment(0, 0);
+    data2.left = new FormAttachment(100, -100);
+    data2.right = new FormAttachment(100, 0);
+//    data2.width = 50;
+    addButton.setLayoutData(data2);
+    addButton.addSelectionListener(this);
+
+    data = new FormData();
+    data.left = new FormAttachment(addButton, 0, SWT.LEFT);
+    data.right = new FormAttachment(100, 0);
+    data.top = new FormAttachment(addButton, 0);
+    addManyButton.setLayoutData(data);
+    addManyButton.addSelectionListener(this);
+
+    data = new FormData();
+    data.left = new FormAttachment(addButton, 0, SWT.LEFT);
+    data.right = new FormAttachment(100, 0);
+    data.top = new FormAttachment(addManyButton, 0);
+    deleteButton.setLayoutData(data);
+    deleteButton.setEnabled(false);
+    deleteButton.addSelectionListener(this);
+
+    data = new FormData();
+    data.top = new FormAttachment(0, 0);
+    data.left = new FormAttachment(0, 0);
+    data.right = new FormAttachment(addButton, 0);
+    data.bottom = new FormAttachment(100, 0);
+    data.width = tableMinimumWidth;
+    table.setLayoutData(data);
+    table.addListener(SWT.Resize, this);
+  }
+  
+  /*
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+   */
+  public void refresh()
+  {
+    Object input = getInput();
+    if (isReadOnly)
+    {
+      composite.setEnabled(false);
+    }
+    else
+    {
+      composite.setEnabled(true);
+    }
+    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
+    
+    Iterator validFacets = st.getValidFacets().iterator();
+    
+    boolean isApplicable = false;
+    while (validFacets.hasNext())
+    {
+      String aValidFacet = (String)validFacets.next();
+      if (aValidFacet.equals(XSDConstants.ENUMERATION_ELEMENT_TAG))
+      {
+        isApplicable = true;
+      }
+    }
+    
+    if (isApplicable)  
+    {
+      addButton.setEnabled(true);
+      addManyButton.setEnabled(true);
+    }
+    else
+    {
+      addButton.setEnabled(false);
+      addManyButton.setEnabled(false);
+    }
+    enumerationsTable.setInput(input);
+  }
+
+  public void handleEvent(Event event)
+  {
+    Table table = enumerationsTable.getTable();
+    if (event.type == SWT.Resize && event.widget == table)
+    {
+      TableColumn tableColumn = table.getColumn(0);
+      tableColumn.setWidth(table.getSize().x);
+    }
+  }
+  
+  public void dispose()
+  {
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+   */
+  public boolean shouldUseExtraSpace()
+  {
+    return true;
+  }
+
+  
+  class EnumerationsTableViewer extends NavigableTableViewer implements ICellModifier
+  {
+    protected String[] columnProperties = {XSDConstants.ENUMERATION_ELEMENT_TAG};
+
+    protected CellEditor[] cellEditors;
+
+    Table table;
+    
+    public EnumerationsTableViewer(Table table)
+    {
+      super(table);
+      table = getTable();
+
+      table.setLinesVisible(true);
+      
+      setContentProvider(new EnumerationsTableContentProvider());
+      setLabelProvider(new EnumerationsTableLabelProvider());
+      setColumnProperties(columnProperties);
+
+      setCellModifier(this);
+
+      TableColumn column = new TableColumn(table, SWT.NONE, 0);
+      column.setText(columnProperties[0]);
+      column.setAlignment(SWT.LEFT);
+      column.setResizable(true);
+ 
+      cellEditors = new CellEditor[1];
+
+      TableLayout layout = new TableLayout();
+      ColumnWeightData data = new ColumnWeightData(100);
+
+      layout.addColumnData(data);
+      cellEditors[0] = new TextCellEditor(table);
+
+      getTable().setLayout(layout);
+      setCellEditors(cellEditors);
+    }
+    
+    public boolean canModify(Object element, String property)
+    {
+      return true;
+    }
+
+    public void modify(Object element, String property, Object value)
+    {
+      if (element instanceof TableItem && (value != null))
+      {
+        TableItem item = (TableItem)element;
+        
+        Element simpleTypeElement = ((XSDSimpleTypeDefinition)getInput()).getElement();
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ENUM_VALUE_CHANGE"), simpleTypeElement); //$NON-NLS-1$
+        
+        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)item.getData();
+        enumFacet.setLexicalValue((String)value);
+        item.setData(enumFacet);
+        item.setText((String)value);
+        endRecording(simpleTypeElement);
+      }
+    }    
+
+    public Object getValue(Object element, String property)
+    {
+      if (element instanceof XSDEnumerationFacet)
+      {
+        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)element;
+        String value = enumFacet.getLexicalValue();
+        if (value == null) value = ""; //$NON-NLS-1$
+        return value;
+      }
+      return ""; //$NON-NLS-1$
+    }
+
+  }
+    
+  class EnumerationsTableContentProvider implements IStructuredContentProvider
+  {
+    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+    {
+    }
+
+    public java.lang.Object[] getElements(java.lang.Object inputElement)
+    {
+      java.util.List list = new ArrayList();
+      if (inputElement instanceof XSDSimpleTypeDefinition)
+      {
+        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)inputElement;
+        return st.getEnumerationFacets().toArray();
+      }
+      return list.toArray();
+    }
+
+    public void dispose()
+    {
+    }
+  }
+
+  class EnumerationsTableLabelProvider extends LabelProvider implements ITableLabelProvider
+  {
+    public EnumerationsTableLabelProvider()
+    {
+      
+    }
+    
+    public Image getColumnImage(Object element, int columnIndex)
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif");
+    }
+    
+    public String getColumnText(Object element, int columnIndex)
+    {
+      if (element instanceof XSDEnumerationFacet)
+      {
+        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)element;
+        String value = enumFacet.getLexicalValue();
+        if (value == null) value = "";
+        return value;
+      }
+      return "";
+    }
+
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSectionDescriptor.java
new file mode 100644
index 0000000..0af99b0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSectionDescriptor.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+
+public class EnumerationsSectionDescriptor extends AbstractSectionDescriptor
+{
+
+  /**
+   * 
+   */
+  public EnumerationsSectionDescriptor()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.enumerations";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDSimpleTypeDefinition.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new EnumerationsSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.enumerations";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDSimpleTypeDefinition)
+      {
+        return true;
+        // return false;  // turn off this tab
+      }
+    }
+    return false;
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetViewer.java
new file mode 100644
index 0000000..1c3faab
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetViewer.java
@@ -0,0 +1,492 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
+import org.eclipse.wst.xsd.ui.internal.properties.XSDComboBoxPropertyDescriptor;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConstrainingFacet;
+import org.eclipse.xsd.XSDMaxExclusiveFacet;
+import org.eclipse.xsd.XSDMaxFacet;
+import org.eclipse.xsd.XSDMaxInclusiveFacet;
+import org.eclipse.xsd.XSDMinExclusiveFacet;
+import org.eclipse.xsd.XSDMinFacet;
+import org.eclipse.xsd.XSDMinInclusiveFacet;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.impl.XSDFactoryImpl;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class FacetViewer extends NavigableTableViewer implements ICellModifier
+{
+  public static final String FACET_NAME = XSDEditorPlugin.getXSDString("_UI_FACET_NAME");  // "Name";
+  public static final String FACET_VALUE = XSDEditorPlugin.getXSDString("_UI_FACET_VALUE"); // "Value";
+  public static final String FACET_OTHER = XSDEditorPlugin.getXSDString("_UI_FACET_FIXED"); // "Fixed";
+
+  protected FacetsTableLabelProvider facetsTableLabelProvider = new FacetsTableLabelProvider();
+  protected FacetsTableContentProvider facetsTableContentProvider = new FacetsTableContentProvider();
+  protected String[] columnProperties = {FACET_NAME, FACET_VALUE, FACET_OTHER};
+  protected CellEditor[] cellEditors;    // these cellEditors are used when non-whitespace facet is selected
+  protected CellEditor[] altCellEditors; // these cellEditors are used when whitespace facet is selected
+  
+  protected String [] whiteSpaceValues = new String[] {"", "preserve", "replace", "collapse" };
+  protected String [] trueFalseValues = new String [] {"", "false", "true" }; 
+  protected FacetsSection facetsSection;
+  /**
+   * @param parent
+   */
+  public FacetViewer(Composite parent, FacetsSection facetsSection)
+  {
+    super(new Table(parent, SWT.FULL_SELECTION | SWT.SINGLE));
+    this.facetsSection = facetsSection;
+    
+    getTable().setLinesVisible(true);
+    getTable().setHeaderVisible(true);
+
+    addSelectionChangedListener(new SelectionChangedListener());
+    getTable().addMouseTrackListener(new MyMouseTrackListener());
+    
+    setContentProvider(facetsTableContentProvider);
+    setLabelProvider(facetsTableLabelProvider);
+    setColumnProperties(columnProperties);
+
+    setCellModifier(this);
+
+    for (int i = 0; i < 3; i++)
+    {
+      TableColumn column = new TableColumn(getTable(), SWT.NONE, i);
+      column.setText(columnProperties[i]);
+      column.setAlignment(SWT.LEFT);
+      column.setResizable(true);
+    }
+    
+    cellEditors = new CellEditor[3];
+    altCellEditors = new CellEditor[3];
+
+    TableLayout layout = new TableLayout();
+    ColumnWeightData data = new ColumnWeightData(60, 120, true);
+    layout.addColumnData(data);
+    cellEditors[0] = null;
+
+    ColumnWeightData data2 = new ColumnWeightData(120, 100, true);
+    layout.addColumnData(data2);
+
+    cellEditors[1] = new TextCellEditor(getTable());
+    XSDComboBoxPropertyDescriptor pd = new XSDComboBoxPropertyDescriptor("combo", "whitespace", whiteSpaceValues);
+    altCellEditors[1] = pd.createPropertyEditor(getTable());
+
+    ColumnWeightData data3 = new ColumnWeightData(60, 80, true);
+    layout.addColumnData(data3);
+
+    XSDComboBoxPropertyDescriptor pd2 = new XSDComboBoxPropertyDescriptor("combo", "other", trueFalseValues);
+    cellEditors[2] = pd2.createPropertyEditor(getTable());
+    altCellEditors[2] = pd2.createPropertyEditor(getTable());
+
+    getTable().setLayout(layout);
+    setCellEditors(cellEditors);
+
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
+   */
+  public boolean canModify(Object element, String property)
+  {
+    return property.equals(FACET_VALUE) || property.equals(FACET_OTHER);
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
+   */
+  public Object getValue(Object element, String property)
+  {
+    int column = 0;
+    if (property.equals(columnProperties[0]))
+    {
+      column = 0;
+    }
+    else if (property.equals(columnProperties[1]))
+    {
+      column = 1;
+    }
+    else if (property.equals(columnProperties[2]))
+    {
+      column = 2;
+    }
+
+    return facetsTableLabelProvider.getColumnText(element, column);
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
+   */
+  public void modify(Object element, String property, Object value)
+  {
+    XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition)getInput();
+    TableItem item = (TableItem)element;
+    if (item != null)
+    {
+      Object o = item.getData();
+      if (o != null)
+      {
+        if (o instanceof String)
+        {
+          String facet = (String)o;
+         
+          Element simpleTypeElement = xsdSimpleType.getElement();
+          XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
+          Element derivedByElement = xsdDOMHelper.getDerivedByElement(simpleTypeElement);
+
+          facetsSection.beginRecording(XSDEditorPlugin.getXSDString("_UI_FACET_CHANGE"), simpleTypeElement);
+
+          String prefix = simpleTypeElement.getPrefix();
+          prefix = (prefix == null) ? "" : (prefix + ":");
+          
+          Element childNodeElement = null;
+          DOMAttribute valueAttr = null;
+
+          XSDConstrainingFacet targetFacet = getXSDConstrainingFacet(facet);
+
+          String newValue = "";
+          if (value != null && value instanceof String)
+          {
+            newValue = (String)value;
+          }
+          
+          if (property.equals(columnProperties[1]))
+          {
+            if (targetFacet == null && newValue.length() > 0)
+            {
+              targetFacet = createFacet(facet);
+              childNodeElement = (derivedByElement.getOwnerDocument()).createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + facet);
+              valueAttr = new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newValue);
+              childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());
+              // add and format child
+              derivedByElement.appendChild(childNodeElement);
+              targetFacet.setElement(childNodeElement);
+              XSDDOMHelper.formatChild(childNodeElement);
+
+//              XSDSchemaHelper.updateElement(xsdSimpleType);
+            }
+            if (targetFacet == null)
+            {
+              facetsSection.endRecording(simpleTypeElement);
+              return;
+            }
+
+            if (newValue.length() > 0)
+            {            
+              targetFacet.setLexicalValue(newValue);
+              
+              if (targetFacet instanceof XSDMaxFacet || targetFacet instanceof XSDMinFacet)
+              {
+                if (targetFacet instanceof XSDMaxFacet)
+                {
+                  if (targetFacet instanceof XSDMaxExclusiveFacet)
+                  {
+                    XSDMaxInclusiveFacet xsdMaxInclusiveFacet = xsdSimpleType.getMaxInclusiveFacet();
+                    if (xsdMaxInclusiveFacet != null)
+                    {
+                      Element xsdMaxInclusiveFacetElement = xsdMaxInclusiveFacet.getElement();
+                      XSDDOMHelper.removeNodeAndWhitespace(xsdMaxInclusiveFacetElement);
+                    }
+                  }
+                  else if (targetFacet instanceof XSDMaxInclusiveFacet)
+                  {
+                    XSDMaxExclusiveFacet xsdMaxExclusiveFacet = xsdSimpleType.getMaxExclusiveFacet();
+                    if (xsdMaxExclusiveFacet != null)
+                    {
+                      Element xsdMaxExclusiveFacetElement = xsdMaxExclusiveFacet.getElement();
+                      XSDDOMHelper.removeNodeAndWhitespace(xsdMaxExclusiveFacetElement);
+                    }
+                  }
+                }
+                else if (targetFacet instanceof XSDMinFacet)
+                {
+                  if (targetFacet instanceof XSDMinExclusiveFacet)
+                  {
+                    XSDMinInclusiveFacet xsdMinInclusiveFacet = xsdSimpleType.getMinInclusiveFacet();
+                    if (xsdMinInclusiveFacet != null)
+                    {
+                      Element xsdMinInclusiveFacetElement = xsdMinInclusiveFacet.getElement();
+                      XSDDOMHelper.removeNodeAndWhitespace(xsdMinInclusiveFacetElement);
+                    }
+                  }
+                  else if (targetFacet instanceof XSDMinInclusiveFacet)
+                  {
+                    XSDMinExclusiveFacet xsdMinExclusiveFacet = xsdSimpleType.getMinExclusiveFacet();
+                    if (xsdMinExclusiveFacet != null)
+                    {
+                      Element xsdMinExclusiveFacetElement = xsdMinExclusiveFacet.getElement();
+                      XSDDOMHelper.removeNodeAndWhitespace(xsdMinExclusiveFacetElement);
+                    }
+                  }
+                }
+              }
+            }
+            else // newValue.length == 0
+            {
+              Element targetFacetElement = targetFacet.getElement();
+              XSDDOMHelper.removeNodeAndWhitespace(targetFacetElement);
+            }
+          }
+          else if (property.equals(columnProperties[2]))
+          {
+            if (targetFacet != null)
+            {
+              if (newValue.length() > 0)
+              {            
+                targetFacet.getElement().setAttribute(XSDConstants.FIXED_ATTRIBUTE, newValue);
+              }
+              else
+              {
+                targetFacet.getElement().removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
+              }
+            }
+          }
+          xsdSimpleType.setElement(simpleTypeElement);
+          //xsdSimpleType.updateElement();
+          facetsSection.endRecording(simpleTypeElement);
+          refresh();
+        }
+      }
+    }
+  }
+
+  
+  private XSDConstrainingFacet getXSDConstrainingFacet(String facetString)
+  {
+    XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition)getInput();
+    List list = xsdSimpleType.getFacetContents();
+    if (list == null)
+    {
+      return null;
+    }
+    Iterator iter = list.iterator();
+    XSDConstrainingFacet targetFacet = null;
+    
+    while (iter.hasNext())
+    {
+      XSDConstrainingFacet xsdConstrainingFacet = (XSDConstrainingFacet)iter.next();
+      if (xsdConstrainingFacet.getFacetName().equals(facetString))
+      {
+        targetFacet = xsdConstrainingFacet;
+        break;
+      }
+    }
+    return targetFacet;
+  }
+
+  private XSDConstrainingFacet createFacet(String facet)
+  {
+    XSDFactoryImpl factory = new XSDFactoryImpl();
+    XSDConstrainingFacet xsdFacet = null;
+    if (facet.equals("length")) { xsdFacet = factory.createXSDLengthFacet(); }
+    else if (facet.equals("minLength")) { xsdFacet = factory.createXSDMinLengthFacet(); }
+    else if (facet.equals("maxLength")) { xsdFacet = factory.createXSDMaxLengthFacet(); }
+
+    else if (facet.equals("minInclusive")) { xsdFacet = factory.createXSDMinInclusiveFacet(); }
+    else if (facet.equals("minExclusive")) { xsdFacet = factory.createXSDMinExclusiveFacet(); }
+
+    else if (facet.equals("maxInclusive")) { xsdFacet = factory.createXSDMaxInclusiveFacet(); }
+    else if (facet.equals("maxExclusive")) { xsdFacet = factory.createXSDMaxExclusiveFacet(); }
+
+    else if (facet.equals("totalDigits")) { xsdFacet = factory.createXSDTotalDigitsFacet(); }
+    else if (facet.equals("fractionDigits")) { xsdFacet = factory.createXSDFractionDigitsFacet(); }
+
+    else if (facet.equals("whiteSpace"))   { xsdFacet = factory.createXSDWhiteSpaceFacet(); }
+
+    return xsdFacet;
+  }
+
+ /**
+  * Get the tooltip for the facet
+  */
+  public String getToolTip(String facet)
+  {
+    String key = "";
+    if (facet.equals("length")) { key = "_UI_TOOLTIP_LENGTH"; }
+    else if (facet.equals("minLength")) { key = "_UI_TOOLTIP_MIN_LEN"; }
+    else if (facet.equals("maxLength")) { key = "_UI_TOOLTIP_MAX_LEN"; }
+
+    else if (facet.equals("minInclusive")) { key = "_UI_TOOLTIP_MIN_INCLUSIVE"; }
+    else if (facet.equals("minExclusive")) { key = "_UI_TOOLTIP_MIN_EXCLUSIVE"; }
+
+    else if (facet.equals("maxInclusive")) { key = "_UI_TOOLTIP_MAX_INCLUSIVE"; }
+    else if (facet.equals("maxExclusive")) { key = "_UI_TOOLTIP_MAX_EXCLUSIVE"; }
+
+    else if (facet.equals("totalDigits"))   { key = "_UI_TOOLTIP_TOTAL_DIGITS"; }
+    else if (facet.equals("fractionDigits")) { key = "_UI_TOOLTIP_FRACTION_DIGITS"; }
+
+    else if (facet.equals("whiteSpace"))   { key = "_UI_TOOLTIP_WHITE_SPACE"; }
+
+    return (key != null) ? XSDEditorPlugin.getXSDString(key) : "";
+  }
+  
+  /**
+   * This listener detects which row is selected and add a tool tip for that row
+   */
+  public class MyMouseTrackListener extends MouseTrackAdapter
+  {
+    public void mouseHover(MouseEvent e)
+    {
+      TableItem item = getTable().getItem(new Point(e.x, e.y));
+      if (item != null)
+      {
+        Object o = item.getData();
+        if (o != null)
+        {
+          String facetName = (String)o;
+          getTable().setToolTipText(getToolTip(facetName));
+        }
+      }
+    }
+  }
+
+  /**
+   * Based on the selection, detects if it is a white space or not, and add the
+   * corresponding cell editors
+   */
+  public class SelectionChangedListener implements ISelectionChangedListener
+  {
+    public void selectionChanged(SelectionChangedEvent event)
+    {
+      Object o = WindowUtility.getSelection(event.getSelection());
+      if (o != null)
+      {
+        String facet = (String)o;
+        if (facet.equals("whiteSpace"))
+        {
+          setCellEditors(altCellEditors);
+        }
+        else
+        {
+          setCellEditors(cellEditors);
+        }
+      }
+    }
+  }
+
+  
+  class FacetsTableContentProvider implements IStructuredContentProvider
+  {
+    protected String facet;
+    
+    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+    {
+    }
+
+    public java.lang.Object[] getElements(java.lang.Object inputElement)
+    {
+      Vector v = new Vector();
+      XSDSimpleTypeDefinition inputXSDSimpleType = (XSDSimpleTypeDefinition)inputElement;
+      XSDSimpleTypeDefinition base = inputXSDSimpleType.getBaseTypeDefinition();
+      
+      if (base != null)
+      {
+        Iterator validFacets = base.getValidFacets().iterator();
+        while (validFacets.hasNext())
+        {
+          String aValidFacet = (String)validFacets.next();
+          if (!(aValidFacet.equals("pattern") || aValidFacet.equals("enumeration")))
+          {
+            v.add(aValidFacet);
+          }
+        }
+      }
+      return v.toArray();
+    }
+
+    public void dispose()
+    {
+    }
+  }
+
+  class FacetsTableLabelProvider extends LabelProvider implements ITableLabelProvider
+  {
+    public Image getColumnImage(Object element, int columnIndex)
+    {
+      return null;
+    }
+    
+    public String getColumnText(Object element, int columnIndex)
+    {
+      if (element instanceof String)
+      {
+        String value = null;
+        XSDConstrainingFacet targetFacet = getXSDConstrainingFacet((String)element);
+        switch (columnIndex)
+        {
+          case 0:
+          {
+            value = (String)element;
+            break;
+          }
+          case 1:
+          {
+            if (targetFacet == null)
+            {
+              value = "";
+            }
+            else
+            {
+              value = targetFacet.getLexicalValue();
+            }
+
+            break;
+          }
+          case 2:
+          {
+            if (targetFacet == null)
+            {
+              value = "";
+            }
+            else
+            {
+              Element elem = targetFacet.getElement();
+              value = elem.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
+              if (value == null) value = "";
+            }
+          }
+        }
+        return value; 
+      }
+      return "";
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSection.java
new file mode 100644
index 0000000..55d9587
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSection.java
@@ -0,0 +1,802 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.wst.xsd.ui.internal.wizards.RegexWizard;
+import org.eclipse.xsd.XSDPatternFacet;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDVariety;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class FacetsSection extends AbstractSection
+{
+  IWorkbenchPart part;
+  ISelection selection;
+  FacetViewer facetViewer;
+  
+  XSDWorkbook workbook;
+  FacetsWorkbookPage facetsWorkbookPage;
+// If you want to add the enumerations tab to this facets tab
+//  EnumsWorkbookPage enumsWorkbookPage;
+  PatternsWorkbookPage patternsWorkbookPage;
+
+  /**
+   * 
+   */
+  public FacetsSection()
+  {
+    super();
+  }
+  
+  /**
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+   */
+  public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+  {
+    super.createControls(parent, factory);
+
+    workbook = new XSDWorkbook(parent, SWT.BOTTOM | SWT.FLAT);
+    
+    facetsWorkbookPage = new FacetsWorkbookPage(workbook, this);
+//    enumsWorkbookPage = new EnumsWorkbookPage(workbook);
+    patternsWorkbookPage = new PatternsWorkbookPage(workbook);
+    facetsWorkbookPage.activate();
+//    enumsWorkbookPage.activate();
+    patternsWorkbookPage.activate();
+    workbook.setSelectedPage(facetsWorkbookPage);
+  }
+  
+  public void selectionChanged(IWorkbenchPart part, ISelection selection)
+  {
+    this.part = part;
+    this.selection = selection;
+  }
+  
+
+  /*
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+   */
+  public void refresh()
+  {
+    Object input = getInput();
+    
+    if (isReadOnly)
+    {
+      facetViewer.getControl().getParent().setEnabled(false);      
+    }
+    else
+    {
+      facetViewer.getControl().getParent().setEnabled(true);
+    }
+
+    if (facetViewer != null)
+    {
+      facetViewer.setInput(input);
+    }
+    
+//    if (enumsWorkbookPage != null)
+//    {
+//      enumsWorkbookPage.setInput(input);
+//    }
+    
+    if (patternsWorkbookPage != null)
+    {
+      patternsWorkbookPage.setInput(input);
+    }
+  }
+
+  public void dispose()
+  {
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+   */
+  public boolean shouldUseExtraSpace()
+  {
+    return true;
+  }
+  
+
+  /* General Facets Page */
+  
+  class FacetsWorkbookPage extends XSDWorkbookPage
+  {
+    FacetsSection facetsSection;
+    Composite page1;
+    
+    public FacetsWorkbookPage(XSDWorkbook workbook, FacetsSection facetsSection)
+    {
+      super(workbook);
+      this.getTabItem().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_FACETS")); //$NON-NLS-1$
+      this.facetsSection = facetsSection;
+    }
+
+    public Control createControl (Composite parent)
+    {
+      page1 = getWidgetFactory().createFlatFormComposite(parent);
+
+      FormData data = new FormData();
+      data.left = new FormAttachment(0, 0);
+      data.right = new FormAttachment(100, 0);
+      data.top = new FormAttachment(0, 0);
+      data.bottom = new FormAttachment(100, 0);
+      
+      facetViewer = new FacetViewer(page1, facetsSection);
+      facetViewer.setInput(getInput());
+      facetViewer.getControl().setLayoutData(data);
+                  
+      return page1;
+    }
+  }
+
+  /* Enumerations Page */
+  
+//  class EnumsWorkbookPage extends XSDWorkbookPage implements SelectionListener
+//  {
+//    EnumerationsTableViewer enumerationsTable;
+//    Button addButton;
+//    Button deleteButton;
+//    
+//    public EnumsWorkbookPage(XSDWorkbook workbook)
+//    {
+//      super(workbook);
+//      this.getTabItem().setText("Enumerations");
+//    }
+//
+//    public Control createControl (Composite parent)
+//    {
+//      Composite composite = getWidgetFactory().createFlatFormComposite(parent);
+//      FormData data;
+//      
+//      addButton = getWidgetFactory().createButton(composite, "Add", SWT.PUSH);
+//      deleteButton = getWidgetFactory().createButton(composite, "Delete", SWT.PUSH);
+//      enumerationsTable = new EnumerationsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
+//      
+//      enumerationsTable.setInput(getInput());
+//      Table table = enumerationsTable.getTable();
+//      table.addSelectionListener(this);
+//
+//      data = new FormData();
+//      data.left = new FormAttachment(deleteButton, 0, SWT.LEFT);
+//      data.right = new FormAttachment(100, 0);
+//      data.top = new FormAttachment(0, 0);
+//      data.bottom = new FormAttachment(deleteButton, 0); //-ITabbedPropertyConstants.VSPACE);
+//      addButton.setLayoutData(data);
+//      addButton.addSelectionListener(this);
+//      
+//      data = new FormData();
+//      data.left = new FormAttachment(table, +ITabbedPropertyConstants.HSPACE);
+//      data.right = new FormAttachment(100, 0);
+//      data.top = new FormAttachment(addButton, 0);
+////      data.bottom = new FormAttachment(deleteButton, +ITabbedPropertyConstants.VSPACE);
+//      deleteButton.setLayoutData(data);
+//      deleteButton.setEnabled(false);
+//      deleteButton.addSelectionListener(this);
+//      
+//      data = new FormData();
+//      data.left = new FormAttachment(0, 0);
+//      data.right = new FormAttachment(85, 0);
+//      data.top = new FormAttachment(0, 0);
+//      data.bottom = new FormAttachment(100, 0);
+//      table.setLayoutData(data);
+//      
+//      return composite;
+//    }
+//    
+//    public void setInput(Object input)
+//    {
+//      enumerationsTable.setInput(input);
+//    }
+//    
+//    public void widgetSelected(SelectionEvent e)
+//    {
+//      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
+//      Element element = st.getElement();
+//      if (e.widget == addButton)
+//      {
+//        XSDDOMHelper helper = new XSDDOMHelper();
+//
+//        int variety = st.getVariety().getValue();
+//        Node varietyElement = null;
+//        if (variety == XSDVariety.ATOMIC)
+//        {
+//          varietyElement = helper.getChildNode(element, XSDConstants.RESTRICTION_ELEMENT_TAG);
+//        }
+//        else if (variety == XSDVariety.UNION)
+//        {
+//          varietyElement = helper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
+//        }
+//        else if (variety == XSDVariety.LIST)
+//        {
+//          varietyElement = helper.getChildNode(element, XSDConstants.LIST_ELEMENT_TAG);
+//        }
+//              
+//        if (varietyElement != null)
+//        {
+//          java.util.List attributes = new ArrayList();
+//          attributes.add(new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, ""));
+//          beginRecording("Add Enumeration", element);
+//          Action action = getNewElementAction(XSDConstants.ENUMERATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUM"), attributes, (Element)varietyElement, null);
+//          action.run();
+//          st.setElement(element);
+//
+//          endRecording(element);
+//          enumerationsTable.refresh();
+//          attributes = null;
+//        }
+//      }
+//      else if (e.widget == deleteButton)
+//      {
+//        StructuredSelection selection = (StructuredSelection)enumerationsTable.getSelection();
+//        if (selection != null)
+//        {
+//          Iterator i = selection.iterator();
+//          beginRecording("Delete Enumeration", element);
+//          while (i.hasNext())
+//          {
+//            Object obj = i.next();
+//            if (obj != null)
+//            {
+//              if (obj instanceof XSDEnumerationFacet)
+//              {
+//                XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)obj;
+//      
+//                // I have to update using DOM
+//                XSDDOMHelper.removeNodeAndWhitespace(enumFacet.getElement());            
+//                
+//              }
+//            }
+//          }
+//          enumerationsTable.refresh();
+//          st.setElement(element);
+//          endRecording(element);
+//        }
+//      }
+//      else if (e.widget == enumerationsTable.getTable())
+//      {
+//        StructuredSelection selection = (StructuredSelection)enumerationsTable.getSelection();
+//        if (selection.getFirstElement() != null)
+//        {
+//          deleteButton.setEnabled(true);
+//        }
+//        else
+//        {
+//          deleteButton.setEnabled(false);
+//        }
+//      }
+//      
+//    }
+//
+//    public void widgetDefaultSelected(SelectionEvent e)
+//    {
+//      
+//    }
+//  }
+//  
+//  class EnumerationsTableViewer extends NavigableTableViewer implements ICellModifier
+//  {
+//    protected String[] columnProperties = {"Enumeration"};
+//
+//    protected CellEditor[] cellEditors;
+//
+//    Table table;
+//    
+//    public EnumerationsTableViewer(Table table)
+//    {
+//      super(table);
+//      table = getTable();
+//      
+//      table.setLinesVisible(true);
+//      
+//      setContentProvider(new EnumerationsTableContentProvider());
+//      setLabelProvider(new EnumerationsTableLabelProvider());
+//      setColumnProperties(columnProperties);
+//
+//      setCellModifier(this);
+//
+//      TableColumn column = new TableColumn(table, SWT.NONE, 0);
+//      column.setText(columnProperties[0]);
+//      column.setAlignment(SWT.LEFT);
+// 
+//      cellEditors = new CellEditor[1];
+//
+//      TableLayout layout = new TableLayout();
+//      ColumnWeightData data = new ColumnWeightData(100);
+//      layout.addColumnData(data);
+//      cellEditors[0] = new TextCellEditor(table);
+//
+//      getTable().setLayout(layout);
+//      setCellEditors(cellEditors);
+//    }
+//    
+//    public boolean canModify(Object element, String property)
+//    {
+//      return true;
+//    }
+//
+//    public void modify(Object element, String property, Object value)
+//    {
+//      if (element instanceof TableItem && (value != null))
+//      {
+//        TableItem item = (TableItem)element;
+//        
+//        Element simpleTypeElement = ((XSDSimpleTypeDefinition)getInput()).getElement();
+//        FacetsSection.this.beginRecording(XSDEditorPlugin.getXSDString("_UI_ENUM_VALUE_CHANGE"), simpleTypeElement);
+//        
+//        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)item.getData();
+//        enumFacet.setLexicalValue((String)value);
+//        item.setData(enumFacet);
+//        item.setText((String)value);
+//        FacetsSection.this.endRecording(simpleTypeElement);
+//      }
+//    }    
+//
+//    public Object getValue(Object element, String property)
+//    {
+//      if (element instanceof XSDEnumerationFacet)
+//      {
+//        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)element;
+//        String value = enumFacet.getLexicalValue();
+//        if (value == null) value = "";
+//        return value;
+//      }
+//      return "";
+//    }
+//
+//  }
+//    
+//  class EnumerationsTableContentProvider implements IStructuredContentProvider
+//  {
+//    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+//    {
+//    }
+//
+//    public java.lang.Object[] getElements(java.lang.Object inputElement)
+//    {
+//      java.util.List list = new ArrayList();
+//      if (inputElement instanceof XSDSimpleTypeDefinition)
+//      {
+//        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)inputElement;
+//        return st.getEnumerationFacets().toArray();
+//      }
+//      return list.toArray();
+//    }
+//
+//    public void dispose()
+//    {
+//    }
+//  }
+//
+//  class EnumerationsTableLabelProvider extends LabelProvider implements ITableLabelProvider
+//  {
+//    public EnumerationsTableLabelProvider()
+//    {
+//      
+//    }
+//    
+//    public Image getColumnImage(Object element, int columnIndex)
+//    {
+//      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif");
+//    }
+//    
+//    public String getColumnText(Object element, int columnIndex)
+//    {
+//      if (element instanceof XSDEnumerationFacet)
+//      {
+//        XSDEnumerationFacet enum = (XSDEnumerationFacet)element;
+//        String value = enum.getLexicalValue();
+//        if (value == null) value = "";
+//        return value;
+//      }
+//      return "";
+//    }
+//
+//  }
+
+  /* Patterns Page */
+  
+  class PatternsWorkbookPage extends XSDWorkbookPage implements SelectionListener, Listener
+  {
+    PatternsTableViewer patternsTable;
+    Button addButton;
+    Button deleteButton;
+    Button editButton;
+    Composite composite;
+    
+    public PatternsWorkbookPage(XSDWorkbook workbook)
+    {
+      super(workbook);
+      this.getTabItem().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_PATTERNS")); //$NON-NLS-1$
+    }
+
+    public Control createControl (Composite parent)
+    {
+      composite = getWidgetFactory().createFlatFormComposite(parent);
+      FormData data;
+
+      patternsTable = new PatternsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
+      patternsTable.setInput(getInput());
+      Table table = patternsTable.getTable();
+      table.addSelectionListener(this);
+
+      addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_ADD"), SWT.PUSH); //$NON-NLS-1$
+      editButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_EDIT"), SWT.PUSH); //$NON-NLS-1$
+      deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH); //$NON-NLS-1$
+
+      data = new FormData();
+      data.left = new FormAttachment(100, -100);
+      data.right = new FormAttachment(100, 0);
+      data.top = new FormAttachment(0, 0);
+      addButton.setLayoutData(data);
+      addButton.addSelectionListener(this);
+
+      data = new FormData();
+      data.left = new FormAttachment(addButton, 0, SWT.LEFT);
+      data.right = new FormAttachment(100, 0);
+      data.top = new FormAttachment(addButton, 0);
+      editButton.setLayoutData(data);
+      editButton.setEnabled(false);
+      editButton.addSelectionListener(this);
+      
+      data = new FormData();
+      data.left = new FormAttachment(addButton, 0, SWT.LEFT);
+      data.right = new FormAttachment(100, 0);
+      data.top = new FormAttachment(editButton, 0);
+      deleteButton.setLayoutData(data);
+      deleteButton.setEnabled(false);
+      deleteButton.addSelectionListener(this);
+      
+      data = new FormData();
+      data.top = new FormAttachment(0, 0);
+      data.left = new FormAttachment(0, 0);
+      data.right = new FormAttachment(addButton, 0);
+      data.bottom = new FormAttachment(100, 0);
+      data.width = tableMinimumWidth;
+      table.setLayoutData(data);
+      table.addListener(SWT.Resize, this);
+      
+      return composite;
+    }
+    
+    public void handleEvent(Event event)
+    {
+      Table table = patternsTable.getTable();
+      if (event.type == SWT.Resize && event.widget == table)
+      {
+        TableColumn tableColumn = table.getColumn(0);
+        tableColumn.setWidth(table.getSize().x);
+      }
+    }
+
+    
+    public void setInput(Object input)
+    {
+      patternsTable.setInput(input);
+      if (isReadOnly)
+      {
+        composite.setEnabled(false);
+      }
+      else
+      {
+        composite.setEnabled(true);
+      }
+    }
+    
+    public void widgetSelected(SelectionEvent e)
+    {
+      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
+      Element element = st.getElement();
+
+      if (e.widget == addButton)
+      {
+        XSDDOMHelper helper = new XSDDOMHelper();
+        
+        int variety = st.getVariety().getValue();
+        Node varietyElement = null;
+        if (variety == XSDVariety.ATOMIC)
+        {
+          varietyElement = helper.getChildNode(element, XSDConstants.RESTRICTION_ELEMENT_TAG);
+        }
+        else if (variety == XSDVariety.UNION)
+        {
+          varietyElement = helper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
+        }
+        else if (variety == XSDVariety.LIST)
+        {
+          varietyElement = helper.getChildNode(element, XSDConstants.LIST_ELEMENT_TAG);
+        }
+              
+        if (varietyElement != null)
+        {
+          Shell shell = Display.getCurrent().getActiveShell();
+
+          String initialValue = ""; //$NON-NLS-1$
+          RegexWizard wizard = new RegexWizard(initialValue);
+
+          WizardDialog wizardDialog = new WizardDialog(shell, wizard);
+          wizardDialog.setBlockOnOpen(true);
+          wizardDialog.create();
+          
+          int result = wizardDialog.open();
+
+          if (result == Window.OK)
+          {
+            String newPattern = wizard.getPattern();
+            
+            java.util.List attributes = new ArrayList();
+            attributes.add(new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newPattern));
+            beginRecording(XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_PATTERN"), element); //$NON-NLS-1$
+            Action action = getNewElementAction(XSDConstants.PATTERN_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_PATTERN"), attributes, (Element)varietyElement, null); //$NON-NLS-1$
+            action.run();
+            st.setElement(element);
+            endRecording(element);
+            patternsTable.refresh();
+            attributes = null;
+          }
+        }
+      }
+      else if (e.widget == deleteButton)
+      {
+        StructuredSelection selection = (StructuredSelection)patternsTable.getSelection();
+        if (selection != null)
+        {
+          Iterator i = selection.iterator();
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), element); // Reword ?
+          while (i.hasNext())
+          {
+            Object obj = i.next();
+            if (obj != null)
+            {
+              if (obj instanceof XSDPatternFacet)
+              {
+                XSDPatternFacet patternFacet = (XSDPatternFacet)obj;
+      
+                // I have to update using DOM
+                XSDDOMHelper.removeNodeAndWhitespace(patternFacet.getElement());            
+              }
+            }
+          }
+          st.setElement(element);
+          endRecording(element);
+          patternsTable.refresh();
+          if (patternsTable.getTable().getItemCount() == 0)
+          {
+            editButton.setEnabled(false);
+            deleteButton.setEnabled(false);
+          }
+        }
+      }
+      else if (e.widget == editButton)
+      {
+        StructuredSelection selection = (StructuredSelection)patternsTable.getSelection();
+        if (selection != null)
+        {
+          Object obj = selection.getFirstElement();
+          if (obj instanceof XSDPatternFacet)
+          {
+            XSDPatternFacet pattern = (XSDPatternFacet)obj;
+            String initialValue = pattern.getLexicalValue();
+            if (initialValue == null)
+            {
+              initialValue = ""; //$NON-NLS-1$
+            }
+
+            Shell shell = Display.getCurrent().getActiveShell();
+
+            RegexWizard wizard = new RegexWizard(initialValue);
+
+            WizardDialog wizardDialog = new WizardDialog(shell, wizard);
+            wizardDialog.setBlockOnOpen(true);
+            wizardDialog.create();
+            
+            int result = wizardDialog.open();
+
+            if (result == Window.OK)
+            {
+              String newPattern = wizard.getPattern();
+              beginRecording(XSDEditorPlugin.getXSDString("_UI_PATTERN_VALUE_CHANGE"), element); //$NON-NLS-1$
+              element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, newPattern);
+              pattern.setLexicalValue(newPattern);
+              endRecording(element);
+              patternsTable.refresh();
+            }
+          }
+        }
+      }
+      else if (e.widget == patternsTable.getTable())
+      {
+        StructuredSelection selection = (StructuredSelection)patternsTable.getSelection();
+        if (selection.getFirstElement() != null)
+        {
+          editButton.setEnabled(true);
+          deleteButton.setEnabled(true);
+        }
+        else
+        {
+          editButton.setEnabled(false);
+          deleteButton.setEnabled(false);
+        }
+      }
+      
+    }
+
+    public void widgetDefaultSelected(SelectionEvent e)
+    {
+      
+    }
+  }
+
+  
+  class PatternsTableViewer extends NavigableTableViewer implements ICellModifier
+  {
+    protected String[] columnProperties = {"Pattern"};
+
+    protected CellEditor[] cellEditors;
+
+    Table table;
+    
+    public PatternsTableViewer(Table table)
+    {
+      super(table);
+      table = getTable();
+      
+      table.setLinesVisible(true);
+      
+      setContentProvider(new PatternsTableContentProvider());
+      setLabelProvider(new PatternsTableLabelProvider());
+      setColumnProperties(columnProperties);
+
+      setCellModifier(this);
+
+      TableColumn column = new TableColumn(table, SWT.NONE, 0);
+      column.setText(columnProperties[0]);
+      column.setAlignment(SWT.LEFT);
+      column.setResizable(true);
+ 
+      cellEditors = new CellEditor[1];
+
+      TableLayout layout = new TableLayout();
+      ColumnWeightData data = new ColumnWeightData(100);
+      layout.addColumnData(data);
+      cellEditors[0] = new TextCellEditor(table);
+
+      getTable().setLayout(layout);
+      setCellEditors(cellEditors);
+    }
+    
+    public boolean canModify(Object element, String property)
+    {
+      return true;
+    }
+
+    public void modify(Object element, String property, Object value)
+    {
+      if (element instanceof TableItem && (value != null))
+      {
+        TableItem item = (TableItem)element;
+        
+        Element simpleTypeElement = ((XSDSimpleTypeDefinition)getInput()).getElement();
+        FacetsSection.this.beginRecording(XSDEditorPlugin.getXSDString("_UI_PATTERN_VALUE_CHANGE"), simpleTypeElement); //$NON-NLS-1$
+        
+        XSDPatternFacet patternFacet = (XSDPatternFacet)item.getData();
+        patternFacet.setLexicalValue((String)value);
+
+        item.setData(patternFacet);
+        item.setText((String)value);
+        FacetsSection.this.endRecording(simpleTypeElement);
+      }
+    }    
+
+    public Object getValue(Object element, String property)
+    {
+      if (element instanceof XSDPatternFacet)
+      {
+        XSDPatternFacet patternFacet = (XSDPatternFacet)element;
+        String value = patternFacet.getLexicalValue();
+        if (value == null) value = ""; //$NON-NLS-1$
+        return value;
+      }
+      return ""; //$NON-NLS-1$
+    }
+
+  }
+    
+  class PatternsTableContentProvider implements IStructuredContentProvider
+  {
+    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+    {
+    }
+
+    public java.lang.Object[] getElements(java.lang.Object inputElement)
+    {
+      java.util.List list = new ArrayList();
+      if (inputElement instanceof XSDSimpleTypeDefinition)
+      {
+        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)inputElement;
+        return st.getPatternFacets().toArray();
+      }
+      return list.toArray();
+    }
+
+    public void dispose()
+    {
+    }
+  }
+
+  class PatternsTableLabelProvider extends LabelProvider implements ITableLabelProvider
+  {
+    public PatternsTableLabelProvider()
+    {
+      
+    }
+    
+    public Image getColumnImage(Object element, int columnIndex)
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDSimplePattern.gif"); //$NON-NLS-1$
+    }
+    
+    public String getColumnText(Object element, int columnIndex)
+    {
+      if (element instanceof XSDPatternFacet)
+      {
+        XSDPatternFacet pattern = (XSDPatternFacet)element;
+        String value = pattern.getLexicalValue();
+        if (value == null) value = ""; //$NON-NLS-1$
+        return value;
+      }
+      return ""; //$NON-NLS-1$
+    }
+
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSectionDescriptor.java
new file mode 100644
index 0000000..c188f7c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSectionDescriptor.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+
+public class FacetsSectionDescriptor extends AbstractSectionDescriptor
+{
+
+  /**
+   * 
+   */
+  public FacetsSectionDescriptor()
+  {
+    super();
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.facets";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDSimpleTypeDefinition.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new FacetsSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.facets";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDSimpleTypeDefinition)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSection.java
new file mode 100644
index 0000000..36b5918
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSection.java
@@ -0,0 +1,282 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class MinMaxSection extends AbstractSection
+{
+  CCombo minCombo;
+  CCombo maxCombo;
+
+  /**
+   * 
+   */
+  public MinMaxSection()
+  {
+    super();
+  }
+
+
+  public void doHandleEvent(Event event)
+	{
+    if (event.widget == minCombo)
+    {
+      updateMinAttribute();
+	  }
+	  else if (event.widget == maxCombo)
+	  {
+      updateMaxAttribute();
+	  }
+	}
+  
+  public void doWidgetSelected(SelectionEvent e)
+  {
+    if (e.widget == minCombo)
+    {
+      updateMinAttribute();
+    }
+    else if (e.widget == maxCombo)
+    {
+      updateMaxAttribute();
+    }
+  }
+
+  private void updateMinAttribute()
+  {
+    XSDParticle particle = null;
+    Object input = getInput();
+
+    if (input instanceof XSDParticleContent)
+    {
+      particle = getAssociatedParticle((XSDParticleContent)input);
+    }
+    if (particle != null)
+    {
+      Element element = particle.getElement();
+      String newValue = ""; //$NON-NLS-1$
+
+      newValue = minCombo.getText();
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element); //$NON-NLS-1$        
+      if (newValue.length()==0)
+      {
+        particle.unsetMinOccurs();
+      }
+      try
+      {
+        if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$
+        {
+          particle.setMinOccurs(XSDParticle.UNBOUNDED);
+        }
+        else
+        {
+          int val = Integer.parseInt(newValue);
+          particle.setMinOccurs(val);
+        }
+      }
+      catch (NumberFormatException e)
+      {
+      
+      }
+      finally
+      { 
+        endRecording(element);
+      }
+    }
+  }
+  
+  private void updateMaxAttribute()
+  {
+    XSDParticle particle = null;
+    Object input = getInput();
+
+    if (input instanceof XSDParticleContent)
+    {
+      particle = getAssociatedParticle((XSDParticleContent)input);
+    }
+    if (particle != null)
+    {
+      Element element = particle.getElement();
+      String newValue = "";
+      newValue = maxCombo.getText();
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element); //$NON-NLS-1$
+      if (newValue.length()==0)
+      {
+        particle.unsetMaxOccurs();
+      }
+      try
+      {
+        if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$
+        {
+          particle.setMaxOccurs(XSDParticle.UNBOUNDED);
+        }
+        else
+        {
+          int val = Integer.parseInt(newValue);
+            particle.setMaxOccurs(val);
+        }
+      }
+      catch (NumberFormatException e)
+      {
+        
+      }
+      finally
+      {
+        endRecording(element);
+      }
+    }    
+  }
+  
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+
+	public void createControls(Composite parent,TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite =	getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+    minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
+    data = new FormData();
+    data.left = new FormAttachment(0, 100);
+    data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+    data.top = new FormAttachment(0, 0);
+    minCombo.setLayoutData(data);
+    minCombo.add("0"); //$NON-NLS-1$
+    minCombo.add("1"); //$NON-NLS-1$
+    minCombo.addListener(SWT.Modify, this);
+    minCombo.addSelectionListener(this);
+    
+		CLabel minLabel = getWidgetFactory().createCLabel(composite, XSDConstants.MINOCCURS_ATTRIBUTE + ":");
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(minCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(minCombo, 0, SWT.CENTER);
+		minLabel.setLayoutData(data);
+
+    maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
+    data = new FormData();
+    data.left = new FormAttachment(0, 100);
+    data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+    data.top = new FormAttachment(minCombo, +ITabbedPropertyConstants.VSPACE);
+    maxCombo.setLayoutData(data);
+    maxCombo.add("0"); //$NON-NLS-1$
+    maxCombo.add("1"); //$NON-NLS-1$
+    maxCombo.add("unbounded"); //$NON-NLS-1$
+    maxCombo.addListener(SWT.Modify, this);
+    maxCombo.addSelectionListener(this);
+    
+		CLabel maxLabel = getWidgetFactory().createCLabel(composite, XSDConstants.MAXOCCURS_ATTRIBUTE + ":");
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(maxCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(maxCombo, 0, SWT.CENTER);
+		maxLabel.setLayoutData(data);
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+    if (doRefresh)
+    {
+      if (isReadOnly)
+      {
+        composite.setEnabled(false);
+      }
+      else
+      {
+        composite.setEnabled(true);
+      }
+
+  	  setListenerEnabled(false);
+      boolean refreshMinText = true;
+      boolean refreshMaxText = true;
+      if (minCombo.isFocusControl())
+      {
+        refreshMinText = false;
+      }
+      if (maxCombo.isFocusControl())
+      {
+        refreshMaxText = false;
+      }
+      if (refreshMinText)
+      {
+        minCombo.setText(""); //$NON-NLS-1$
+      }
+      if (refreshMaxText)
+      {
+        maxCombo.setText(""); //$NON-NLS-1$
+      }
+  	  Object input = getInput();
+  	  if (input != null)
+  	  {
+  	    if (input instanceof XSDParticleContent)
+  	    {
+  		    XSDParticle particle = getAssociatedParticle((XSDParticleContent)input);
+  		    if (particle != null)
+  		    {
+  //  	      minText.setText(String.valueOf(particle.getMinOccurs()));
+  //	        maxText.setText(String.valueOf(particle.getMaxOccurs()));
+            Element element = particle.getElement();
+  		      if (element != null)
+  		      {
+  		        String min = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
+  		        String max = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
+  		        if (min != null && refreshMinText)
+  		        {
+  		          minCombo.setText(min);
+  		        }
+  		        if (max != null && refreshMaxText)
+  		        {
+  		          maxCombo.setText(max);
+  		        }
+  		      }
+  		    }
+  	    }
+  	  }
+  	  setListenerEnabled(true);
+    }
+	}
+	
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+  private XSDParticle getAssociatedParticle(XSDParticleContent particleContent)
+  {
+    XSDConcreteComponent xsdComp = particleContent.getContainer();
+    if (xsdComp instanceof XSDParticle)
+    {
+      return (XSDParticle)xsdComp;
+    }
+    return null;
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSectionDescriptor.java
new file mode 100644
index 0000000..b82b234
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSectionDescriptor.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDWildcard;
+
+public class MinMaxSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public MinMaxSectionDescriptor()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.minmax";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDElementDeclaration.class);
+    list.add(XSDModelGroup.class);
+    list.add(XSDWildcard.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new MinMaxSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+//      if (object instanceof XSDElementDeclaration)
+//      {
+//        Element element = ((XSDElementDeclaration)object).getElement();
+//        Object parentNode = element.getParentNode();
+//        // minOccurs and maxOccurs apply to non-global elements
+//        boolean isGlobalElement = XSDDOMHelper.inputEquals(parentNode, XSDConstants.SCHEMA_ELEMENT_TAG, false);
+//        return !isGlobalElement;
+//      }
+//      if (object instanceof XSDParticle)
+//      {
+//        XSDParticle particle = (XSDParticle)object;
+//        Element element = particle.getElement();
+//        if (inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+//        {
+//          return true;
+//        }
+//        else if (inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, true))
+//        {
+//          return false;
+//        }
+//        else
+//        {
+//          return true;
+//        }
+//      }
+      if (object instanceof XSDModelGroup)
+      {
+        return true;
+      }
+      else if (object instanceof XSDElementDeclaration)
+      {
+        XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)object;
+        if (xsdElementDeclaration.isGlobal())
+        {
+          return false;
+        }
+        else
+        {
+          return true;
+        }
+      }
+      else if (object instanceof XSDWildcard)
+      {
+        XSDWildcard wildcard = (XSDWildcard)object;
+        if (wildcard.getContainer() instanceof XSDComplexTypeDefinition ||
+            wildcard.getContainer() instanceof XSDAttributeGroupDefinition)
+        {
+          return false;
+        }
+        else
+        {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+  
+  public String getAfterSection()
+  {
+    return "org.eclipse.wst.wsdleditor.section.reference";
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSection.java
new file mode 100644
index 0000000..bfc6f8a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSection.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDModelGroup;
+import org.w3c.dom.Element;
+
+public class ModelGroupSection extends AbstractSection
+{
+  CCombo modelGroupCombo;
+  private String[] modelGroupComboValues = { "sequence", "choice", "all" }; //$NON-NLS-1$
+  
+  /**
+   * 
+   */
+  public ModelGroupSection()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite = getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+		modelGroupCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
+		data = new FormData();
+		data.left = new FormAttachment(0, 100);
+		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(0, 0);
+		modelGroupCombo.setLayoutData(data);
+		modelGroupCombo.addSelectionListener(this);
+		modelGroupCombo.setItems(modelGroupComboValues);
+
+		CLabel cLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_KIND")); //$NON-NLS-1$
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(modelGroupCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(modelGroupCombo, 0, SWT.CENTER);
+		cLabel.setLayoutData(data);
+
+	}
+ 	
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+	  setListenerEnabled(false);
+    if (isReadOnly)
+    {
+      composite.setEnabled(false);
+    }
+    else
+    {
+      composite.setEnabled(true);
+    }
+	  Object input = getInput();
+	  if (input != null)
+	  {
+      if (input instanceof XSDModelGroup)
+	    {
+	      XSDModelGroup particle = (XSDModelGroup)input;
+	      String modelType = particle.getCompositor().getName();
+	      modelGroupCombo.setText(modelType);
+	    }
+	  }
+	  setListenerEnabled(true);
+	}
+
+  public void widgetSelected(SelectionEvent e)
+  {
+    if (e.widget == modelGroupCombo)
+    {
+      Object input = getInput();
+	    if (input instanceof XSDModelGroup)
+	    {
+	      XSDModelGroup particle = (XSDModelGroup)input;
+
+        Element element = particle.getElement();
+        Element parent = (Element)element.getParentNode();
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_SCOPE_CHANGE"), parent); //$NON-NLS-1$
+//        changeContentModel(parent, modelGroupCombo.getText());
+        particle.setCompositor(XSDCompositor.get(modelGroupCombo.getText()));      
+        endRecording(parent);
+        refresh();
+	    }
+    }
+  }
+
+//  private void changeContentModel(Element parent, String contentModel)
+//  {
+//    Document doc = parent.getOwnerDocument();
+//    XSDDOMHelper domHelper = getDomHelper();
+//  
+//    String prefix = parent.getPrefix();
+//    prefix = prefix == null ? "" : prefix + ":";
+//    
+//    Element contentModelElement = domHelper.getContentModelFromParent(parent);
+//  
+//    if (contentModelElement.getLocalName().equals(contentModel))
+//    {
+//      return; // it's already the content model 
+//    }
+//  
+//    Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
+//  
+//    if (contentModelElement.hasChildNodes())
+//    {        
+//      NodeList nodes = contentModelElement.getChildNodes();
+//      // use clones so we don't have a refresh problem
+//      for (int i = 0; i < nodes.getLength(); i++)
+//      {
+//        Node node = nodes.item(i);
+//        newNode.appendChild(node.cloneNode(true)); 
+//      }
+//    }
+//    parent.replaceChild(newNode, contentModelElement);
+//  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSectionDescriptor.java
new file mode 100644
index 0000000..2f91552
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSectionDescriptor.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDModelGroup;
+
+public class ModelGroupSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public ModelGroupSectionDescriptor()
+  {
+    super();
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.modelgroup";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDModelGroup.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new ModelGroupSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDModelGroup)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSection.java
new file mode 100644
index 0000000..95ebbe3
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSection.java
@@ -0,0 +1,434 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalAttributeGroupRenamer;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalAttributeRenamer;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalElementRenamer;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalGroupRenamer;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalSimpleOrComplexTypeRenamer;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDComponent;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class NameSection extends AbstractSection
+{
+  /**
+   * 
+   */
+  public NameSection()
+  {
+    super();
+  }
+  
+	Text nameText;
+
+	
+  public void doHandleEvent(Event event) 
+  {
+    if (event.widget == nameText)
+	  {
+			Object input = getInput();
+      String newValue = nameText.getText();
+	    if (input instanceof XSDNamedComponent)
+	    {
+	      XSDNamedComponent namedComponent = (XSDNamedComponent)input;
+	      if (newValue.length() > 0)
+	      {
+	        namedComponent.setName(newValue);
+          doReferentialIntegrityCheck(namedComponent, newValue);
+	      }
+	      else
+	      {
+          // TODO: Show error message
+	      }
+	    }
+//	    else if (input instanceof XSDParticle)
+//	    {
+//	      XSDParticle xsdParticle = (XSDParticle)input;
+//	      if (newValue.length() > 0)
+//	      {
+//	        doReferentialIntegrityCheck(xsdParticle, newValue);
+//	      }
+//	      else
+//	      {
+//	        // TODO: Show error message
+//	      }
+//	    }
+      else if (input instanceof XSDAttributeDeclaration)
+      {
+        XSDAttributeDeclaration attribute = (XSDAttributeDeclaration)input;
+	      if (newValue.length() > 0)
+	      {
+	        doReferentialIntegrityCheck(attribute, newValue);
+	        attribute.setName(newValue);
+	      }
+	      else
+	      {
+	        // TODO: Show error message
+	      }
+      }
+	    else if (input instanceof XSDAttributeUse)
+      {
+        XSDAttributeUse attributeUse = (XSDAttributeUse)input;
+        XSDAttributeDeclaration attribute = attributeUse.getAttributeDeclaration();
+	      if (newValue.length() > 0)
+	      {
+	        doReferentialIntegrityCheck(attribute, newValue);
+	        attribute.setName(newValue);
+	        attributeUse.setAttributeDeclaration(attribute);
+	      }
+	      else
+	      {
+          // TODO: Show error message
+	      }
+      }
+	  }
+	}
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite =	getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+		nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
+		data = new FormData();
+		data.left = new FormAttachment(0, 100);
+		// data.right = new FormAttachment(95, 0);
+    data.right = new FormAttachment(100, -rightMarginSpace -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(0, 0);
+		nameText.setLayoutData(data);
+		nameText.addListener(SWT.Modify, this);
+
+		CLabel nameLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_NAME")); //$NON-NLS-1$
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(nameText, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(nameText, 0, SWT.CENTER);
+		nameLabel.setLayoutData(data);
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+    if (nameText.isFocusControl())
+    {
+      return;
+    }
+    setListenerEnabled(false);
+    nameText.setEditable(true);
+    if (isReadOnly)
+    {
+      composite.setEnabled(false);
+    }
+    else
+    {
+      composite.setEnabled(true);
+    }
+	  Object input = getInput();
+	  nameText.setText(""); //$NON-NLS-1$
+	  if (input != null)
+	  {
+	    if (input instanceof XSDComplexTypeDefinition || input instanceof XSDSimpleTypeDefinition)
+	    {
+	      XSDTypeDefinition type = (XSDTypeDefinition)input;
+	      
+	      Element element = type.getElement();
+        String name = element.getAttribute(XSDConstants.NAME_ATTRIBUTE);
+        if (name == null) name = "";
+        
+        boolean isAnonymousType = checkForAnonymousType(element);
+        if (isAnonymousType)
+        {
+          nameText.setText("**anonymous**"); //$NON-NLS-1$
+          nameText.setEditable(false);
+        }
+        else
+        {
+          nameText.setText(name);
+          nameText.setEditable(true);
+        }
+	    }
+	    else if (input instanceof XSDNamedComponent)
+	    {
+	      XSDNamedComponent namedComponent = (XSDNamedComponent)input;
+          String name = namedComponent.getName();
+	      if (name != null)
+	      {
+	        nameText.setText(name);
+	      }
+	    }
+      else if (input instanceof XSDAttributeDeclaration)
+      {
+        XSDAttributeDeclaration attribute = (XSDAttributeDeclaration)input;
+        //String name = attribute.getName();
+        Element element = attribute.getElement();
+        String name = element.getAttribute(XSDConstants.NAME_ATTRIBUTE);
+        if (name != null)
+	      {
+	        nameText.setText(name);
+	      }
+      }
+	    else if (input instanceof XSDAttributeUse)
+      {
+        XSDAttributeUse attributeUse = (XSDAttributeUse)input;
+        XSDAttributeDeclaration attribute = attributeUse.getAttributeDeclaration();
+        String name = attribute.getName();
+        if (name != null)
+	      {
+	        nameText.setText(name);
+	      }
+      }
+//	    else if (input instanceof Element)
+//	    {
+//	      String name = ((Element)input).getAttribute(XSDConstants.NAME_ATTRIBUTE);
+//	      if (name == null) name = "";
+//	      nameText.setText(name);
+//	    }
+	  }
+	  setListenerEnabled(true);
+	}
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+   */
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+	private void doReferentialIntegrityCheck(XSDComponent xsdComponent, String newValue)
+	{
+    Element element = xsdComponent.getElement();
+    if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+    {
+      if (validateName(newValue))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_NAME_CHANGE"), element); //$NON-NLS-1$
+        element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+        if (xsdComponent instanceof XSDNamedComponent)
+        {
+          ((XSDNamedComponent)xsdComponent).setName(newValue);
+        }
+        
+        // now rename any references to this element
+       
+        if (xsdSchema != null)
+        {
+          XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+          if (comp != null && comp instanceof XSDElementDeclaration && comp.getContainer().equals(xsdSchema))
+          {
+            GlobalElementRenamer renamer = new GlobalElementRenamer((XSDNamedComponent)comp, newValue);
+            renamer.visitSchema(xsdSchema);
+          }
+        }        
+        endRecording(element);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+    {
+      if (validateName(newValue))
+      {
+	      beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_NAME_CHANGE"), element); //$NON-NLS-1$
+	      if (newValue.length() > 0)
+	      {
+	        // now rename any references to this type
+	        if (xsdSchema != null)
+	        {
+	          XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+	          if (comp != null && comp instanceof XSDComplexTypeDefinition && comp.getContainer().equals(xsdSchema))
+	          {
+	            GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, newValue);
+	            renamer.visitSchema(xsdSchema);
+	          }
+	        }
+	        element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+	        ((XSDNamedComponent)xsdComponent).setName(newValue);
+	      }
+	      else
+	      {
+	        element.removeAttribute(XSDConstants.NAME_ATTRIBUTE);
+	      }
+      endRecording(element);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+    {
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_SIMPLETYPE_NAME_CHANGE"), element);
+      if (validateName(newValue))
+      {
+        // now rename any references to this type
+        if (newValue.length() > 0)
+        {
+          if (xsdSchema != null)
+          {
+            XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+            if (comp != null && comp instanceof XSDSimpleTypeDefinition && comp.getContainer().equals(xsdSchema))
+            {
+              GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, newValue);
+              renamer.visitSchema(xsdSchema);
+            }
+          }
+//          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+        }
+        else
+        {
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
+        }
+      }
+      endRecording(element);
+
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+    {  
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_NAME_CHANGE"), element); //$NON-NLS-1$
+      // now rename any references to this element
+      if (xsdSchema != null)
+       {
+        XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+        if (comp != null && comp instanceof XSDAttributeDeclaration && comp.getContainer().equals(xsdSchema))
+        {
+          GlobalAttributeRenamer renamer = new GlobalAttributeRenamer((XSDNamedComponent)comp, newValue);
+          renamer.visitSchema(xsdSchema);
+        }
+      }
+      // element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+      endRecording(element);
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
+    {  
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_NAME_CHANGE"), element); //$NON-NLS-1$
+      ((XSDNamedComponent)xsdComponent).setName(newValue);
+      // now rename any references to this element
+      if (xsdSchema != null)
+      {
+        XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+        if (comp != null && comp instanceof XSDAttributeGroupDefinition && comp.getContainer().equals(xsdSchema))
+        {
+          GlobalAttributeGroupRenamer renamer = new GlobalAttributeGroupRenamer((XSDNamedComponent)comp, newValue);
+          renamer.visitSchema(xsdSchema);
+        }
+      }
+      endRecording(element);
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.UNIQUE_ELEMENT_TAG, false))
+    {
+      if (validateName(newValue))
+       {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_UNIQUE_NAME_CHANGE"), element); //$NON-NLS-1$
+        if (newValue.length() > 0)
+        {
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+        }
+        else
+        {
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, ""); //$NON-NLS-1$
+        }
+        endRecording(element);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.KEY_ELEMENT_TAG, false))
+    {
+      if (validateName(newValue))
+      {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_KEY_NAME_CHANGE"), element); //$NON-NLS-1$
+        if (newValue.length() > 0)
+        {
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+        }
+        else
+        {
+          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, ""); //$NON-NLS-1$
+        }
+        endRecording(element);
+      }
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.GROUP_ELEMENT_TAG, false))
+    {
+      if (validateName(newValue))
+       {
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_NAME_CHANGE"), element); //$NON-NLS-1$
+        // now rename any references to this element
+        if (xsdSchema != null)
+         {
+          XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
+          if (comp != null && comp instanceof XSDModelGroupDefinition && comp.getContainer().equals(xsdSchema))
+          {
+            GlobalGroupRenamer renamer = new GlobalGroupRenamer((XSDNamedComponent)comp, newValue);
+            renamer.visitSchema(xsdSchema);
+          }
+        }
+        element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
+        endRecording(element);
+      }
+      
+    }
+    
+
+
+	}
+
+  boolean checkForAnonymousType(Element element)
+  {
+    Object parentElement = (Object)element.getParentNode();
+    boolean isAnonymous = false;
+    if (parentElement != null)
+    {
+      if (XSDDOMHelper.inputEquals(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+      {
+        if (XSDDOMHelper.inputEquals(parentElement, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+        {
+          isAnonymous = true; 
+        }
+      }
+      else if (XSDDOMHelper.inputEquals(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+      {
+        if (XSDDOMHelper.inputEquals(parentElement, XSDConstants.RESTRICTION_ELEMENT_TAG, false) ||
+            XSDDOMHelper.inputEquals(parentElement, XSDConstants.ELEMENT_ELEMENT_TAG, false) ||
+            XSDDOMHelper.inputEquals(parentElement, XSDConstants.UNION_ELEMENT_TAG, false) ||
+            XSDDOMHelper.inputEquals(parentElement, XSDConstants.LIST_ELEMENT_TAG, false) ||
+            XSDDOMHelper.inputEquals(parentElement, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+        {
+          isAnonymous = true;
+        }
+      }
+    }
+    return isAnonymous;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSectionDescriptor.java
new file mode 100644
index 0000000..e4349ea
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSectionDescriptor.java
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class NameSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
+{
+  /**
+   * 
+   */
+  public NameSectionDescriptor()
+  {
+    super();
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.name";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDNamedComponent.class);
+    list.add(XSDAttributeUse.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new NameSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDNamedComponent)
+      {
+        XSDNamedComponent namedComponent = (XSDNamedComponent)object;
+        Element element = namedComponent.getElement();
+        
+        if (inputEquals(element, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false) ||
+            inputEquals(element, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+        {
+          return false;
+        }
+        
+        // don't want to show editable name section for ref's
+        // need to show ref section with a combobox
+        
+        if (namedComponent instanceof XSDElementDeclaration)
+        {
+          if (((XSDElementDeclaration)namedComponent).isElementDeclarationReference())
+          {
+            return false;
+          }
+          else
+          {
+            return true;
+          }
+        }
+        else if (namedComponent instanceof XSDAttributeDeclaration)
+        {
+          if (((XSDAttributeDeclaration)namedComponent).isAttributeDeclarationReference())
+          {
+            return false;
+          }
+          else
+          {
+            return true;
+          }
+        }
+
+        if (element != null)
+        {
+          if (inputEquals(element, element.getLocalName(), true))
+          {
+            return false;
+          }
+          else
+          {
+            return true;
+          }
+        }
+      }
+//      else if (object instanceof XSDParticle)
+//      {
+//        XSDParticle particle = (XSDParticle)object;
+//        Element element = particle.getElement();
+//        if (inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+//        {
+//          return true;
+//        }
+//        else if (inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, true))
+//        {
+//          return false;
+//        }
+//        else
+//        {
+//          return false;
+//        }
+//      }
+      else if (object instanceof XSDAttributeUse)
+      {
+        XSDAttributeUse attributeUse = (XSDAttributeUse)object;
+        Element element = attributeUse.getElement();
+        if (inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+        {
+          return true;
+        }
+        else
+        {
+          return false;
+        }
+      }
+
+    }
+
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationDescriptor.java
new file mode 100644
index 0000000..f86fe2d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationDescriptor.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDImport;
+
+public class NamespaceAndSchemaLocationDescriptor extends AbstractSectionDescriptor
+{
+	  NamespaceAndSchemaLocationSection namespaceAndSchemaLocationSection;
+	  /**
+	   * 
+	   */
+	  public NamespaceAndSchemaLocationDescriptor()
+	  {
+	    super();
+	    namespaceAndSchemaLocationSection = new NamespaceAndSchemaLocationSection();
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+	   */
+	  public String getId()
+	  {
+	    return "org.eclipse.wst.xsdeditor.section.namespaceAndSchemaLocationSection";
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+	   */
+	  public List getInputTypes()
+	  {
+	    List list = new ArrayList();
+	    list.add(XSDConcreteComponent.class);
+	    return list;
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+	   */
+	  public ISection getSectionClass()
+	  {
+	    return namespaceAndSchemaLocationSection;
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+	   */
+	  public String getTargetTab()
+	  {
+	    return "org.eclipse.wst.xmlwebservices.general";
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+	   */
+	  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+	  {
+	    Object object = null;	    
+	    
+	    if (selection instanceof StructuredSelection)
+	    {
+	      StructuredSelection structuredSelection = (StructuredSelection)selection;
+	      object = structuredSelection.getFirstElement();
+	      if (object instanceof XSDImport) {
+		    return true;
+	      }
+	    }
+	    
+	    return false;
+	  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationSection.java
new file mode 100644
index 0000000..91a1924
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationSection.java
@@ -0,0 +1,361 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
+import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.impl.XSDImportImpl;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class NamespaceAndSchemaLocationSection extends CommonDirectivesSection
+{
+	Text namespaceText, prefixText;
+  protected String oldPrefixValue;
+	  
+	public NamespaceAndSchemaLocationSection()
+  {
+		super();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
+
+		CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_NAMESPACE")); //$NON-NLS-1$
+    namespaceText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
+		namespaceText.setEditable(false);
+
+    FormData data = new FormData();
+    data.left = new FormAttachment(0, 0);
+    data.right = new FormAttachment(namespaceText, +ITabbedPropertyConstants.HSPACE);
+    data.top = new FormAttachment(namespaceText, 0, SWT.CENTER);
+    namespaceLabel.setLayoutData(data);
+    
+    data = new FormData();
+    data.left = new FormAttachment(0, 110);
+    data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+    data.top = new FormAttachment(0, 0);
+    namespaceText.setLayoutData(data);
+    
+		CLabel prefixLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_PREFIX")); //$NON-NLS-1$				
+		prefixText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
+		prefixText.setEditable(true);
+    prefixText.addListener(SWT.Modify, this);
+
+    data = new FormData();
+    data.left = new FormAttachment(0, 0);
+    data.right = new FormAttachment(prefixText, 0);
+    data.top = new FormAttachment(prefixText, 0, SWT.CENTER);
+    prefixLabel.setLayoutData(data);  
+    
+		data = new FormData();
+		data.left = new FormAttachment(0, 110);
+		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(namespaceText, +ITabbedPropertyConstants.VSPACE);
+		prefixText.setLayoutData(data);
+   
+		// Create Schema Location Label
+		CLabel schemaLocationLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")); //$NON-NLS-1$
+    schemaLocationText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
+
+		// Create Wizard Button
+		wizardButton = getWidgetFactory().createButton(composite, "", SWT.NONE); //$NON-NLS-1$
+    wizardButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
+		FormData buttonFormData = new FormData();
+		buttonFormData.left = new FormAttachment(100, -rightMarginSpace + 2);
+		buttonFormData.right = new FormAttachment(100, 0);
+		buttonFormData.top = new FormAttachment(schemaLocationText, 0, SWT.CENTER);
+		wizardButton.setLayoutData(buttonFormData);
+		wizardButton.addSelectionListener(this);
+		
+		// Create Schema Location Text
+		schemaLocationText.setEditable(true);
+		FormData schemaLocationData = new FormData();
+		schemaLocationData.left = new FormAttachment(0, 110);
+		schemaLocationData.right = new FormAttachment(wizardButton, 0);
+		schemaLocationData.top = new FormAttachment(prefixText, +ITabbedPropertyConstants.VSPACE);
+		schemaLocationText.setLayoutData(schemaLocationData);
+		schemaLocationText.addListener(SWT.Modify, this);
+    
+    data = new FormData();
+    data.left = new FormAttachment(0, 0);
+    data.right = new FormAttachment(schemaLocationText, 0);
+    data.top = new FormAttachment(schemaLocationText, 0, SWT.CENTER);
+    schemaLocationLabel.setLayoutData(data);
+    
+    // error text
+    errorText = new StyledText(composite, SWT.FLAT);
+    errorText.setEditable(false);
+    errorText.setEnabled(false);
+    errorText.setText("");
+    
+    data = new FormData();
+    data.left = new FormAttachment(schemaLocationText, 0, SWT.LEFT);
+    data.right = new FormAttachment(100, 0);
+    data.top = new FormAttachment(schemaLocationText, 0);
+    errorText.setLayoutData(data);
+  }
+	
+	public void widgetSelected(SelectionEvent event)
+  {
+		if (event.widget == wizardButton)
+    {
+      setListenerEnabled(false);
+			Shell shell = Display.getCurrent().getActiveShell();
+		    
+			IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
+			ViewerFilter filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$ 
+		            new IFile[] { currentIFile },
+		            null);
+		      
+			XSDSelectIncludeFileWizard fileSelectWizard = 
+			   new XSDSelectIncludeFileWizard(xsdSchema, 
+                                        false,
+			                                  XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
+			                                  XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
+			                                  filter,
+			                                  (IStructuredSelection) selection);
+
+			WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
+			wizardDialog.create();
+			wizardDialog.setBlockOnOpen(true);
+			int result = wizardDialog.open();
+			  
+		  String value = schemaLocationText.getText();
+      prefixText.removeListener(SWT.Modify, this);
+		  if (result == Window.OK)
+		  {
+        errorText.setText("");
+        IFile selectedIFile = fileSelectWizard.getResultFile();
+        String schemaFileString = value;
+        if (selectedIFile != null) 
+        {
+          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
+        }
+        else
+        {
+          schemaFileString = fileSelectWizard.getURL();
+        }
+
+        String namespace = fileSelectWizard.getNamespace();
+        if (namespace == null) namespace = "";
+
+        XSDSchema externalSchema = fileSelectWizard.getExternalSchema();
+        handleSchemaLocationChange(schemaFileString, namespace, externalSchema);
+		  }
+      setListenerEnabled(true);
+      prefixText.addListener(SWT.Modify, this);
+		}
+	}
+
+  protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
+  {
+    XSDConcreteComponent comp = (XSDConcreteComponent)getInput();
+    if (comp instanceof XSDImport)
+    {
+      XSDImport xsdImport = (XSDImport)comp;
+      Element importElement = comp.getElement();
+      
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_IMPORT_CHANGE"), importElement);
+
+      xsdImport.setNamespace(namespace);
+      xsdImport.setSchemaLocation(schemaFileString);
+      xsdImport.setResolvedSchema(externalSchema);
+      
+      java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+      
+//      System.out.println("changed Import Map is " + map.values());
+//      System.out.println("changed import Map keys are " + map.keySet());
+
+      // Referential integrity on old import
+      // How can we be sure that if the newlocation is the same as the oldlocation
+      // the file hasn't changed
+      
+      XSDSchema referencedSchema = xsdImport.getResolvedSchema();
+      if (referencedSchema != null)
+      {
+        XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
+        cleanHelper.visitSchema(xsdSchema);
+      }
+
+      Element schemaElement = getSchema().getElement();
+
+      // update the xmlns in the schema element first, and then update the import element next
+      // so that the last change will be in the import element.  This keeps the selection
+      // on the import element
+      TypesHelper helper = new TypesHelper(externalSchema);
+      String prefix = helper.getPrefix(namespace, false);
+      
+      if (map.containsKey(prefix))
+      {
+        prefix = null;
+      }
+
+      if (prefix == null || (prefix !=null && prefix.length() == 0))
+      {
+        StringBuffer newPrefix = new StringBuffer("pref");  //$NON-NLS-1$
+        int prefixExtension = 1;
+        while (map.containsKey(newPrefix.toString()) && prefixExtension < 100)
+        {
+          newPrefix = new StringBuffer("pref" + String.valueOf(prefixExtension));
+          prefixExtension++;
+        }
+        prefix = newPrefix.toString();
+      }
+
+      if (namespace.length() > 0)
+      {
+        // if ns already in map, use its corresponding prefix
+        if (map.containsValue(namespace))
+        {
+          TypesHelper typesHelper = new TypesHelper(xsdSchema);
+          prefix = typesHelper.getPrefix(namespace, false);
+        }
+        else // otherwise add to the map
+        {
+          schemaElement.setAttribute("xmlns:"+prefix, namespace);
+        }
+        prefixText.setText(prefix);
+      }
+      else
+      {
+        prefixText.setText("");
+        namespaceText.setText("");
+      }
+        
+      endRecording(importElement);
+      
+//      System.out.println("changed Import Map is " + map.values());
+//      System.out.println("changed import Map keys are " + map.keySet());
+
+    }        
+    refresh();
+  }
+  
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+		if (doRefresh)
+		{
+      errorText.setText("");
+			setListenerEnabled(false);
+
+			Element element = null;
+			if (input instanceof XSDImport) { 
+				element = ((XSDImportImpl) input).getElement();
+				
+				String namespace = element.getAttribute("namespace"); //$NON-NLS-1$
+				String schemaLocation = element.getAttribute("schemaLocation"); //$NON-NLS-1$
+				
+				TypesHelper helper = new TypesHelper(xsdSchema);
+		        String prefix = helper.getPrefix(element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE), false);
+
+				if (namespace == null) {
+					namespace = ""; //$NON-NLS-1$
+				}
+				if (prefix == null) {
+					prefix = ""; //$NON-NLS-1$
+				}
+				if (schemaLocation == null) {
+					schemaLocation = ""; //$NON-NLS-1$
+				}
+				
+				namespaceText.setText(namespace);
+				prefixText.setText(prefix);
+				schemaLocationText.setText(schemaLocation);
+        oldPrefixValue = prefixText.getText();
+			}
+
+			setListenerEnabled(true);
+		}
+	}
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+   */
+  public boolean shouldUseExtraSpace()
+  {
+    return true;
+  }
+
+  public void doHandleEvent(Event event)
+  {
+    super.doHandleEvent(event);
+    if (event.type == SWT.Modify)
+    {
+      if (event.widget == prefixText)
+      {
+        if (validatePrefix(prefixText.getText()) && schemaLocationText.getText().trim().length() > 0)
+        {
+          Element element = ((XSDConcreteComponent)getInput()).getElement();
+          Map map = getSchema().getQNamePrefixToNamespaceMap();
+
+          if (map.containsKey(prefixText.getText()))
+          {
+            setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_PREFIX_EXISTS"));
+          }
+          else
+          {
+            beginRecording(XSDEditorPlugin.getXSDString("_UI_PREFIX_CHANGE"), element);
+            
+            Element schemaElement = getSchema().getElement();
+            schemaElement.removeAttribute("xmlns:"+oldPrefixValue);
+            schemaElement.setAttribute("xmlns:" + prefixText.getText(), namespaceText.getText());
+            XSDSchemaHelper.updateElement(getSchema());
+
+            clearErrorMessage();
+            oldPrefixValue = prefixText.getText();
+            endRecording(element);  
+
+//            System.out.println("Map is " + map.values());
+//            System.out.println("Map keys are " + map.keySet());
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSection.java
new file mode 100644
index 0000000..f32b09c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSection.java
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.Iterator;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDProcessContents;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class NamespaceProcessContentsSection extends AbstractSection
+{
+  CCombo namespaceCombo;
+  CCombo processContentsCombo;
+  
+  private String[] namespaceComboValues = {
+      "",               //$NON-NLS-1$
+      "##any",          //$NON-NLS-1$
+      "##other",        //$NON-NLS-1$
+      "##targetNamespace", //$NON-NLS-1$
+      "##local" //$NON-NLS-1$
+  };
+
+  /**
+   * 
+   */
+  public NamespaceProcessContentsSection()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent,TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		Composite composite =	getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+		
+
+		namespaceCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
+		data = new FormData();
+		data.left = new FormAttachment(0, 100);
+		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(0, 0);
+		namespaceCombo.setLayoutData(data);
+//		Iterator list = XSDNamespaceConstraintCategory.VALUES.iterator();
+//		while (list.hasNext())
+//		{
+//		  namespaceCombo.add(((XSDNamespaceConstraintCategory)list.next()).getName());
+//		}
+		namespaceCombo.setItems(namespaceComboValues);
+		namespaceCombo.addSelectionListener(this);
+
+		CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, XSDConstants.NAMESPACE_ATTRIBUTE);
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(namespaceCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(namespaceCombo, 0, SWT.CENTER);
+		namespaceLabel.setLayoutData(data);
+
+		processContentsCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
+		data = new FormData();
+		data.left = new FormAttachment(0, 100);
+		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(namespaceCombo, +ITabbedPropertyConstants.VSPACE);
+		processContentsCombo.setLayoutData(data);
+		Iterator list = XSDProcessContents.VALUES.iterator();
+		processContentsCombo.add(""); //$NON-NLS-1$
+		while (list.hasNext())
+		{
+		  processContentsCombo.add(((XSDProcessContents)list.next()).getName());
+		}
+		processContentsCombo.addSelectionListener(this);
+
+		CLabel processContentsLabel = getWidgetFactory().createCLabel(composite, XSDConstants.PROCESSCONTENTS_ATTRIBUTE);
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(processContentsCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(processContentsCombo, 0, SWT.CENTER);
+		processContentsLabel.setLayoutData(data);
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+//	  namespaceCombo.removeSelectionListener(this);
+//	  processContentsCombo.removeSelectionListener(this);
+	  namespaceCombo.setText(""); //$NON-NLS-1$
+	  processContentsCombo.setText(""); //$NON-NLS-1$
+	  Object input = getInput();
+	  if (input != null)
+	  {
+	    if (input instanceof XSDWildcard)
+	    {
+	      XSDWildcard wildcard = (XSDWildcard)input;
+	      if (wildcard.isSetLexicalNamespaceConstraint())
+	      {
+	        namespaceCombo.setText(wildcard.getStringLexicalNamespaceConstraint());
+	      }
+	      else
+	      {
+	        namespaceCombo.setText("");
+	      }
+	      if (wildcard.isSetProcessContents())
+	      {
+	        XSDProcessContents pc = wildcard.getProcessContents();
+	        processContentsCombo.setText(pc.getName());
+	      }
+	    }
+	  }
+	}
+	
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+  public void widgetSelected(SelectionEvent e)
+  {
+    XSDConcreteComponent concreteComponent = (XSDConcreteComponent)getInput();
+    Element element = concreteComponent.getElement();
+    if (concreteComponent instanceof XSDWildcard)
+    {
+      XSDWildcard wildcard =  (XSDWildcard)concreteComponent;
+      if (e.widget == namespaceCombo)
+      {
+        String newValue = namespaceCombo.getText();
+        boolean removeAttribute = false;
+        if (newValue.length() == 0)
+        {
+          removeAttribute = true;
+        }
+
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"), element); //$NON-NLS-1$
+        if (removeAttribute)
+        {
+          wildcard.unsetLexicalNamespaceConstraint();
+        }
+        else
+        {
+          wildcard.setStringLexicalNamespaceConstraint(newValue);
+        }
+        endRecording(element);
+      }
+      else if (e.widget == processContentsCombo)
+      {
+        String newValue = processContentsCombo.getText();
+        boolean removeAttribute = false;
+        if (newValue.length() == 0)
+        {
+          removeAttribute = true;
+        }
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_PROCESSCONTENTS_CHANGE"), element); //$NON-NLS-1$
+        if (removeAttribute)
+        {
+          wildcard.unsetProcessContents();
+        }
+        else
+        {
+          wildcard.setProcessContents(XSDProcessContents.get(processContentsCombo.getItem(processContentsCombo.getSelectionIndex())));
+        }
+        endRecording(element);
+      }
+    }
+    refresh();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSectionDescriptor.java
new file mode 100644
index 0000000..87608c9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSectionDescriptor.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDWildcard;
+
+public class NamespaceProcessContentsSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public NamespaceProcessContentsSectionDescriptor()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.namespaceprocesscontents";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDWildcard.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new NamespaceProcessContentsSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDWildcard)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSection.java
new file mode 100644
index 0000000..468106e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSection.java
@@ -0,0 +1,430 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.XSDEditNamespacesAction;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.TargetNamespaceChangeHandler;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class NamespaceSection extends AbstractSection
+{
+	  IWorkbenchPart part;
+	  Text prefixText;
+	  Text targetNamespaceText;
+    Button editButton;
+    StyledText errorText;
+    Color red;
+	  
+	  /**
+	   * 
+	   */
+	  public NamespaceSection()
+	  {
+	    super();
+	  }
+
+		/**
+		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+		 */
+		public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+		{
+			super.createControls(parent, factory);
+			Composite composite = getWidgetFactory().createFlatFormComposite(parent);
+      
+			// Create Prefix Label
+			CLabel prefixLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_PREFIX")); //$NON-NLS-1$
+
+      int leftCoordinate = getStandardLabelWidth(composite, 
+          new String[] {XSDEditorPlugin.getXSDString("_UI_LABEL_TARGET_NAME_SPACE"), XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_PREFIX")});
+      
+			// Create Prefix Text
+			prefixText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
+			FormData prefixTextData = new FormData();
+			// prefixTextData.left = new FormAttachment(0, 115);
+      prefixTextData.left = new FormAttachment(0, leftCoordinate);
+			prefixTextData.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+			prefixText.setLayoutData(prefixTextData);
+			prefixText.addListener(SWT.Modify, this);		    
+		    
+			FormData data = new FormData();
+			data.left = new FormAttachment(0, 0);
+			data.right = new FormAttachment(prefixText, -ITabbedPropertyConstants.HSPACE);
+      data.top = new FormAttachment(prefixText, 0, SWT.CENTER);
+			prefixLabel.setLayoutData(data);
+
+			// Create TargetNamespace Label
+			CLabel targetNamespaceLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_TARGET_NAME_SPACE")); //$NON-NLS-1$
+      
+      // Create TargetNamespace Text
+      targetNamespaceText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
+      
+			FormData tnsLabelData = new FormData();
+			tnsLabelData.left = new FormAttachment(0, 0);
+      tnsLabelData.right = new FormAttachment(targetNamespaceText, -ITabbedPropertyConstants.HSPACE); 
+			tnsLabelData.top = new FormAttachment(targetNamespaceText, 0, SWT.CENTER);
+			targetNamespaceLabel.setLayoutData(tnsLabelData);
+
+      FormData tnsTextData = new FormData();
+      // tnsTextData.left = new FormAttachment(0, 115);
+      tnsTextData.left = new FormAttachment(0, leftCoordinate);
+      tnsTextData.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+      tnsTextData.top = new FormAttachment(prefixText, +ITabbedPropertyConstants.VSPACE);
+      targetNamespaceText.setLayoutData(tnsTextData);
+      targetNamespaceText.addListener(SWT.Modify, this);
+      
+      // Advanced Button
+      editButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_SECTION_ADVANCED_ATTRIBUTES") + "...", SWT.PUSH);
+
+      FormData buttonFormData = new FormData();
+      buttonFormData.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+      buttonFormData.top = new FormAttachment(targetNamespaceText, +ITabbedPropertyConstants.VSPACE);
+      editButton.setLayoutData(buttonFormData);
+      editButton.addSelectionListener(this);
+
+      // error text
+      errorText = new StyledText(composite, SWT.FLAT);
+      errorText.setEditable(false);
+      errorText.setEnabled(false);
+      errorText.setText("");
+      
+      data = new FormData();
+      data.left = new FormAttachment(targetNamespaceText, 0, SWT.LEFT);
+      data.right = new FormAttachment(100, 0);
+      data.top = new FormAttachment(editButton, 0);
+      errorText.setLayoutData(data);
+    }
+
+		/*
+		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+		 */
+		public void refresh()
+		{
+      if (doRefresh)
+      {
+        // hack...open bug against properties
+        if (prefixText.isDisposed() || targetNamespaceText.isDisposed())
+        {
+          return;
+        }
+        if (prefixText.isFocusControl() || targetNamespaceText.isFocusControl())
+        {
+          return;
+        }
+
+        setListenerEnabled(false);
+	    	 
+			  Element element = xsdSchema.getElement();
+	    	
+        if (element != null)
+        {
+  		    // Handle prefixText
+  			  TypesHelper helper = new TypesHelper(xsdSchema);
+    		  String aPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
+        
+          if (aPrefix != null && aPrefix.length() > 0)
+  	      {
+  	  	  	prefixText.setText(aPrefix);
+  	  	  }
+  	  	  else
+          {
+  			  	prefixText.setText(""); //$NON-NLS-1$
+  			  }
+  	    	 
+  				// Handle TargetNamespaceText
+  				String tns = element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
+  			  if (tns != null && tns.length() > 0)
+          {
+   	        targetNamespaceText.setText(tns);
+   	      }
+  			  else
+          {
+  				  targetNamespaceText.setText(""); //$NON-NLS-1$
+  			  }
+          errorText.setText("");
+        }
+				setListenerEnabled(true);
+			}
+		}
+		
+		public void doHandleEvent(Event event)
+		{
+          errorText.setText("");
+          String prefixValue = prefixText.getText();
+          String tnsValue = targetNamespaceText.getText();
+          if (tnsValue.trim().length() == 0)
+          {
+            if (prefixValue.trim().length() > 0)
+            {
+              errorText.setText(XSDEditorPlugin.getXSDString("_ERROR_TARGET_NAMESPACE_AND_PREFIX"));
+              int length = errorText.getText().length();
+              red = new Color(null, 255, 0, 0);
+              StyleRange style = new StyleRange(0, length, red, targetNamespaceText.getBackground());
+              errorText.setStyleRange(style);
+              return;
+            }
+          }
+
+		  if (event.widget == prefixText)
+		  {
+            updateNamespaceInfo(prefixValue, tnsValue);
+		  }
+		  else if (event.widget == targetNamespaceText)
+          {
+            updateNamespaceInfo(prefixValue, tnsValue);
+		  }
+		}
+		
+		public void doWidgetSelected(SelectionEvent e) {
+			if (e.widget == editButton) {
+				XSDEditNamespacesAction nsAction = new XSDEditNamespacesAction(XSDEditorPlugin.getXSDString("_UI_ACTION_EDIT_NAMESPACES"), xsdSchema.getElement(), null, xsdSchema); //$NON-NLS-1$ 
+				nsAction.run();
+				refresh();				
+			}			
+		}
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+	   */
+	  public boolean shouldUseExtraSpace()
+	  {
+	    return true;
+	  }
+
+	  private void updateNamespaceInfo(String newPrefix, String newTargetNamespace)
+	  {
+	    Element element = xsdSchema.getElement();
+	    DocumentImpl doc = (DocumentImpl)element.getOwnerDocument();
+
+	    String modelTargetNamespace = xsdSchema.getTargetNamespace();
+	    String oldNamespace = xsdSchema.getTargetNamespace();
+	    
+	    TypesHelper helper = new TypesHelper(xsdSchema);
+   		String oldPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
+	    
+	    if (modelTargetNamespace == null)
+	    {
+	      modelTargetNamespace = ""; //$NON-NLS-1$
+	    }
+	        
+	    String targetNamespace = newTargetNamespace.trim(); 
+	    String prefix = newPrefix.trim();
+
+	    if (!validatePrefix(prefix) || !validateTargetNamespace(targetNamespace))
+	    {
+	      return;
+	    }
+	        
+	    if (prefix.length() > 0 && targetNamespace.length() == 0)
+	    {
+	       // can't have blank targetnamespace and yet specify a prefix
+	       return;
+	    }
+
+	    doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_TARGETNAMESPACE_CHANGE")); //$NON-NLS-1$
+	    String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
+	    Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+
+//	 For debugging
+//	        System.out.println("1. SW Map is " + map.values());
+//	        System.out.println("1. SW Map keys are " + map.keySet());
+
+	    // Check if prefix is blank
+	    // if it is, then make sure we have a prefix 
+	    // for schema for schema
+	    if (prefix.length() == 0)
+	    {
+	      // if prefix for schema for schema is blank
+	      // then set it to value specified in preference
+	      // and update ALL nodes with this prefix
+	      if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
+	      {
+	        // get preference prefix
+	        xsdForXSDPrefix = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
+	        // get a unique prefix by checking what's in the map
+
+	        xsdForXSDPrefix = getUniqueSchemaForSchemaPrefix(xsdForXSDPrefix, map);
+	        element.setAttribute("xmlns:" + xsdForXSDPrefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); //$NON-NLS-1$
+
+	        updateAllNodes(element, xsdForXSDPrefix);
+	            
+	        // remove the old xmlns attribute for the schema for schema
+	        if (element.getAttribute("xmlns") != null && //$NON-NLS-1$
+	            element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
+	        {
+	          element.removeAttribute("xmlns"); //$NON-NLS-1$
+	        }
+	      }
+	    }
+
+	    if (targetNamespace.length() > 0 ||
+	       (targetNamespace.length() == 0 && prefix.length() == 0))
+	    {
+	      // clean up the old prefix for this schema
+	      if (oldPrefix != null && oldPrefix.length() > 0)
+	      {
+	        element.removeAttribute("xmlns:"+oldPrefix); //$NON-NLS-1$
+//	            element.setAttribute("xmlns:" + prefix, targetNamespace);
+//	            java.util.Map prefixToNameSpaceMap = xsdSchema.getQNamePrefixToNamespaceMap();
+//	            prefixToNameSpaceMap.remove(oldPrefix);
+	      }
+	      else // if no prefix
+	      {
+	        if (element.getAttribute("xmlns") != null) //$NON-NLS-1$
+	        {
+	          if (!element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
+	           {
+	            element.removeAttribute("xmlns"); //$NON-NLS-1$
+	          }
+	        }
+	      }
+	    }
+
+	    if (targetNamespace.length() > 0)
+	    {
+	      if (!modelTargetNamespace.equals(targetNamespace))
+	      {
+	        element.setAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE, targetNamespace);
+	      }
+	      // now set the new xmlns:prefix attribute
+	      if (prefix.length() > 0)
+	      {
+	        element.setAttribute("xmlns:" + prefix, targetNamespace); //$NON-NLS-1$
+	      }
+	      else
+	      {
+	        element.setAttribute("xmlns", targetNamespace); //$NON-NLS-1$
+	      }
+	      // set the targetNamespace attribute
+	    }
+	    else // else targetNamespace is blank
+	    {
+	      if (prefix.length() == 0)
+	      {
+	        element.removeAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
+	      }
+	    }
+
+//	    System.out.println("1.5 SW Map is " + map.values());
+//	    System.out.println("1.5 SW Map keys are " + map.keySet());
+	    
+	    // do our own referential integrity
+	    TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, oldNamespace, targetNamespace);
+	    targetNamespaceChangeHandler.resolve();
+	    
+	    XSDSchemaHelper.updateElement(xsdSchema);
+	    
+	    doc.getModel().endRecording(this);
+
+//	 For debugging
+//	        map = xsdSchema.getQNamePrefixToNamespaceMap();
+//	        System.out.println("2. SW Map is " + map.values());
+//	        System.out.println("2. SW Map keys are " + map.keySet());
+	  }
+
+	  private String getUniqueSchemaForSchemaPrefix(String xsdForXSDPrefix, Map map)
+	  {
+	    if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
+	     {       
+	      xsdForXSDPrefix = "xsd"; //$NON-NLS-1$
+	    }
+	    // ensure prefix is unique
+	    int prefixExtension = 1;
+	    while (map.containsKey(xsdForXSDPrefix) && prefixExtension < 100)
+	     {
+	      xsdForXSDPrefix = xsdForXSDPrefix + String.valueOf(prefixExtension);
+	      prefixExtension++;
+	    }
+	    return xsdForXSDPrefix;
+	  }
+	  
+	  private void updateAllNodes(Element element, String prefix)
+	  {
+	    element.setPrefix(prefix);
+	    NodeList list = element.getChildNodes();
+	    if (list != null)
+	    {
+	      for (int i=0; i < list.getLength(); i++)
+	      {
+	        Node child = list.item(i);
+	        if (child != null && child instanceof Element)
+	        {
+	          child.setPrefix(prefix);
+	          if (child.hasChildNodes())
+	          {
+	            updateAllNodes((Element)child, prefix);
+	          }
+	        }
+	      }
+	    }   
+	  }
+	  
+	  private boolean validateTargetNamespace(String ns)
+	  {
+	    // will allow blank namespace !!
+	    if (ns.equals(""))
+	     {
+	      return true;
+	    }
+	    
+	    String errorMessage = null;
+      try
+      {
+        URI testURI = new URI(ns);
+        testURI.isAbsolute();
+      }
+      catch (URISyntaxException e)
+      {
+	      errorMessage = XSDEditorPlugin.getXSDString("_WARN_INVALID_TARGET_NAMESPACE"); //$NON-NLS-1$
+	    }
+	    
+	    if (errorMessage == null || errorMessage.length() == 0)
+	     {
+	      return true;
+	    }
+	    return false;
+	  }
+    
+    public void dispose()
+    {
+      super.dispose();
+      if (red != null)
+      {
+        red.dispose();
+        red = null;
+      }
+    }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSectionDescriptor.java
new file mode 100644
index 0000000..69f2d15
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSectionDescriptor.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.impl.XSDSchemaImpl;
+
+public class NamespaceSectionDescriptor extends AbstractSectionDescriptor
+{
+	  NamespaceSection namespaceSection;
+	  /**
+	   * 
+	   */
+	  public NamespaceSectionDescriptor()
+	  {
+	    super();
+	    namespaceSection = new NamespaceSection();
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+	   */
+	  public String getId()
+	  {
+	    return "org.eclipse.wst.xsdeditor.section.namespaceSection";
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+	   */
+	  public List getInputTypes()
+	  {
+	    List list = new ArrayList();
+	    list.add(XSDConcreteComponent.class);
+	    return list;
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+	   */
+	  public ISection getSectionClass()
+	  {
+	    return namespaceSection;
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+	   */
+	  public String getTargetTab()
+	  {
+	    return "org.eclipse.wst.xmlwebservices.general";
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+	   */
+	  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+	  {
+	    Object object = null;
+	    if (selection instanceof StructuredSelection)
+	    {
+	      StructuredSelection structuredSelection = (StructuredSelection)selection;
+	      object = structuredSelection.getFirstElement();
+	      if (object instanceof XSDSchemaImpl) {
+	      	return true;
+	      }
+	    }
+	    
+	    return false;
+	  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSection.java
new file mode 100644
index 0000000..2b934bc
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSection.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.properties.XSDPropertySourceProvider;
+import org.eclipse.xsd.XSDElementDeclaration;
+
+public class OtherAttributesSection extends AbstractSection
+{
+  PropertySheetPage propertySheetPage;
+  
+  /**
+   * 
+   */
+  public OtherAttributesSection()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite = getWidgetFactory().createFlatFormComposite(parent);
+		FormData data = new FormData();
+		data.left = new FormAttachment(0, 0);
+    data.right = new FormAttachment(100, 0);
+		data.top = new FormAttachment(0, 0);
+		data.bottom = new FormAttachment(100, 0);
+
+    propertySheetPage = new PropertySheetPage();
+		propertySheetPage.createControl(composite);
+    propertySheetPage.setPropertySourceProvider(new XSDPropertySourceProvider());
+    propertySheetPage.getControl().setLayoutData(data);
+	}
+	
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+    if (doRefresh)
+    {
+      if (isReadOnly)
+      {
+        composite.setEnabled(false);
+      }
+      else
+      {
+        composite.setEnabled(true);
+      }
+    }
+    propertySheetPage.refresh();
+	}
+
+  public void dispose()
+  {
+    super.dispose();
+    if (propertySheetPage != null)
+    {
+      propertySheetPage.dispose();
+      propertySheetPage = null;
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+   */
+  public boolean shouldUseExtraSpace()
+  {
+    return true;
+  }
+  
+  public void setInput(IWorkbenchPart part, ISelection selection)
+  {
+    super.setInput(part, selection);
+    if (input instanceof XSDElementDeclaration)
+    {
+      XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)input;
+      if (elementDeclaration.isElementDeclarationReference())
+      {
+        input = elementDeclaration.getResolvedElementDeclaration();
+        
+        isReadOnly = (!(elementDeclaration.getResolvedElementDeclaration().getRootContainer() == xsdSchema));
+      }
+    }
+    // update property sheet because of new input change
+    propertySheetPage.selectionChanged(part, selection);
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSectionDescriptor.java
new file mode 100644
index 0000000..ce3808b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSectionDescriptor.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDAnnotation;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDEnumerationFacet;
+import org.eclipse.xsd.XSDIdentityConstraintCategory;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDPatternFacet;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+
+public class OtherAttributesSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public OtherAttributesSectionDescriptor()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.otherattributes";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDConcreteComponent.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new OtherAttributesSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.other";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDConcreteComponent)
+      {
+      	if (object instanceof XSDAttributeGroupDefinition ||
+      	    object instanceof XSDAttributeUse ||
+      	    object instanceof XSDAttributeDeclaration ||
+      	    object instanceof XSDEnumerationFacet ||
+      	    object instanceof XSDPatternFacet ||
+      	    object instanceof XSDSimpleTypeDefinition ||
+      	    object instanceof XSDAnnotation ||
+            object instanceof XSDWildcard ||
+            object instanceof XSDSchemaDirective)
+      	{
+     	    return false;
+      	}
+        else if (object instanceof XSDModelGroup)
+        {
+          return false;
+        }
+        else if (object instanceof XSDElementDeclaration)
+        {
+//        Remove this to fix bug 3870 Element references should have the same properties as elements 
+//          if (((XSDElementDeclaration)object).isElementDeclarationReference())
+//          {
+//            return false;
+//          }
+          return true;
+        }
+        else if (object instanceof XSDModelGroupDefinition)
+        {
+          if (((XSDModelGroupDefinition)object).isModelGroupDefinitionReference())
+          {
+            return false;
+          }
+          return false;
+        }
+        else if (object instanceof XSDIdentityConstraintDefinition)
+        {
+          XSDIdentityConstraintDefinition constraint = (XSDIdentityConstraintDefinition)object;
+          XSDIdentityConstraintCategory category = constraint.getIdentityConstraintCategory();
+          if (category.getValue() == XSDIdentityConstraintCategory.KEYREF)
+          {
+            return true;
+          }
+          else
+          {
+            return false;
+          }
+        }
+        return true;
+      }
+    }
+    return false;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSection.java
new file mode 100644
index 0000000..9a0255c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSection.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.wizards.RegexWizard;
+import org.eclipse.xsd.XSDPatternFacet;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class PatternSection extends AbstractSection
+{
+  /**
+   * 
+   */
+  public PatternSection()
+  {
+    super();
+  }
+  
+  Text patternText;
+  Button button;
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+
+		super.createControls(parent, factory);
+		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+		patternText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
+		CLabel nameLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_VALUE") + ":"); //$NON-NLS-1$
+    button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
+    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
+    
+    patternText.addListener(SWT.Modify, this);
+
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(patternText, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(button, 0, SWT.CENTER);
+		nameLabel.setLayoutData(data);
+
+    button.addSelectionListener(this);
+		data = new FormData();
+		data.left = new FormAttachment(100, -rightMarginSpace + 2);
+		data.right = new FormAttachment(100,0);
+		data.top = new FormAttachment(patternText, 0, SWT.CENTER);
+		button.setLayoutData(data);
+
+    data = new FormData();
+    data.left = new FormAttachment(0, 100);
+    data.right = new FormAttachment(button, 0);
+    patternText.setLayoutData(data);
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+	  setListenerEnabled(false);
+	  Object input = getInput();
+	  patternText.setText(""); //$NON-NLS-1$
+	  if (input != null)
+	  {
+	    Element element = null;
+	    if (input instanceof XSDPatternFacet)
+	    {
+	      element = ((XSDPatternFacet)input).getElement();
+	    }
+	    if (element != null)
+	    {
+        String result = element.getAttribute(XSDConstants.VALUE_ATTRIBUTE);
+        if (result != null)
+        {
+          patternText.setText(result);
+        }
+	    }
+	  }
+	  setListenerEnabled(true);
+	}
+
+  /**
+   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
+   */
+  public void widgetSelected(SelectionEvent e)
+  {
+    if (e.widget == button)
+    {
+	    Shell shell = Display.getCurrent().getActiveShell();
+	    Element element = ((XSDPatternFacet)getInput()).getElement();
+
+      String initialValue = element.getAttribute(XSDConstants.VALUE_ATTRIBUTE);
+      if (initialValue == null)
+      {
+        initialValue = ""; //$NON-NLS-1$
+      }
+      RegexWizard wizard = new RegexWizard(initialValue);
+
+      WizardDialog wizardDialog = new WizardDialog(shell, wizard);
+      wizardDialog.setBlockOnOpen(true);
+      wizardDialog.create();
+      
+      int result = wizardDialog.open();
+
+      if (result == Window.OK)
+      {
+        String newPattern = wizard.getPattern();
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_PATTERN_VALUE_CHANGE"), element); //$NON-NLS-1$
+        element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, newPattern);
+        ((XSDPatternFacet)getInput()).setLexicalValue(newPattern);
+        endRecording(element);
+      }
+
+      refresh();
+    }
+  }
+  
+  public void doHandleEvent(Event event)
+  {
+	  if (event.widget == patternText)
+	  {
+		  XSDPatternFacet pattern = (XSDPatternFacet)getInput();
+		  
+      String newValue = patternText.getText();
+      if (newValue.length() > 0)
+      {
+        pattern.setLexicalValue(newValue);
+      }
+	  }
+
+  }
+
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSectionDescriptor.java
new file mode 100644
index 0000000..68219c7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSectionDescriptor.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDPatternFacet;
+
+public class PatternSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public PatternSectionDescriptor()
+  {
+    super();
+  }
+  
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.pattern";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDPatternFacet.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new PatternSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDPatternFacet)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSection.java
new file mode 100644
index 0000000..574d548
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSection.java
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class ReferenceSection extends AbstractSection
+{
+  protected CCombo componentNameCombo; 
+  Button button;
+  IEditorPart editorPart;
+  CLabel refLabel;
+  
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite = getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+    componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
+    componentNameCombo.addSelectionListener(this);
+		data = new FormData();
+		data.left = new FormAttachment(0, 100);
+		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(0, 1);
+		componentNameCombo.setLayoutData(data);
+
+		refLabel = getWidgetFactory().createCLabel(composite, XSDConstants.REF_ATTRIBUTE + ":");  //$NON-NLS-1$
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(componentNameCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(componentNameCombo, 0, SWT.CENTER);
+		refLabel.setLayoutData(data);
+	}
+
+  public void setInput(IWorkbenchPart part, ISelection selection)
+  {
+    super.setInput(part, selection);
+    
+    Object obj = getInput();
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    List items = new ArrayList();
+    if (obj instanceof XSDElementDeclaration)
+    {
+      XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)obj;
+      if (elementDeclaration.isElementDeclarationReference())
+      {
+        items = helper.getGlobalElements();
+//            minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
+//            WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MINIMUM);
+//            maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
+//            WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MAXIMUM);
+      }
+    }
+    else if (obj instanceof XSDAttributeDeclaration)
+    {
+      items = helper.getGlobalAttributes();
+    }
+    else if (obj instanceof XSDModelGroupDefinition)
+    {
+      XSDModelGroupDefinition group = (XSDModelGroupDefinition)obj;
+      if (group.isModelGroupDefinitionReference())
+      {
+        items = helper.getModelGroups();
+          // Need tooltip for Group Ref
+//            minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
+//            WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_GROUP_REF_MINIMUM);
+//            maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
+//            WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_GROUP_REF_MAXIMUM);
+      }
+    }
+    else if (obj instanceof XSDNamedComponent)
+    {
+      XSDNamedComponent namedComponent = (XSDNamedComponent)obj;
+      Element element = namedComponent.getElement();
+      if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
+      {
+        items = helper.getGlobalAttributeGroups();
+//      WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW);
+//      WorkbenchHelp.setHelp(refCombo, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_REF_NAME);
+      }
+      else if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, true))
+      {
+        items = helper.getGlobalElements();
+//          minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
+//          WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MINIMUM);
+//          maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
+//          WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MAXIMUM);
+      }
+    }
+    else if (obj instanceof XSDAttributeUse)
+    {
+      XSDAttributeUse attributeUse = (XSDAttributeUse)obj;
+      Element element = attributeUse.getElement();
+      if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
+      {
+        items = helper.getGlobalAttributes();
+//      WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_REF_DESIGN_VIEW);
+//      WorkbenchHelp.setHelp(refCombo, XSDEditorContextIds.XSDE_ATTRIBUTE_REF_NAME);      
+      }
+    }      
+    items.add(0, "");
+    int size = items.size();
+    String [] st = new String[size];
+    System.arraycopy(items.toArray(), 0, st, 0, size);
+    componentNameCombo.setItems(st);
+      
+    st = null;
+  }
+	
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+    if (doRefresh)
+    {
+  	  setListenerEnabled(false);  
+  //	  componentNameCombo.removeListener(SWT.Modify, this);
+  	  Object input = getInput();
+      if (isReadOnly)
+      {
+        composite.setEnabled(false);
+      }
+      else
+      {
+        composite.setEnabled(true);
+      }
+
+  	  if (input instanceof XSDNamedComponent)
+  	  {
+        XSDNamedComponent namedComponent = (XSDNamedComponent)getInput();
+        Element element = namedComponent.getElement();
+        if (element != null)
+        {
+          String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
+          if (attrValue == null)
+          {
+            attrValue = "";
+          }
+          componentNameCombo.setText(attrValue);
+        }
+  	  }
+      else if (input instanceof XSDParticleContent)
+      {
+        XSDParticleContent particle = (XSDParticleContent)input;
+        Element element = particle.getElement();
+        String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
+        if (attrValue == null)
+        {
+          attrValue = "";
+        }
+        componentNameCombo.setText(attrValue);
+      }
+  	  else if (input instanceof XSDAttributeUse)
+  	  {
+  	    XSDAttributeUse attributeUse = (XSDAttributeUse)getInput();
+  	    Element element = attributeUse.getElement();
+        String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
+        if (attrValue == null)
+        {
+          attrValue = "";
+        }
+        componentNameCombo.setText(attrValue);
+  	  }
+  	  
+      setListenerEnabled(true);
+  //    componentNameCombo.addListener(SWT.Modify, this);
+    }
+	}
+
+	
+  public void widgetSelected(SelectionEvent e)
+  {
+	  Object input = getInput();
+    if (e.widget == componentNameCombo)
+    {
+      String newValue = componentNameCombo.getText();
+		  if (input instanceof XSDNamedComponent)
+		  {
+	      XSDNamedComponent namedComponent = (XSDNamedComponent)getInput();
+	      Element element = namedComponent.getElement();
+	      
+	      if (namedComponent instanceof XSDElementDeclaration)
+	      {
+	        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_REF_CHANGE"), element); //$NON-NLS-1$
+	        element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
+	        endRecording(element);
+	      }
+			  else if (namedComponent instanceof XSDAttributeDeclaration)
+			  {
+	        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_REF_CHANGE"), element); //$NON-NLS-1$
+	        element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
+	        endRecording(element);
+
+			  }
+	  	  else if (namedComponent instanceof XSDAttributeGroupDefinition)
+	  	  {
+	        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_REF_CHANGE"), element); //$NON-NLS-1$
+	        // element.setAttribute(XSDConstants.REF_ATTRIBUTE, (String) value);
+	        XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)namedComponent;
+	        Iterator iter = xsdSchema.getAttributeGroupDefinitions().iterator();
+	        while (iter.hasNext())
+	        {
+	          XSDAttributeGroupDefinition def = (XSDAttributeGroupDefinition)iter.next();
+	          if (def.getQName(xsdSchema).equals(componentNameCombo.getText()))
+	          {
+	            attrGroup.setResolvedAttributeGroupDefinition(def);
+	            attrGroup.setName(componentNameCombo.getText());
+	            break;
+	          }
+	        }  
+	        endRecording(element);
+	  	  }
+        else if (namedComponent instanceof XSDModelGroupDefinition)
+        {
+          beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_REF_CHANGE"), element); //$NON-NLS-1$
+          element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
+          endRecording(element);
+        }
+		  }
+		  else if (input instanceof XSDAttributeUse)
+		  {
+		    XSDAttributeUse attributeUse = (XSDAttributeUse)getInput();
+		    Element element = attributeUse.getElement();
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_USE_CHANGE"), element); //$NON-NLS-1$
+        Iterator iter = xsdSchema.getAttributeDeclarations().iterator();
+        while (iter.hasNext())
+        {
+          XSDAttributeDeclaration attr = (XSDAttributeDeclaration)iter.next();
+          if (attr.getQName(xsdSchema).equals(newValue))
+          {
+            attributeUse.setAttributeDeclaration(attr);
+            element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
+            break;
+          }
+        }  
+
+        endRecording(element);
+		  }
+    }
+  }
+  
+  public void setEditorPart(IEditorPart editorPart)
+  {
+    this.editorPart = editorPart;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSectionDescriptor.java
new file mode 100644
index 0000000..8c11abb
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSectionDescriptor.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class ReferenceSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
+{
+  ReferenceSection referenceSection;
+  
+  /**
+   * 
+   */
+  public ReferenceSectionDescriptor()
+  {
+    super();
+    this.referenceSection = new ReferenceSection();
+  }
+
+
+  /**
+   * 
+   */
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.wsdleditor.section.reference";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDNamedComponent.class);
+    list.add(XSDElementDeclaration.class);
+    list.add(XSDModelGroupDefinition.class);
+    list.add(XSDAttributeDeclaration.class);
+    list.add(XSDAttributeUse.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return referenceSection;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    if (part != null)
+    {
+      referenceSection.setEditorPart(part.getSite()
+            .getWorkbenchWindow()
+              .getActivePage()
+                .getActiveEditor());
+    }
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDNamedComponent)
+      {
+        XSDNamedComponent namedComponent = (XSDNamedComponent)object;
+        Element element = namedComponent.getElement();
+        if (element == null)
+        {
+          return false;
+        }
+        if (inputEquals(element, element.getLocalName(), true))
+        {
+          return true;
+        }
+        else
+        {
+          return false;
+        }
+      }
+      else if (object instanceof XSDElementDeclaration)
+      {
+        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)object;
+        if (elementDeclaration.isElementDeclarationReference())
+        {
+          return true;
+        }
+        else
+        {
+          return false;
+        }
+      }
+      else if (object instanceof XSDAttributeDeclaration)
+      {
+        XSDAttributeDeclaration attr = (XSDAttributeDeclaration)object;
+        if (attr.isAttributeDeclarationReference())
+        {
+          return true;
+        }
+        else
+        {
+          return false;
+        }
+      }
+      else if (object instanceof XSDModelGroupDefinition)
+      {
+        XSDModelGroupDefinition group = (XSDModelGroupDefinition)object;
+        if (group.isModelGroupDefinitionReference())
+        {
+          return true;
+        }
+        else
+        {
+          return false;
+        }
+      }
+      else if (object instanceof XSDAttributeUse)
+      {
+        XSDAttributeUse attributeUse = (XSDAttributeUse)object;
+        Element element = attributeUse.getElement();
+        if (inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
+        {
+          return true;
+        }
+        else
+        {
+          return false;
+        }
+      }
+      
+    }
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationDescriptor.java
new file mode 100644
index 0000000..ca2200d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationDescriptor.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDRedefine;
+
+public class SchemaLocationDescriptor extends AbstractSectionDescriptor
+{
+	  SchemaLocationSection schemaLocationSection;
+	  /**
+	   * 
+	   */
+	  public SchemaLocationDescriptor()
+	  {
+	    super();
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+	   */
+	  public String getId()
+	  {
+	    return "org.eclipse.wst.xsdeditor.section.schemaLocationSection";
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+	   */
+	  public List getInputTypes()
+	  {
+	    List list = new ArrayList();
+	    list.add(XSDConcreteComponent.class);
+	    return list;
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+	   */
+	  public ISection getSectionClass()
+	  {
+	    return schemaLocationSection;
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+	   */
+	  public String getTargetTab()
+	  {
+	    return "org.eclipse.wst.xmlwebservices.general";
+	  }
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+	   */
+	  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+	  {
+	    Object object = null;	    
+	    
+	    if (selection instanceof StructuredSelection)
+	    {
+	      StructuredSelection structuredSelection = (StructuredSelection)selection;
+	      object = structuredSelection.getFirstElement();
+	      if (object instanceof XSDInclude || object instanceof XSDRedefine) {
+		    schemaLocationSection = new SchemaLocationSection();
+	      	return true;
+	      }
+	    }
+	    
+	    return false;
+	  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationSection.java
new file mode 100644
index 0000000..6f2d1df
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationSection.java
@@ -0,0 +1,207 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.impl.XSDIncludeImpl;
+import org.eclipse.xsd.impl.XSDRedefineImpl;
+import org.w3c.dom.Element;
+
+public class SchemaLocationSection extends CommonDirectivesSection
+{
+	  IWorkbenchPart part;
+	  
+	  /**
+	   * 
+	   */
+	  public SchemaLocationSection()
+	  {
+	    super();
+	  }
+
+		/**
+		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+		 */
+		public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+		{
+			super.createControls(parent, factory);
+			Composite composite = getWidgetFactory().createFlatFormComposite(parent);
+
+      int leftCoordinate = getStandardLabelWidth(composite, 
+          new String[] {XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")});
+      
+			// Create Schema Location Label
+			CLabel schemaLocationLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")); //$NON-NLS-1$
+			
+      // Create Schema Location Text
+      schemaLocationText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
+      
+			// Create Wizard Button
+			wizardButton = getWidgetFactory().createButton(composite, "", SWT.NONE); //$NON-NLS-1$
+      
+      wizardButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
+			FormData buttonFormData = new FormData();
+			buttonFormData.left = new FormAttachment(100, -rightMarginSpace + 2);
+			buttonFormData.right = new FormAttachment(100,0);
+			buttonFormData.top = new FormAttachment(schemaLocationText, 0, SWT.CENTER);
+			wizardButton.setLayoutData(buttonFormData);
+			wizardButton.addSelectionListener(this);
+			
+			schemaLocationText.setEditable(true);
+			FormData schemaLocationData = new FormData();
+      schemaLocationData.left = new FormAttachment(0, leftCoordinate);
+      schemaLocationData.right = new FormAttachment(wizardButton, 0);
+			schemaLocationText.setLayoutData(schemaLocationData);
+			schemaLocationText.addListener(SWT.Modify, this);		    
+
+			FormData data = new FormData();
+			data.left = new FormAttachment(0, 0);
+			data.right = new FormAttachment(schemaLocationText, -ITabbedPropertyConstants.HSPACE);
+			data.top = new FormAttachment(schemaLocationText, 0, SWT.CENTER);
+			schemaLocationLabel.setLayoutData(data);
+			
+      // error text
+      errorText = new StyledText(composite, SWT.FLAT);
+      errorText.setEditable(false);
+      errorText.setEnabled(false);
+      errorText.setText("");
+      
+      data = new FormData();
+      data.left = new FormAttachment(schemaLocationText, 0, SWT.LEFT);
+      data.right = new FormAttachment(100, 0);
+      data.top = new FormAttachment(schemaLocationText, 0);
+      errorText.setLayoutData(data);
+		}
+		
+		public void widgetSelected(SelectionEvent event)
+    {
+			if (event.widget == wizardButton)
+      {
+				Shell shell = Display.getCurrent().getActiveShell();
+			    
+				IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
+				ViewerFilter filter = new ResourceFilter(new String[] { ".xsd" },  //$NON-NLS-1$
+			            new IFile[] { currentIFile },
+			            null);
+			      
+			  XSDSelectIncludeFileWizard fileSelectWizard = 
+			      new XSDSelectIncludeFileWizard(xsdSchema, true,
+			          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
+			          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
+			          filter,
+			          (IStructuredSelection) selection);
+
+			  WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
+			  wizardDialog.create();
+			  wizardDialog.setBlockOnOpen(true);
+			  int result = wizardDialog.open();
+				  
+	      String value = schemaLocationText.getText();
+	      if (result == Window.OK)
+	      {
+          errorText.setText("");
+	        IFile selectedIFile = fileSelectWizard.getResultFile();
+	        String schemaFileString = value;
+	        if (selectedIFile != null) 
+	        {
+	          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
+	        }
+	        else
+	        {
+	          schemaFileString = fileSelectWizard.getURL();
+	        }
+
+          handleSchemaLocationChange(schemaFileString, fileSelectWizard.getNamespace(), null);
+	        refresh();
+			  } 
+			}
+		}
+
+		/*
+		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+		 */
+		public void refresh()
+		{
+			if (doRefresh)
+			{
+				setListenerEnabled(false);
+
+				Element element = null;
+				if (input instanceof XSDInclude)
+        { 
+					element = ((XSDIncludeImpl) input).getElement();
+				}
+				else if (input instanceof XSDRedefine)
+        {
+					element = ((XSDRedefineImpl) input).getElement();
+				}
+				
+				if (element != null)
+        {
+					String location = ""; //$NON-NLS-1$
+					location = element.getAttribute("schemaLocation"); //$NON-NLS-1$
+          if (location == null)
+          {
+            location = "";
+          }
+					schemaLocationText.setText(location);
+				}
+
+        setListenerEnabled(true);
+			}
+		}
+
+	  /* (non-Javadoc)
+	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+	   */
+	  public boolean shouldUseExtraSpace()
+	  {
+	    return true;
+	  }
+    
+    protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
+    {
+      if (input instanceof XSDInclude)
+      {
+        Element element = ((XSDIncludeImpl) input).getElement();
+        element.setAttribute("schemaLocation", schemaFileString); //$NON-NLS-1$
+      }
+      else if (input instanceof XSDRedefine)
+      {
+        Element element = ((XSDRedefineImpl) input).getElement();
+        element.setAttribute("schemaLocation", schemaFileString); //$NON-NLS-1$
+      }
+    }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentBaseTypeOptionsDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentBaseTypeOptionsDialog.java
new file mode 100644
index 0000000..2aa1a50
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentBaseTypeOptionsDialog.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class SimpleContentBaseTypeOptionsDialog extends TypesDialog
+{
+  /**
+   * @param parentShell
+   * @param element
+   * @param id
+   * @param xsdSchema
+   */
+  public SimpleContentBaseTypeOptionsDialog(Shell parentShell, Element element, Object id, XSDSchema xsdSchema)
+  {
+    super(parentShell, element, id, xsdSchema);
+    showAnonymous = false;
+  }
+  
+	protected void ok()
+	{
+		TableItem[] items = table.getItems();
+		int selection = table.getSelectionIndex();
+		if (items != null && items.length > 0 && selection >= 0)
+		 {
+		  typeObject = items[selection].getData();
+		}
+	}
+
+  
+  public void handleSetInput()
+  {
+    XSDDOMHelper domHelper = new XSDDOMHelper();
+    typeSection.getSimpleType().setSelection(false);
+    typeSection.getUserSimpleType().setSelection(false);
+    typeSection.getUserComplexType().setSelection(false);
+    showAnonymous = false;
+    if (element != null)
+    {
+      String derivedBy = domHelper.getDerivedByName(element);
+      String baseType = domHelper.getBaseType(element);
+      boolean derivedByRestriction = true;
+      
+      if (XSDDOMHelper.inputEquals(element, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+      {
+        typeSection.getSimpleType().setEnabled(false);
+        typeSection.getUserSimpleType().setEnabled(false);
+        typeSection.getUserComplexType().setSelection(true);
+
+        previousType = 3;
+      }
+      else if (XSDDOMHelper.inputEquals(element, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+      {
+        typeSection.getSimpleType().setEnabled(false);
+        typeSection.getUserSimpleType().setEnabled(false);
+
+        if (derivedBy.equals("restriction"))
+        {
+          typeSection.getSimpleType().setEnabled(false);
+          typeSection.getUserSimpleType().setEnabled(false);
+          typeSection.getUserComplexType().setEnabled(true);
+        }
+        else if (derivedBy.equals("extension"))
+        {
+          derivedByRestriction = false;
+          typeSection.getSimpleType().setEnabled(true);
+          typeSection.getUserSimpleType().setEnabled(true);
+          typeSection.getUserComplexType().setEnabled(true);
+        }
+      }
+        
+      if (derivedBy != null)
+      {
+          if (baseType != null && !baseType.equals(""))
+          {
+            Element parent = (Element)element.getParentNode();
+            XSDConcreteComponent component = null;
+            if (parent != null)
+            {
+              component = xsdSchema.getCorrespondingComponent(parent);
+            }
+            XSDTypeDefinition baseTypeDefinition = null;
+            if (component instanceof XSDComplexTypeDefinition)
+            {
+              XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition)component;
+              baseTypeDefinition = complexType.getBaseTypeDefinition();
+            }               
+
+            if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(baseType) && !derivedByRestriction)
+            {
+              typeSection.getSimpleType().setSelection(true);
+              populateBuiltInType();
+              int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(baseType);
+              table.setSelection(i);
+              previousType = 1;
+            }
+            else if (baseTypeDefinition instanceof XSDSimpleTypeDefinition && !derivedByRestriction)
+            {
+              typeSection.getUserSimpleType().setSelection(true);
+              populateUserSimpleType();
+              int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(baseType);
+              if (showAnonymous)
+               {
+                table.setSelection(i + 1);
+              }
+              else
+               {
+                table.setSelection(i);
+              }
+              previousType = 2;
+            }
+            else if (baseTypeDefinition instanceof XSDComplexTypeDefinition)
+            {
+              typeSection.getUserComplexType().setSelection(true);
+              populateUserComplexType();
+              int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(baseType);
+              if (showAnonymous)
+               {
+                table.setSelection(i + 1);
+              }
+              else
+               {
+                table.setSelection(i);
+              }
+              previousType = 3;
+            }
+          }
+          else
+          {
+            typeSection.getUserComplexType().setSelection(true);
+            populateUserComplexType();
+            table.setSelection(0);
+          }
+        }
+
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentUnionMemberTypesDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentUnionMemberTypesDialog.java
new file mode 100644
index 0000000..c58a7aa
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentUnionMemberTypesDialog.java
@@ -0,0 +1,311 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+public class SimpleContentUnionMemberTypesDialog extends Dialog implements SelectionListener
+{
+  XSDSimpleTypeDefinition simpleType;
+  /**
+   * @param parentShell
+   */
+  public SimpleContentUnionMemberTypesDialog(Shell parentShell, XSDSimpleTypeDefinition simpleType)
+  {
+    super(parentShell);
+    this.simpleType = simpleType;
+  }
+  
+  Table table;
+  TypeSection typeSection;
+  Button addButton, removeButton;
+  org.eclipse.swt.widgets.List memberTypesList;
+  
+  private String result;
+
+  protected void configureShell(Shell shell)
+  {
+    super.configureShell(shell);
+  }
+
+  protected void buttonPressed(int buttonId)
+  {
+    if (buttonId == Dialog.OK)
+    {
+      StringBuffer sb = new StringBuffer();
+      int length = memberTypesList.getItemCount();
+      for (int i=0 ; i < length; i++)
+      {
+        sb.append(memberTypesList.getItem(i));
+        if (i < length - 1)
+        {
+          sb.append(" ");
+        }
+      }
+      result = sb.toString();
+    }
+    super.buttonPressed(buttonId);
+  }
+
+  public String getResult() { return result; }
+
+  //
+  // Create the controls
+  //
+  public Control createDialogArea(Composite parent)
+  {
+    Composite client = (Composite)super.createDialogArea(parent);
+    getShell().setText("Union " + XSDConstants.MEMBERTYPES_ATTRIBUTE); 
+    
+    Label instructions = new Label(client, SWT.LEFT | SWT.WRAP);
+    instructions.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SELECT_MEMBERTYPES"));
+    
+    Composite columnsComposite = new Composite(client, SWT.NONE);
+    GridLayout ccGL = new GridLayout();
+    ccGL.verticalSpacing = 0;
+    ccGL.horizontalSpacing = 0;
+    ccGL.marginHeight = 0;
+    ccGL.marginWidth = 0;
+    ccGL.makeColumnsEqualWidth = true;
+    ccGL.numColumns = 3;
+    columnsComposite.setLayout(ccGL);
+    
+    GridData ccGD = new GridData();
+    ccGD.grabExcessHorizontalSpace = true;
+    ccGD.horizontalAlignment = GridData.FILL;
+    columnsComposite.setLayoutData(ccGD);     
+                           
+    typeSection = new TypeSection(columnsComposite);
+    typeSection.setShowUserComplexType(false);
+
+    typeSection.createClient(columnsComposite);
+    typeSection.getSimpleType().setSelection(false);
+    typeSection.getSimpleType().addSelectionListener(this);
+    typeSection.getUserSimpleType().addSelectionListener(this);
+    
+    ViewUtility.createHorizontalFiller(columnsComposite, 1);
+    
+    Label memberListLabel = new Label(columnsComposite, SWT.LEFT);
+    memberListLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_VALUE"));
+    
+    Composite dataComposite = new Composite(client, SWT.NONE);
+    GridLayout dcGL = new GridLayout();
+    dcGL.verticalSpacing = 0;
+    dcGL.marginHeight = 0;
+    dcGL.marginWidth = 0;
+    dcGL.numColumns = 3;
+    dataComposite.setLayout(dcGL);
+    
+    GridData dcGD = new GridData();
+    dcGD.grabExcessHorizontalSpace = true;
+    dcGD.grabExcessVerticalSpace = true;
+    dataComposite.setLayoutData(dcGD);
+    
+    table = new Table(dataComposite,
+        SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); 
+    table.setHeaderVisible(false);
+    table.setLinesVisible(true);
+    GridData gd2 = new GridData();
+    gd2.grabExcessHorizontalSpace = true;
+    gd2.grabExcessVerticalSpace = true;
+    gd2.horizontalAlignment = GridData.FILL;
+    gd2.verticalAlignment = GridData.FILL;
+    gd2.heightHint = 200;
+    gd2.widthHint = 200;
+    table.setLayoutData(gd2);
+
+    // Fill table
+    handleSetInput();
+    table.getItemCount();
+
+    TableColumn tc = new TableColumn(table, SWT.LEFT);
+    tc.setWidth(200);
+    tc.setResizable(true);
+    
+    Composite buttonComposite = new Composite(dataComposite, SWT.NONE);
+    GridLayout bcGL = new GridLayout();
+    bcGL.numColumns = 1;
+    buttonComposite.setLayout(bcGL);
+    addButton = new Button(buttonComposite, SWT.PUSH);
+    addButton.setText(">");
+    addButton.addSelectionListener(this);
+    removeButton = new Button(buttonComposite, SWT.PUSH);
+    removeButton.setText("<");
+    removeButton.addSelectionListener(this);
+    
+    Composite listComposite = new Composite(dataComposite, SWT.NONE);
+    GridLayout mtGL = new GridLayout();
+    mtGL.numColumns = 1;
+    mtGL.marginHeight = 0;
+    mtGL.marginWidth = 0;
+    mtGL.horizontalSpacing = 0;
+    mtGL.verticalSpacing = 0;
+    listComposite.setLayout(mtGL);
+
+    GridData mtGD = new GridData();
+    mtGD.grabExcessHorizontalSpace = true;
+    mtGD.grabExcessVerticalSpace = true;
+    mtGD.verticalAlignment = GridData.FILL;
+    mtGD.horizontalAlignment = GridData.FILL;
+    listComposite.setLayoutData(mtGD);
+    
+    memberTypesList = new org.eclipse.swt.widgets.List(listComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+    GridData mtlGD = new GridData();
+    mtlGD.grabExcessHorizontalSpace = true;
+    mtlGD.grabExcessVerticalSpace = true;
+    mtlGD.verticalAlignment = GridData.FILL;
+    mtlGD.horizontalAlignment = GridData.FILL;
+    mtlGD.heightHint = 200;
+    mtlGD.widthHint = 200;
+    memberTypesList.setLayoutData(mtlGD);
+    
+    initializeMemberListContent();
+    return client;
+  }
+
+  private void initializeMemberListContent()
+  {
+//    String result = element.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
+//    if (result == null)
+//    {
+//      return;
+//    }
+//    StringTokenizer token = new StringTokenizer(result);
+//    while (token.hasMoreTokens())
+//    {
+//      memberTypesList.add(token.nextToken());
+//    }
+    XSDSchema schema = simpleType.getSchema();
+    for (Iterator i = simpleType.getMemberTypeDefinitions().iterator(); i.hasNext(); )
+    {
+      String name = ((XSDSimpleTypeDefinition)i.next()).getQName(schema);
+      if (name != null)
+      memberTypesList.add(name);
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+   */
+  public void widgetSelected(SelectionEvent e)
+  {
+    if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
+     {
+      populateBuiltInType();
+    }
+    else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
+     {
+      populateUserSimpleType(false);
+    }
+    else if (e.widget == addButton)
+    {
+      TableItem[] items = table.getItems();
+      int selection = table.getSelectionIndex();
+      if (items != null && items.length > 0 && selection >= 0)
+      {
+        String typeToAdd = items[selection].getData().toString();
+        if (memberTypesList.indexOf(typeToAdd) < 0)
+        {
+          memberTypesList.add(items[selection].getData().toString());
+        }
+      }
+    }
+    else if (e.widget == removeButton)
+    {
+      String[] typesToRemove = memberTypesList.getSelection();
+      for (int i=0; i < typesToRemove.length; i++)
+      {
+        memberTypesList.remove(typesToRemove[i]);
+      }
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+   */
+  public void widgetDefaultSelected(SelectionEvent e)
+  {
+  }
+  
+  public void handleSetInput()
+  {
+    populateBuiltInType();
+  }
+  
+  public void populateBuiltInType()
+  {
+    table.removeAll();
+    List items = getBuiltInTypeNamesList();
+    for (int i = 0; i < items.size(); i++)
+     {
+      TableItem item = new TableItem(table, SWT.NONE);
+      item.setText(items.get(i).toString());
+      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+      item.setData(items.get(i));
+    }
+  }
+
+  public void populateUserSimpleType(boolean showAnonymous)
+  {
+    table.removeAll();
+    if (showAnonymous)
+     {
+      TableItem anonymousItem = new TableItem(table, SWT.NONE);
+      anonymousItem.setText("**anonymous**");
+      anonymousItem.setData("**anonymous**");
+    }
+    List items = getUserSimpleTypeNamesList();
+    for (int i = 0; i < items.size(); i++)
+     {
+      TableItem item = new TableItem(table, SWT.NONE);
+      item.setText(items.get(i).toString());
+      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+      item.setData(items.get(i));
+    }
+  }
+  
+  public java.util.List getBuiltInTypeNamesList()
+  {
+    TypesHelper helper = new TypesHelper(simpleType.getSchema());
+    return helper.getBuiltInTypeNamesList();
+  }
+
+  public java.util.List getUserSimpleTypeNamesList()
+  {
+    TypesHelper helper = new TypesHelper(simpleType.getSchema());
+    return helper.getUserSimpleTypeNamesList();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSection.java
new file mode 100644
index 0000000..c69a73a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSection.java
@@ -0,0 +1,570 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
+import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDVariety;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class SimpleTypeSection extends AbstractSection
+{
+  CCombo varietyCombo;
+  Text typesText;
+  CLabel typesLabel;
+  Button button;
+
+  /**
+   * 
+   */
+  public SimpleTypeSection()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite = getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+		varietyCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
+		CLabel label = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY")); //$NON-NLS-1$
+    
+		List list = XSDVariety.VALUES;	
+		Iterator iter = list.iterator();
+		while (iter.hasNext())
+		{
+		  varietyCombo.add(((XSDVariety)iter.next()).getName());
+		}
+    varietyCombo.addSelectionListener(this);
+
+		data = new FormData();
+		data.left = new FormAttachment(0, 100);
+		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(0, 0);
+		varietyCombo.setLayoutData(data);
+
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(varietyCombo, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(varietyCombo, 0, SWT.CENTER);
+		label.setLayoutData(data);
+    
+    typesText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
+    typesLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
+    button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
+    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
+    
+    typesText.addListener(SWT.Modify, this);
+
+    data = new FormData();
+    data.left = new FormAttachment(0, 100);
+    data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
+    data.top = new FormAttachment(button, 0, SWT.CENTER);
+    typesText.setLayoutData(data);
+
+    data = new FormData();
+    data.left = new FormAttachment(0, 0);
+    data.right = new FormAttachment(typesText, -ITabbedPropertyConstants.HSPACE);
+    data.top = new FormAttachment(button, 0, SWT.CENTER);
+    typesLabel.setLayoutData(data);
+
+    button.addSelectionListener(this);
+    data = new FormData();
+    data.left = new FormAttachment(typesText, 0);
+    data.right = new FormAttachment(100,0);
+    data.top = new FormAttachment(varietyCombo, +ITabbedPropertyConstants.VSPACE);
+    button.setLayoutData(data);
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+	  setListenerEnabled(false);
+    if (isReadOnly)
+    {
+      composite.setEnabled(false);
+    }
+    else
+    {
+      composite.setEnabled(true);
+    }
+	  Object input = getInput();
+	  varietyCombo.setText(""); //$NON-NLS-1$
+    typesText.setText(""); //$NON-NLS-1$
+    typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
+	  if (input != null)
+	  {
+	    if (input instanceof XSDSimpleTypeDefinition)
+	    {
+	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
+        
+        Element simpleTypeElement = st.getElement();
+        Element element = null;
+	      String variety = st.getVariety().getName();
+        
+        int intVariety = st.getVariety().getValue();
+        
+	      if (variety != null)
+	      {
+          varietyCombo.setText(variety);
+          if (intVariety == XSDVariety.ATOMIC)
+          {
+            element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.RESTRICTION_ELEMENT_TAG);
+//            if (element == null)
+//            {
+//              element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.EXTENSION_ELEMENT_TAG);
+//              if (element == null) return;
+//            }
+            
+            if (element == null)
+            {
+              varietyCombo.setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE")); // "Select a simple type variety"); //$NON-NLS-1$            
+            }
+            else
+            {
+              String result = element.getAttribute(XSDConstants.BASE_ATTRIBUTE);
+              if (result == null)
+              {
+                typesText.setText("**anonymous**"); //$NON-NLS-1$
+              }
+              else
+              {
+                typesText.setText(result);
+              }
+            }
+            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
+          }
+          else if (intVariety == XSDVariety.LIST)
+          {
+            element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
+            if (element != null)
+            {
+              String result = element.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
+              if (result == null)
+              {
+                typesText.setText("**anonymous**"); //$NON-NLS-1$
+              }
+              else
+              {
+                typesText.setText(result);
+              }
+            }
+            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
+          }
+          else if (intVariety == XSDVariety.UNION)
+          {
+            Element unionElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.UNION_ELEMENT_TAG);
+            if (unionElement != null)
+            {
+              String memberTypes = unionElement.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
+              if (memberTypes != null)
+              {
+                typesText.setText(memberTypes);
+              }
+            }
+            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
+          }
+	      }
+	    }
+	  }
+	  setListenerEnabled(true);
+	}
+
+  /**
+   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
+   */
+  public void widgetSelected(SelectionEvent e)
+  {
+	  Object input = getInput();
+    if (e.widget == varietyCombo)
+    {
+  	  if (input != null)
+  	  {
+  	    if (input instanceof XSDSimpleTypeDefinition)
+  	    {
+  	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
+          Element parent = st.getElement();
+          
+  	      String variety = varietyCombo.getText();
+  	      if (variety.equals(XSDVariety.ATOMIC_LITERAL.getName()))
+          {
+            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
+            st.setVariety(XSDVariety.ATOMIC_LITERAL);
+            addCreateElementActionIfNotExist(XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), parent, null); //$NON-NLS-1$
+          }
+  	      else if (variety.equals(XSDVariety.UNION_LITERAL.getName()))
+  	      {
+            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
+            st.setVariety(XSDVariety.UNION_LITERAL);
+            addCreateElementActionIfNotExist(XSDConstants.UNION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_UNION"), parent, null); //$NON-NLS-1$
+          }
+  	      else if (variety.equals(XSDVariety.LIST_LITERAL.getName()))
+  	      {
+            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
+            st.setVariety(XSDVariety.LIST_LITERAL);
+            addCreateElementActionIfNotExist(XSDConstants.LIST_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LIST"), parent, null); //$NON-NLS-1$
+          }
+  	    }
+  	  }
+    }
+    else if (e.widget == button)
+    {
+      Shell shell = Display.getCurrent().getActiveShell();
+      Element element = ((XSDConcreteComponent)input).getElement();
+      Dialog dialog = null;
+      String property = "";
+      Element secondaryElement = null;
+      
+      IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
+
+      XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, xsdSchema);
+      dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
+      provider.setDialog((XSDComponentSelectionDialog) dialog);
+      
+      if (input instanceof XSDSimpleTypeDefinition)
+      {
+        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
+        Element simpleTypeElement = st.getElement();
+        if (st.getVariety() == XSDVariety.LIST_LITERAL)
+        {
+          Element listElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
+//          dialog = new TypesDialog(shell, listElement, XSDConstants.ITEMTYPE_ATTRIBUTE, xsdSchema);
+//          dialog.showComplexTypes = false;
+          provider.showComplexTypes(false);
+          
+          secondaryElement = listElement;
+          property = XSDConstants.ITEMTYPE_ATTRIBUTE;
+        }
+        else if (st.getVariety() == XSDVariety.ATOMIC_LITERAL)
+        {
+          Element derivedByElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.RESTRICTION_ELEMENT_TAG);
+          if (derivedByElement == null)
+          {
+            derivedByElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.EXTENSION_ELEMENT_TAG);
+            if (derivedByElement == null) return;
+          }
+          if (derivedByElement != null)
+          {
+//            dialog = new TypesDialog(shell, derivedByElement, XSDConstants.BASE_ATTRIBUTE, xsdSchema);
+//            dialog.showComplexTypes = false;
+              provider.showComplexTypes(false);
+
+              secondaryElement = derivedByElement;
+              property = XSDConstants.BASE_ATTRIBUTE;
+          }
+          else
+          {
+            return;
+          }
+        }
+        else if (st.getVariety() == XSDVariety.UNION_LITERAL)
+        {
+          SimpleContentUnionMemberTypesDialog unionDialog = new SimpleContentUnionMemberTypesDialog(shell, st);
+          unionDialog.setBlockOnOpen(true);
+          unionDialog.create();
+          
+          int result = unionDialog.open();
+          if (result == Window.OK)
+          {
+            String newValue = unionDialog.getResult();
+            beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_CHANGE"), element); //$NON-NLS-1$
+            Element unionElement = (Element)domHelper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
+            unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
+
+            if (newValue.length() > 0)
+            {
+              unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
+            }
+            else
+            {
+              unionElement.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);  
+            }
+            endRecording(unionElement);
+            if (doRefresh)
+            {
+              refresh();
+            }
+          }
+          return;
+        }
+        else
+        {
+//          dialog = new TypesDialog(shell, element, "type", xsdSchema); //$NON-NLS-1$
+            property = "type";
+        }
+      }
+      else
+      {
+//        dialog = new TypesDialog(shell, element, "type", xsdSchema); //$NON-NLS-1$
+          property = "type";
+      }
+      beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element); //$NON-NLS-1$
+      dialog.setBlockOnOpen(true);
+      dialog.create();
+      int result = dialog.open();
+      
+      if (result == Window.OK)
+      {
+          if (secondaryElement == null) {
+              secondaryElement = element;
+          }
+          XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, xsdSchema);
+          helper.setType(secondaryElement, property, ((XSDComponentSelectionDialog) dialog).getSelection());          
+
+        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
+        st.setElement(element);
+        updateSimpleTypeFacets();
+      }
+      endRecording(element);
+    }
+    if (doRefresh)
+    {
+      refresh();
+    }
+  }
+
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+  
+  protected boolean addCreateElementActionIfNotExist(String elementTag, String label, Element parent, Node relativeNode)
+  {
+    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
+    List attributes = new ArrayList();
+    String reuseType = null;
+    
+    beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY_CHANGE"), parent); //$NON-NLS-1$
+    if (elementTag.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
+    {
+      Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
+      if (listNode != null)
+      {
+        reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
+        XSDDOMHelper.removeNodeAndWhitespace(listNode);
+      }
+
+      Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
+      if (unionNode != null)
+      {
+        String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
+        if (memberAttr != null)
+        {
+          StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
+          reuseType = stringTokenizer.nextToken();
+        }
+        XSDDOMHelper.removeNodeAndWhitespace(unionNode);
+      }
+
+      if (reuseType == null)
+      {
+        reuseType = getBuiltInStringQName();        
+      }
+      attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, reuseType));
+      st.setItemTypeDefinition(null);
+    }
+    else if (elementTag.equals(XSDConstants.LIST_ELEMENT_TAG))
+    {
+      Element restrictionNode = getFirstChildNodeIfExists(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false);
+      if (restrictionNode != null)
+      {
+        reuseType = restrictionNode.getAttribute(XSDConstants.BASE_ATTRIBUTE);
+        XSDDOMHelper.removeNodeAndWhitespace(restrictionNode);
+      }
+      Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
+      if (unionNode != null)
+      {
+        String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
+        if (memberAttr != null)
+        {
+          StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
+          reuseType = stringTokenizer.nextToken();
+        }
+        XSDDOMHelper.removeNodeAndWhitespace(unionNode);
+      }
+      attributes.add(new DOMAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, reuseType));
+    }
+    else if (elementTag.equals(XSDConstants.UNION_ELEMENT_TAG))
+    {
+      Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
+      if (listNode != null)
+      {
+        reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
+        XSDDOMHelper.removeNodeAndWhitespace(listNode);
+      }
+      Element restrictionNode = getFirstChildNodeIfExists(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false);
+      if (restrictionNode != null)
+      {
+        reuseType = restrictionNode.getAttribute(XSDConstants.BASE_ATTRIBUTE);
+        XSDDOMHelper.removeNodeAndWhitespace(restrictionNode);
+      }
+      attributes.add(new DOMAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, reuseType));
+      st.setItemTypeDefinition(null);
+    }
+    
+    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
+    {
+      Action action = addCreateElementAction(elementTag,label,attributes,parent,relativeNode);
+      action.run();
+    }
+
+    st.setElement(parent);
+//    st.updateElement();
+    endRecording(parent);
+    return true;
+  }
+
+  protected Action addCreateElementAction(String elementTag, String label, List attributes, Element parent, Node relativeNode)
+  {
+    CreateElementAction action = new CreateElementAction(label);
+    action.setElementTag(elementTag);
+    action.setAttributes(attributes);
+    action.setParentNode(parent);
+    action.setRelativeNode(relativeNode);
+    return action;
+  }
+
+  
+  protected Element getFirstChildNodeIfExists(Node parent, String elementTag, boolean isRef)
+  {
+    NodeList children = parent.getChildNodes();
+    Element targetNode = null;
+    for (int i=0; i < children.getLength(); i++)
+    {
+      Node child = children.item(i);
+      if (child != null && child instanceof Element)
+      {
+        if (XSDDOMHelper.inputEquals((Element)child, elementTag, isRef))
+        {
+          targetNode = (Element)child;
+          break;
+        }
+      }
+    }
+    return targetNode;
+  }
+
+  protected String getBuiltInStringQName()
+  {
+    String stringName = "string"; //$NON-NLS-1$
+    
+    if (getSchema() != null)
+    {
+      String schemaForSchemaPrefix = getSchema().getSchemaForSchemaQNamePrefix();
+      if (schemaForSchemaPrefix != null && schemaForSchemaPrefix.length() > 0)
+      {
+        String prefix = getSchema().getSchemaForSchemaQNamePrefix();
+        if (prefix != null && prefix.length() > 0)
+        {
+          stringName = prefix + ":" + stringName; //$NON-NLS-1$
+        }
+      }
+    }
+    return stringName;
+  }
+
+  private void updateSimpleTypeFacets()
+  {
+    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
+    Element simpleTypeElement = st.getElement();
+    Element derivedByElement = getDomHelper().getDerivedByElement(simpleTypeElement);
+    if (derivedByElement != null)
+    {
+      List nodesToRemove = new ArrayList();
+      NodeList childList = derivedByElement.getChildNodes();
+      int length = childList.getLength();
+      for (int i = 0; i < length; i++)
+      {
+        Node child = childList.item(i);
+        if (child instanceof Element)
+        {
+          Element elementChild = (Element)child;
+          if (!(elementChild.getLocalName().equals("pattern") || elementChild.getLocalName().equals("enumeration") || //$NON-NLS-1$
+               XSDDOMHelper.inputEquals(elementChild, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false) ||
+               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ANNOTATION_ELEMENT_TAG, false) ||
+               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) ||
+               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true) ||
+               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false) ||
+               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true) ||
+               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false)
+               ))
+          {
+            nodesToRemove.add(child);
+          }
+        }
+      }
+      Iterator iter = nodesToRemove.iterator();
+      while (iter.hasNext())
+      {
+        Element facetToRemove = (Element)iter.next();
+        String facetName = facetToRemove.getLocalName();
+        Iterator it = st.getValidFacets().iterator();
+        boolean doRemove = true;
+        while (it.hasNext())
+        {
+          String aValidFacet = (String)it.next();
+          if (aValidFacet.equals(facetName))
+          {
+            doRemove = false;
+            break;
+          }
+        }
+        if (doRemove)
+        {
+          XSDDOMHelper.removeNodeAndWhitespace(facetToRemove);
+        }
+      }
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSectionDescriptor.java
new file mode 100644
index 0000000..bd02dee
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSectionDescriptor.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+
+public class SimpleTypeSectionDescriptor extends AbstractSectionDescriptor
+{
+
+  /**
+   * 
+   */
+  public SimpleTypeSectionDescriptor()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.simpletype";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDSimpleTypeDefinition.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new SimpleTypeSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+  
+  public String getAfterSection()
+  {
+    return "org.eclipse.wst.xsdeditor.section.name";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDSimpleTypeDefinition)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSection.java
new file mode 100644
index 0000000..a4496dc
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSection.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class SimpleTypeUnionSection extends AbstractSection
+{
+  Text memberTypesText;
+  Button button;
+
+  /**
+   * 
+   */
+  public SimpleTypeUnionSection()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite = getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+		memberTypesText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
+		CLabel label = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
+    button = getWidgetFactory().createButton(composite, "...", SWT.PUSH); //$NON-NLS-1$
+    
+    memberTypesText.addListener(SWT.Modify, this);
+//    memberTypesText.addSelectionListener(this);
+
+		data = new FormData();
+		data.left = new FormAttachment(0, 100);
+		data.right = new FormAttachment(95, 0);
+		data.top = new FormAttachment(button, 0, SWT.CENTER);
+		memberTypesText.setLayoutData(data);
+
+
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(memberTypesText, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(button, 0, SWT.CENTER);
+		label.setLayoutData(data);
+
+    button.addSelectionListener(this);
+		data = new FormData();
+		data.left = new FormAttachment(memberTypesText, +ITabbedPropertyConstants.HSPACE);
+		data.right = new FormAttachment(100,0);
+		// data.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
+		data.top = new FormAttachment(0,0);
+		button.setLayoutData(data);
+		
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+	  setListenerEnabled(false);
+	  Object input = getInput();
+    if (isReadOnly)
+    {
+      composite.setEnabled(false);
+    }
+    else
+    {
+      composite.setEnabled(true);
+    }
+	  memberTypesText.setText(""); //$NON-NLS-1$
+	  if (input != null)
+	  {
+	    Element element = null;
+	    if (input instanceof XSDSimpleTypeDefinition)
+	    {
+	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
+	      element = st.getElement();
+        Element unionElement = (Element)domHelper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
+        String memberTypes = unionElement.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
+        if (memberTypes != null)
+        {
+          memberTypesText.setText(memberTypes);
+        }
+	      
+//        StringBuffer buf = new StringBuffer();	      
+//	      if (st.getMemberTypeDefinitions().size() > 0)
+//	      {
+//	        for (Iterator i = st.getMemberTypeDefinitions().iterator(); i.hasNext(); )
+//	        {
+//	          String name = ((XSDSimpleTypeDefinition)i.next()).getQName(getSchema());
+//	          if (name != null)
+//	          {
+//	            buf.append(name);
+//	            buf.append(" ");
+//	          }
+//	        }
+//	      }
+//	      memberTypesText.setText(buf.toString());
+	    }
+	  }
+	  setListenerEnabled(true);
+	}
+
+  /**
+   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
+   */
+  public void widgetSelected(SelectionEvent e)
+  {
+    if (e.widget == button)
+    {
+	    Shell shell = Display.getCurrent().getActiveShell();
+      
+	    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
+	    Element element = st.getElement();
+      SimpleContentUnionMemberTypesDialog dialog = new SimpleContentUnionMemberTypesDialog(shell, st);
+      dialog.setBlockOnOpen(true);
+      dialog.create();
+      
+      int result = dialog.open();
+      if (result == Window.OK)
+      {
+        String newValue = dialog.getResult();
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_CHANGE"), element); //$NON-NLS-1$
+        Element unionElement = (Element)domHelper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
+        unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
+
+        if (newValue.length() > 0)
+        {
+          unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
+        }
+        else
+        {
+          unionElement.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);  
+        }
+        endRecording(unionElement);
+
+      }
+
+      refresh();
+    }
+  }
+  
+  public void doHandleEvent(Event event)
+  {
+	  if (event.widget == memberTypesText)
+	  {
+	  }
+
+  }
+
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSectionDescriptor.java
new file mode 100644
index 0000000..b1338ae
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSectionDescriptor.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+public class SimpleTypeUnionSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public SimpleTypeUnionSectionDescriptor()
+  {
+    super();
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.simpletypeunion";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDSimpleTypeDefinition.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new SimpleTypeUnionSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TextChangeHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TextChangeHelper.java
new file mode 100644
index 0000000..0df6ffa
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TextChangeHelper.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+public abstract class TextChangeHelper implements Listener
+{
+	private boolean nonUserChange;
+
+	/**
+	 * Marks the start of a programmatic change to the widget contents.
+	 * Clients must call startNonUserChange() before directly setting 
+	 * the widget contents to avoid unwanted lifecycle events.
+	 * @throws IllegalArgumentException if a programmatic change is 
+	 * already in progress.
+	 */
+	public void startNonUserChange() {
+		if (nonUserChange)
+			throw new IllegalStateException("we already started a non user change");//$NON-NLS-1$
+		nonUserChange = true;
+	}
+
+	/**
+	 * Clients who call startNonUserChange() should call 
+	 * finishNonUserChange() as soon as possible after the change is done.
+	 * @throws IllegalArgumentException if no change is in progress.
+	 */
+	public void finishNonUserChange() {
+		if (!nonUserChange)
+			throw new IllegalStateException("we are not in a non user change");//$NON-NLS-1$
+		nonUserChange = false;
+	}
+
+	/**
+	 * Returns true if a programmatic change is in progress.
+	 */
+	public boolean isNonUserChange() {
+		return nonUserChange;
+	}
+
+	/**
+	 * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+	 */
+	public void handleEvent(Event event) {
+		switch (event.type) {
+			case SWT.KeyDown :
+				if (event.character == SWT.CR)
+					textChanged((Control)event.widget);
+				break;
+			case SWT.FocusOut :
+				textChanged((Control)event.widget);
+				break;
+		}
+	}
+
+	/**
+	 * Abstract method notified when a text field has been changed.
+	 * @param control
+	 */
+	public abstract void textChanged(Control control);
+
+	/**
+	 * Registers this helper with the given control to listen for events
+	 * which indicate that a change is in progress (or done).
+	 */
+	public void startListeningTo(Control control) {
+		control.addListener(SWT.FocusOut, this);
+		control.addListener(SWT.Modify, this);
+	}
+
+	/**
+	 * Registers this helper with the given control to listen for the
+	 * Enter key.  When Enter is pressed, the change is considered done 
+	 * (this is only appropriate for single-line Text widgets).
+	 */
+	public void startListeningForEnter(Control control) {
+		// NOTE: KeyDown rather than KeyUp, because of similar usage in CCombo. 
+		control.addListener(SWT.KeyDown, this);
+	}
+
+	/**
+	 * Unregisters this helper from a control previously passed to
+	 * startListeningTo() and/or startListeningForEnter().
+	 */
+	public void stopListeningTo(Control control) {
+		control.removeListener(SWT.FocusOut, this);
+		control.removeListener(SWT.Modify, this);
+		control.removeListener(SWT.KeyDown, this);
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesDialog.java
new file mode 100644
index 0000000..1454b4d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesDialog.java
@@ -0,0 +1,721 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class TypesDialog extends Dialog implements SelectionListener, Listener
+{
+  XSDSchema xsdSchema;
+  String property;
+
+  /**
+   * @param parentShell
+   */
+  public TypesDialog(Shell parentShell, Element element, Object id, XSDSchema xsdSchema)
+  {
+    super(parentShell);
+    setShellStyle(getShellStyle() | SWT.RESIZE);
+    this.element = element;
+    this.property = (String)id;
+    this.element = element;
+    this.xsdSchema = xsdSchema;
+
+    if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
+    {
+      showComplexTypes = true;
+    }
+    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) ||
+      XSDDOMHelper.inputEquals(element, XSDConstants.LIST_ELEMENT_TAG, false) ||
+      XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
+    {
+      showComplexTypes = false;
+    }
+  }
+
+  String type;
+  Object typeObject;
+  Text textField;
+  Table table;
+  TableColumn tableColumn;
+  Element element;
+  
+  boolean showComplexTypes = true;
+  TypeSection typeSection;
+  boolean showAnonymous = true;
+  String previousStringType = "";
+  boolean isAnonymous;
+  int previousType;
+
+  protected void configureShell(Shell shell)
+  {
+    super.configureShell(shell);
+  }
+
+  protected void buttonPressed(int buttonId)
+  {
+    if (buttonId == Dialog.OK)
+    {
+      type = table.getItem(table.getSelectionIndex()).getText();
+      ok();
+    }
+    super.buttonPressed(buttonId);
+  }
+
+  public Object getTypeObject() { return typeObject; }
+  public String getType() { return type; }
+
+  //
+  // Create the controls
+  //
+  public Control createDialogArea(Composite parent)
+  {
+    Composite client = (Composite)super.createDialogArea(parent);
+    getShell().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_AVAILABLE_TYPES"));
+
+    typeObject = null;
+    
+    GridLayout gl = new GridLayout(1, true);
+//    gl.marginHeight = 0;
+//    gl.marginWidth = 0;
+//    gl.horizontalSpacing = 0;
+//    gl.verticalSpacing = 0;
+    client.setLayout(gl);
+
+    GridData gd = new GridData();
+    gd.grabExcessHorizontalSpace = true;
+    gd.grabExcessVerticalSpace = true;
+    gd.horizontalAlignment = GridData.FILL;
+    gd.verticalAlignment = GridData.FILL;
+    gd.horizontalIndent = 0;
+    client.setLayoutData(gd);
+    
+    typeSection = new TypeSection(client);
+    typeSection.setShowUserComplexType(showComplexTypes);
+
+    typeSection.createClient(client);
+    typeSection.getSimpleType().setSelection(false);
+    typeSection.getSimpleType().addSelectionListener(this);
+    typeSection.getUserSimpleType().addSelectionListener(this);
+    if (showComplexTypes)
+    {
+      typeSection.getUserComplexType().addSelectionListener(this);
+    }
+
+    textField = ViewUtility.createTextField(client, 50);
+    textField.addListener(SWT.Modify, this);
+    ViewUtility.createVerticalFiller(client, 0);
+
+    table = new Table(client,
+                      SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); 
+    table.setHeaderVisible(false);
+    table.setLinesVisible(true);
+    table.addSelectionListener(this);
+    
+    GridData gd2 = new GridData();
+    gd2.grabExcessHorizontalSpace = true;
+    gd2.grabExcessVerticalSpace = true;
+    gd2.horizontalAlignment = GridData.FILL;
+    gd2.verticalAlignment = GridData.FILL;
+    gd2.heightHint = 200;
+    table.setLayoutData(gd2);
+    table.addListener(SWT.Resize, this);
+    
+    tableColumn = new TableColumn(table, SWT.LEFT);
+//    tableColumn.setImage(XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"));
+    tableColumn.setResizable(true);
+    tableColumn.setWidth(200);
+
+    // Fill table and select input type
+    handleSetInput();
+
+    return client;
+  }
+  
+  public void handleEvent(Event event)
+  {
+  	if (event.type == SWT.Resize && event.widget == table) {
+  		tableColumn.setWidth(table.getSize().x);
+  	}
+  	else if (event.type == SWT.Modify && event.widget == textField) {
+  		boolean showAll = false;
+  		String inputString = textField.getText();
+  		
+  		if (inputString.equals("")) {
+  			showAll = true;
+  		}
+  		else {
+  			inputString = insertString("*", ".", inputString);
+  			inputString = insertString("?", ".", inputString);
+  			inputString = inputString + ".*";
+  		}
+  		
+  		try {
+  			if (typeSection.getSimpleType().getSelection())
+  			{
+  				if (showAll) {
+  					populateBuiltInType();
+  				}
+  				else {
+  					populateBuiltInType(inputString);
+  				}
+  			}
+  			else if (typeSection.getUserComplexType().getSelection())
+  			{
+  				if (showAll) {
+  					populateUserComplexType();
+  				}
+  				else {
+  					populateUserComplexType(inputString);
+  				}
+  			}
+  			else if (typeSection.getUserSimpleType().getSelection())
+  			{
+  				if (showAll) {
+  					populateUserSimpleType();
+  				}
+  				else {
+  					populateUserSimpleType(inputString);
+  				}
+  			}
+  		}
+  		catch (Exception e) {
+  			// Do nothing
+  		}
+  	}
+  	
+  	setEnabledState();
+  }
+  
+  private void setEnabledState() {
+  	if (table.getSelectionIndex() != -1) {
+  		this.getButton(IDialogConstants.OK_ID).setEnabled(true);
+  	}
+  	else {
+  		this.getButton(IDialogConstants.OK_ID).setEnabled(false);
+  	}
+  }
+  
+  private String insertString(String target, String newString, String string) {
+  	StringBuffer stringBuffer = new StringBuffer(string);
+  	
+  	int index = stringBuffer.indexOf(target);
+  	while (index != -1) {
+  		stringBuffer = stringBuffer.insert(index, newString);
+  		index = stringBuffer.indexOf(target, index + newString.length() + target.length());
+  	}
+  	
+  	return stringBuffer.toString();
+  }
+  
+  public void widgetSelected(SelectionEvent e)
+  {
+    if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
+    {
+    	if (textField.getText().equals("")) {
+    		populateBuiltInType();
+    	}
+    	else {
+    		populateBuiltInType(textField.getText());
+    	}
+    }
+    else if (e.widget == typeSection.getUserComplexType() && typeSection.getUserComplexType().getSelection())
+    {
+    	if (textField.getText().equals("")) {
+    		populateUserComplexType();
+    	}
+    	else {
+    		populateUserComplexType(textField.getText());
+    	}
+    }
+    else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
+    {
+    	if (textField.getText().equals("")) {
+    		populateUserSimpleType();
+    	}
+    	else {
+    		populateUserSimpleType(textField.getText());
+    	}
+    }
+    setEnabledState();
+  }
+  
+	public void widgetDefaultSelected(SelectionEvent e)
+  {
+  }
+
+  protected void ok()
+  {
+    TableItem[] items = table.getItems();
+    int selection = table.getSelectionIndex();
+    if (items != null && items.length > 0 && selection >= 0)
+    {
+      typeObject = items[selection].getData();
+    }
+//    System.out.println("typeObject is " + typeObject);
+
+//    beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_TYPE_CHANGE"), element);
+//    beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);
+//    doSetValue(typeObject);
+//    applyEditorValueAndDeactivate();
+//    dialog.close();
+
+    if (!XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
+    {
+	    if (typeObject.equals("**anonymous**"))
+	    {
+	      if (typeSection.getUserSimpleType().getSelection())
+	      {
+//	        if (!previousStringType.equals("**anonymous**"))
+	        {
+	          updateElementToAnonymous(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+	        }
+	      }
+	      else
+	      {
+//	        if (!previousStringType.equals("**anonymous**"))
+	        {
+	          updateElementToAnonymous(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+	        }
+	      }
+	      // element.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
+	      element.removeAttribute(property);
+	    }
+	    else
+	    {
+	      XSDDOMHelper.updateElementToNotAnonymous(element);
+	      //element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, typeObject.toString());
+	      element.setAttribute(property, typeObject.toString());
+	    }
+    }
+//    endRecording(element);
+
+    //implement dispose();
+//    table.removeAll();
+//    table.dispose();
+  }
+
+	
+  public void handleSetInput()
+  {
+    table.removeAll();
+    isAnonymous = checkForAnonymousType(element);
+    // Attr attr = element.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
+    Attr attr = element.getAttributeNode(property);
+    if (attr != null)
+    {
+      String value = attr.getValue();
+      if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(value))
+      {
+        typeSection.getSimpleType().setSelection(true);
+        populateBuiltInType();
+        int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(value);
+        table.setSelection(i);
+        previousType = 1;
+      }
+      else if (typeSection.getUserSimpleTypeNamesList(xsdSchema).contains(value))
+      {
+        typeSection.getUserSimpleType().setSelection(true);
+        populateUserSimpleType();
+        int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(value);
+        if (showAnonymous)
+        {
+          table.setSelection(i + 1);
+        }
+        else
+        {
+          table.setSelection(i);
+        }
+        previousType = 2;
+      }
+      else if (typeSection.getUserComplexTypeNamesList(xsdSchema).contains(value))
+      {
+        typeSection.getUserComplexType().setSelection(true);
+        populateUserComplexType();
+        int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(value);
+        if (showAnonymous)
+         {
+          table.setSelection(i + 1);
+        }
+        else
+         {
+          table.setSelection(i);
+        }
+        previousType = 3;
+      }
+      else // if it is type="" for an empty list of simple types
+        {
+        typeSection.getUserSimpleType().setSelection(true);
+        populateUserSimpleType();
+        previousType = 2;
+      }
+    }
+    else
+    {
+      if (isAnonymous)
+      {
+        if (isSTAnonymous(element))
+        {
+          typeSection.getUserSimpleType().setSelection(true);
+          populateUserSimpleType();
+          previousType = 2;
+        }
+        else
+        {
+          typeSection.getUserComplexType().setSelection(true);
+          populateUserComplexType();
+          previousType = 3;
+        }
+        table.setSelection(0); // anonymous
+        //        typeSection.getTypeList().setText("**anonymous**");
+      }
+      else
+      {
+        typeSection.getSimpleType().setSelection(true);
+        populateBuiltInType();
+        table.setSelection(0);
+        
+        //        typeSection.getTypeList().setEnabled(true);
+        //        typeSection.getSimpleType().setSelection(true);
+        //        typeSection.populateBuiltInType(xsdSchema);
+        //        typeSection.getTypeList().setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE"));
+        previousType = 1;
+      }
+    }
+    if (table.getSelection() != null && table.getSelection().length > 0)
+    {
+      previousStringType = (table.getSelection()[0]).getText();
+    }
+  }
+  
+  public void populateBuiltInType()
+  {
+    table.removeAll();
+    List items = getBuiltInTypeNamesList();
+    for (int i = 0; i < items.size(); i++)
+    {
+      TableItem item = new TableItem(table, SWT.NONE);
+      item.setText(items.get(i).toString());
+      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+      item.setData(items.get(i));
+    }
+  }
+
+  public void populateBuiltInType(String fragment)
+  {
+    table.removeAll();
+    List items = getBuiltInTypeNamesList();
+    fragment = fragment.toLowerCase();
+	Pattern regex = Pattern.compile(fragment);
+	
+    for (int i = 0; i < items.size(); i++)
+    {
+    	String itemString = items.get(i).toString().toLowerCase();
+    	Matcher m = regex.matcher(itemString);
+
+    	if (itemString.startsWith(fragment) || m.matches()) {
+    		TableItem item = new TableItem(table, SWT.NONE);
+    		item.setText(items.get(i).toString());
+    		item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+    		item.setData(items.get(i));
+    	}
+    }
+    
+    table.select(0);
+  }
+
+  public void populateUserComplexType()
+  {
+    table.removeAll();
+    if (showAnonymous)
+    {
+      TableItem anonymousItem = new TableItem(table, SWT.NONE);
+      anonymousItem.setText("**anonymous**");
+      anonymousItem.setData("**anonymous**");
+    }
+    List items = getUserComplexTypeNamesList();
+    for (int i = 0; i < items.size(); i++)
+    {
+      TableItem item = new TableItem(table, SWT.NONE);
+//      System.out.println("item " + i + " is " + item);
+      item.setText(items.get(i).toString());
+      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"));
+      item.setData(items.get(i));
+    }
+  }
+  
+  public void populateUserComplexType(String fragment)
+  {
+    table.removeAll();
+    fragment = fragment.toLowerCase();
+    Pattern regex = java.util.regex.Pattern.compile(fragment);
+    
+    if (showAnonymous)
+    {
+    	Matcher m = regex.matcher("**anonymous**");
+    	if ("**anonymous**".startsWith(fragment) || m.matches()) {
+    		TableItem anonymousItem = new TableItem(table, SWT.NONE);
+    		anonymousItem.setText("**anonymous**");
+    		anonymousItem.setData("**anonymous**");
+    	}
+    }
+    List items = getUserComplexTypeNamesList();
+    for (int i = 0; i < items.size(); i++)
+    {
+    	String itemString = items.get(i).toString().toLowerCase();
+    	Matcher m = regex.matcher(itemString);
+    	
+    	if (itemString.startsWith(fragment) || m.matches()) {
+    		TableItem item = new TableItem(table, SWT.NONE);
+    		item.setText(items.get(i).toString());
+    		item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"));
+    		item.setData(items.get(i));
+    	}
+    }
+    
+    table.select(0);
+  }
+
+  public void populateUserSimpleType()
+  {
+    table.removeAll();
+    if (showAnonymous)
+     {
+      TableItem anonymousItem = new TableItem(table, SWT.NONE);
+      anonymousItem.setText("**anonymous**");
+      anonymousItem.setData("**anonymous**");
+    }
+    List items = getUserSimpleTypeNamesList();
+    for (int i = 0; i < items.size(); i++)
+     {
+      TableItem item = new TableItem(table, SWT.NONE);
+      item.setText(items.get(i).toString());
+      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+      item.setData(items.get(i));
+    }
+  }
+
+  public void populateUserSimpleType(String fragment)
+  {
+    table.removeAll();
+    fragment = fragment.toLowerCase();
+    Pattern regex = java.util.regex.Pattern.compile(fragment);
+    
+    if (showAnonymous)
+     {
+    	Matcher m = regex.matcher("**anonymous**");
+    	if ("**anonymous**".startsWith(fragment) || m.matches())  {
+    		TableItem anonymousItem = new TableItem(table, SWT.NONE);
+    		anonymousItem.setText("**anonymous**");
+    		anonymousItem.setData("**anonymous**");
+    	}
+    }
+    List items = getUserSimpleTypeNamesList();
+    for (int i = 0; i < items.size(); i++)
+     {
+    	String itemString = items.get(i).toString().toLowerCase();
+    	Matcher m = regex.matcher(itemString);
+    	
+    	if (itemString.startsWith(fragment) || m.matches()) {
+    		TableItem item = new TableItem(table, SWT.NONE);
+    		item.setText(items.get(i).toString());
+    		item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
+    		item.setData(items.get(i));
+    	}
+    }
+    
+    table.select(0);
+  }
+  
+  boolean checkForAnonymousType(Element element)
+  {
+    /*
+     * Using Ed's model to check boolean isAnonymous = false;
+     * 
+     * XSDConcreteComponent component =
+     * getXSDSchema().getCorrespondingComponent(element); if (component
+     * instanceof XSDElementDeclaration) { XSDElementDeclaration xsdElem =
+     * (XSDElementDeclaration)component; isAnonymous =
+     * xsdElem.isSetAnonymousTypeDefinition(); } return isAnonymous;
+     */
+    XSDDOMHelper helper = new XSDDOMHelper();
+    boolean isAnonymous = false;
+    Node aNode =
+    helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+    if (aNode != null)
+     {
+      return true;
+    }
+    aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+    if (aNode != null)
+     {
+      isAnonymous = true;
+    }
+    return isAnonymous;
+  }
+
+  void updateElementToAnonymous(Element element, String xsdType)
+  {
+    String prefix = element.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    XSDDOMHelper.updateElementToNotAnonymous(element);
+    Element childNode = null;
+    if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+    {
+      childNode = element.getOwnerDocument().createElementNS(
+          XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
+          prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+    }
+    else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
+    {
+      childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+      
+      Element restrictionNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
+      restrictionNode.setAttribute(XSDConstants.BASE_ATTRIBUTE, prefix + "string");
+      childNode.appendChild(restrictionNode);      
+    }
+    if (childNode != null)
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      Node annotationNode = helper.getChildNode(element, XSDConstants.ANNOTATION_ELEMENT_TAG);
+      if (annotationNode == null)
+      {
+        Node firstChild = element.getFirstChild();
+        element.insertBefore(childNode, firstChild);
+      }
+      else
+      {
+        Node nextSibling = annotationNode.getNextSibling();
+        element.insertBefore(childNode, nextSibling);
+      }
+      XSDDOMHelper.formatChild(childNode);
+    }
+  }
+
+  boolean isSTAnonymous(Element element)
+  {
+    XSDDOMHelper helper = new XSDDOMHelper();
+    Node aNode = helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+    if (aNode != null)
+    {
+      if (XSDDOMHelper.inputEquals(aNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  boolean isCTAnonymous(Element element)
+  {
+    XSDDOMHelper helper = new XSDDOMHelper();
+    Node aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+    if (aNode != null)
+     {
+      if (XSDDOMHelper.inputEquals(aNode, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
+       {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  XSDTypeDefinition getAnonymousTypeDefinition(Element element)
+  {
+    XSDDOMHelper helper = new XSDDOMHelper();
+    Node typeDefinitionNode =
+    helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+    if (typeDefinitionNode == null)
+     {
+      typeDefinitionNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+    }
+    if (typeDefinitionNode != null)
+     {
+      XSDConcreteComponent component =
+      xsdSchema.getCorrespondingComponent(typeDefinitionNode);
+      if (component instanceof XSDTypeDefinition)
+       {
+        return (XSDTypeDefinition) component;
+      }
+    }
+    return null;
+  }
+  
+  public java.util.List getBuiltInTypeNamesList()
+  {
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    return helper.getBuiltInTypeNamesList();
+  }
+
+  public java.util.List getUserSimpleTypeNamesList()
+  {
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    return helper.getUserSimpleTypeNamesList();
+  }
+  
+  public java.util.List getUserComplexTypeNamesList()
+  {
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    return helper.getUserComplexTypeNamesList();
+  }
+  
+  protected boolean hasElementChildren(Node parentNode)
+  {
+    boolean hasChildrenElements = false;
+    if (parentNode != null && parentNode.hasChildNodes())
+    {
+      NodeList nodes = parentNode.getChildNodes();
+      for (int i = 0; i < nodes.getLength(); i++)
+      {
+        if (nodes.item(i) instanceof Element)
+        {
+          hasChildrenElements = true;
+          break;
+        }
+      }
+    }
+    return hasChildrenElements;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSection.java
new file mode 100644
index 0000000..3381d16
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSection.java
@@ -0,0 +1,359 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
+import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
+import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class TypesSection extends AbstractSection
+{
+  Text typeCombo;
+  Button button;
+
+  String type;
+  Object typeObject;
+  CLabel typeLabel;
+  Table table;
+  TypeSection typeSection;
+  boolean showAnonymous = true;
+  String previousStringType = "";
+  boolean isAnonymous;
+  int previousType;
+  boolean showComplexTypes = true;
+  
+  /**
+   * 
+   */
+  public TypesSection()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		composite = getWidgetFactory().createFlatFormComposite(parent);
+    
+		FormData data;
+
+		typeCombo = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
+    typeCombo.setEditable(false);
+		typeCombo.addListener(SWT.Modify, this);
+    
+    button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
+    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
+
+    typeLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE") + ":"); //$NON-NLS-1$
+
+    button.addSelectionListener(this);
+		FormData data2 = new FormData();
+		data2.left = new FormAttachment(100, -rightMarginSpace + 2);
+		data2.right = new FormAttachment(100,0);
+		data2.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
+		button.setLayoutData(data2);
+
+    data = new FormData();
+    data.left = new FormAttachment(0, 100);
+    data.right = new FormAttachment(button, 0);
+    typeCombo.setLayoutData(data);
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+	  Object input = getInput();
+    if (isReadOnly)
+    {
+      composite.setEnabled(false);
+    }
+    else
+    {
+      composite.setEnabled(true);
+    }
+	  typeCombo.setText(""); //$NON-NLS-1$
+	  if (input != null)
+	  {
+	    Element element = null;
+	    if (input instanceof XSDElementDeclaration)
+	    {
+        XSDElementDeclaration xsdElem = (XSDElementDeclaration)input;
+	      element = xsdElem.getElement();
+        XSDTypeDefinition typeDef = xsdElem.getTypeDefinition();
+        boolean isAnonymous = xsdElem.isAbstract();
+
+        if (isAnonymous)
+        {
+          typeCombo.setText("**anonymous**"); //$NON-NLS-1$
+        }
+        else
+        {
+          String typeName = ""; //$NON-NLS-1$
+          if (typeDef != null)
+          {
+            typeName = typeDef.getQName(getSchema());
+            if (typeName == null)
+            {
+              typeName = ""; //$NON-NLS-1$
+            }
+            typeCombo.setText(typeName);
+          }
+          else
+          {
+            typeCombo.setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE")); //$NON-NLS-1$
+          }
+        }
+	    }
+	    else if (input instanceof XSDAttributeDeclaration)
+	    {
+	      element = ((XSDAttributeDeclaration)input).getElement();
+	    }
+      else if (input instanceof XSDAttributeUse)
+      {
+        XSDAttributeUse attributeUse = (XSDAttributeUse)input;
+        XSDAttributeDeclaration attribute = attributeUse.getAttributeDeclaration();
+        element = attribute.getElement();
+      }
+	    else if (input instanceof Element)
+	    {
+	      element = (Element)input;
+	    }
+//      else if (input instanceof XSDSimpleTypeDefinition)
+//      {
+//	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
+//	      Element simpleTypeElement = st.getElement();
+//        if (st.getVariety() == XSDVariety.LIST_LITERAL)
+//        {
+//	        element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
+//          String result = element.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
+//          if (result == null)
+//          {
+//            typeCombo.setText("**anonymous**");
+//          }
+//          else
+//          {
+//            typeCombo.setText(result);
+//          }
+//          typeLabel.setText("Item Type:");
+//        }
+//        else if (st.getVariety() == XSDVariety.ATOMIC_LITERAL)
+//        {
+//          typeLabel.setText("Base Type:");
+//	        element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.RESTRICTION_ELEMENT_TAG);
+//	        if (element == null)
+//	        {
+//	          element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.EXTENSION_ELEMENT_TAG);
+//	          if (element == null) return;
+//	        }
+//
+//          String result = element.getAttribute(XSDConstants.BASE_ATTRIBUTE);
+//          if (result == null)
+//          {
+//            typeCombo.setText("");
+//          }
+//          else
+//          {
+//            typeCombo.setText(result);
+//          }
+//        }
+//        return;
+//      }
+      
+      typeLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE") + ":"); //$NON-NLS-1$
+	    if (element != null)
+	    {
+        boolean isAnonymous = checkForAnonymousType(element);
+        String result = element.getAttribute(XSDConstants.TYPE_ATTRIBUTE);
+	      if (isAnonymous)
+	      {
+	        typeCombo.setText("**anonymous**"); //$NON-NLS-1$
+	      }
+	      if (result != null && result.equals("")) //$NON-NLS-1$
+	      {
+	        typeCombo.setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE")); //$NON-NLS-1$
+	      }
+	      else if (result != null)
+	      {
+	        typeCombo.setText(result);
+	      }
+
+	    }
+	  }
+	}
+
+  /**
+   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
+   */
+  public void widgetSelected(SelectionEvent e)
+  {
+    if (e.widget == button)
+    {
+/*        
+	    Shell shell = Display.getCurrent().getActiveShell();
+	    Object input = getInput();
+	    Element element = ((XSDConcreteComponent)getInput()).getElement();
+	    TypesDialog dialog;
+
+//	    if (input instanceof XSDSimpleTypeDefinition)
+//	    {
+//	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
+//	      Element simpleTypeElement = st.getElement();
+//	      if (st.getVariety() == XSDVariety.LIST_LITERAL)
+//	      {
+//	        Element listElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
+//	        dialog = new TypesDialog(shell, listElement, XSDConstants.ITEMTYPE_ATTRIBUTE, xsdSchema);
+//          dialog.showComplexTypes = false;
+//        }
+//        else if (st.getVariety() == XSDVariety.ATOMIC_LITERAL)
+//        {
+//          Element derivedByElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.RESTRICTION_ELEMENT_TAG);
+//          if (derivedByElement == null)
+//          {
+//            derivedByElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.EXTENSION_ELEMENT_TAG);
+//            if (derivedByElement == null) return;
+//          }
+//          if (derivedByElement != null)
+//          {
+//            dialog = new TypesDialog(shell, derivedByElement, XSDConstants.BASE_ATTRIBUTE, xsdSchema);
+//          }
+//          else
+//          {
+//            return;
+//          }
+//        }
+//        else
+//        {
+//          dialog = new TypesDialog(shell, element, "type", xsdSchema);
+//        }
+//	    }
+//	    else
+//	    {
+	      dialog = new TypesDialog(shell, element, "type", xsdSchema); //$NON-NLS-1$
+//	    }
+
+	    dialog.setBlockOnOpen(true);
+	    dialog.create();
+	    int result = dialog.open();
+	    
+	    if (result == Window.OK)
+	    {
+	      Object typeObject = dialog.getType();
+//		    if (input instanceof XSDSimpleTypeDefinition)
+//		    {
+//		      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
+//		      Element simpleTypeElement = st.getElement();
+//	        Element listElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
+//
+//  	      beginRecording("ItemType Change", element);
+//          listElement.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, (String)typeObject);
+//          endRecording(element);
+//		    }
+	    }
+*/        
+        Shell shell = Display.getCurrent().getActiveShell();
+        IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
+        
+        Object input = getInput();
+        XSDSchema schema = null;
+        if (input instanceof XSDConcreteComponent) {
+            schema = ((XSDConcreteComponent) input).getSchema();
+        }
+        
+        XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
+        XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);  // TODO: Externalize This
+        if (input instanceof XSDAttributeDeclaration)
+        {
+          provider.showComplexTypes(false);
+        }
+        provider.setDialog(dialog);
+        
+        dialog.setBlockOnOpen(true);
+        dialog.create();
+
+        if (dialog.open() == Window.OK) {
+            Element element = ((XSDConcreteComponent)getInput()).getElement();
+            XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
+            helper.setType(element, "type", dialog.getSelection());
+        }        
+
+//      refresh();
+    }
+  }
+
+  
+  
+  boolean checkForAnonymousType(Element element)
+  {
+    /* Using Ed's model to check
+     boolean isAnonymous = false;
+
+     XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
+     if (component instanceof XSDElementDeclaration)
+     {
+     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
+     isAnonymous = xsdElem.isSetAnonymousTypeDefinition();
+     }
+     return isAnonymous;
+     */
+
+    boolean isAnonymous = false;
+
+    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
+    if (aNode != null)
+     {
+      return true;
+    }
+    aNode = getDomHelper().getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
+    if (aNode != null)
+     {
+      isAnonymous = true;
+    }
+    return isAnonymous;
+  }
+
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSectionDescriptor.java
new file mode 100644
index 0000000..3e9b8bf
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSectionDescriptor.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class TypesSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public TypesSectionDescriptor()
+  {
+    super();
+  }
+
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
+   */
+  public String getId()
+  {
+    return "org.eclipse.wst.xsdeditor.section.types";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDElementDeclaration.class);
+    list.add(XSDAttributeDeclaration.class);
+    list.add(XSDAttributeUse.class);
+    list.add(XSDSimpleTypeDefinition.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new TypesSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDElementDeclaration)
+      {
+        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)object;
+        if (elementDeclaration.isElementDeclarationReference())
+        {
+          return false;
+        }
+        return true;
+      }
+      else if (object instanceof XSDAttributeDeclaration)
+      {
+        XSDAttributeDeclaration attr = (XSDAttributeDeclaration)object;
+        if (attr.isAttributeDeclarationReference())
+        {
+          return false;
+        }
+        return true;
+      }
+      else if (object instanceof XSDAttributeUse)
+      {
+        XSDAttributeUse attributeUse = (XSDAttributeUse)object;
+        Element element = attributeUse.getElement();
+        if (inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
+        {
+          return true;
+        }
+        else
+        {
+          return false;
+        }
+      }
+    }
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSection.java
new file mode 100644
index 0000000..d72ed50
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSection.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDEnumerationFacet;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class ValueSection extends AbstractSection
+{
+  Text valueText;
+  /**
+   * 
+   */
+  public ValueSection()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+	 */
+	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
+	{
+		super.createControls(parent, factory);
+		Composite composite =	getWidgetFactory().createFlatFormComposite(parent);
+		FormData data;
+
+		valueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
+		data = new FormData();
+		data.left = new FormAttachment(0, 100);
+		data.right = new FormAttachment(100, 0);
+		data.top = new FormAttachment(0, 0);
+		valueText.setLayoutData(data);
+		valueText.addListener(SWT.Modify, this);
+
+		CLabel valueLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_VALUE") + ":"); //$NON-NLS-1$
+		data = new FormData();
+		data.left = new FormAttachment(0, 0);
+		data.right = new FormAttachment(valueText, -ITabbedPropertyConstants.HSPACE);
+		data.top = new FormAttachment(valueText, 0, SWT.CENTER);
+		valueLabel.setLayoutData(data);
+		
+//		listener.startListeningForEnter(valueText);
+//		listener.startListeningTo(valueText);
+	}
+
+	/*
+	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+	 */
+	public void refresh()
+	{
+	  setListenerEnabled(false);
+	  Object input = getInput();
+	  valueText.setText(""); //$NON-NLS-1$
+	  if (input != null)
+	  {
+	    if (input instanceof XSDEnumerationFacet)
+	    {
+	      XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)input;
+	      Element element = enumFacet.getElement();
+        String value = element.getAttribute(XSDConstants.VALUE_ATTRIBUTE);
+        
+        if (value != null)
+        {
+          valueText.setText(value);
+        }
+	    }
+	  }
+	  setListenerEnabled(true);
+	}
+	
+  public void doHandleEvent(Event event)
+  {
+    if (event.widget == valueText)
+    {
+      Object input = getInput();
+	    if (input instanceof XSDEnumerationFacet)
+	    {
+	      XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)input;
+	      Element element = enumFacet.getElement();
+        
+        beginRecording(XSDEditorPlugin.getXSDString("_UI_ENUM_VALUE_CHANGE"), element); //$NON-NLS-1$
+        String value = valueText.getText();
+        element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, value);
+        endRecording(element);
+	    }
+    }
+  }
+
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
+   */
+  public boolean shouldUseExtraSpace()
+  {
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSectionDescriptor.java
new file mode 100644
index 0000000..e8f0b48
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSectionDescriptor.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
+import org.eclipse.xsd.XSDEnumerationFacet;
+
+public class ValueSectionDescriptor extends AbstractSectionDescriptor
+{
+  /**
+   * 
+   */
+  public ValueSectionDescriptor()
+  {
+    super();
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
+   */
+  public List getInputTypes()
+  {
+    List list = new ArrayList();
+    list.add(XSDEnumerationFacet.class);
+    return list;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
+   */
+  public ISection getSectionClass()
+  {
+    return new ValueSection();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
+   */
+  public String getTargetTab()
+  {
+    return "org.eclipse.wst.xmlwebservices.general";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+   */
+  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
+  {
+    Object object = null;
+    if (selection instanceof StructuredSelection)
+    {
+      StructuredSelection structuredSelection = (StructuredSelection)selection;
+      object = structuredSelection.getFirstElement();
+      if (object instanceof XSDEnumerationFacet)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+  
+  public String getAfterSection()
+  {
+    return "org.eclipse.wst.xsdeditor.section.name";
+  }
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/WindowUtility.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/WindowUtility.java
new file mode 100644
index 0000000..9cc0e4d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/WindowUtility.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+* Copyright (c) 2004, 2005 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
+* http://www.eclipse.org/legal/epl-v10.html
+* 
+* Contributors:
+*     IBM Corporation - Initial API and implementation
+*******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+
+class WindowUtility
+{
+	public static Object getSelection(ISelection selection)
+	{
+		if (selection == null)
+		{
+			return null;
+		} // end of if ()
+
+		Object result = null;
+		if (selection instanceof IStructuredSelection)
+		{
+			 IStructuredSelection es= (IStructuredSelection)selection;
+			 Iterator i= es.iterator();
+			 if (i.hasNext())
+			 {
+				 result= i.next();
+			 }
+		}                     
+		return result;
+	}
+
+	public static List getSelectionList(ISelection selection)
+	{
+		List result = null;
+		if (selection != null)
+		{
+			if (selection instanceof IStructuredSelection)
+			{
+				IStructuredSelection es= (IStructuredSelection)selection;
+				result = new Vector();
+				for (Iterator i= es.iterator(); i.hasNext(); )
+				{
+					result.add(i.next());
+				}
+			}
+		}                     
+		return result;
+	} 
+
+	public static void openErrorCreatingFile(Shell shell, IResource resource)
+	{                   
+		 String title = null;
+		 String briefMessage = null;
+		 String reason = null;
+		 String details = null;
+
+//	KCPort TODO
+//		 title = B2BGUIPlugin.getInstance().getString("_UI_ERROR_CREATING_FILE_TITLE");
+//		 briefMessage = B2BGUIPlugin.getInstance().getString("_UI_ERROR_CREATING_FILE_SHORT_DESC", resource.getName());
+//		 details = B2BGUIPlugin.getInstance().getString("_UI_ERROR_CREATING_FILE_LONG_DESC", resource.getLocation().toOSString()); 
+//      
+//		 IResource parent = resource.getParent();     
+//		 if (parent != null) 
+//		 {                   
+//			 if (parent.isReadOnly())
+//			 {
+//				 reason = B2BGUIPlugin.getInstance().getString("_UI_PARENT_FOLDER_IS_READ_ONLY", parent.getName());     
+//			 }
+//			 else
+//			 {
+//				 // on windows the isReadOnly() = false for read only shared directory... so we give a hint
+//				 reason = B2BGUIPlugin.getInstance().getString("_UI_UNKNOWN_ERROR_WITH_HINT", parent.getName());  
+//			 }
+//		 } 
+//
+//		 if (reason == null)
+//		 {
+//			 reason = B2BGUIPlugin.getInstance().getString("_UI_UNKNOWN_ERROR");
+//		 }
+
+		 openError(shell, title, briefMessage, reason, details);
+	}      
+
+	public static void openError(Shell shell, String title, String briefMessage, String reason, String detailedMessage)
+	{
+		ErrorDialog.openError(shell, title, briefMessage, createStatus(reason, detailedMessage));                                  
+	}      
+
+	private static IStatus createStatus(String reason, String msg)
+	{
+// KCPort TODO
+//	  String pluginId = B2BGUIPlugin.getInstance().getDescriptor().getUniqueIdentifier();
+	  String pluginId = "";
+		MultiStatus multiStatus = new MultiStatus(pluginId, 0, reason, null);
+		Status status = new Status(IStatus.ERROR, pluginId, 0, msg, null);
+		multiStatus.add(status);
+		return multiStatus;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionDescriptorProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionDescriptorProvider.java
new file mode 100644
index 0000000..54acd8c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionDescriptorProvider.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptorProvider;
+
+
+public class XSDSectionDescriptorProvider implements ISectionDescriptorProvider
+{
+  /**
+   * 
+   */
+  public XSDSectionDescriptorProvider()
+  {
+    super();
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptorProvider#getSectionDescriptors()
+   */
+  public ISectionDescriptor[] getSectionDescriptors()
+  {
+    ISectionDescriptor[] descriptors = new ISectionDescriptor[18];
+    descriptors[0] = new NameSectionDescriptor();
+    descriptors[1] = new TypesSectionDescriptor();
+    descriptors[2] = new OtherAttributesSectionDescriptor();
+    descriptors[3] = new AttributesViewSectionDescriptor();
+    descriptors[4] = new ModelGroupSectionDescriptor();
+    descriptors[5] = new NamespaceProcessContentsSectionDescriptor();
+    descriptors[6] = new ReferenceSectionDescriptor();
+    descriptors[7] = new ComplexTypeSectionDescriptor();
+    descriptors[8] = new ValueSectionDescriptor();
+    descriptors[9] = new PatternSectionDescriptor();
+    descriptors[10] = new AnnotationSectionDescriptor();
+    descriptors[11] = new SimpleTypeSectionDescriptor();
+    descriptors[12] = new FacetsSectionDescriptor();
+    descriptors[13] = new EnumerationsSectionDescriptor();
+    descriptors[14] = new NamespaceSectionDescriptor();
+    descriptors[15] = new SchemaLocationDescriptor();
+    descriptors[16] = new NamespaceAndSchemaLocationDescriptor();
+    descriptors[17] = new MinMaxSectionDescriptor();
+    
+//  descriptors[18] = new SimpleTypeUnionSectionDescriptor();
+//  descriptors[19] = new FixedDefaultSectionDescriptor();    
+    return descriptors;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionLabelProvider.java
new file mode 100644
index 0000000..77bebed
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionLabelProvider.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.w3c.dom.Element;
+
+
+public class XSDSectionLabelProvider extends LabelProvider
+{
+  /**
+   * 
+   */
+  public XSDSectionLabelProvider()
+  {
+    super();
+  }
+
+	/**
+	 * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+	 */
+	public Image getImage(Object object)
+	{
+		if (object == null || object.equals(StructuredSelection.EMPTY)) {
+			return null;
+		}
+    Image result = null;           
+    if (object instanceof StructuredSelection)
+    {
+      Object selected = ((StructuredSelection)object).getFirstElement();
+      
+      if (selected instanceof XSDConcreteComponent)
+      {
+        IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
+        IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+        IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
+        if (editorPart instanceof XSDEditor)
+        {
+          return ((XSDEditor)editorPart).getLabelProvider().getImage((XSDConcreteComponent)selected);
+        }
+      }
+      
+//      selected  = typeMapper.remapObject(selected);
+//      ModelAdapter modelAdapter = adapterFactory.getAdapter(selected);
+//      if (modelAdapter != null)
+//      {
+//        result = (Image)modelAdapter.getProperty(selected, ModelAdapter.IMAGE_PROPERTY);     
+//      }
+    }
+    return result;
+	}
+
+	/**
+	 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+	 */
+	public String getText(Object object)
+	{
+		if (object == null || object.equals(StructuredSelection.EMPTY))
+    {
+			return "No items selected";
+		}
+    
+    String result = null;
+
+    boolean isReference = false;
+    Object selected = null;
+    if (object instanceof StructuredSelection)
+    {
+      selected = ((StructuredSelection)object).getFirstElement();
+      
+      if (selected instanceof XSDConcreteComponent)
+      {
+        if (selected instanceof XSDElementDeclaration)
+        {
+          XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)selected;
+          if (xsdElementDeclaration.isElementDeclarationReference())
+          {
+            isReference = true;
+          }
+        }
+        else if (selected instanceof XSDAttributeDeclaration)
+        {
+          if (((XSDAttributeDeclaration)selected).isAttributeDeclarationReference())
+          {
+            isReference = true;
+          }
+        }
+        else if (selected instanceof XSDModelGroupDefinition)
+        {
+          if (((XSDModelGroupDefinition)selected).isModelGroupDefinitionReference())
+          {
+            isReference = true;
+          }
+        }
+        StringBuffer sb = new StringBuffer();
+        Element element = ((XSDConcreteComponent)selected).getElement();
+        if (element != null)
+        {
+          sb.append(((XSDConcreteComponent)selected).getElement().getLocalName());
+          
+          if (isReference)
+          {
+            sb.append(" ");
+            sb.append(XSDEditorPlugin.getXSDString("_UI_PAGE_HEADING_REFERENCE"));
+          }
+          
+          if (!(element instanceof IDOMNode))
+          {
+            sb.append(" (" + XSDEditorPlugin.getXSDString("_UI_LABEL_READ_ONLY") + ")");   //$NON-NLS-1$
+          }
+          return sb.toString();
+        }
+        else
+        {
+          return "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_READ_ONLY") + ")";  //$NON-NLS-1$
+        }
+      }
+
+//      selected  = typeMapper.remapObject(selected);
+//      
+//       ModelAdapter modelAdapter = adapterFactory.getAdapter(selected);
+//       if (modelAdapter != null)
+//       {                       
+//         // result = (String)modelAdapter.getProperty(selected, ModelAdapter.LABEL_PROPERTY);
+//         result = ((WSDLElement)selected).getElement().getLocalName();
+//       }
+      if (object instanceof Element)
+      {
+        return ((Element)object).getLocalName();
+      }
+    }
+    else if (object instanceof TextSelection)
+    {
+    }
+    
+
+    return result;
+	}
+
+	/**
+	 * Determine if a multiple object selection has been passed to the 
+	 * label provider. If the objects is a IStructuredSelection, see if 
+	 * all the objects in the selection are the same and if so, we want
+	 * to provide labels for the common selected element.
+	 * @param objects a single object or a IStructuredSelection.
+	 * @param multiple first element in the array is true if there is multiple
+	 * unequal selected elements in a IStructuredSelection.
+	 * @return the object to get labels for.
+	 */
+	private Object getObject(Object objects, boolean multiple[]) {
+		Assert.isNotNull(objects);
+		Object object = null;
+		return object;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDTabbedPropertySheetPage.java
new file mode 100644
index 0000000..97810d0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDTabbedPropertySheetPage.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.IPageSite;
+import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor;
+import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
+import org.eclipse.wst.xsd.ui.internal.XSDSelectionManager;
+import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
+import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.Text;
+
+public class XSDTabbedPropertySheetPage extends TabbedPropertySheetPage
+  implements ISelectionChangedListener, INotifyChangedListener 
+{
+  XSDSchema xsdSchema;
+  private XSDSelectionManager selectionManager;
+  private XSDModelAdapterFactoryImpl adapterFactory;
+  /**
+   * @param tabbedPropertySheetPageContributor
+   */
+  public XSDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
+  {
+    super(tabbedPropertySheetPageContributor);
+  }
+  
+  public void init(IPageSite pageSite)
+  {
+  	super.init(pageSite);
+  	getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(this);
+  }
+
+  public void setXSDSchema(XSDSchema xsdSchema)
+  {
+    this.xsdSchema = xsdSchema;
+  }
+  
+  public void setXSDModelAdapterFactory(XSDModelAdapterFactoryImpl adapterFactory) {
+    // disconnect from old one
+    if (adapterFactory != null) {
+      adapterFactory.removeListener(this);
+    }
+
+    this.adapterFactory = adapterFactory;
+
+    // connect to new one
+    if (adapterFactory != null) {
+      adapterFactory.addListener(this);
+    }
+  }
+  
+  public void setSelectionManager(XSDSelectionManager newSelectionManager)
+  { 
+    // disconnect from old one
+    if (selectionManager != null)
+    {                                                        
+      selectionManager.removeSelectionChangedListener(this);  
+    }
+
+    selectionManager = newSelectionManager;
+
+    // connect to new one
+    if (selectionManager != null)
+    {
+      selectionManager.addSelectionChangedListener(this);  
+    }
+  }    
+
+  public void selectionChanged(IWorkbenchPart part, ISelection selection)
+  {
+    // override for category
+    if (selection != null)
+    {
+      if (selection instanceof IStructuredSelection)
+      {
+        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+        if (structuredSelection.isEmpty())
+        {
+          return;
+        }
+        Object obj = structuredSelection.getFirstElement();
+        if (obj instanceof Element)
+        {
+          try
+          {
+            Object modelObject = xsdSchema.getCorrespondingComponent((Element) obj);
+            if (modelObject != null)
+            {
+              obj = modelObject;
+              selection = new StructuredSelection(obj);
+            }
+          }
+          catch (Exception e)
+          {
+          }
+        }
+        else if (obj instanceof Text)
+        {
+        	Node parent = ((Text)obj).getParentNode();
+          Object modelObject = xsdSchema.getCorrespondingComponent(parent);
+          if (modelObject != null)
+          {
+            obj = modelObject;
+            selection = new StructuredSelection(obj);
+          }
+        }
+        else if (obj instanceof CategoryAdapter)
+        {
+          selection = new StructuredSelection(((CategoryAdapter)obj).getXSDSchema());
+        }
+        else if (obj instanceof Category)
+        {
+          selection = new StructuredSelection(((Category)obj).getXSDSchema());
+        }
+        else if (obj instanceof ProcessingInstruction)
+        {
+        	selection = new StructuredSelection(xsdSchema);
+        }
+      }
+      else if (selection instanceof TextSelection)
+      {
+        return;
+      }
+    }
+    super.selectionChanged(part, selection);
+  }
+	
+  public void selectionChanged(SelectionChangedEvent event)
+  {
+    if (!event.getSelection().isEmpty())
+    {
+      selectionChanged(getSite().getWorkbenchWindow().getActivePage().getActivePart(), event.getSelection());
+      //super.selectionChanged(getSite().getWorkbenchWindow().getActivePage().getActivePart(), event.getSelection());
+    }
+  }
+  
+  public void dispose()
+  {
+    if (selectionManager != null)
+    {
+      selectionManager.removeSelectionChangedListener(this);
+    }
+    if (adapterFactory != null)
+    {
+      adapterFactory.removeListener(this);
+    }
+    getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(this);
+    super.dispose();
+  }
+  
+  public void notifyChanged(Notification notification)
+  {
+    if (getCurrentTab() != null)
+    {
+      refresh();
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbook.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbook.java
new file mode 100644
index 0000000..9c43704
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbook.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Composite;
+
+public class XSDWorkbook {
+  private CTabFolder tabFolder;
+  private CTabItem selectedTab;
+/**
+ * Workbook constructor comment.
+ */
+public XSDWorkbook(Composite parent, int style) {
+  tabFolder = new CTabFolder(parent, style);
+
+  tabFolder.addSelectionListener(new SelectionAdapter() {
+    public void widgetSelected(SelectionEvent event) {
+      CTabItem newSelectedTab = (CTabItem) event.item;
+      if (selectedTab == newSelectedTab) // Do nothing if the selection did not change.
+        return;
+
+      if (selectedTab != null && (!selectedTab.isDisposed())) {
+        XSDWorkbookPage selectedPage = getWorkbookPage(selectedTab);
+        if (!selectedPage.deactivate()) {
+          // tabFolder.setSelection(new CTabItem[] {selectedTab});
+          tabFolder.setSelection(selectedTab);
+          return;
+        }
+      }
+
+      selectedTab = newSelectedTab;
+      XSDWorkbookPage newSelectedPage = getWorkbookPage(newSelectedTab);
+      if (newSelectedPage != null)
+      newSelectedPage.activate();
+
+    }
+  });
+
+}
+public XSDWorkbookPage getSelectedPage() {
+
+  int index = tabFolder.getSelectionIndex();
+  if (index == -1) // When can this be -1
+    return null;
+
+  CTabItem selectedItem = tabFolder.getItem(index);
+
+  return (XSDWorkbookPage)selectedItem.getData();
+}
+public CTabFolder getTabFolder() {
+
+  return tabFolder;
+
+}
+protected XSDWorkbookPage getWorkbookPage(CTabItem item) {
+
+  try {
+    return (XSDWorkbookPage) item.getData();
+  } catch (ClassCastException e) {
+    return null;
+  }
+}
+public XSDWorkbookPage[] getWorkbookPages() {
+
+  CTabItem[] tabItems = tabFolder.getItems();
+  int nItems = tabItems.length;
+  XSDWorkbookPage[] workbookPages = new XSDWorkbookPage[nItems];
+  for (int i = 0; i < nItems; i++)
+    workbookPages[i] = getWorkbookPage(tabItems[i]);
+  return workbookPages;
+}
+public void setSelectedPage (XSDWorkbookPage workbookPage)
+{
+  CTabItem newSelectedTab = workbookPage.getTabItem();
+
+  if (selectedTab == newSelectedTab)
+    return;
+
+  selectedTab = newSelectedTab;
+  workbookPage.activate();
+  // tabFolder.setSelection(new CTabItem[] {newSelectedTab});
+  tabFolder.setSelection(newSelectedTab);
+
+}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbookPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbookPage.java
new file mode 100644
index 0000000..f865afa
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbookPage.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.properties.section;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public abstract class XSDWorkbookPage {
+  public CTabItem tabItem;
+/**
+ * WorkbookPage constructor comment.
+ */
+public XSDWorkbookPage(XSDWorkbook parent) {
+  CTabFolder folder = parent.getTabFolder();
+  tabItem = new CTabItem(folder,SWT.NONE);
+  tabItem.setData(this);
+}
+public void activate() {
+
+  if (tabItem.getControl() == null)
+    tabItem.setControl(createControl(tabItem.getParent()));
+      
+}
+protected abstract Control createControl (Composite parent);
+public boolean deactivate() {
+  return true;
+}
+public void dispose() {
+
+  if (tabItem == null)
+    return;
+
+  CTabItem oldItem = tabItem;
+  tabItem = null;
+  oldItem.dispose();
+}
+public CTabItem getTabItem() {
+  return tabItem;
+}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/CategoryAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/CategoryAdapter.java
new file mode 100644
index 0000000..3182e9a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/CategoryAdapter.java
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.xsd.XSDSchema;
+
+
+public class CategoryAdapter // extends ItemProvider
+  implements ILabelProvider, IChangeNotifier, ITreeContentProvider
+{
+  
+  protected String text;
+
+  /**
+   * This is the image returned by {@link #getImage getImage(Object)}.
+   */
+  protected Image image;
+
+  /**
+   * This is the parent returned by {@link #getParent getParent(Object)}.
+   */
+  protected Object parent;
+
+  public CategoryAdapter(String label, Image image, Collection children, XSDSchema xsdSchema, int groupType)
+  {
+//    super(label, image, xsdSchema);
+    this.text = label;
+    this.image = image;
+    this.parent = xsdSchema;
+    this.xsdSchema = xsdSchema;
+    this.children = children;
+    this.groupType = groupType;
+  }
+  
+  public final static int ATTRIBUTES = 1;
+  public final static int ELEMENTS = 2;
+  public final static int TYPES = 3;
+  public final static int GROUPS = 5;
+  public final static int DIRECTIVES = 6;
+  public final static int NOTATIONS = 7;
+  public final static int ATTRIBUTE_GROUPS = 8;
+  public final static int IDENTITY_CONSTRAINTS = 9;
+  public final static int ANNOTATIONS = 10;
+                                 
+  protected int groupType;
+  Collection children;
+  XSDSchema xsdSchema;
+  
+  public XSDSchema getXSDSchema()
+  {
+    return xsdSchema;
+  }
+  
+  public int getGroupType()
+  {
+    return groupType;
+  }   
+
+//  public boolean hasChildren(Object o)
+//  {
+//    return !children.isEmpty();
+//  }
+
+//  public Collection getChildren(Object o)
+//  {
+//    return children;
+//  }
+  
+  public Image getImage(Object element)
+  {
+    return image;
+  }
+  
+  public String getText(Object object)
+  {
+    // return object.toString();
+    return text;
+  }
+  
+  public void addListener(ILabelProviderListener listener)
+  {
+    
+  }
+  
+  public boolean isLabelProperty(Object element, String property)
+  {
+    return false;
+  }
+
+  public void removeListener(ILabelProviderListener listener)
+  {
+    
+  }
+
+  public void fireNotifyChanged(Notification notification)
+  {
+    
+  }
+
+  /**
+   * This adds another listener.
+   */
+  public void addListener(INotifyChangedListener notifyChangedListener)
+  {
+    
+  }
+
+  /**
+   * This removes a listener.
+   */
+  public void removeListener(INotifyChangedListener notifyChangedListener)
+  {
+    
+  }
+
+  public void dispose()
+  {
+    
+  }
+  
+  public Object[] getElements(Object inputElement)
+  {
+    return getChildren(inputElement);
+  }
+
+  public Object[] getChildren(Object parentElement)
+  {
+    return children.toArray();
+  }
+  
+  public void setChildren(Collection list)
+  {
+    children = list;
+  }
+
+  public Object getParent(Object element)
+  {
+    return xsdSchema;
+  }
+  
+  public boolean hasChildren(Object element)
+  {
+    return true;
+  }
+
+  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+  {
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAbstractAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAbstractAdapter.java
new file mode 100644
index 0000000..8233c5e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAbstractAdapter.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+
+public class XSDAbstractAdapter extends AdapterImpl
+  implements ITreeContentProvider, ILabelProvider, IChangeNotifier
+{
+
+  protected AdapterFactory adapterFactory;
+  /**
+   * 
+   */
+  public XSDAbstractAdapter(AdapterFactory adapterFactory)
+  {
+    super();
+    this.adapterFactory = adapterFactory;
+  }
+  
+  /**
+   * The adapter factory is used as the type key.
+   * This returns true, only if this adapter was created by the given factory.
+   */
+  public boolean isAdapterForType(Object type)
+  {
+    return type == adapterFactory;
+  }
+
+  public Image getImage(Object element)
+  {
+    return null;
+  }
+  
+  public String getText(Object object)
+  {
+    return object.toString();
+  }
+  
+  public void addListener(ILabelProviderListener listener)
+  {
+    
+  }
+  
+  public boolean isLabelProperty(Object element, String property)
+  {
+    return false;
+  }
+
+  public void removeListener(ILabelProviderListener listener)
+  {
+    
+  }
+  
+  public Object[] getChildren(Object parentElement)
+  {
+    List list = new ArrayList();
+    return list.toArray();
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return false;
+  }
+
+  public Object getParent(Object object)
+  {
+    return null;
+  }
+
+  public Object[] getElements(Object inputElement)
+  {
+    return getChildren(inputElement);
+  }
+
+  public void dispose()
+  {
+    
+  }
+  
+  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+  {
+    
+  }
+
+  /**
+   * This is used to implement {@link IChangeNotifier}.
+   */
+  protected IChangeNotifier changeNotifier;
+
+  
+  public void notifyChanged(Notification msg)
+  {                        
+    if (msg.getEventType() != Notification.RESOLVE)
+    {        
+      fireNotifyChanged(msg);
+    }
+  }  
+
+  /**
+   * This calls {@link org.eclipse.emf.edit.provider.INotifyChangedListener#notifyChanged notifyChanged} for each listener.
+   */
+  public void fireNotifyChanged(Notification notification)
+  {
+    if (changeNotifier != null)
+    {
+      changeNotifier.fireNotifyChanged(notification);
+    }
+
+    if (adapterFactory instanceof IChangeNotifier)
+    {
+      IChangeNotifier changeNotifier = (IChangeNotifier)adapterFactory;
+      changeNotifier.fireNotifyChanged(notification);
+    }
+  }
+
+
+  /**
+   * This adds another listener.
+   */
+  public void addListener(INotifyChangedListener notifyChangedListener)
+  {
+    if (changeNotifier == null)
+    {
+      changeNotifier = new ChangeNotifier();
+    }
+    changeNotifier.addListener(notifyChangedListener);
+   
+  }
+
+  /**
+   * This removes a listener.
+   */
+  public void removeListener(INotifyChangedListener notifyChangedListener)
+  {
+    if (changeNotifier != null)
+    {
+      changeNotifier.removeListener(notifyChangedListener);
+    }
+   
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAdapterFactoryLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAdapterFactoryLabelProvider.java
new file mode 100644
index 0000000..6cf228e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAdapterFactoryLabelProvider.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+public class XSDAdapterFactoryLabelProvider implements ILabelProvider, INotifyChangedListener, ITableLabelProvider {
+	protected XSDModelAdapterFactoryImpl adapterFactory;
+	protected Collection labelProviderListeners;
+
+	/**
+	 * 
+	 */
+	public XSDAdapterFactoryLabelProvider(XSDModelAdapterFactoryImpl adapterFactory) {
+		this.adapterFactory = adapterFactory;
+		labelProviderListeners = new ArrayList();
+	}
+
+	/**
+	 * Return the wrapped AdapterFactory.
+	 */
+	public AdapterFactory getAdapterFactory() {
+		return adapterFactory;
+	}
+
+	/**
+	 * Set the wrapped AdapterFactory.
+	 */
+	public void setAdapterFactory(XSDModelAdapterFactoryImpl adapterFactory) {
+		if (this.adapterFactory instanceof IChangeNotifier) {
+			((IChangeNotifier) this.adapterFactory).removeListener(this);
+		}
+
+		if (adapterFactory instanceof IChangeNotifier) {
+			((IChangeNotifier) adapterFactory).addListener(this);
+		}
+
+		this.adapterFactory = adapterFactory;
+	}
+
+	/**
+	 * Since we won't ever generate these notifications, we can just ignore
+	 * this.
+	 */
+	public void addListener(ILabelProviderListener listener) {
+		labelProviderListeners.add(listener);
+	}
+
+	/**
+	 * Since we won't ever add listeners, we can just ignore this.
+	 */
+	public void removeListener(ILabelProviderListener listener) {
+		labelProviderListeners.remove(listener);
+	}
+
+	/**
+	 * This discards the content provider and removes this as a listener to
+	 * the {@link #adapterFactory}.
+	 */
+	public void dispose() {
+		if (this.adapterFactory instanceof IChangeNotifier) {
+			((IChangeNotifier) adapterFactory).removeListener(this);
+		}
+	}
+
+	/**
+	 * This always returns true right now.
+	 */
+	public boolean isLabelProperty(Object object, String id) {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+	 */
+	public Image getImage(Object object) {
+		ILabelProvider labelProvider = (ILabelProvider) adapterFactory.adapt(object, ILabelProvider.class);
+
+		return labelProvider != null ? labelProvider.getImage(object) : null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+	 */
+	public String getText(Object object) {
+		// Get the adapter from the factory.
+		//
+		ILabelProvider labelProvider = (ILabelProvider) adapterFactory.adapt(object, ILabelProvider.class);
+
+		return labelProvider != null ? labelProvider.getText(object) : object == null ? "" : object.toString();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.emf.edit.provider.INotifyChangedListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
+	 */
+	public void notifyChanged(Notification notification) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
+	 *      int)
+	 */
+	public Image getColumnImage(Object element, int columnIndex) {
+		return getImage(element);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
+	 *      int)
+	 */
+	public String getColumnText(Object element, int columnIndex) {
+		return getText(element);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAnnotationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAnnotationAdapter.java
new file mode 100644
index 0000000..b57a4c5
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAnnotationAdapter.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAnnotation;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class XSDAnnotationAdapter extends XSDAbstractAdapter
+{
+  public XSDAnnotationAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object element)
+  {
+    return XSDEditorPlugin.getPlugin().getImage("icons/XSDAnnotate.gif");
+  }
+  
+  public String getText(Object object)
+  {
+    XSDAnnotation xsdAnnotation = ((XSDAnnotation)object);
+    String result = "";
+    List userInformation = xsdAnnotation.getUserInformation();
+    if (!userInformation.isEmpty())
+    {
+      Element element = (Element)userInformation.get(0);
+      if (element.hasAttribute(XSDConstants.SOURCE_ATTRIBUTE))
+      {
+        result = element.getAttribute(XSDConstants.SOURCE_ATTRIBUTE);
+      }
+      else
+      {
+        org.w3c.dom.Node text = element.getFirstChild(); 
+        while (text instanceof Element)
+        {
+          text = ((Element)text).getFirstChild();
+        }
+        if (text != null && text.getNodeValue() != null)
+        {
+          result = text.getNodeValue();
+          result = result.trim();
+          if (result.length() > 50)
+          {
+            result = result.substring(0, 50) + "...";
+          }
+        }
+      }
+    }
+
+    return result;
+  }
+  
+  public Object[] getChildren(Object parentElement)
+  {
+    return null;  
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return true;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDAnnotation element = (XSDAnnotation)object;
+    return element.getContainer();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeDeclarationAdapter.java
new file mode 100644
index 0000000..330925f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeDeclarationAdapter.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+public class XSDAttributeDeclarationAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDAttributeDeclarationAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object object)
+  {
+    XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
+    XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
+    
+    if (resolvedAttributeDeclaration.getContainer() == null)
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
+    }
+    // if (xsdAttributeDeclaration.getResolvedAttributeDeclaration() == xsdAttributeDeclaration)
+    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeRef.gif");
+    }
+    else
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
+    }
+    
+//    return 
+//    XSDEditorPlugin.getPlugin().getIconImage
+//     (resolvedAttributeDeclaration.getContainer() == null ?
+//        "full/obj16/XSDAttributeUnresolved" :
+//          xsdAttributeDeclaration.getResolvedAttributeDeclaration() == xsdAttributeDeclaration ?
+//          "full/obj16/XSDAttributeDeclaration" :
+//          "full/obj16/XSDAttributeUse");
+  }
+
+  public String getText(Object object)
+  {
+    XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
+    XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
+    String name =
+      xsdAttributeDeclaration != resolvedAttributeDeclaration ?
+        xsdAttributeDeclaration.getQName() :
+        xsdAttributeDeclaration.getName();
+
+    StringBuffer result = new StringBuffer();
+    if (name == null)
+    {
+      result.append("'absent'");
+    }
+    else
+    {
+      result.append(name);
+    }
+
+    if (resolvedAttributeDeclaration.getAnonymousTypeDefinition() == null && resolvedAttributeDeclaration.getTypeDefinition() != null)
+    {
+      result.append(" : ");
+      result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
+    }
+
+    return result.toString();
+  }
+
+  public Object[] getChildren(Object parentElement)
+  {
+    XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)parentElement;
+    List list = new ArrayList();
+    
+    XSDTypeDefinition type = xsdAttributeDeclaration.getAnonymousTypeDefinition();
+    if (type != null)
+    {
+      list.add(type);
+    }
+    return list.toArray();
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return true;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDAttributeDeclaration element = (XSDAttributeDeclaration)object;
+    return element.getContainer();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeGroupDefinitionAdapter.java
new file mode 100644
index 0000000..a45588e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeGroupDefinitionAdapter.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDWildcard;
+
+
+public class XSDAttributeGroupDefinitionAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDAttributeGroupDefinitionAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object object)
+  {
+    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = ((XSDAttributeGroupDefinition)object);
+
+    if (xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeGroupRef.gif");
+    }
+    else
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeGroup.gif");
+    }
+  }
+
+  public String getText(Object object)
+  {
+    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = ((XSDAttributeGroupDefinition)object);
+    String result =  
+      xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference() ?
+        xsdAttributeGroupDefinition.getQName() :
+        xsdAttributeGroupDefinition.getName();
+    return result == null ? "'absent'" : result;
+  }
+
+  public Object[] getChildren(Object parentElement)
+  {
+    XSDAttributeGroupDefinition xsdAttributeGroup = (XSDAttributeGroupDefinition)parentElement;
+    List list = new ArrayList();
+    list.addAll(xsdAttributeGroup.getContents());   
+//    Iterator i = xsdAttributeGroup.getContents().iterator();
+//    while (i.hasNext())
+//    {
+//      XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)i.next();
+//      if (attrGroupContent instanceof XSDAttributeUse)
+//      {
+//        list.add(((XSDAttributeUse)attrGroupContent).getAttributeDeclaration());
+//      }
+//      else
+//      {
+//        list.add(attrGroupContent);
+//      }
+//    }
+    
+    XSDWildcard wildcard = xsdAttributeGroup.getAttributeWildcardContent();
+    if (wildcard != null)
+    {
+      list.add(wildcard);
+    }
+    return list.toArray();
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return true;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDAttributeGroupDefinition element = (XSDAttributeGroupDefinition)object;
+    return element.getContainer();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeUseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeUseAdapter.java
new file mode 100644
index 0000000..5c8c127
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeUseAdapter.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeUse;
+
+public class XSDAttributeUseAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDAttributeUseAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+  
+  protected XSDAttributeDeclaration getDelegate(XSDAttributeUse xsdAttributeUse)
+  {
+    return xsdAttributeUse.getContent();
+  }
+  
+  /**
+   * This returns XSDAttributeUse.gif.
+   */
+  public Image getImage(Object object)
+  {
+    XSDAttributeUse xsdAttributeUse = ((XSDAttributeUse)object);
+    
+    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
+    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeRef.gif");
+    }
+    else
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
+    }
+    //return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDAttributeUse");  
+    
+  }
+
+  public String getText(Object object)
+  {
+    return getText(object, true);
+  }
+
+  public String getText(Object object, boolean showType)
+  {
+    XSDAttributeUse xsdAttributeUse = ((XSDAttributeUse)object);
+    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
+    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
+    {
+      return xsdAttributeDeclaration.getResolvedAttributeDeclaration().getName();
+    }
+    StringBuffer result  = new StringBuffer();
+    if (xsdAttributeDeclaration != null)
+    {
+      result.append(xsdAttributeDeclaration.getName());
+    }
+
+    if (xsdAttributeUse.isSetConstraint())
+    {
+      if (result.length() != 0)
+      {
+        result.append("  ");
+      }
+      result.append('<');
+      result.append(xsdAttributeUse.getConstraint());
+      result.append("=\"");
+      result.append(xsdAttributeUse.getLexicalValue());
+      result.append("\">");
+    }
+
+    return result.toString();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDComplexTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDComplexTypeDefinitionAdapter.java
new file mode 100644
index 0000000..38f7351
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDComplexTypeDefinitionAdapter.java
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.xsd.XSDComplexTypeContent;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class XSDComplexTypeDefinitionAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDComplexTypeDefinitionAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object object)
+  {
+    return XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif");
+//    XSDComplexTypeDefinition xsdComplexTypeDefinition = ((XSDComplexTypeDefinition)object);
+//    return 
+//      XSDEditorPlugin.getPlugin().getIconImage
+//        (xsdComplexTypeDefinition.getContainer() == null ?
+//          "full/obj16/XSDComplexTypeDefinitionUnresolved" :
+//          "full/obj16/XSDComplexTypeDefinition");
+  }
+  
+  public String getText(Object object)
+  {
+    return getText(object, true);
+  }
+  
+  public String getText(Object object, boolean showType)
+  {
+    XSDComplexTypeDefinition xsdComplexTypeDefinition = ((XSDComplexTypeDefinition)object);
+
+    StringBuffer result = new StringBuffer();
+    
+    result.append
+     (xsdComplexTypeDefinition.getName() == null ? 
+        // xsdComplexTypeDefinition.getAliasName() :
+        "local type" :
+        xsdComplexTypeDefinition.getName());
+
+    if (showType)
+    {
+      XSDTypeDefinition baseTypeDefinition = xsdComplexTypeDefinition.getBaseTypeDefinition();
+      if (baseTypeDefinition != null && 
+            baseTypeDefinition != xsdComplexTypeDefinition.getContent() &&
+            baseTypeDefinition.getName() != null &&
+            !XSDConstants.isURType(baseTypeDefinition))
+      {
+        result.append(" : ");
+        result.append(baseTypeDefinition.getQName(xsdComplexTypeDefinition));
+      }
+    }
+
+    return result.toString();
+  }
+
+  public Object[] getChildren(Object parentElement)
+  {
+    XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition)parentElement;
+    List list = new ArrayList();
+    
+    if (xsdComplexTypeDefinition.getContent() != null)
+    {
+      XSDComplexTypeContent xsdComplexTypeContent = xsdComplexTypeDefinition.getContent();
+      if (xsdComplexTypeContent instanceof XSDParticle)
+      {
+        list.add(((XSDParticle)xsdComplexTypeContent).getContent());
+      }
+    }
+    
+//    if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowInherited())
+//    {
+//      if (xsdComplexTypeDefinition.getSyntheticParticle() != null)
+//      {
+//        XSDTypeDefinition type = xsdComplexTypeDefinition.getBaseTypeDefinition();
+//        list.addAll(XSDChildUtility.getModelChildren(type));
+//      }
+//      if (xsdComplexTypeDefinition.getSyntheticWildcard() != null)
+//      {
+//        list.add(xsdComplexTypeDefinition.getSyntheticWildcard());
+//      }
+//    }
+    
+//    List attributes = xsdComplexTypeDefinition.getAttributeContents();
+//    if (attributes.size() > 0)
+//    {
+//      list.addAll(attributes);
+//    }
+
+//  list = new ArrayList();
+    if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowInherited())
+    {
+      if (xsdComplexTypeDefinition.getDerivationMethod().getName().equals("extension"))
+      {
+        XSDTypeDefinition type = xsdComplexTypeDefinition.getBaseTypeDefinition();
+        Iterator iter = XSDChildUtility.getModelChildren(type).iterator();
+        boolean cont = true;
+        while (cont)
+        {
+          while (iter.hasNext())
+          {
+            list.add(0, iter.next());
+          }
+          
+          if (type instanceof XSDComplexTypeDefinition)
+          {
+            XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)type;
+            type = ctd.getBaseTypeDefinition();
+                      
+            // defect 264957 - workbench hangs when modifying complex content
+            // Since we don't filter out the current complexType from
+            // the combobox, we can potentially have an endless loop
+            if (ctd == type)
+            {
+              cont = false;
+              break;
+            }
+
+            if (ctd.getDerivationMethod().getName().equals("extension"))
+            {
+              iter = XSDChildUtility.getModelChildren(type).iterator();
+            }
+            else
+            {
+              cont = false;
+            }
+          }
+          else
+          {
+            cont = false;
+          }
+        }
+
+      }
+
+          
+//          list.addAll(XSDChildUtility.getModelChildren(baseType));
+      }
+
+//    list.addAll(XSDChildUtility.getModelChildren(xsdComplexTypeDefinition));
+
+    return list.toArray();
+ 
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return true;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDComplexTypeDefinition element = (XSDComplexTypeDefinition)object;
+    return element.getContainer();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDContentProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDContentProvider.java
new file mode 100644
index 0000000..984e099
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDContentProvider.java
@@ -0,0 +1,228 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDWildcard;
+import org.w3c.dom.Node;
+
+public class XSDContentProvider implements ITreeContentProvider, INotifyChangedListener
+{
+  XSDModelAdapterFactoryImpl xsdModelAdapterFactory;
+
+  public XSDContentProvider(XSDModelAdapterFactoryImpl xsdModelAdapterFactoryImpl)
+  {
+    this.xsdModelAdapterFactory = xsdModelAdapterFactoryImpl;
+    
+    if (xsdModelAdapterFactory instanceof IChangeNotifier)
+    {
+      ((IChangeNotifier)xsdModelAdapterFactory).addListener(this);
+    }
+  }
+  
+  /*
+   * @see ITreeContentProvider#getChildren(Object)
+   */
+  public Object[] getChildren(Object parentElement)
+  {
+    XSDConcreteComponent xsdComp = null;
+    List list = null;
+    
+    // root/input is structuredmodel
+    if (parentElement instanceof IDOMModel) {
+		IDOMDocument domDoc = ((IDOMModel) parentElement).getDocument();
+		if (domDoc != null) {
+			XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
+			/*
+			 * ISSUE: Didn't want to go through initializing
+			 * schema if it does not already exist, so just
+			 * attempted to get existing adapter. If doesn't
+			 * exist, just don't bother working.
+			 */
+			if (modelAdapter != null)
+				xsdComp = modelAdapter.getSchema();
+			if (xsdComp != null) {
+		      xsdModelAdapterFactory.adapt(xsdComp, xsdModelAdapterFactory);
+
+		      list = new ArrayList();
+		      list.add(xsdComp);
+		      return list.toArray();
+			}
+		}
+    }
+    else if (parentElement instanceof XSDConcreteComponent)
+    {
+      xsdComp = (XSDConcreteComponent)parentElement;
+      list = new ArrayList();
+    }
+    else if (parentElement instanceof ITreeItemContentProvider)
+    {
+      return ((ITreeItemContentProvider)parentElement).getChildren(parentElement).toArray();
+    }
+    else if (parentElement instanceof ITreeContentProvider)
+    {
+      return ((ITreeContentProvider)parentElement).getChildren(parentElement);
+    }
+    
+    if (xsdComp != null)
+    {
+      XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(xsdComp, xsdModelAdapterFactory);
+      
+      if (xsdComp instanceof XSDElementDeclaration || xsdComp instanceof XSDModelGroup || xsdComp instanceof XSDWildcard)
+      {
+        xsdModelAdapterFactory.adapt(((XSDParticleContent)xsdComp).getContainer(), xsdModelAdapterFactory);
+      }
+
+      if (a != null)
+      {
+ 	    Object [] obj = a.getChildren(xsdComp);
+ 	    if (obj != null)
+ 	    {
+ 	      list = Arrays.asList(obj);
+ 	    }
+ 	  }
+    }
+    
+    list =  list != null ? list : Collections.EMPTY_LIST;
+    return list.toArray();
+  }
+
+  /*
+   * @see ITreeContentProvider#getParent(Object)
+   */
+  public Object getParent(Object element)
+  {
+    if (element instanceof Node)
+    {
+      return ((Node)element).getParentNode();
+    }
+    else if (element instanceof XSDConcreteComponent)
+    {
+      return ((XSDConcreteComponent)element).getContainer();
+    }
+    return null;
+  }
+
+  /*
+   * @see ITreeContentProvider#hasChildren(Object)
+   */
+  public boolean hasChildren(Object element)
+  {
+    Object[] children = getChildren(element);
+    return children != null && children.length > 0;   
+  }
+
+  /*
+   * @see IStructuredContentProvider#getElements(Object)
+   */
+  public Object[] getElements(Object inputElement)
+  {
+    return getChildren(inputElement);
+  }
+
+  public void notifyChanged(Notification notification)
+  {
+    if (viewer != null)
+    {
+      if (viewer instanceof StructuredViewer)
+      {
+        if (notification.getFeature() instanceof EAttribute)
+        {
+          ((StructuredViewer)viewer).update(notification.getNotifier(), null);
+        }
+        else
+        {
+          ((StructuredViewer)viewer).refresh(notification.getNotifier());
+        }
+      }
+      else
+      {
+        viewer.refresh();
+      }
+    }
+
+  }
+
+  /*
+   * @see IContentProvider#dispose()
+   */
+  public void dispose()
+  {
+    viewer = null;
+    xsdModelAdapterFactory.removeListener(this);
+  }
+  
+  protected Viewer viewer = null;
+
+  /*
+   * @see IContentProvider#inputChanged(Viewer, Object, Object)
+   */
+  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+  {
+    this.viewer = viewer;
+  }
+  
+	/**
+	 * Gets the xsd schema from document
+	 * 
+	 * @param document
+	 * @return XSDSchema or null of one does not exist yet for document
+	 */
+	private XSDSchema getXSDSchema(IDocument document) {
+		XSDSchema schema = null;
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+		if (model != null) {
+			try {
+				if (model instanceof IDOMModel) {
+					IDOMDocument domDoc = ((IDOMModel) model).getDocument();
+					if (domDoc != null) {
+						XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
+						/*
+						 * ISSUE: Didn't want to go through initializing
+						 * schema if it does not already exist, so just
+						 * attempted to get existing adapter. If doesn't
+						 * exist, just don't bother working.
+						 */
+						if (modelAdapter != null)
+							schema = modelAdapter.getSchema();
+					}
+				}
+			}
+			finally {
+				model.releaseFromRead();
+			}
+		}
+		return schema;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDElementDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDElementDeclarationAdapter.java
new file mode 100644
index 0000000..f273ccf
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDElementDeclarationAdapter.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class XSDElementDeclarationAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDElementDeclarationAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object element)
+  {
+    XSDElementDeclaration xsdElementDeclaration = ((XSDElementDeclaration)element);
+    
+    if (!xsdElementDeclaration.isElementDeclarationReference())
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
+    }
+    else
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDElementRef.gif");
+    }
+  }
+  
+  public String getText(Object object)
+  {
+    XSDElementDeclaration xsdElementDeclaration = ((XSDElementDeclaration)object);
+    XSDElementDeclaration resolvedElementDeclaration = xsdElementDeclaration.getResolvedElementDeclaration();
+    String name = 
+      xsdElementDeclaration != resolvedElementDeclaration ?
+        xsdElementDeclaration.getQName() :
+        xsdElementDeclaration.getName();
+
+    StringBuffer result = new StringBuffer();
+    if (name == null)
+    {
+      result.append("'absent'");
+    }
+    else
+    {
+      result.append(name);
+    }
+    
+    if (!xsdElementDeclaration.isGlobal())
+    {
+      Element element = xsdElementDeclaration.getElement();
+      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
+      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
+
+      if (hasMinOccurs || hasMaxOccurs)
+      {
+	      result.append(" ["); 
+		    if (hasMinOccurs)
+	      {
+	        int min = ((XSDParticle)xsdElementDeclaration.getContainer()).getMinOccurs();
+	  	    if (min == XSDParticle.UNBOUNDED)
+	  	    {
+	  	      result.append("*");
+	  	    }
+	  	    else
+	  	    {
+	  	      result.append(String.valueOf(min));
+	  	    }
+	      }
+        else // print default
+        {
+          int min = ((XSDParticle)xsdElementDeclaration.getContainer()).getMinOccurs();
+          result.append(String.valueOf(min));
+        }
+	      if (hasMaxOccurs)
+	      {
+	        int max = ((XSDParticle)xsdElementDeclaration.getContainer()).getMaxOccurs();
+	  	    result.append("..");
+	  	    if (max == XSDParticle.UNBOUNDED)
+	  	    {
+	  	      result.append("*");
+	  	    }
+	  	    else
+	  	    {
+	  	      result.append(String.valueOf(max));
+	  	    }
+	      }
+        else // print default
+        {
+          result.append("..");
+          int max = ((XSDParticle)xsdElementDeclaration.getContainer()).getMaxOccurs();
+          result.append(String.valueOf(max));
+         
+        }
+	      result.append("]");
+      }
+    }
+    
+    if (resolvedElementDeclaration.getAnonymousTypeDefinition() == null && resolvedElementDeclaration.getTypeDefinition() != null)
+    {
+      result.append(" : ");
+      result.append(resolvedElementDeclaration.getTypeDefinition().getQName(xsdElementDeclaration));
+    }
+
+    return result.toString();
+  }
+  
+  public Object[] getChildren(Object parentElement)
+  {
+    XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)parentElement;
+    List list = new ArrayList();
+    XSDTypeDefinition type = null;
+    if (xsdElementDeclaration.isElementDeclarationReference())
+    {
+      if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowReferences())
+      {
+        type = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
+      }
+    }
+    else
+    {
+      type = xsdElementDeclaration.getAnonymousTypeDefinition();
+      if (type == null)
+      {
+        if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowReferences())
+        {
+          type = xsdElementDeclaration.getTypeDefinition();
+        }
+      }
+    }
+
+    if (type != null && type instanceof XSDComplexTypeDefinition)
+    {
+      XSDComplexTypeDefinition ctType = (XSDComplexTypeDefinition)type;
+      if (ctType != null)
+      {
+        list.add(ctType);
+      }
+    }
+
+//    if (xsdElementDeclaration.getIdentityConstraintDefinitions() != null)
+//    {
+//      list.addAll(xsdElementDeclaration.getIdentityConstraintDefinitions());
+//    }
+    
+//    return XSDChildUtility.getModelChildren(xsdElementDeclaration.getResolvedElementDeclaration()).toArray();
+    return list.toArray();
+  
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return true;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDElementDeclaration element = (XSDElementDeclaration)object;
+    return element.getContainer();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelAdapterFactoryImpl.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelAdapterFactoryImpl.java
new file mode 100644
index 0000000..4b64fce
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelAdapterFactoryImpl.java
@@ -0,0 +1,359 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.Disposable;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.xsd.XSDAnnotation;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.util.XSDAdapterFactory;
+import org.eclipse.xsd.util.XSDSwitch;
+
+public class XSDModelAdapterFactoryImpl extends XSDAdapterFactory
+  implements IChangeNotifier, IDisposable
+{
+  static XSDModelAdapterFactoryImpl instance;
+  
+  public static XSDModelAdapterFactoryImpl getInstance()
+  {
+    if (instance == null)
+    {
+      instance = new XSDModelAdapterFactoryImpl();
+    }                                         
+    return instance;
+  }
+  
+  protected IChangeNotifier changeNotifier = new ChangeNotifier();
+  
+  protected Disposable disposable = new Disposable();
+  
+  protected Collection supportedTypes = new ArrayList();
+  
+  protected boolean showReferences = false;
+  protected boolean showInherited = false;
+  
+  /**
+   * 
+   */
+  public XSDModelAdapterFactoryImpl()
+  {
+    super();
+    supportedTypes.add(ILabelProvider.class);
+  }
+
+  public void setShowReferences(boolean b)
+  {
+    showReferences = b;
+  }
+  
+  public boolean getShowReferences()
+  {
+    return showReferences;
+  }
+  
+  public void setShowInherited(boolean b)
+  {
+    showInherited= b;
+  }
+  
+  public boolean getShowInherited()
+  {
+    return showInherited;
+  }
+  
+  protected XSDSwitch modelSwitch = new XSDSwitch()
+  {
+      public Object caseXSDAnnotation(XSDAnnotation object)
+      {
+        return createXSDAnnotationAdapter();
+      }
+      public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object)
+      {
+        return createXSDAttributeDeclarationAdapter();
+      }
+      public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object)
+      {
+        return createXSDAttributeGroupDefinitionAdapter();
+      }
+      public Object caseXSDAttributeUse(XSDAttributeUse object)
+      {
+        return createXSDAttributeUseAdapter();
+      }
+      public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
+      {
+        return createXSDComplexTypeDefinitionAdapter();
+      }
+      public Object caseXSDElementDeclaration(XSDElementDeclaration object)
+      {
+        return createXSDElementDeclarationAdapter();
+      }
+      public Object caseXSDModelGroup(XSDModelGroup object)
+      {
+        return createXSDModelGroupAdapter();
+      }
+      public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
+      {
+        return createXSDModelGroupDefinitionAdapter();
+      }
+      public Object caseXSDNotationDeclaration(XSDNotationDeclaration object)
+      {
+        return createXSDNotationDeclarationAdapter();
+      }
+      public Object caseXSDParticle(XSDParticle object)
+      {
+        return createXSDParticleAdapter();
+      }
+//      public Object caseXSDParticleContent(XSDParticleContent object)
+//      {
+//        return createXSDParticleContentAdapter();
+//      }
+      public Object caseXSDSchema(XSDSchema object)
+      {
+        return createXSDSchemaAdapter();
+      }
+      public Object caseXSDImport(XSDImport object)
+      {
+        // return createXSDImportAdapter();
+        return createXSDSchemaDirectiveAdapter();
+      }
+      public Object caseXSDInclude(XSDInclude object)
+      {
+        // return createXSDIncludeAdapter();
+        return createXSDSchemaDirectiveAdapter();
+      }
+      public Object caseXSDRedefine(XSDRedefine object)
+      {
+        // return createXSDRedefineAdapter();
+        return createXSDSchemaDirectiveAdapter();
+      }
+      public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object)
+      {
+        return createXSDSimpleTypeDefinitionAdapter();
+      
+      }
+      public Object caseXSDWildcard(XSDWildcard object)
+      {
+        return createXSDWildcardAdapter();
+      }
+      public Object defaultCase(EObject object)
+      {
+        return createEObjectAdapter();
+      }
+  };
+
+  public Adapter createAdapter(Notifier target)
+  {
+    Adapter adapter = null;
+    if (target instanceof EObject)
+    {
+      adapter = (Adapter)modelSwitch.doSwitch((EObject)target);
+    }
+    return adapter;
+  }
+
+  /* create adapters */
+  
+  public Adapter createXSDAnnotationAdapter()
+  {
+    return new XSDAnnotationAdapter(this);
+  }
+
+  public Adapter createXSDAttributeDeclarationAdapter()
+  {
+    return new XSDAttributeDeclarationAdapter(this);
+  }
+
+  public Adapter createXSDAttributeGroupDefinitionAdapter()
+  {
+    return new XSDAttributeGroupDefinitionAdapter(this);
+  }
+
+  public Adapter createXSDAttributeUseAdapter()
+  {
+    return new XSDAttributeUseAdapter(this);
+  }
+
+  public Adapter createXSDComplexTypeDefinitionAdapter()
+  {
+	return new XSDComplexTypeDefinitionAdapter(this); 
+  }
+
+  public Adapter createXSDElementDeclarationAdapter()
+  {
+    return new XSDElementDeclarationAdapter(this);
+  }
+
+  public Adapter createXSDModelGroupAdapter()
+  {
+    return new XSDModelGroupAdapter(this);
+  }
+
+
+  public Adapter createXSDModelGroupDefinitionAdapter()
+  {
+    return new XSDModelGroupDefinitionAdapter(this);
+  }
+
+  public Adapter createXSDNotationDeclarationAdapter()
+  {
+    return new XSDNotationDeclarationAdapter(this);
+  }
+
+  public Adapter createXSDWildcardAdapter()
+  {
+    return new XSDWildcardAdapter(this);
+  }
+  
+  public Adapter createXSDParticleAdapter()
+  {
+    return new XSDParticleAdapter(this);
+  }
+//
+//  protected XSDParticleContentAdapter xsdParticleContentAdapter;
+//  public Adapter createXSDParticleContentAdapter()
+//  {
+//    if (xsdParticleContentAdapter == null)
+//    {
+//      xsdParticleContentAdapter = new XSDParticleContentAdapter(this);
+//    }
+//    return xsdParticleContentAdapter;
+//  }
+
+  public Adapter createXSDSchemaAdapter()
+  {
+    return new XSDSchemaAdapter(this);
+  }
+  
+  public Adapter createXSDSchemaDirectiveAdapter()
+  {
+    return new XSDSchemaDirectiveAdapter(this);
+  }
+
+  public Adapter createXSDSimpleTypeDefinitionAdapter()
+  {
+    return new XSDSimpleTypeDefinitionAdapter(this);
+  }
+
+  public Adapter createEObjectAdapter()
+  {
+    return null;
+  }
+
+  public boolean isFactoryForType(Object type)
+  {
+    return super.isFactoryForType(type) || supportedTypes.contains(type);
+  }
+
+  /**
+   * This implementation substitutes the factory itself as the key for the adapter.
+   */
+  public Adapter adapt(Notifier notifier, Object type)
+  {
+    return super.adapt(notifier, this);
+  }
+
+  public Object adapt(Object object, Object type)
+  {
+    // This is a kludge to deal with enumerators, which crash the doSwitch.
+    //
+    if (object instanceof EObject && ((EObject)object).eClass() == null)
+    {
+      return null;
+    }
+
+    if (isFactoryForType(type))
+    {
+      Object adapter = super.adapt(object, type);
+      if (!(type instanceof Class) || (((Class)type).isInstance(adapter)))
+      {
+        return adapter;
+      }
+    }
+
+    return null;
+  }
+
+  public Adapter adaptNew(Notifier object, Object type)
+  {
+    Adapter result = super.adaptNew(object, type);
+    disposable.add(result);
+    return result;
+  }
+
+  /**
+   * This adds a listener.
+   */
+  public void addListener(INotifyChangedListener notifyChangedListener)
+  {
+    changeNotifier.addListener(notifyChangedListener);
+  }
+
+  /**
+   * This removes a listener.
+   */
+  public void removeListener(INotifyChangedListener notifyChangedListener)
+  {
+    changeNotifier.removeListener(notifyChangedListener);
+  }
+
+  /**
+   * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+   */
+  public void fireNotifyChanged(Notification notification)
+  {
+    Display display = Display.getDefault();
+    if (display != null)
+    {
+      if (display.getThread() == Thread.currentThread ())
+      {
+        changeNotifier.fireNotifyChanged(notification);
+      }
+    }
+
+//    if (parentAdapterFactory != null)
+//    {
+//      parentAdapterFactory.fireNotifyChanged(notification);
+//    }
+  }
+
+  public void dispose()
+  {
+    instance = null;
+    disposable.dispose();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupAdapter.java
new file mode 100644
index 0000000..c8535b6
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupAdapter.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class XSDModelGroupAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDModelGroupAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object element)
+  {
+    XSDModelGroup xsdModelGroup = ((XSDModelGroup)element);
+    if (XSDCompositor.CHOICE_LITERAL == xsdModelGroup.getCompositor())
+    {
+      // return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDModelGroupChoice");
+      return XSDEditorPlugin.getXSDImage("icons/XSDChoice.gif");
+    }
+    else if (XSDCompositor.ALL_LITERAL == xsdModelGroup.getCompositor())
+    {
+      // return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDModelGroupAll");
+      return XSDEditorPlugin.getXSDImage("icons/XSDAll.gif");
+    }
+    else 
+    {
+      // return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDModelGroupSequence");
+      return XSDEditorPlugin.getXSDImage("icons/XSDSequence.gif");
+    }
+  }
+  
+  public String getText(Object object)
+  {
+    XSDModelGroup xsdModelGroup = ((XSDModelGroup)object);
+    
+    StringBuffer result = new StringBuffer();
+    String name = xsdModelGroup.getCompositor().getName();
+    if (name != null)
+    {
+      result.append(name);
+    }
+    
+    Element element = xsdModelGroup.getElement();
+    
+    if (element != null)
+    {
+      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
+      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
+      
+      if (hasMinOccurs || hasMaxOccurs)
+      {
+        XSDConcreteComponent comp = xsdModelGroup.getContainer();
+        boolean isParticle = (comp instanceof XSDParticle);
+        if (isParticle)
+        {
+          result.append(" [");
+        }
+  	    if (hasMinOccurs)
+  	    {
+          if (isParticle)
+          {
+  	        int min = ((XSDParticle)comp).getMinOccurs();
+  		      if (min == XSDParticle.UNBOUNDED)
+  		      {
+  		        result.append("*");
+            } 
+  		      else
+  		      {
+  		        result.append(String.valueOf(min));
+            }
+  		    }
+  	    }
+        else // print default
+        {
+          if (isParticle)
+          {
+            int min = ((XSDParticle)comp).getMinOccurs();
+            result.append(String.valueOf(min));
+          }
+        }
+  	    if (hasMaxOccurs)
+  	    {
+          if (isParticle)
+          {
+    	      int max = ((XSDParticle)comp).getMaxOccurs();
+  		      result.append("..");
+  		      if (max == XSDParticle.UNBOUNDED)
+  		      {
+  		        result.append("*");
+  		      }
+  		      else
+  		      {
+  		        result.append(String.valueOf(max));
+            }
+  		    }
+  	    }
+        else // print default
+        {
+          if (isParticle)
+          {
+            result.append("..");
+            int max = ((XSDParticle)comp).getMaxOccurs();
+            result.append(String.valueOf(max));
+          }
+        }
+        if (isParticle)
+        {
+    	    result.append("]");
+        }
+      }
+    }
+    return result.toString();
+  }
+  
+  public Object[] getChildren(Object parentElement)
+  {
+    XSDModelGroup xsdModelGroup = (XSDModelGroup)parentElement;
+    List list = new ArrayList();
+    // list.addAll(xsdModelGroup.getContents());
+    list.addAll(XSDChildUtility.getModelChildren(xsdModelGroup));
+    return list.toArray();
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return true;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDModelGroup element = (XSDModelGroup)object;
+    return element.getContainer();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupDefinitionAdapter.java
new file mode 100644
index 0000000..93e551c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupDefinitionAdapter.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+
+
+public class XSDModelGroupDefinitionAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDModelGroupDefinitionAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object object)
+  {
+    XSDModelGroupDefinition xsdModelGroupDefinition = ((XSDModelGroupDefinition)object);
+
+    if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDGroupRef.gif");
+    }
+    else
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDGroup.gif");
+    }
+  }
+  
+  public String getText(Object object)
+  {
+    XSDModelGroupDefinition xsdModelGroupDefinition = ((XSDModelGroupDefinition)object);
+    String result = 
+      xsdModelGroupDefinition.isModelGroupDefinitionReference() ?
+        xsdModelGroupDefinition.getQName() :
+        xsdModelGroupDefinition.getName();
+    return result == null ? "'absent'" : result;
+  }
+  
+  boolean hasChildren = false;
+  
+  public Object[] getChildren(Object parentElement)
+  {
+    XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition)parentElement;
+    List list = new ArrayList();
+    if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
+    {
+      if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowReferences())
+      {
+        list.add(xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup());
+        hasChildren = true;
+      }
+    }
+    else
+    {
+      if (xsdModelGroupDefinition.getModelGroup() != null)
+      {
+        list.add(xsdModelGroupDefinition.getModelGroup());
+        hasChildren = true;
+      }
+    }
+    
+    return list.toArray();
+ 
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return hasChildren;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDModelGroupDefinition element = (XSDModelGroupDefinition)object;
+    return element.getContainer();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDNotationDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDNotationDeclarationAdapter.java
new file mode 100644
index 0000000..3c89274
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDNotationDeclarationAdapter.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDNotationDeclaration;
+
+
+public class XSDNotationDeclarationAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDNotationDeclarationAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+  
+  public Image getImage(Object object)
+  {
+    // return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDNotationDeclaration");
+    return XSDEditorPlugin.getXSDImage("icons/XSDNotation.gif");
+  }
+
+  public String getText(Object object)
+  {
+    XSDNotationDeclaration xsdNotationDeclaration = ((XSDNotationDeclaration)object);
+    String result = xsdNotationDeclaration.getName();
+    return result == null ? "" : result;
+  }
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDParticleAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDParticleAdapter.java
new file mode 100644
index 0000000..c37e8a7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDParticleAdapter.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationWrapper;
+import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.XSDWildcard;
+
+
+public class XSDParticleAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDParticleAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  // hack to notify outline and graph view of minOccurs and maxOccurs changes
+  public void notifyChanged(Notification msg) 
+  {
+    XSDParticle xsdParticle = (XSDParticle)msg.getNotifier();
+    XSDParticleContent xsdParticleContent = xsdParticle.getContent();
+    if (xsdParticleContent != null)
+    {
+      if (xsdParticleContent instanceof XSDElementDeclaration)
+      {
+        fireNotifyChanged(new NotificationWrapper((XSDElementDeclaration)xsdParticleContent, msg));
+        XSDModelAdapterFactory.getAdapter(xsdParticleContent).firePropertyChanged(xsdParticleContent, null);
+      }
+      else if (xsdParticleContent instanceof XSDModelGroup)
+      {
+        fireNotifyChanged(new NotificationWrapper((XSDModelGroup)xsdParticleContent, msg));
+        XSDModelAdapterFactory.getAdapter(xsdParticleContent).firePropertyChanged(xsdParticleContent, null);
+      }
+      else if (xsdParticleContent instanceof XSDWildcard)
+      {
+        fireNotifyChanged(new NotificationWrapper((XSDWildcard)xsdParticleContent, msg));
+        XSDModelAdapterFactory.getAdapter(xsdParticleContent).firePropertyChanged(xsdParticleContent, null);
+      }
+    }
+    // super.notifyChanged(msg);
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaAdapter.java
new file mode 100644
index 0000000..4836bc7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaAdapter.java
@@ -0,0 +1,379 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.NotificationImpl;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDPackage;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+public class XSDSchemaAdapter extends XSDAbstractAdapter {
+	protected XSDPackage xsdPackage;
+
+	/**
+	 * @param adapterFactory
+	 */
+	public XSDSchemaAdapter(AdapterFactory adapterFactory) {
+		super(adapterFactory);
+		xsdPackage = XSDPackage.eINSTANCE;
+	}
+
+	public Image getImage(Object element) {
+		return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif");
+	}
+
+	public String getText(Object element) {
+		XSDSchema xsdSchema = (XSDSchema) element;
+		String result = xsdSchema.getSchemaLocation();
+		if (result == null) {
+			return "";
+		}
+		else {
+			return URI.createURI(result).lastSegment();
+		}
+	}
+
+	List children;
+	private CategoryAdapter fDirectivesCategory;
+	private CategoryAdapter fElementsCategory;
+	private CategoryAdapter fAttributesCategory;
+	private CategoryAdapter fAttributeGroupsCategory;
+	private CategoryAdapter fTypesCategory;
+	private CategoryAdapter fGroupsCategory;
+	private CategoryAdapter fNotationsCategory;
+
+	/**
+	 * Create all the category adapters
+	 * 
+	 * @param xsdSchema
+	 */
+	private void createCategoryAdapters(XSDSchema xsdSchema) {
+		List directivesList = getDirectives(xsdSchema);
+		List elementsList = getGlobalElements(xsdSchema);
+		List attributeGroupList = getAttributeGroupList(xsdSchema);
+		List attributesList = getAttributeList(xsdSchema);
+		List groups = getGroups(xsdSchema);
+		List notations = getNotations(xsdSchema);
+		List types = getComplexTypes(xsdSchema);
+		types.addAll(getSimpleTypes(xsdSchema));
+
+		fDirectivesCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Elements_label"),
+					XSDEditorPlugin.getXSDString("_UI_GRAPH_DIRECTIVES"), XSDEditorPlugin.getPlugin().getIconImage("obj16/directivesheader"), directivesList, xsdSchema, CategoryAdapter.DIRECTIVES);
+		fElementsCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Elements_label"),
+					XSDEditorPlugin.getXSDString("_UI_GRAPH_ELEMENTS"), XSDEditorPlugin.getPlugin().getIconImage("obj16/elementsheader"), elementsList, xsdSchema, CategoryAdapter.ELEMENTS);
+		fAttributesCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Attributes_label"),
+					XSDEditorPlugin.getXSDString("_UI_GRAPH_ATTRIBUTES"), XSDEditorPlugin.getPlugin().getIconImage("obj16/attributesheader"), attributesList, xsdSchema, CategoryAdapter.ATTRIBUTES);
+		fAttributeGroupsCategory = new CategoryAdapter(// XSDEditPlugin.getString("_UI_AttributeGroups_label"),
+					XSDEditorPlugin.getXSDString("_UI_GRAPH_ATTRIBUTE_GROUPS"), XSDEditorPlugin.getPlugin().getIconImage("obj16/attributegroupsheader"), attributeGroupList, xsdSchema, CategoryAdapter.ATTRIBUTE_GROUPS);
+		fTypesCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Types_label"),
+					XSDEditorPlugin.getXSDString("_UI_GRAPH_TYPES"), XSDEditorPlugin.getPlugin().getIconImage("obj16/typesheader"), types, xsdSchema, CategoryAdapter.TYPES);
+		fGroupsCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_ModelGroups_label"),
+					XSDEditorPlugin.getXSDString("_UI_GRAPH_GROUPS"), XSDEditorPlugin.getPlugin().getIconImage("obj16/groupsheader"), groups, xsdSchema, CategoryAdapter.GROUPS);
+		fNotationsCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Notations_label"),
+					XSDEditorPlugin.getXSDString("_UI_GRAPH_NOTATIONS"), XSDEditorPlugin.getPlugin().getIconImage("obj16/notationsheader"), notations, xsdSchema, CategoryAdapter.NOTATIONS);
+	}
+
+	public void setTarget(Notifier newTarget) {
+		super.setTarget(newTarget);
+
+		XSDSchema xsdSchema = ((XSDSchema) newTarget);
+		createCategoryAdapters(xsdSchema);
+	}
+
+	public Object[] getChildren(Object parentElement) {
+		XSDSchema xsdSchema = ((XSDSchema) parentElement);
+
+		children = new ArrayList();
+
+		// just set categoryadapters' children if category adapters are
+		// already created
+		if (fDirectivesCategory != null) {
+			List directivesList = getDirectives(xsdSchema);
+			List elementsList = getGlobalElements(xsdSchema);
+			List attributeGroupList = getAttributeGroupList(xsdSchema);
+			List attributesList = getAttributeList(xsdSchema);
+			List groups = getGroups(xsdSchema);
+			List notations = getNotations(xsdSchema);
+			List types = getComplexTypes(xsdSchema);
+			types.addAll(getSimpleTypes(xsdSchema));
+
+			fDirectivesCategory.setChildren(directivesList);
+			fElementsCategory.setChildren(elementsList);
+			fAttributesCategory.setChildren(attributesList);
+			fAttributeGroupsCategory.setChildren(attributeGroupList);
+			fTypesCategory.setChildren(types);
+			fGroupsCategory.setChildren(groups);
+			fNotationsCategory.setChildren(notations);
+
+			// children.add
+			// (new CategoryAdapter
+			// ( //XSDEditPlugin.getString("_UI_IdentityConstraints_label"),
+			// "Identity Constraints",
+			// XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDIdentityConstraintDefinitionKey"),
+			// xsdSchema.getIdentityConstraintDefinitions(), xsdSchema,
+			// CategoryAdapter.IDENTITY_CONSTRAINTS));
+			// children.add
+			// (new CategoryAdapter
+			// ( // XSDEditPlugin.getString("_UI_Annotations_label"),
+			// "Annotations",
+			// XSDEditorPlugin.getPlugin().getIconImage("obj16/annotationsheader"),
+			// xsdSchema.getAnnotations(), xsdSchema,
+			// CategoryAdapter.ANNOTATIONS));
+		}
+		else {
+			createCategoryAdapters(xsdSchema);
+		}
+
+		children.add(fDirectivesCategory);
+		children.add(fElementsCategory);
+		children.add(fAttributesCategory);
+		children.add(fAttributeGroupsCategory);
+		children.add(fTypesCategory);
+		children.add(fGroupsCategory);
+		children.add(fNotationsCategory);
+
+		return children.toArray();
+	}
+
+	public boolean hasChildren(Object object) {
+		return true;
+	}
+
+	public Object getParent(Object object) {
+		return null;
+	}
+
+	public void notifyChanged(final Notification msg) {
+		class CategoryNotification extends NotificationImpl {
+			protected Object category;
+
+			public CategoryNotification(Object category) {
+				super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
+				this.category = category;
+			}
+
+			public Object getNotifier() {
+				return category;
+			}
+
+			public Object getFeature() {
+				return msg.getFeature();
+			}
+		}
+
+		if (children == null) {
+			getChildren(target);
+		}
+
+		if (msg.getFeature() == xsdPackage.getXSDSchema_Contents()) {
+			CategoryAdapter adapter = (CategoryAdapter) children.get(0);
+			XSDSchema xsdSchema = adapter.getXSDSchema();
+			adapter.setChildren(getDirectives(xsdSchema));
+			this.fireNotifyChanged(new CategoryNotification(adapter));
+			return;
+		}
+		else if (msg.getFeature() == xsdPackage.getXSDSchema_ElementDeclarations()) {
+			CategoryAdapter adapter = (CategoryAdapter) children.get(1);
+			XSDSchema xsdSchema = adapter.getXSDSchema();
+			adapter.setChildren(getGlobalElements(xsdSchema));
+			this.fireNotifyChanged(new CategoryNotification(adapter));
+			return;
+		}
+		else if (msg.getFeature() == xsdPackage.getXSDSchema_AttributeDeclarations()) {
+			CategoryAdapter adapter = (CategoryAdapter) children.get(2);
+			XSDSchema xsdSchema = adapter.getXSDSchema();
+			adapter.setChildren(getAttributeList(xsdSchema));
+			this.fireNotifyChanged(new CategoryNotification(adapter));
+			return;
+		}
+		else if (msg.getFeature() == xsdPackage.getXSDSchema_AttributeGroupDefinitions()) {
+			CategoryAdapter adapter = (CategoryAdapter) children.get(3);
+			XSDSchema xsdSchema = adapter.getXSDSchema();
+			adapter.setChildren(getAttributeGroupList(xsdSchema));
+			this.fireNotifyChanged(new CategoryNotification(adapter));
+			return;
+		}
+		else if (msg.getFeature() == xsdPackage.getXSDSchema_TypeDefinitions()) {
+			CategoryAdapter adapter = (CategoryAdapter) children.get(4);
+			XSDSchema xsdSchema = adapter.getXSDSchema();
+			List types = getComplexTypes(xsdSchema);
+			types.addAll(getSimpleTypes(xsdSchema));
+
+			adapter.setChildren(types);
+			this.fireNotifyChanged(new CategoryNotification(adapter));
+			return;
+		}
+		else if (msg.getFeature() == xsdPackage.getXSDSchema_ModelGroupDefinitions()) {
+			CategoryAdapter adapter = (CategoryAdapter) children.get(5);
+			XSDSchema xsdSchema = adapter.getXSDSchema();
+			adapter.setChildren(getGroups(xsdSchema));
+			this.fireNotifyChanged(new CategoryNotification(adapter));
+			return;
+		}
+		else if (msg.getFeature() == xsdPackage.getXSDSchema_NotationDeclarations()) {
+			CategoryAdapter adapter = (CategoryAdapter) children.get(6);
+			XSDSchema xsdSchema = adapter.getXSDSchema();
+			adapter.setChildren(getNotations(xsdSchema));
+			this.fireNotifyChanged(new CategoryNotification(adapter));
+			return;
+		}
+		// else if (msg.getFeature() ==
+		// xsdPackage.getXSDSchema_IdentityConstraintDefinitions())
+		// {
+		// this.fireNotifyChanged(new CategoryNotification(children.get(7)));
+		// return;
+		// }
+		else if (msg.getFeature() == xsdPackage.getXSDSchema_Annotations()) {
+			// this.fireNotifyChanged(new
+			// CategoryNotification(children.get(7)));
+			return;
+		}
+		else if (msg.getFeature() == xsdPackage.getXSDSchema_SchemaLocation()) {
+			this.fireNotifyChanged(msg);
+			return;
+		}
+
+		super.notifyChanged(msg);
+	}
+
+	protected List getDirectives(XSDSchema schema) {
+		List list = new ArrayList();
+		for (Iterator i = schema.getContents().iterator(); i.hasNext();) {
+			Object o = i.next();
+			if (o instanceof XSDSchemaDirective) {
+				list.add(o);
+			}
+		}
+		return list;
+	}
+
+	protected List getAttributeGroupList(XSDSchema xsdSchema) {
+		List attributeGroupList = new ArrayList();
+		for (Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator(); i.hasNext();) {
+			XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) i.next();
+			if (attrGroup.getRootContainer() == xsdSchema) {
+				attributeGroupList.add(attrGroup);
+			}
+		}
+		return attributeGroupList;
+	}
+
+	protected List getAttributeList(XSDSchema xsdSchema) {
+		List attributesList = new ArrayList();
+		for (Iterator iter = xsdSchema.getAttributeDeclarations().iterator(); iter.hasNext();) {
+			Object o = iter.next();
+			if (o instanceof XSDAttributeDeclaration) {
+				XSDAttributeDeclaration attr = (XSDAttributeDeclaration) o;
+				if (attr != null) {
+					if (attr.getTargetNamespace() != null) {
+						if (!(attr.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema-instance"))) {
+							if (attr.getRootContainer() == xsdSchema) {
+								attributesList.add(attr);
+							}
+						}
+					}
+					else {
+						if (attr.getRootContainer() == xsdSchema) {
+							attributesList.add(attr);
+						}
+					}
+				}
+			}
+		}
+		return attributesList;
+	}
+
+	protected List getGlobalElements(XSDSchema schema) {
+		List elements = schema.getElementDeclarations();
+		List list = new ArrayList();
+		for (Iterator i = elements.iterator(); i.hasNext();) {
+			XSDElementDeclaration elem = (XSDElementDeclaration) i.next();
+			if (elem.getRootContainer() == schema) {
+				list.add(elem);
+			}
+		}
+		return list;
+	}
+
+	protected List getComplexTypes(XSDSchema schema) {
+		List allTypes = schema.getTypeDefinitions();
+		List list = new ArrayList();
+		for (Iterator i = allTypes.iterator(); i.hasNext();) {
+			XSDTypeDefinition td = (XSDTypeDefinition) i.next();
+			if (td instanceof XSDComplexTypeDefinition) {
+				XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) td;
+				if (ct.getRootContainer() == schema) {
+					list.add(ct);
+				}
+			}
+		}
+		return list;
+	}
+
+	protected List getSimpleTypes(XSDSchema schema) {
+		List allTypes = schema.getTypeDefinitions();
+		List list = new ArrayList();
+		for (Iterator i = allTypes.iterator(); i.hasNext();) {
+			XSDTypeDefinition td = (XSDTypeDefinition) i.next();
+			if (td instanceof XSDSimpleTypeDefinition) {
+				XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) td;
+				if (st.getRootContainer() == schema) {
+					list.add(st);
+				}
+			}
+		}
+		return list;
+	}
+
+	protected List getGroups(XSDSchema schema) {
+		List groups = schema.getModelGroupDefinitions();
+		List list = new ArrayList();
+		for (Iterator i = groups.iterator(); i.hasNext();) {
+			XSDModelGroupDefinition group = (XSDModelGroupDefinition) i.next();
+			if (group.getRootContainer() == schema) {
+				list.add(group);
+			}
+		}
+		return list;
+	}
+
+	protected List getNotations(XSDSchema schema) {
+		List notations = schema.getNotationDeclarations();
+		List list = new ArrayList();
+		for (Iterator i = notations.iterator(); i.hasNext();) {
+			XSDNotationDeclaration notation = (XSDNotationDeclaration) i.next();
+			if (notation.getRootContainer() == schema) {
+				list.add(notation);
+			}
+		}
+		return list;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaDirectiveAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaDirectiveAdapter.java
new file mode 100644
index 0000000..47cf912
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaDirectiveAdapter.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchemaDirective;
+
+public class XSDSchemaDirectiveAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDSchemaDirectiveAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  
+  public Image getImage(Object object)
+  {
+    if (object instanceof XSDImport)
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDImport.gif");
+    }
+    else if (object instanceof XSDInclude)
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDInclude.gif");
+    }
+    else if (object instanceof XSDRedefine)
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDRedefine.gif");
+    }
+    return null;
+  }
+
+  public String getText(Object object)
+  {
+    XSDSchemaDirective directive = (XSDSchemaDirective)object;
+    String result = directive.getSchemaLocation();
+    if (result == null) result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
+    if (result.equals("")) result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED")+ ")";
+    return result;
+    
+//    XSDImport xsdImport = ((XSDImport)object);
+//    String result = xsdImport.getSchemaLocation();
+//    return result == null ? "" : result;
+    
+//    XSDInclude xsdInclude = ((XSDInclude)object);
+//    String result = xsdInclude.getSchemaLocation();
+//    return result == null ? "" : result;
+    
+//    XSDRedefine xsdRedefine = ((XSDRedefine)object);
+//    String result = xsdRedefine.getSchemaLocation();
+//    return result == null ? "" : result;
+
+
+  }
+
+  public Object[] getChildren(Object parentElement)
+  {
+    List list = new ArrayList();
+    if (parentElement instanceof XSDRedefine)
+    {
+      XSDRedefine redefine = (XSDRedefine)parentElement;
+      list = redefine.getContents();
+      if (list == null)
+      {
+        list = new ArrayList();
+      }
+    }
+    return list.toArray();
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return false;
+  }
+
+  public Object getParent(Object object)
+  {
+    return null;
+    
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSimpleTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSimpleTypeDefinitionAdapter.java
new file mode 100644
index 0000000..299bd3f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSimpleTypeDefinitionAdapter.java
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDVariety;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class XSDSimpleTypeDefinitionAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDSimpleTypeDefinitionAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object object)
+  {
+    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = ((XSDSimpleTypeDefinition)object);
+    
+    if (xsdSimpleTypeDefinition.getContainer() == null)
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
+    }
+    
+    if (XSDVariety.LIST_LITERAL == xsdSimpleTypeDefinition.getVariety())
+    {
+      // return XSDEditorPlugin.getXSDImage("icons/XSDSimpleList.gif");
+      return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_list_obj");
+    }
+    else if (XSDVariety.UNION_LITERAL == xsdSimpleTypeDefinition.getVariety())
+    {
+      //return XSDEditorPlugin.getXSDImage("icons/XSDSimpleUnion.gif");
+      return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_union_obj");
+    }
+    else if (XSDVariety.ATOMIC_LITERAL == xsdSimpleTypeDefinition.getVariety())
+    {
+      // return XSDEditorPlugin.getXSDImage("icons/XSDSimpleRestrict.gif");
+      Element stElement = xsdSimpleTypeDefinition.getElement();
+      XSDDOMHelper domHelper = new XSDDOMHelper();
+      if (domHelper.getChildNode(stElement, XSDConstants.RESTRICTION_ELEMENT_TAG) != null)
+      {
+        return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_restrict_obj");
+      }
+      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
+    }
+    else if (xsdSimpleTypeDefinition.isSetVariety())
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
+    }
+    else
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
+    }
+    
+//    return 
+//      XSDEditorPlugin.getPlugin().getIconImage
+//        (xsdSimpleTypeDefinition.getContainer() == null ?
+//           "full/obj16/XSDSimpleTypeDefinitionUnresolved" :
+//           XSDVariety.LIST_LITERAL == xsdSimpleTypeDefinition.getVariety() ? 
+//             "full/obj16/XSDSimpleTypeDefinitionList" :  
+//              XSDVariety.UNION_LITERAL == xsdSimpleTypeDefinition.getVariety() ? 
+//                "full/obj16/XSDSimpleTypeDefinitionUnion" :
+//                  xsdSimpleTypeDefinition.isSetVariety() ?
+//                    "full/obj16/XSDSimpleTypeDefinitionAtomic"  :
+//                    "full/obj16/XSDSimpleTypeDefinition");
+  }
+  
+  public String getText(Object object)
+  {
+    return getText(object, true);
+  }
+ 
+  public String getText(Object object, boolean showType)
+  {
+    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = ((XSDSimpleTypeDefinition)object);
+
+    StringBuffer result = new StringBuffer();
+
+    result.append
+      (xsdSimpleTypeDefinition.getName() == null ? 
+         // xsdSimpleTypeDefinition.getAliasName() :
+         "local type" :
+         xsdSimpleTypeDefinition.getName());
+
+    if (showType)
+    {
+      XSDSimpleTypeDefinition baseTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition();
+      if (baseTypeDefinition != null && XSDVariety.ATOMIC_LITERAL == xsdSimpleTypeDefinition.getVariety())
+      {
+        if (baseTypeDefinition.getName() != null && 
+              !xsdSimpleTypeDefinition.getContents().contains(baseTypeDefinition) &&
+              !XSDConstants.isAnySimpleType(baseTypeDefinition)) 
+        {
+          result.append(" : ");
+          result.append(baseTypeDefinition.getQName(xsdSimpleTypeDefinition));
+        }
+      }
+      else
+      {
+        XSDSimpleTypeDefinition itemTypeDefinition = xsdSimpleTypeDefinition.getItemTypeDefinition();
+        if (itemTypeDefinition != null)
+        {
+          if (itemTypeDefinition.getName() != null) 
+          {
+            result.append(" : ");
+            result.append(itemTypeDefinition.getQName(xsdSimpleTypeDefinition));
+          }
+        }
+        else 
+        {
+          List memberTypeDefinitions = xsdSimpleTypeDefinition.getMemberTypeDefinitions();
+          if (!memberTypeDefinitions.isEmpty())
+          {
+            boolean first = true;
+            for (Iterator members = memberTypeDefinitions.iterator(); members.hasNext(); )
+            {
+              XSDSimpleTypeDefinition memberTypeDefinition = (XSDSimpleTypeDefinition)members.next();
+              if (memberTypeDefinition.getName() != null) 
+              {
+                if (first)
+                {
+                  result.append(" : ");
+                  first = false;
+                }
+                else
+                {
+                  result.append(" | ");
+                }
+                result.append(memberTypeDefinition.getQName(xsdSimpleTypeDefinition));
+              }
+              else
+              {
+                break;
+              }
+            }
+          } 
+          else if (result.length() == 0)
+          {
+            result.append("'absent'");
+          }
+        }
+      }
+    }
+
+    return result.toString();
+  }
+
+  public Object[] getChildren(Object parentElement)
+  {
+    List list = new ArrayList();
+    return list.toArray();
+  
+  }
+  
+  public boolean hasChildren(Object object)
+  {
+    return true;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDSimpleTypeDefinition element = (XSDSimpleTypeDefinition)object;
+    return element.getContainer();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDWildcardAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDWildcardAdapter.java
new file mode 100644
index 0000000..b219f6b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDWildcardAdapter.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.provider;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class XSDWildcardAdapter extends XSDAbstractAdapter
+{
+
+  /**
+   * @param adapterFactory
+   */
+  public XSDWildcardAdapter(AdapterFactory adapterFactory)
+  {
+    super(adapterFactory);
+  }
+
+  public Image getImage(Object object)
+  {
+    XSDWildcard xsdWildcard = (XSDWildcard)object;
+    return XSDEditorPlugin.getXSDImage
+      (xsdWildcard.eContainer() instanceof XSDParticle ?
+        "icons/XSDAny.gif" :
+        "icons/XSDAnyAttribute.gif");
+  }
+  
+  public String getText(Object object)
+  {
+    XSDWildcard xsdWildcard = ((XSDWildcard)object);
+    
+    StringBuffer result = new StringBuffer();
+    Element element = xsdWildcard.getElement();
+    
+    if (element != null)
+    {
+      result.append(element.getNodeName());
+      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
+      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
+      
+      if (hasMinOccurs || hasMaxOccurs)
+      {
+        result.append(" [");   //$NON-NLS-1$
+        if (hasMinOccurs)
+        {
+          
+          int min = ((XSDParticle)xsdWildcard.getContainer()).getMinOccurs();
+          if (min == XSDParticle.UNBOUNDED)
+          {
+            result.append("*");
+          }
+          else
+          {
+            result.append(String.valueOf(min));
+          }
+        }
+        else // print default
+        {
+          int min = ((XSDParticle)xsdWildcard.getContainer()).getMinOccurs();
+          result.append(String.valueOf(min));
+        }
+        if (hasMaxOccurs)
+        {
+          int max = ((XSDParticle)xsdWildcard.getContainer()).getMaxOccurs();
+          result.append("..");
+          if (max == XSDParticle.UNBOUNDED)
+          {
+            result.append("*");
+          }
+          else
+          {
+            result.append(String.valueOf(max));
+          }
+        }
+        else // print default
+        {
+          result.append("..");
+          int max = ((XSDParticle)xsdWildcard.getContainer()).getMaxOccurs();
+          result.append(String.valueOf(max));
+        }
+        result.append("]");
+      }
+    }
+    return result.toString();
+
+  }
+
+  public boolean hasChildren(Object object)
+  {
+    return false;
+  }
+
+  public Object getParent(Object object)
+  {
+    XSDWildcard xsdWildcard = (XSDWildcard)object;
+    return xsdWildcard.getContainer();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
new file mode 100644
index 0000000..7b56d8d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class RefactoringMessages {
+
+	private static final String RESOURCE_BUNDLE= "org.eclipse.wst.xsd.ui.internal.refactor.messages";//$NON-NLS-1$
+
+	private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+	private RefactoringMessages() {
+	}
+
+	public static String getString(String key) {
+		try {
+			return fgResourceBundle.getString(key);
+		} catch (MissingResourceException e) {
+			return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+		}
+	}
+	
+	public static String[] getStrings(String keys[]) {
+		String[] result= new String[keys.length];
+		for (int i= 0; i < keys.length; i++) {
+			result[i]= getString(keys[i]);
+		}
+		return result;
+	}
+	
+	public static String getFormattedString(String key, Object arg) {
+		return getFormattedString(key, new Object[] { arg });
+	}
+	
+	public static String getFormattedString(String key, Object[] args) {
+		return MessageFormat.format(getString(key), args);	
+	}	
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/XSDVisitor.java
new file mode 100644
index 0000000..24bda3f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/XSDVisitor.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor;
+
+import java.util.Iterator;
+
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeContent;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+
+public class XSDVisitor
+{
+  public XSDVisitor()
+  {
+  }
+  
+  protected XSDSchema schema;
+  
+  public void visitSchema(XSDSchema schema)
+  {
+    this.schema = schema;
+    for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
+    {
+      XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
+      visitAttributeDeclaration(attr);
+    }
+    for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
+    {
+      XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
+      visitTypeDefinition(type);
+    }
+    for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
+    {
+      XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
+      visitElementDeclaration(element);
+    }
+    for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
+    {
+      XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
+      visitIdentityConstraintDefinition(identityConstraint);
+    }
+    for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
+    {
+      XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
+      visitModelGroupDefinition(modelGroup);
+    }
+    for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
+    {
+      XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
+      visitAttributeGroupDefinition(attributeGroup);
+    }
+    for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
+    {
+      XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
+      visitNotationDeclaration(element);
+    }
+    
+  }
+  
+  public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
+  {
+  }
+  
+  public void visitTypeDefinition(XSDTypeDefinition type)
+  {
+    if (type instanceof XSDSimpleTypeDefinition)
+    {
+      visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
+    }
+    else if (type instanceof XSDComplexTypeDefinition)
+    {
+      visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
+    }
+  }
+  
+  public void visitElementDeclaration(XSDElementDeclaration element)
+  {
+    if (element.isElementDeclarationReference())
+    {
+    }
+    else if (element.getAnonymousTypeDefinition() != null)
+    {
+      visitTypeDefinition(element.getAnonymousTypeDefinition());
+    }
+  }
+  
+  public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
+  {
+  }
+  
+  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
+  {
+    if (!modelGroupDef.isModelGroupDefinitionReference())
+    {
+      if (modelGroupDef.getModelGroup() != null)
+      {
+        visitModelGroup(modelGroupDef.getModelGroup());
+      }
+    }
+  }
+  
+  public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
+  {
+    if (attributeGroup.getAttributeUses() != null)
+    {
+      for (Iterator iter = attributeGroup.getAttributeUses().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
+        visitAttributeDeclaration(attrUse.getContent());
+      }
+    }
+  }
+  
+  public void visitNotationDeclaration(XSDNotationDeclaration notation)
+  {
+  }
+  
+  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
+  {
+  }
+  
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    if (type.getContentType() != null)
+    {
+      XSDComplexTypeContent complexContent = (XSDComplexTypeContent) type.getContentType();
+      if (complexContent instanceof XSDSimpleTypeDefinition)
+      {
+        visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
+      }
+      else if (complexContent instanceof XSDParticle)
+      {
+        visitParticle((XSDParticle) complexContent);
+      }
+    }
+    
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
+        if (attrGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
+          visitAttributeDeclaration(attrUse.getContent());
+        }
+        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
+        {
+          visitAttributeGroupDefinition((XSDAttributeGroupDefinition)attrGroupContent);
+        }
+      }
+    }
+  }
+  
+  public void visitParticle(XSDParticle particle)
+  {
+    visitParticleContent(particle.getContent());
+  }
+  
+  public void visitParticleContent(XSDParticleContent particleContent)
+  {
+    if (particleContent instanceof XSDModelGroupDefinition)
+    {
+      visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
+    }
+    else if (particleContent instanceof XSDModelGroup)
+    {
+      visitModelGroup((XSDModelGroup)particleContent);
+    }
+    else if (particleContent instanceof XSDElementDeclaration)
+    {
+      visitElementDeclaration((XSDElementDeclaration)particleContent);
+    }
+    else if (particleContent instanceof XSDWildcard)
+    {
+      visitWildcard((XSDWildcard)particleContent);
+    }
+  }
+  
+  public void visitModelGroup(XSDModelGroup modelGroup)
+  {
+    if (modelGroup.getContents() != null)
+    {
+      for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
+      {
+        XSDParticle particle = (XSDParticle) iterator.next();
+        visitParticle(particle);
+      }
+    }
+  }
+  
+  public void visitWildcard(XSDWildcard wildcard)
+  {
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
new file mode 100644
index 0000000..6404b3d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.actions;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.commands.MakeAnonymousTypeGlobalCommand;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameRefactoringWizard;
+import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeTypeGlobalProcessor;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.w3c.dom.Node;
+
+public class MakeAnonymousTypeGlobalAction extends SelectionDispatchAction {
+
+	private String fParentName;
+	private boolean isComplexType = true;
+	private XSDTypeDefinition fSelectedComponent;
+	
+	public MakeAnonymousTypeGlobalAction(ISelectionProvider selectionProvider, XSDSchema schema) {
+		super(selectionProvider);
+		setText(XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL")); //$NON-NLS-1$
+		setSchema(schema);
+	}
+	
+	public boolean canRun() {
+
+		return fSelectedComponent != null;
+	}
+	
+
+	private String getNewDefaultName(){
+		if(fParentName != null && !"".equals(fParentName)){
+			if(isComplexType){
+				return fParentName + "ComplexType";
+			}
+			else{
+				return fParentName + "SimpleType";
+			}
+		}
+		else{
+			if(isComplexType){
+				return "NewComplexType";
+			}
+			else{
+				return "NewSimpleType";
+			}
+		}
+		
+	}
+	private boolean canEnable(XSDConcreteComponent xsdComponent){
+		if (xsdComponent instanceof XSDComplexTypeDefinition) {
+			fSelectedComponent = (XSDComplexTypeDefinition)xsdComponent;
+			isComplexType = true;
+			XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition) xsdComponent;
+			XSDConcreteComponent parent = typeDef.getContainer();
+			if(parent instanceof XSDElementDeclaration){
+				fParentName = ((XSDElementDeclaration)parent).getName();
+				return true;
+			}
+		} 
+		else if (xsdComponent instanceof XSDSimpleTypeDefinition){
+			fSelectedComponent = (XSDSimpleTypeDefinition)xsdComponent;
+			isComplexType = false;
+			XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComponent;
+			XSDConcreteComponent parent = typeDef.getContainer();
+			if(parent instanceof XSDElementDeclaration){
+				fParentName = ((XSDElementDeclaration)parent).getName();
+				return true;
+			}
+			else if(parent instanceof XSDAttributeDeclaration){
+				fParentName = ((XSDAttributeDeclaration)parent).getName();
+				return true;
+			}
+			
+		}
+		return false;
+	}
+
+	protected boolean canEnable(Object selectedObject) {
+		
+		if (selectedObject instanceof XSDConcreteComponent) {
+			return canEnable((XSDConcreteComponent)selectedObject);
+		}
+		else if (selectedObject instanceof Node) {
+			Node node = (Node) selectedObject;
+			XSDSchema xsdSchema = getSchema();
+			if (xsdSchema != null)
+			{
+			  XSDConcreteComponent concreteComponent = xsdSchema.getCorrespondingComponent(node);
+		  	return canEnable(concreteComponent);
+			}
+		}
+		return false;
+		
+	}
+
+	public void run1() {
+		
+		if(fSelectedComponent == null){
+			return;
+		}
+		
+		if(fSelectedComponent.getSchema() == null){
+			getSchema().updateElement(true);
+		}
+		MakeTypeGlobalProcessor processor = new MakeTypeGlobalProcessor(fSelectedComponent, getNewDefaultName());
+		RenameRefactoring refactoring = new RenameRefactoring(processor);
+		try {
+			RefactoringWizard wizard = new RenameRefactoringWizard(
+					refactoring,
+					RefactoringMessages.getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
+					RefactoringMessages.getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
+					null);
+			RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
+			op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
+			op.getInitialConditionCheckingStatus();
+			//triggerBuild();
+		} catch (InterruptedException e) {
+			// do nothing. User action got cancelled
+		}
+		
+	}
+	
+	public void run(){
+		if(fSelectedComponent == null){
+			return;
+		}
+		
+		if(fSelectedComponent.getSchema() == null){
+			getSchema().updateElement(true);
+		}
+		DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement().getOwnerDocument();
+		doc.getModel().beginRecording(
+						this,
+						XSDEditorPlugin
+								.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"));
+		MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
+				fSelectedComponent, getNewDefaultName());
+		command.run();
+		doc.getModel().endRecording(this);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
new file mode 100644
index 0000000..ced71d7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.actions;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xsd.ui.internal.commands.MakeLocalElementGlobalCommand;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Node;
+
+public class MakeLocalElementGlobalAction extends SelectionDispatchAction {
+
+	XSDElementDeclaration fSelectedComponent;
+
+	public MakeLocalElementGlobalAction(ISelectionProvider selectionProvider, XSDSchema schema) {
+		super(selectionProvider);
+		setText(RefactoringMessages.getString("MakeLocalElementGlobalAction.text")); //$NON-NLS-1$
+		setSchema(schema);
+	}
+	
+	public boolean canRun() {
+
+		return fSelectedComponent != null;
+	}
+
+	protected boolean canEnable(XSDConcreteComponent selectedObject) {
+
+		fSelectedComponent = null;
+		if (selectedObject instanceof XSDElementDeclaration) {
+			XSDElementDeclaration element = (XSDElementDeclaration) selectedObject;
+			if (!element.isElementDeclarationReference() && !element.isGlobal()) {
+				fSelectedComponent = element;
+			}
+		} 
+		return canRun();
+	}
+	
+	
+	protected boolean canEnable(Object selectedObject) {
+		
+		if (selectedObject instanceof XSDConcreteComponent) {
+			return canEnable((XSDConcreteComponent)selectedObject);
+		}
+		else if (selectedObject instanceof Node) {
+			Node node = (Node) selectedObject;
+			XSDSchema xsdSchema = getSchema();
+			if (xsdSchema != null)
+			{
+			  XSDConcreteComponent concreteComponent = xsdSchema.getCorrespondingComponent(node);
+		  	return canEnable(concreteComponent);
+			}
+		}
+		return false;
+		
+	}
+
+
+	public void run() {
+		DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement()
+				.getOwnerDocument();
+		doc.getModel().beginRecording(this, getText());
+		MakeLocalElementGlobalCommand command = new MakeLocalElementGlobalCommand(
+				fSelectedComponent);
+		command.run();
+		doc.getModel().endRecording(this);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RefactorActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RefactorActionGroup.java
new file mode 100644
index 0000000..f260bb4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RefactorActionGroup.java
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.events.MenuAdapter;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.ActionGroup;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.xsd.XSDSchema;
+
+/**
+ * Action group that adds refactor actions (for example 'Rename', 'Move') to a
+ * context menu and the global menu bar.
+ * 
+ */
+public class RefactorActionGroup extends ActionGroup {
+
+	public static final String MENU_ID = "org.eclipse.wst.xsd.ui.refactoring.menu"; //$NON-NLS-1$
+
+	public static final String GROUP_REORG = "reorgGroup"; //$NON-NLS-1$
+
+	public static final String RENAME_ELEMENT = "org.eclipse.wst.xsd.ui.refactor.rename.element"; //$NON-NLS-1$
+
+	public static final String MAKE_ELEMENT_GLOBAL = "org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"; //$NON-NLS-1$
+	
+	public static final String MAKE_TYPE_GLOBAL = "org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"; //$NON-NLS-1$
+
+	public static final String RENAME = "org.eclipse.wst.xsd.ui.refactoring.actions.Rename"; //$NON-NLS-1$
+
+	/**
+	 * Pop-up menu: name of group for reorganize actions (value
+	 * <code>"group.reorganize"</code>).
+	 */
+	public static final String GROUP_REORGANIZE = IWorkbenchActionConstants.GROUP_REORGANIZE;
+
+	/**
+	 * 
+	 * @deprecated
+	 * 
+	 */
+	private ISelectionProvider fSelectionProvider;
+
+	private String fGroupName = GROUP_REORGANIZE;
+
+	private SelectionDispatchAction fRenameAction;
+
+	private SelectionDispatchAction fMakeLocalElementGlobal;
+	
+	private SelectionDispatchAction fMakeLocalTypeGlobal;
+
+	private List fEditorActions;
+
+	private IMenuManager fRefactorSubmenu;
+
+	private static class NoActionAvailable extends Action {
+		public NoActionAvailable() {
+			setEnabled(true);
+			setText(RefactoringMessages
+					.getString("RefactorActionGroup.no_refactoring_available")); //$NON-NLS-1$
+		}
+	}
+
+	private Action fNoActionAvailable = new NoActionAvailable();
+	
+	public RefactorActionGroup(ISelectionProvider selectionProvider,
+			XSDSchema schema, String groupName) {
+		this(selectionProvider, schema);
+		fGroupName = groupName;
+	}
+	
+	public RefactorActionGroup(ISelectionProvider selectionProvider,
+			XSDSchema schema) {
+		fSelectionProvider = selectionProvider;
+		fEditorActions = new ArrayList();
+		fRenameAction = new RenameAction(selectionProvider, schema);
+		fRenameAction.setActionDefinitionId(RENAME_ELEMENT);
+		fEditorActions.add(fRenameAction);
+
+		fMakeLocalElementGlobal = new MakeLocalElementGlobalAction(
+				selectionProvider, schema);
+		fMakeLocalElementGlobal.setActionDefinitionId(MAKE_ELEMENT_GLOBAL);
+		fEditorActions.add(fMakeLocalElementGlobal);
+		
+		fMakeLocalTypeGlobal = new MakeAnonymousTypeGlobalAction(
+				selectionProvider, schema);
+		fMakeLocalTypeGlobal.setActionDefinitionId(MAKE_TYPE_GLOBAL);
+		fEditorActions.add(fMakeLocalTypeGlobal);
+
+		initAction(fRenameAction, fSelectionProvider);
+		initAction(fMakeLocalElementGlobal, fSelectionProvider);
+		initAction(fMakeLocalTypeGlobal, fSelectionProvider);
+	}
+
+	private static void initAction(SelectionDispatchAction action,
+			ISelectionProvider provider) {
+
+		Assert.isNotNull(provider);
+		Assert.isNotNull(action);
+		action.update(provider.getSelection());
+		provider.addSelectionChangedListener(action);
+	}
+
+	/*
+	 * (non-Javadoc) Method declared in ActionGroup
+	 */
+	public void fillActionBars(IActionBars actionBars) {
+		super.fillActionBars(actionBars);
+		actionBars.setGlobalActionHandler(RENAME, fRenameAction);
+		retargetFileMenuActions(actionBars);
+	}
+
+	/**
+	 * Retargets the File actions with the corresponding refactoring actions.
+	 * 
+	 * @param actionBars
+	 *            the action bar to register the move and rename action with
+	 */
+	public void retargetFileMenuActions(IActionBars actionBars) {
+		actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(),
+				fRenameAction);
+	}
+
+	/*
+	 * (non-Javadoc) Method declared in ActionGroup
+	 */
+	public void fillContextMenu(IMenuManager menu) {
+		super.fillContextMenu(menu);
+		addRefactorSubmenu(menu);
+	}
+
+	/*
+	 * @see ActionGroup#dispose()
+	 */
+	public void dispose() {
+		disposeAction(fRenameAction, fSelectionProvider);
+		disposeAction(fMakeLocalElementGlobal, fSelectionProvider);
+		super.dispose();
+	}
+
+	private void disposeAction(ISelectionChangedListener action,
+			ISelectionProvider provider) {
+		if (action != null)
+			provider.removeSelectionChangedListener(action);
+	}
+
+	private void addRefactorSubmenu(IMenuManager menu) {
+
+		String menuText = RefactoringMessages.getString("RefactorMenu.label"); //$NON-NLS-1$
+
+		fRefactorSubmenu = new MenuManager(menuText, MENU_ID);
+		//if (fEditor != null) {
+			fRefactorSubmenu.addMenuListener(new IMenuListener() {
+				public void menuAboutToShow(IMenuManager manager) {
+					refactorMenuShown(manager);
+				}
+			});
+			fRefactorSubmenu.add(fNoActionAvailable);
+			if (menu.find(fRefactorSubmenu.getId()) == null) {
+				if (menu.find(fGroupName) == null) {
+					menu.add(fRefactorSubmenu);
+				} else {
+					menu.appendToGroup(fGroupName, fRefactorSubmenu);
+				}
+			}
+//		} else {
+//			if (fillRefactorMenu(fRefactorSubmenu) > 0)
+//				menu.appendToGroup(fGroupName, fRefactorSubmenu);
+//		}
+	}
+
+	private int fillRefactorMenu(IMenuManager refactorSubmenu) {
+		int added = 0;
+		refactorSubmenu.add(new Separator(GROUP_REORG));
+		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
+			Action action = (Action) iter.next();
+			added += addAction(refactorSubmenu, action);
+		}
+		return added;
+	}
+
+	private int addAction(IMenuManager menu, IAction action) {
+		if (action != null && action.isEnabled()) {
+			menu.add(action);
+			return 1;
+		}
+		return 0;
+	}
+
+	public int addAction(IAction action) {
+		if (action != null && action.isEnabled()) {
+			fEditorActions.add(action);
+			return 1;
+		}
+		return 0;
+	}
+
+	private void refactorMenuShown(final IMenuManager refactorSubmenu) {
+		// we know that we have an MenuManager since we created it in
+		// addRefactorSubmenu.
+		Menu menu = ((MenuManager) refactorSubmenu).getMenu();
+		menu.addMenuListener(new MenuAdapter() {
+			public void menuHidden(MenuEvent e) {
+				refactorMenuHidden(refactorSubmenu);
+			}
+		});
+//		ISelection selection = (ISelection) fEditor.getSelectionManager()
+//				.getSelection();
+		ISelection selection = fSelectionProvider.getSelection();
+		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
+			Action action = (Action) iter.next();
+			if (action instanceof SelectionDispatchAction) {
+				SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
+				selectionAction.update(selection);
+			}
+		}
+		refactorSubmenu.removeAll();
+		if (fillRefactorMenu(refactorSubmenu) == 0)
+			refactorSubmenu.add(fNoActionAvailable);
+	}
+
+	private void refactorMenuHidden(IMenuManager manager) {
+//		ISelection selection = (ISelection) fEditor.getSelectionManager()
+//				.getSelection();
+		ISelection selection = fSelectionProvider.getSelection();
+		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
+			Action action = (Action) iter.next();
+			if (action instanceof SelectionDispatchAction) {
+				SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
+				selectionAction.update(selection);
+			}
+
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
new file mode 100644
index 0000000..c9c6178
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.actions;
+
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.xsd.XSDSchema;
+
+
+/**
+* Renames a XML Schema element or workbench resource.
+* <p>
+* Action is applicable to selections containing elements of type
+* <code></code> or <code>IResource</code>.
+* 
+* <p>
+* This class may be instantiated; it is not intended to be subclassed.
+* </p>
+
+*/
+public class RenameAction extends SelectionDispatchAction  {
+
+	private RenameComponentAction fRenameXSDElement;
+	private RenameResourceAction fRenameResource;
+	
+	
+	public RenameAction(ISelectionProvider selectionProvider, XSDSchema schema) {
+		super(selectionProvider);
+		setText(RefactoringMessages.getString("RenameAction.text")); //$NON-NLS-1$
+		fRenameXSDElement= new RenameComponentAction(selectionProvider, schema);
+		fRenameXSDElement.setText(getText());
+		fRenameResource= new RenameResourceAction(selectionProvider);
+		fRenameResource.setText(getText());
+		
+	}
+	
+	/*
+	 * @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
+	 */
+	public void selectionChanged(SelectionChangedEvent event) {
+		fRenameXSDElement.selectionChanged(event);
+		if (fRenameResource != null)
+			fRenameResource.selectionChanged(event);
+		setEnabled(computeEnabledState());		
+	}
+
+	/*
+	 * @see SelectionDispatchAction#update(ISelection)
+	 */
+	public void update(ISelection selection) {
+		if(fRenameXSDElement != null){
+			fRenameXSDElement.update(selection);
+		}
+		if (fRenameResource != null)
+			fRenameResource.update(selection);
+		setEnabled(computeEnabledState());		
+	}
+	
+	private boolean computeEnabledState(){
+		if (fRenameResource != null) {
+			return fRenameXSDElement.isEnabled() || fRenameResource.isEnabled();
+		} else {
+			return fRenameXSDElement.isEnabled();
+		}
+	}
+	
+	public void run(IStructuredSelection selection) {
+		if (fRenameXSDElement.isEnabled())
+			fRenameXSDElement.run(selection);
+		if (fRenameResource != null && fRenameResource.isEnabled())
+			fRenameResource.run(selection);
+	}
+
+	public void run(ITextSelection selection) {
+		if (fRenameXSDElement.canRun())
+			fRenameXSDElement.run(selection);
+		else
+			MessageDialog.openInformation(XSDEditorPlugin.getShell(), RefactoringMessages.getString("RenameAction.rename"), RefactoringMessages.getString("RenameAction.unavailable"));  //$NON-NLS-1$ //$NON-NLS-2$
+	}
+	public void run(ISelection selection) {
+	    if(selection == null){
+	    	super.run();
+	    }
+	    else{
+	    	super.run(selection);
+	    }
+		
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
new file mode 100644
index 0000000..01527c0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.actions;
+
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.ui.actions.GlobalBuildAction;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameRefactoringWizard;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.w3c.dom.Node;
+
+public class RenameComponentAction extends SelectionDispatchAction {
+
+	private XSDNamedComponent fSelectedComponent;
+
+	public RenameComponentAction(ISelectionProvider selectionProvider,
+			XSDSchema schema) {
+		super(selectionProvider);
+		setSchema(schema);
+	}
+
+	protected boolean canEnable(XSDConcreteComponent selectedObject) {
+
+		fSelectedComponent = null;
+		if (selectedObject instanceof XSDNamedComponent) {
+			fSelectedComponent = (XSDNamedComponent) selectedObject;
+
+			// if it's element reference, then this action is not appropriate
+			if (fSelectedComponent instanceof XSDElementDeclaration) {
+				XSDElementDeclaration element = (XSDElementDeclaration) fSelectedComponent;
+				if (element.isElementDeclarationReference()) {
+					fSelectedComponent = null;
+				}
+			}
+			if(fSelectedComponent instanceof XSDTypeDefinition){
+				XSDTypeDefinition type = (XSDTypeDefinition) fSelectedComponent;
+				XSDConcreteComponent parent = type.getContainer();
+				if (parent instanceof XSDElementDeclaration) {
+					XSDElementDeclaration element = (XSDElementDeclaration) parent;
+					if(element.getAnonymousTypeDefinition().equals(type)){
+						fSelectedComponent = null;
+					}
+				}
+				else if(parent instanceof XSDAttributeDeclaration) {
+					XSDAttributeDeclaration element = (XSDAttributeDeclaration) parent;
+					if(element.getAnonymousTypeDefinition().equals(type)){
+						fSelectedComponent = null;
+					}
+				}
+			}
+		}
+
+		return canRun();
+	}
+
+	protected boolean canEnable(Object selectedObject) {
+
+		if (selectedObject instanceof XSDConcreteComponent) {
+			return canEnable((XSDConcreteComponent) selectedObject);
+		} else if (selectedObject instanceof Node) {
+			Node node = (Node) selectedObject;
+			if (getSchema() != null) {
+				XSDConcreteComponent concreteComponent = getSchema()
+						.getCorrespondingComponent(node);
+				return canEnable(concreteComponent);
+			}
+		}
+		return false;
+
+	}
+
+	public boolean canRun() {
+
+		return fSelectedComponent != null;
+	}
+
+	public void run(ISelection selection) {
+		if (fSelectedComponent.getName() == null) {
+			fSelectedComponent.setName(new String());
+		}
+		if (fSelectedComponent.getSchema() == null) {
+			if (getSchema() != null) {
+				getSchema().updateElement(true);
+			}
+
+		}
+		RenameComponentProcessor processor = new RenameComponentProcessor(
+				fSelectedComponent, fSelectedComponent.getName());
+		RenameRefactoring refactoring = new RenameRefactoring(processor);
+		try {
+			RefactoringWizard wizard = new RenameRefactoringWizard(
+					refactoring,
+					RefactoringMessages
+							.getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
+					RefactoringMessages
+							.getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
+					null);
+			RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
+					wizard);
+			op.run(XSDEditorPlugin.getShell(), wizard
+					.getDefaultPageTitle());
+			op.getInitialConditionCheckingStatus();
+			triggerBuild();
+		} catch (InterruptedException e) {
+			// do nothing. User action got cancelled
+		}
+
+	}
+
+	public static void triggerBuild() {
+		if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
+			new GlobalBuildAction(XSDEditorPlugin.getPlugin().getWorkbench()
+					.getActiveWorkbenchWindow(),
+					IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
new file mode 100644
index 0000000..cfa535b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.actions;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameRefactoringWizard;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor;
+
+
+
+public class RenameResourceAction extends SelectionDispatchAction {
+
+
+	public RenameResourceAction(ISelectionProvider selectionProvider) {
+		super(selectionProvider);
+	}
+	
+	public void selectionChanged(IStructuredSelection selection) {
+		IResource element= getResource(selection);
+		if (element == null) {
+			setEnabled(false);
+		} else {
+			RenameResourceProcessor processor= new RenameResourceProcessor(element);
+			setEnabled(processor.isApplicable());
+			
+		}
+	}
+
+	public void run(IStructuredSelection selection) {
+		IResource resource = getResource(selection);
+		RenameResourceProcessor processor= new RenameResourceProcessor(resource);
+
+			if(!processor.isApplicable())
+				return;
+			RenameRefactoring refactoring= new RenameRefactoring(processor);
+			try {
+				RefactoringWizard wizard = new RenameRefactoringWizard(
+						refactoring,
+						RefactoringMessages.getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
+						RefactoringMessages.getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
+						null);
+				RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
+				op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
+				op.getInitialConditionCheckingStatus();
+			} catch (InterruptedException e) {
+				// do nothing. User action got cancelled
+			}
+			
+	}
+	
+	private static IResource getResource(IStructuredSelection selection) {
+		if (selection.size() != 1)
+			return null;
+		Object first= selection.getFirstElement();
+		if (! (first instanceof IResource))
+			return null;
+		return (IResource)first;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
new file mode 100644
index 0000000..f008e13
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.actions;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author ebelisar@ca.ibm.com
+ */
+public class RenameResourceActionDelegate implements IObjectActionDelegate {
+	
+	private ISelection fCurrentSelection;
+
+	private IWorkbenchPart fPart;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
+	 */
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+		fPart = targetPart;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	public void run(IAction action) {
+		if (fCurrentSelection instanceof IStructuredSelection) {
+			IStructuredSelection structuredSelection= (IStructuredSelection) fCurrentSelection;
+			Object first= structuredSelection.getFirstElement();
+			if (first instanceof IFile) {
+				RenameResourceAction renameAction = new RenameResourceAction(fPart.getSite().getSelectionProvider());
+				renameAction.run(structuredSelection);
+			}
+		}
+
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+	 */
+	public void selectionChanged(IAction action, ISelection selection) {
+		fCurrentSelection= selection;
+
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
new file mode 100644
index 0000000..abe853d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.xsd.XSDSchema;
+
+
+
+/**
+ * Action that dispatches the <code>IAction#run()</code> and the 
+ * <code>ISelectionChangedListener#selectionChanged</code> 
+ * according to the type of the selection. 
+ * 
+ * <ul>
+ * 	<li>if selection is of type <code>ITextSelection</code> then
+ * 	<code>run(ITextSelection)</code> and <code>selectionChanged(ITextSelection)</code>
+ * 	is called.</li> 
+ * 	<li>if selection is of type <code>IStructuredSelection</code> then
+ * 	<code>run(IStructuredSelection)</code> and <code>
+ * 	selectionChanged(IStructuredSelection)</code> is called.</li>
+ * 	<li>default is to call <code>run(ISelection)</code> and <code>
+ * 	selectionChanged(ISelection)</code>.</li>
+ * </ul>
+ * 
+ * <p>
+ * adapted from <code>org.eclipse.jdt.ui.actions.SelectionDispatchAction</code>
+ * </p>
+ *   
+ * 
+ */
+public abstract class SelectionDispatchAction extends Action implements ISelectionChangedListener {
+	
+	private ISelectionProvider fSelectionProvider;
+	
+	private XSDSchema fSchema;
+	
+	protected SelectionDispatchAction(ISelectionProvider selectionProvider) {
+		Assert.isNotNull(selectionProvider);
+		fSelectionProvider = selectionProvider;
+	}
+
+	/**
+	 * Returns the selection provided by the site owning this action.
+	 * 
+	 * @return the site's selection
+	 */	
+	public ISelection getSelection() {
+		if (getSelectionProvider() != null)
+			return getSelectionProvider().getSelection();
+		else
+			return null;
+	}
+
+	/**
+	 * Returns the selection provider managed by the site owning this action.
+	 * 
+	 * @return the site's selection provider	
+	 */
+	public ISelectionProvider getSelectionProvider() {
+		return fSelectionProvider;
+	}
+
+	/**
+	 * Updates the action's enablement state according to the given selection. This
+	 * default implementation calls one of the <code>selectionChanged</code>
+	 * methods depending on the type of the passed selection.
+	 * 
+	 * @param selection the selection this action is working on
+	 */
+	public void update(ISelection selection) {
+		dispatchSelectionChanged(selection);
+	}
+
+	/**
+	 * Notifies this action that the given structured selection has changed. This default
+	 * implementation calls <code>selectionChanged(ISelection selection)</code>.
+	 * 
+	 * @param selection the new selection
+ 	 */
+	public void selectionChanged(IStructuredSelection selection) {
+		if (selection.size() == 1) {
+			Object object = selection.getFirstElement();
+			setEnabled(canEnable(object));
+		}
+		else{
+			setEnabled(false);
+		}
+	}
+	
+	protected boolean canEnable(Object selectedObject){
+		return false;
+	}
+
+	/**
+	 * Executes this actions with the given structured selection. This default implementation
+	 * calls <code>run(ISelection selection)</code>.
+	 */
+	public void run(IStructuredSelection selection) {
+		run((ISelection)selection);
+	}
+
+	
+	/**
+	 * Notifies this action that the given text selection has changed.  This default
+	 * implementation calls <code>selectionChanged(ISelection selection)</code>.
+	 * 
+	 * @param selection the new selection
+ 	 */
+	public void selectionChanged(ITextSelection selection) {
+		selectionChanged((ISelection)selection);
+	}
+	
+	/**
+	 * Executes this actions with the given text selection. This default implementation
+	 * calls <code>run(ISelection selection)</code>.
+	 */
+	public void run(ITextSelection selection) {
+		run((ISelection)selection);
+	}
+	
+	/**
+	 * Notifies this action that the given selection has changed.  This default
+	 * implementation sets the action's enablement state to <code>false</code>.
+	 * 
+	 * @param selection the new selection
+ 	 */
+	public void selectionChanged(ISelection selection) {
+		setEnabled(false);
+	}
+	
+	/**
+	 * Executes this actions with the given selection. This default implementation
+	 * does nothing.
+	 */
+	public void run(ISelection selection) {
+		System.out.println("SelectionDispatchAction.run");
+	}
+
+	/* (non-Javadoc)
+	 * Method declared on IAction.
+	 */
+	public void run() {
+		dispatchRun(getSelection());
+		
+	}
+	
+	/* (non-Javadoc)
+	 * Method declared on ISelectionChangedListener.
+	 */
+	public void selectionChanged(SelectionChangedEvent event) {
+		dispatchSelectionChanged(event.getSelection());
+	}
+
+	private void dispatchSelectionChanged(ISelection selection) {
+		if (selection instanceof IStructuredSelection) {
+			selectionChanged((IStructuredSelection)selection);
+		} else if (selection instanceof ITextSelection) {
+			selectionChanged((ITextSelection)selection);
+		} else {
+			selectionChanged(selection);
+		}
+	}
+
+	protected void dispatchRun(ISelection selection) {
+		if (selection instanceof IStructuredSelection) {
+			run((IStructuredSelection)selection);
+		}  else if (selection instanceof ITextSelection) {
+			run((ITextSelection)selection);
+		} else {
+			run(selection);
+		}
+	}
+
+	public XSDSchema getSchema() {
+		return fSchema;
+	}
+
+	public void setSchema(XSDSchema schema) {
+		fSchema = schema;
+	}
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseCleanup.java
new file mode 100644
index 0000000..f45a1e2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseCleanup.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.delete;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Element;
+
+public abstract class BaseCleanup extends XSDVisitor
+{
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitSchema(XSDSchema)
+   */
+  public void visitSchema(XSDSchema schema)
+  {
+    super.visitSchema(schema);
+    
+    // now remove all children that were queued up for removal
+    
+    for (Iterator iter = childrenToRemove.iterator(); iter.hasNext(); )
+    {
+      Element domElement = (Element) iter.next();
+      XSDDOMHelper.removeNodeAndWhitespace(domElement);
+//      domElement.getParentNode().removeChild(domElement);
+    }
+  }
+
+
+  protected ArrayList messages = new ArrayList();
+
+  public ArrayList getMessages()
+  {
+  	return messages;
+  }
+  
+
+  protected void addMessage(String msg, XSDConcreteComponent component)
+  {
+////    ErrorMessage message = new ErrorMessage();
+//    
+//    XSDConcreteComponent currComp = component;
+//    while (!(currComp instanceof XSDSchemaContent) && currComp.getContainer() != null)
+//    {
+//      currComp = currComp.getContainer();
+//    }
+//
+//    Element domElement = currComp.getElement();
+//    Node parent = domElement;
+//    while (!(parent instanceof NodeImpl) && parent != null)
+//    {
+//      parent = parent.getParentNode();
+//    }
+//    if (parent instanceof NodeImpl)
+//    {
+//      // message.setModelObject(currComp.getElement());
+//			message.setTargetObject(currComp.getElement());
+//    }
+//    message.setLocalizedMessage(msg);
+//  ???
+//    addMessage(message);
+  }
+    
+
+// // protected void addMessage(ErrorMessage message)
+//	protected void addMessage(Message message)
+//  {
+//    messages.add(message);
+//  }
+  
+
+  protected ArrayList childrenToRemove = new ArrayList();
+  
+
+  protected String getNamedComponentName(XSDConcreteComponent concrete)
+  {
+    String name = null;
+    if (concrete instanceof XSDNamedComponent)
+    {
+      name = ((XSDNamedComponent)concrete).getName();
+    }
+    
+    XSDConcreteComponent comp = concrete;
+    while (comp != null && name == null)
+    {
+      comp = comp.getContainer();
+      if (comp instanceof XSDNamedComponent)
+      {
+        name = ((XSDNamedComponent)comp).getName();
+      }
+    }
+    return name != null ? name : "";
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseGlobalCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseGlobalCleanup.java
new file mode 100644
index 0000000..6503971
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseGlobalCleanup.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.delete;
+
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDNamedComponent;
+
+public class BaseGlobalCleanup extends BaseCleanup
+{
+  public BaseGlobalCleanup(XSDConcreteComponent deletedItem)
+  {
+    this.deletedItem = deletedItem;
+  }
+  
+  protected XSDConcreteComponent deletedItem;
+  
+  protected String getDeletedQName()
+  {
+    return ((XSDNamedComponent)deletedItem).getQName();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeCleanup.java
new file mode 100644
index 0000000..2ff9b55
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeCleanup.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.delete;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class GlobalAttributeCleanup extends BaseGlobalCleanup
+{
+  /**
+   * Constructor for GlobalAttributeCleanup.
+   * @param deletedItem
+   */
+  public GlobalAttributeCleanup(XSDConcreteComponent deletedItem)
+  {
+    super(deletedItem);
+  }
+  
+  protected String replacementName = null;
+  
+  protected String getReplacementElementName()
+  {
+    if (replacementName == null)
+    {
+      TypesHelper helper = new TypesHelper(schema);
+      
+      List elements = helper.getGlobalAttributes();
+      
+      String deletedName = getDeletedQName();
+      for (Iterator i = elements.iterator(); i.hasNext();)
+      {
+        String name = (String) i.next();
+        if (!name.equals(deletedName))
+        {
+          replacementName = name;
+          break;
+        }
+      }
+    }
+    return replacementName;
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
+   */
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    super.visitComplexTypeDefinition(type);
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+        if (attrGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
+          XSDAttributeDeclaration attrDecl = attrUse.getContent();
+          
+          // now is this a reference?
+          if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
+          {
+            if (deletedItem.equals(attrDecl.getResolvedAttributeDeclaration()))
+            {
+              if (getReplacementElementName() != null)
+              {
+				String msg = XSDEditorPlugin.getPlugin().getString("_UI_WARNING_RESET_ATTR_REF", getReplacementElementName()); 
+                addMessage(msg, attrUse);
+                attrUse.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
+              }
+              else
+              {
+                String name = getNamedComponentName(type);
+				String msg = XSDEditorPlugin.getPlugin().getString("_UI_WARNING_REMOVE_ATTR_REF", name);
+                addMessage(msg, attrUse.getContainer());
+                
+                childrenToRemove.add(attrDecl.getElement());
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+
+
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java
new file mode 100644
index 0000000..f858427
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.delete;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class GlobalAttributeGroupCleanup extends BaseGlobalCleanup
+{
+  /**
+   * Constructor for GlobalAttributeGroupCleanup.
+   * @param deletedItem
+   */
+  public GlobalAttributeGroupCleanup(XSDConcreteComponent deletedItem)
+  {
+    super(deletedItem);
+  }
+  
+  
+  protected String replacementName = null;
+  
+  protected String getReplacementElementName()
+  {
+    if (replacementName == null)
+    {
+      TypesHelper helper = new TypesHelper(schema);
+      
+      List elements = helper.getGlobalAttributeGroups();
+      
+      String deletedName = getDeletedQName();
+      for (Iterator i = elements.iterator(); i.hasNext();)
+      {
+        String name = (String) i.next();
+        if (!name.equals(deletedName))
+        {
+          replacementName = name;
+          break;
+        }
+      }
+    }
+    return replacementName;
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
+   */
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    super.visitComplexTypeDefinition(type);
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+
+        if (attrGroupContent instanceof XSDAttributeGroupDefinition)
+        {
+          XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
+          
+          if (deletedItem.equals(attrGroupDef.getResolvedAttributeGroupDefinition()))
+          {
+            if (getReplacementElementName() != null)
+            {
+			  String msg = XSDEditorPlugin.getXSDString("_INFO_RESET_ATTRIBUTE_GROUP_REFERENCE") + " <" + getReplacementElementName() + ">";
+              addMessage(msg, attrGroupDef);
+              attrGroupDef.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
+            }
+            else
+            {
+              // remove the attribute group reference
+              String name = getNamedComponentName(type);
+			  String msg = XSDEditorPlugin.getXSDString("_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE") + " <" + name + ">";  
+              addMessage(msg, attrGroupDef.getContainer());
+              
+              childrenToRemove.add(attrGroupDef.getElement());
+            }
+          }
+        }
+      }
+    }
+    
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalElementCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalElementCleanup.java
new file mode 100644
index 0000000..9719e39
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalElementCleanup.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.delete;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class GlobalElementCleanup extends BaseGlobalCleanup
+{
+    
+  /**
+   * Constructor for GlobalElementCleanup.
+   * @param deletedItem
+   */
+  public GlobalElementCleanup(XSDConcreteComponent deletedItem)
+  {
+    super(deletedItem);
+  }
+
+  protected String replacementName = null;
+  
+  protected String getReplacementElementName()
+  {
+    if (replacementName == null)
+    {
+      TypesHelper helper = new TypesHelper(schema);
+      
+      List elements = helper.getGlobalElements();
+      
+      String deletedName = getDeletedQName();
+      for (Iterator i = elements.iterator(); i.hasNext();)
+      {
+        String name = (String) i.next();
+        if (!name.equals(deletedName))
+        {
+          replacementName = name;
+          break;
+        }
+      }
+    }
+    return replacementName;
+  }
+  
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
+   */
+  public void visitElementDeclaration(XSDElementDeclaration element)
+  {
+    if (element.isElementDeclarationReference())
+    {
+      if (deletedItem.equals(element.getResolvedElementDeclaration()))
+      {
+        if (getReplacementElementName() != null)
+        {
+          // KCPort String msg = XSDPlugin.getSchemaString("_INFO_RESET_ELEMENT_REFERENCE") + " <" + getReplacementElementName() + ">";
+					String msg = "_INFO_RESET_ELEMENT_REFERENCE" + " <" + getReplacementElementName() + ">";
+          addMessage(msg, element);
+          element.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
+        }
+        else
+        {
+          // KCPort  String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ELEMENT_REFERENCE") + " <" + getNamedComponentName(element.getContainer()) + ">";
+					String msg = "_INFO_REMOVE_ELEMENT_REFERENCE" + " <" + getNamedComponentName(element.getContainer()) + ">";
+          addMessage(msg, element.getContainer());
+          childrenToRemove.add(element.getElement());
+        }
+      }
+    }
+    super.visitElementDeclaration(element);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalGroupCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalGroupCleanup.java
new file mode 100644
index 0000000..9486ff2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalGroupCleanup.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.delete;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class GlobalGroupCleanup extends BaseGlobalCleanup
+{
+  /**
+   * Constructor for GlobalGroupCleanup.
+   * @param deletedItem
+   */
+  public GlobalGroupCleanup(XSDConcreteComponent deletedItem)
+  {
+    super(deletedItem);
+  }
+
+  protected String replacementName = null;
+  
+  protected String getReplacementElementName()
+  {
+    if (replacementName == null)
+    {
+      TypesHelper helper = new TypesHelper(schema);
+      
+      List elements = helper.getModelGroups();
+      
+      String deletedName = getDeletedQName();
+      for (Iterator i = elements.iterator(); i.hasNext();)
+      {
+        String name = (String) i.next();
+        if (!name.equals(deletedName))
+        {
+          replacementName = name;
+          break;
+        }
+      }
+    }
+    return replacementName;
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitModelGroupDefinition(XSDModelGroupDefinition)
+   */
+  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
+  {
+    super.visitModelGroupDefinition(modelGroup);
+    if (modelGroup.isModelGroupDefinitionReference())
+    {
+      if (deletedItem.equals(modelGroup.getResolvedModelGroupDefinition()))
+      {
+        if (getReplacementElementName() != null)
+        {
+          // KCPort String msg = XSDPlugin.getSchemaString("_INFO_RESET_GROUP_REFERENCE") + " <" + getReplacementElementName() + ">";
+					String msg = "_INFO_RESET_GROUP_REFERENCE" + " <" + getReplacementElementName() + ">";
+          addMessage(msg, modelGroup);
+          modelGroup.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
+        }
+        else
+        {
+          String name = getNamedComponentName(modelGroup);
+          // KCPort String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_GROUP_REFERENCE") + " <" + name + ">";
+					String msg = "_INFO_REMOVE_GROUP_REFERENCE" + " <" + name + ">";
+          addMessage(msg, modelGroup.getContainer());
+          childrenToRemove.add(modelGroup.getElement());
+        }
+      }
+    }      
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalSimpleOrComplexTypeCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalSimpleOrComplexTypeCleanup.java
new file mode 100644
index 0000000..ed4132c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalSimpleOrComplexTypeCleanup.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.delete;
+
+import java.text.MessageFormat;
+import java.util.Iterator;
+
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class GlobalSimpleOrComplexTypeCleanup extends BaseGlobalCleanup
+{
+  /**
+   * Constructor for GlobalSimpleOrComplexTypeCleanup.
+   * @param deletedItem
+   */
+  public GlobalSimpleOrComplexTypeCleanup(XSDConcreteComponent deletedItem)
+  {
+    super(deletedItem);
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
+   */
+  public void visitElementDeclaration(XSDElementDeclaration element)
+  {
+    if (!element.isElementDeclarationReference() &&
+        deletedItem.equals(element.getTypeDefinition()))
+    {
+      resetTypeToString(element.getElement());
+      
+      String msg = "";
+      if (element.isGlobal())
+      {
+        String pattern = XSDEditorPlugin.getXSDString("_INFO_RESET_GLOBAL_ELEMENT");
+        Object args[] = {element.getName()};
+        msg = MessageFormat.format(pattern, args);
+      }
+      else
+      {
+        msg = XSDEditorPlugin.getXSDString("_INFO_RESET_ELEMENT");
+        msg += "<" + element.getName() + "> " + XSDEditorPlugin.getXSDString("_UI_TO_TYPE_STRING");
+      }
+      addMessage(msg, element);
+    }
+
+
+    super.visitElementDeclaration(element);
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
+   */
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    super.visitComplexTypeDefinition(type);
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+        if (attrGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
+          XSDAttributeDeclaration attrDecl = attrUse.getContent();
+          
+          // now is this a reference?
+          if (attrDecl != null &&
+              !attrDecl.isAttributeDeclarationReference() &&
+              deletedItem.equals(attrDecl.getTypeDefinition()))
+          {
+              resetTypeToString(attrDecl.getElement());
+              // reset the type of the attribute decl to string
+              String msg = XSDEditorPlugin.getXSDString("_INFO_RESET_ATTRIBUTE") +
+                          " <" + attrDecl.getName() + "> " +
+                          XSDEditorPlugin.getXSDString("_UI_TO_TYPE_STRING");
+              addMessage(msg, attrDecl);
+              resetTypeToString(attrDecl.getElement());
+          }
+        }
+      }
+    }
+    XSDTypeDefinition base = type.getBaseTypeDefinition();
+    if (base != null && base == deletedItem)
+    {
+      String msg = XSDEditorPlugin.getXSDString("_INFO_RESET_COMPLEX_TYPE") +
+              " <" + getNamedComponentName(type) + "> " +
+              XSDEditorPlugin.getXSDString("_UI_DERIVATION");
+
+      addMessage(msg, type);
+      
+      type.setBaseTypeDefinition(null);
+
+      java.util.List listOfCT = schema.getTypeDefinitions();
+      XSDTypeDefinition typeDefinition = null;
+      if (listOfCT.size() > 0)
+      {
+        for (Iterator iter = listOfCT.iterator(); iter.hasNext(); )
+        {
+          typeDefinition = (XSDTypeDefinition)iter.next();
+          if (typeDefinition != deletedItem)
+          {
+            type.setBaseTypeDefinition(typeDefinition);
+          }
+        }
+      }
+    }
+  }
+
+  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
+  {
+    if (type.getBaseTypeDefinition() == deletedItem)
+    {
+      type.setBaseTypeDefinition(schema.resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string"));
+    }
+  }
+
+  protected void resetTypeToString(Element element)
+  {
+    String prefix = element.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    
+    element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, prefix + "string"); 
+  }
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java
new file mode 100644
index 0000000..aa40416
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java
@@ -0,0 +1,299 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.delete;
+
+import java.text.MessageFormat;
+import java.util.Iterator;
+
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaContent;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class XSDExternalFileCleanup extends BaseCleanup
+{
+  /**
+   * Constructor for XSDExternalFileCleanup.
+   */
+  public XSDExternalFileCleanup(String oldFilename)
+  {
+    super();
+    this.oldFilename = oldFilename;
+  }
+  
+  protected XSDSchema deletedSchema;
+  public XSDExternalFileCleanup(XSDSchema deletedSchema)
+  {
+    this.deletedSchema = deletedSchema;
+  }
+
+  protected String oldFilename;
+  
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
+   */
+  public void visitElementDeclaration(XSDElementDeclaration element)
+  {
+    boolean addMessage = true;
+    String schemaLocation = element.getSchema().getSchemaLocation();
+    if (schemaLocation!= null)
+    {
+      if (!schemaLocation.equals(schema.getSchemaLocation()))
+      {
+        addMessage = false;
+      }
+    }
+    if (element.isElementDeclarationReference())
+    {
+      if (isFromDeletedSchema(element.getResolvedElementDeclaration()))
+      {
+        if (addMessage)
+        {
+          // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ELEMENT_REFERENCE") + " <" + getNamedComponentName(element.getContainer()) + ">";
+					String msg = "_INFO_REMOVE_ELEMENT_REFERENCE" + " <" + getNamedComponentName(element.getContainer()) + ">";
+          addMessage(msg, element.getContainer());
+        }
+        childrenToRemove.add(element.getElement());
+//        Element domElement = element.getElement();
+//        domElement.getParentNode().removeChild(domElement);     
+      }
+    }
+    else if (removeType(element))
+    {
+      String msg = "";
+      if (element.isGlobal())
+      {
+      	// String pattern = XSDPlugin.getSchemaString("_INFO_RESET_GLOBAL_ELEMENT");
+				String pattern = "_INFO_RESET_GLOBAL_ELEMENT";
+        Object args[] = {element.getName()};
+        msg = MessageFormat.format(pattern, args);
+      }
+      else
+      {
+      	// msg = XSDPlugin.getSchemaString("_INFO_RESET_ELEMENT");
+				msg = "_INFO_RESET_ELEMENT";
+      	// msg += "<" + element.getName() + "> " + XSDPlugin.getSchemaString("_UI_TO_TYPE_STRING");
+				msg += "<" + element.getName() + "> " + "_UI_TO_TYPE_STRING";
+      }
+      if (addMessage)
+      {
+        addMessage(msg, element);
+      }
+    }
+
+
+    super.visitElementDeclaration(element);
+  }
+
+  protected void resetTypeToString(Element element)
+  {
+    String prefix = element.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    
+    element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, prefix + "string"); 
+  }
+  
+  protected boolean removeType(XSDElementDeclaration element)
+  {
+  	if (removeType(element.getTypeDefinition()))
+  	{
+      resetTypeToString(element.getElement());
+  	  return true;
+  	}
+  	return false;
+  }
+  
+  protected boolean isFromDeletedSchema(XSDConcreteComponent component)
+  {
+    if (component == null)
+    {
+      return false;
+    }
+    XSDConcreteComponent root = component.getRootContainer();
+
+    boolean isFromDeletedSchema = false;
+    if (deletedSchema.getContents() != null)
+    {
+      Iterator contents = deletedSchema.getContents().iterator();
+      while (contents.hasNext())
+      {
+        XSDSchemaContent content = (XSDSchemaContent)contents.next();
+        if (content instanceof XSDSchemaDirective)
+        {
+          XSDSchema aSchema = ((XSDSchemaDirective)content).getResolvedSchema();
+          if (root != null && root.equals(aSchema))
+          {
+            isFromDeletedSchema = true;
+          }
+        }
+      }
+    }
+    if (root != null && root.equals(deletedSchema))
+    {
+      isFromDeletedSchema = true;
+    }
+    return isFromDeletedSchema;
+  }
+      
+  /**
+   * Remove the type from the element if it belongs to the external file
+   */
+  protected boolean removeType(XSDTypeDefinition typeDef)
+  {
+    if (typeDef == null)
+    {
+      return false;
+    }
+    return isFromDeletedSchema(typeDef);
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
+   */
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    super.visitComplexTypeDefinition(type);
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+        if (attrGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
+          XSDAttributeDeclaration attrDecl = attrUse.getContent();
+          
+          // now is this a reference?
+          if (attrDecl.isAttributeDeclarationReference())
+          {
+            if (isFromDeletedSchema(attrDecl.getResolvedAttributeDeclaration()))
+            {
+              String name = getNamedComponentName(type);
+              // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_REFERENCE") +
+							String msg = "_INFO_REMOVE_ATTRIBUTE_REFERENCE" +
+                       " <" + name + ">";
+              addMessage(msg, attrDecl.getContainer());
+              
+              childrenToRemove.add(attrDecl.getElement());
+            }
+          }
+          // otherwise check the type of the attribute and see if it is from the deleted schema
+          else
+          {
+            if (removeType(attrDecl.getTypeDefinition()))
+            {
+              // reset the type of the attribute decl to string
+              // String msg = XSDPlugin.getSchemaString("_INFO_RESET_ATTRIBUTE") +
+							String msg = "_INFO_RESET_ATTRIBUTE" +
+                          " <" + attrDecl.getName() + "> " +
+                          // XSDPlugin.getSchemaString("_UI_TO_TYPE_STRING");
+							            "_UI_TO_TYPE_STRING";
+              addMessage(msg, attrDecl);
+              resetTypeToString(attrDecl.getElement());
+
+            }
+          }
+        }
+        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
+        {
+          XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
+          
+          if (isFromDeletedSchema(attrGroupDef.getResolvedAttributeGroupDefinition()))
+          {
+          	// remove the attribute group reference
+            String name = getNamedComponentName(type);
+            // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE") + " <" + name + ">";
+						String msg = "_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE" + " <" + name + ">";
+
+            addMessage(msg, attrGroupDef.getContainer());
+            
+            childrenToRemove.add(attrGroupDef.getElement());
+          }
+        }
+      }
+    }
+
+    // For the complex type with simple content case, see the visitComplexTypeDefinition method
+    XSDTypeDefinition base = type.getBaseTypeDefinition();
+    if (base instanceof XSDSimpleTypeDefinition)
+    {
+      XSDSimpleTypeDefinition baseType = (XSDSimpleTypeDefinition)base;
+      if (isFromDeletedSchema(baseType))
+      {
+        // String msg = XSDPlugin.getSchemaString("_INFO_RESET_COMPLEX_TYPE") +
+				String msg = "_INFO_RESET_COMPLEX_TYPE" +
+                " <" + getNamedComponentName(type) + "> " +
+                // XSDPlugin.getSchemaString("_UI_DERIVATION");
+				        "_UI_DERIVATION";
+        addMessage(msg, type);
+      
+        type.setBaseTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"));
+      }
+    }
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitModelGroupDefinition(XSDModelGroupDefinition)
+   */
+  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
+  {
+    super.visitModelGroupDefinition(modelGroup);
+    if (modelGroup.isModelGroupDefinitionReference())
+    {
+      if (isFromDeletedSchema(modelGroup.getResolvedModelGroupDefinition()))
+      {
+        String name = getNamedComponentName(modelGroup);
+        // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_GROUP_REFERENCE") + " <" + name + ">";
+				String msg = "_INFO_REMOVE_GROUP_REFERENCE" + " <" + name + ">";
+        addMessage(msg, modelGroup.getContainer());
+        childrenToRemove.add(modelGroup.getElement());
+      }
+    }      
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitSimpleTypeDefinition(XSDSimpleTypeDefinition)
+   */
+  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
+  {
+    super.visitSimpleTypeDefinition(type);
+    XSDSimpleTypeDefinition baseType = type.getBaseTypeDefinition();
+    if (isFromDeletedSchema(baseType))
+    {
+      // String msg = XSDPlugin.getSchemaString("_INFO_RESET_SIMPLE_TYPE") +
+			String msg = "_INFO_RESET_SIMPLE_TYPE" +
+              " <" + getNamedComponentName(type) + "> " +
+              // XSDPlugin.getSchemaString("_UI_DERIVATION");
+			        "_UI_DERIVATION";
+      addMessage(msg, type);
+      
+
+    // This will set the simple Type base to string 
+    // For the complex type with simple content case, see the visitComplexTypeDefinition method
+
+      type.getFacetContents().clear();
+      type.getFacets().clear();
+      type.setBaseTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"));
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
new file mode 100644
index 0000000..5432863
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
@@ -0,0 +1,33 @@
+RefactorMenu.label=Refactor
+RefactorActionGroup.no_refactoring_available=<no refactoring available>
+
+RenameAction.rename=Rename
+RenameAction.unavailable=Operation unavailable on the current selection.\nSelect a ....
+RenameAction.text=Re&name...
+
+RenameInputWizardPage.new_name= &New name:
+RenameRefactoringWizard.internal_error= Internal error during name checking: {0}
+
+
+RenameXSDElementAction.exception=Unexpected exception occurred. See log for details
+RenameXSDElementAction.not_available=Operation unavailable on the current selection.\nSelect a XSD project, folder, resource, file, attribute declarations,  attribute group definitions, complex type definitions, element declarations, identity constraint definitions, model groups definitions, notation declarations, or simple type definitions.
+RenameXSDElementAction.name=Rename
+
+
+RenameSupport.dialog.title=Rename
+RenameSupport.not_available=Rename support not available
+
+RenameComponentWizard.defaultPageTitle=Rename wizard
+RenameComponentWizard.inputPage.description=Rename XML Schema component
+
+RenameInputWizardPage.update_references=Update references
+XSDComponentRenameChange.name=XML Schema component renaming: {0} to {1}
+XSDComponentRenameChange.Renaming=Renaming...
+XSDResourceRenameParticipant.compositeChangeName=XSD file rename references updating changes
+XSDRenameResourceChange.rename_resource=Renaming resource name references
+XSDRenameResourceChange.name=Resource rename: {0} to {1}
+RenameResourceRefactoring.Internal_Error=Internal error
+RenameResourceRefactoring.alread_exists=Resource already exist
+RenameResourceRefactoring.invalidName=Invalid resource name
+RenameResourceProcessor.name=Resource renaming
+MakeLocalElementGlobalAction.text=Make Local Element Global
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseCleanup.java
new file mode 100644
index 0000000..3a3da3b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseCleanup.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Element;
+
+public abstract class BaseCleanup extends XSDVisitor
+{
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitSchema(XSDSchema)
+   */
+  public void visitSchema(XSDSchema schema)
+  {
+    super.visitSchema(schema);
+    
+    // now remove all children that were queued up for removal
+    
+    for (Iterator iter = childrenToRemove.iterator(); iter.hasNext(); )
+    {
+      Element domElement = (Element) iter.next();
+      XSDDOMHelper.removeNodeAndWhitespace(domElement);
+//      domElement.getParentNode().removeChild(domElement);
+    }
+  }
+
+
+  protected ArrayList messages = new ArrayList();
+
+  public ArrayList getMessages()
+  {
+  	return messages;
+  }
+  
+
+  protected void addMessage(String msg, XSDConcreteComponent component)
+  {
+////    ErrorMessage message = new ErrorMessage();
+//    
+//    XSDConcreteComponent currComp = component;
+//    while (!(currComp instanceof XSDSchemaContent) && currComp.getContainer() != null)
+//    {
+//      currComp = currComp.getContainer();
+//    }
+//
+//    Element domElement = currComp.getElement();
+//    Node parent = domElement;
+//    while (!(parent instanceof NodeImpl) && parent != null)
+//    {
+//      parent = parent.getParentNode();
+//    }
+//    if (parent instanceof NodeImpl)
+//    {
+//      // message.setModelObject(currComp.getElement());
+//			message.setTargetObject(currComp.getElement());
+//    }
+//    message.setLocalizedMessage(msg);
+//  ???
+//    addMessage(message);
+  }
+    
+
+// // protected void addMessage(ErrorMessage message)
+//	protected void addMessage(Message message)
+//  {
+//    messages.add(message);
+//  }
+  
+
+  protected ArrayList childrenToRemove = new ArrayList();
+  
+
+  protected String getNamedComponentName(XSDConcreteComponent concrete)
+  {
+    String name = null;
+    if (concrete instanceof XSDNamedComponent)
+    {
+      name = ((XSDNamedComponent)concrete).getName();
+    }
+    
+    XSDConcreteComponent comp = concrete;
+    while (comp != null && name == null)
+    {
+      comp = comp.getContainer();
+      if (comp instanceof XSDNamedComponent)
+      {
+        name = ((XSDNamedComponent)comp).getName();
+      }
+    }
+    return name != null ? name : "";
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java
new file mode 100644
index 0000000..1a789e8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.util.XSDConstants;
+
+
+/**
+ * Base class for rename helpers of various named root components.  This is to be used when
+ * the user renames a global element, group, attribute, attribute group, complex/simple type etc
+ */
+public abstract class BaseRenamer extends XSDVisitor
+{
+
+  
+  /**
+   * Method BaseRenamer.
+   * @param globalComponent - this is the component (who's parent is the schema) that has been renamed
+   */
+  public BaseRenamer(XSDNamedComponent globalComponent, String newName)
+  {
+    this.globalComponent = globalComponent;
+    this.newName = newName;
+  }
+  
+  public String getNewQName()
+  {
+    String qName = null;
+    if (newName != null)
+    {
+      qName = XSDConstants.lookupQualifier(globalComponent.getElement(), globalComponent.getTargetNamespace());
+      if (qName != null && qName.length() > 0)
+      {
+        qName += ":" + newName;
+      }
+      else
+      {
+        qName = newName; 
+      }
+    }
+    else
+    {
+      qName = newName;
+    }
+    
+    return qName;
+  }
+  
+  protected String newName;
+  protected XSDNamedComponent globalComponent;
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameChange.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameChange.java
new file mode 100644
index 0000000..678c77f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameChange.java
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.text.Assert;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDSwitch;
+
+
+/**
+ * @author ebelisar
+ *
+ */
+public class ComponentRenameChange extends Change {
+	
+	private Map fChanges;
+	private String fNewName;
+
+	private String fOldName;
+
+	private XSDNamedComponent fNamedComponent;
+
+	public ComponentRenameChange(XSDNamedComponent component, String oldName, String newName) {
+		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
+		Assert.isNotNull(oldName, "old name"); //$NON-NLS-1$
+
+		fNamedComponent = component;
+		fOldName= oldName;
+		fNewName= newName;
+	}
+	
+//	public static Change[] createChangesFor(XSDNamedComponent component, String newName) {
+//		// TODO: P1 implement search of XSD files	
+//		XSDSearchSupport support = XSDSearchSupport.getInstance();
+//		RefactorSearchRequestor requestor = new RefactorSearchRequestor(component, newName);
+//		support.searchRunnable(component, IXSDSearchConstants.WORKSPACE_SCOPE, requestor);
+//
+//		return requestor.getChanges();
+//
+//	}
+
+	protected Change createUndoChange() {
+		return new ComponentRenameChange(fNamedComponent, getNewName(), getOldName());
+	}
+	
+	protected void doRename(IProgressMonitor pm) throws CoreException {
+		// TODO P1 change temporary rename of XSD model components 
+		performModify(getNewName());
+	}
+	
+	public void performModify(final String value)
+	  {
+	    if (value.length() > 0)
+	    {
+	      DelayedRenameRunnable runnable = new DelayedRenameRunnable(fNamedComponent, value);
+	      Display.getCurrent().asyncExec(runnable);
+	    }
+	  }      
+
+	  protected static class DelayedRenameRunnable implements Runnable
+	  {
+	    protected XSDNamedComponent component;
+	    protected String name;
+
+	    public DelayedRenameRunnable(XSDNamedComponent component, String name)
+	    {                                                               
+	      this.component = component;
+	      this.name = name;
+	    }                                                              
+
+	    public void run()
+	    {                      
+	      component.updateElement(true);
+	      XSDSwitch xsdSwitch = new XSDSwitch()
+	      {                   
+	        public Object caseXSDTypeDefinition(XSDTypeDefinition object)
+	        {
+	          new GlobalSimpleOrComplexTypeRenamer(object, name).visitSchema(object.getSchema());
+	          return null;
+	        } 
+	      
+	        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
+	        {           
+	          if (object.isGlobal())
+	          {
+	            new GlobalElementRenamer(object, name).visitSchema(object.getSchema());
+	          }
+	          return null;
+	        }
+	      
+	        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
+	        {
+	          new GlobalGroupRenamer(object, name).visitSchema(object.getSchema());
+	          return null;
+	        }
+	      };
+	      xsdSwitch.doSwitch(component); 
+	      component.setName(name);
+	     
+	    }
+	  }
+	
+	public TextChange getChange(IFile file) {
+		TextChange result= (TextChange)fChanges.get(file);
+		if (result == null) {
+			result= new TextFileChange(file.getName(), file);
+			fChanges.put(file, result);
+		}
+		return result;
+	}
+	
+	public String getName() {
+		return RefactoringMessages.getFormattedString("XSDComponentRenameChange.name", new String[]{getOldName(), getNewName()}); //$NON-NLS-1$
+	}
+
+	public final Change perform(IProgressMonitor pm) throws CoreException {
+		try {
+			pm.beginTask(RefactoringMessages.getString("XSDComponentRenameChange.Renaming"), 1); //$NON-NLS-1$
+			Change result= createUndoChange();
+			doRename(new SubProgressMonitor(pm, 1));
+			return result;
+		} finally {
+			pm.done();
+		}
+	}
+
+	/**
+	 * Gets the newName.
+	 * 
+	 * @return Returns a String
+	 */
+	protected String getNewName() {
+		return fNewName;
+	}
+
+	/**
+	 * Gets the oldName
+	 * 
+	 * @return Returns a String
+	 */
+	protected String getOldName() {
+		return fOldName;
+	}
+
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
+	 */
+	public Object getModifiedElement() {
+		// TODO Auto-generated method stub
+		return fNamedComponent;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void initializeValidationData(IProgressMonitor pm) {
+		// TODO Auto-generated method stub
+
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
+			OperationCanceledException {
+		// TODO implement change validation
+		return new RefactoringStatus();
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeGroupRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeGroupRenamer.java
new file mode 100644
index 0000000..d01ec4f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeGroupRenamer.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.Iterator;
+
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class GlobalAttributeGroupRenamer extends BaseRenamer
+{
+  /**
+   * Constructor for GlobalAttributeGroupRenamer.
+   * @param globalComponent
+   */
+  public GlobalAttributeGroupRenamer(XSDNamedComponent globalComponent, String newName)
+  {
+    super(globalComponent, newName);
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
+   */
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    super.visitComplexTypeDefinition(type);
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+
+        if (attrGroupContent instanceof XSDAttributeGroupDefinition)
+        {
+          XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
+          
+          if (globalComponent.equals(attrGroupDef.getResolvedAttributeGroupDefinition()))
+          {
+            attrGroupDef.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getNewQName());
+          }
+        }
+      }
+    }
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeRenamer.java
new file mode 100644
index 0000000..d1b3e68
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeRenamer.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.Iterator;
+
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class GlobalAttributeRenamer extends BaseRenamer
+{
+  /**
+   * Constructor for GlobalAttributeRenamer.
+   * @param globalComponent
+   */
+  public GlobalAttributeRenamer(XSDNamedComponent globalComponent, String newName)
+  {
+    super(globalComponent, newName);
+  }
+  
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
+   */
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    super.visitComplexTypeDefinition(type);
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+        if (attrGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
+          XSDAttributeDeclaration attrDecl = attrUse.getContent();
+          
+          // now is this a reference?
+          if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
+          {
+            if (globalComponent.equals(attrDecl.getResolvedAttributeDeclaration()))
+            {
+              attrDecl.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getNewQName());           
+            }
+          }
+        }
+      }
+    }
+  }
+
+
+  
+
+  
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalElementRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalElementRenamer.java
new file mode 100644
index 0000000..869d775
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalElementRenamer.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class GlobalElementRenamer extends BaseRenamer
+{
+  /**
+   * Constructor for GlobalElementRenamer.
+   * @param globalComponent
+   */
+  public GlobalElementRenamer(XSDNamedComponent globalComponent, String newName)
+  {
+    super(globalComponent, newName);
+  }
+  
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
+   */
+  public void visitElementDeclaration(XSDElementDeclaration element)
+  {
+    super.visitElementDeclaration(element);
+    if (element.isElementDeclarationReference() &&
+        globalComponent.equals(element.getResolvedElementDeclaration()))
+    {
+      element.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getNewQName());
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalGroupRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalGroupRenamer.java
new file mode 100644
index 0000000..b29b8e4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalGroupRenamer.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class GlobalGroupRenamer extends BaseRenamer
+{
+
+  /**
+   * Constructor for GlobalGroupRenamer.
+   * @param globalComponent
+   */
+  public GlobalGroupRenamer(XSDNamedComponent globalComponent, String newName)
+  {
+    super(globalComponent, newName);
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitModelGroupDefinition(XSDModelGroupDefinition)
+   */
+  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
+  {
+    super.visitModelGroupDefinition(modelGroup);
+    if (modelGroup.isModelGroupDefinitionReference())
+    {
+      if (globalComponent.equals(modelGroup.getResolvedModelGroupDefinition()))
+      {
+        modelGroup.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getNewQName());
+      }
+    }      
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalSimpleOrComplexTypeRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalSimpleOrComplexTypeRenamer.java
new file mode 100644
index 0000000..63e4a67
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalSimpleOrComplexTypeRenamer.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.Iterator;
+
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+public class GlobalSimpleOrComplexTypeRenamer extends BaseRenamer
+{
+  /**
+   * Constructor for GlobalSimpleOrComplexTypeRenamer.
+   * @param globalComponent
+   */
+  public GlobalSimpleOrComplexTypeRenamer(XSDNamedComponent globalComponent, String newName)
+  {
+    super(globalComponent, newName);
+  }
+  
+  
+  /**
+   * 
+   */
+  public void visitElementDeclaration(XSDElementDeclaration element)
+  {
+    if (!element.isElementDeclarationReference() &&
+        globalComponent.equals(element.getTypeDefinition()))
+    {
+      element.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName());
+    }
+
+    super.visitElementDeclaration(element);
+  }
+
+
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
+   */
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    super.visitComplexTypeDefinition(type);
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+        if (attrGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
+          XSDAttributeDeclaration attrDecl = attrUse.getContent();
+          
+          // now is this a reference?
+          if (!attrDecl.isAttributeDeclarationReference() &&
+              globalComponent.equals(attrDecl.getTypeDefinition()))
+          {
+            attrDecl.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName());
+          }
+        }
+      }
+    }
+
+    XSDTypeDefinition base = type.getBaseTypeDefinition();
+    if (base.equals(globalComponent))
+    {
+      XSDDOMHelper helper = new XSDDOMHelper();
+      Element derivedByNode = helper.getDerivedByElementFromComplexType(type.getElement());
+      if (derivedByNode != null)
+      {
+        derivedByNode.setAttribute(XSDConstants.BASE_ATTRIBUTE, getNewQName());
+      }
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/INameUpdating.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/INameUpdating.java
new file mode 100644
index 0000000..7aa495e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/INameUpdating.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+
+/**
+ * @author ebelisar
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public interface INameUpdating {
+	//---- INameUpdating ---------------------------------------------------
+	public abstract void setNewElementName(String newName);
+
+	public abstract String getNewElementName();
+
+	public abstract String getCurrentElementName();
+
+	/* non java-doc
+	 * @see IRenameRefactoring#checkNewName()
+	 */public abstract RefactoringStatus checkNewElementName(String newName);
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
new file mode 100644
index 0000000..7d1cf38
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.xsd.XSDNamedComponent;
+
+public class RenameComponentProcessor extends RenameProcessor  implements INameUpdating{
+	
+	private XSDNamedComponent fNamedComponent;
+	private String fNewElementName;
+
+	public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.renameComponentProcessor"; //$NON-NLS-1$
+
+	//private QualifiedNameSearchResult fNameSearchResult;
+	
+	public RenameComponentProcessor(XSDNamedComponent element, String newName) {
+		fNamedComponent= element;
+		fNewElementName = newName;
+		
+	}
+	
+	public XSDNamedComponent getNamedComponent() {
+		return fNamedComponent;
+	}
+
+	
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
+	 */
+	public boolean canEnableTextUpdating() {
+		return true;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#getCurrentElementName()
+	 */
+	public String getCurrentElementName() {
+		
+		return fNamedComponent.getName();
+	}
+
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#getAffectedProjectNatures()
+	 */
+	protected String[] getAffectedProjectNatures() throws CoreException {
+		//TODO: find project natures of the files that are going to be refactored
+		return new String[0];
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#loadDerivedParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, java.util.List, java.lang.String[], org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
+	 */
+	protected void loadDerivedParticipants(RefactoringStatus status,
+			List result, String[] natures, SharableParticipants shared)
+			throws CoreException {
+		// TODO: provide a way to load rename participants
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+			CheckConditionsContext context) throws CoreException,
+			OperationCanceledException {
+		// TODO add code to check final conditions for component rename
+		return new RefactoringStatus();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
+			throws CoreException, OperationCanceledException {
+//		 TODO add code to check initial conditions for component rename
+		return new RefactoringStatus();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change createChange(IProgressMonitor pm) throws CoreException,
+			OperationCanceledException {
+		// TODO P1 add change creation
+//		Change[] changes = XSDComponentRenameChange.createChangesFor(this.fNamedComponent, getNewElementName());
+//		CompositeChange multiChange = null; 
+//			if(changes.length > 0)
+//				multiChange  = new CompositeChange("XSD component rename participant changes", changes); //$NON-NLS-1$ TODO: externalize string
+//		return multiChange;
+		
+//		computeNameMatches(pm);	
+//		Change[] changes = fNameSearchResult.getAllChanges();
+//		return new CompositeChange("XSD file rename participant changes", changes); //TODO: externalize string
+		pm.beginTask("", 1); //$NON-NLS-1$
+		try{
+			return new ComponentRenameChange(fNamedComponent, fNamedComponent.getName(), getNewElementName());
+		} finally{
+			pm.done();
+		}	 
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
+	 */
+	public Object[] getElements() {
+		
+		return new Object[] {fNamedComponent};
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
+	 */
+	public String getIdentifier() {
+		return IDENTIFIER;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
+	 */
+	public String getProcessorName() {
+		return RefactoringMessages.getFormattedString(
+				"RenameComponentRefactoring.name",  //$NON-NLS-1$
+				new String[]{fNamedComponent.getTargetNamespace() + ":" + fNamedComponent.getName(), getNewElementName()});
+
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
+	 */
+	public boolean isApplicable() throws CoreException {
+		if (fNamedComponent == null)
+			return false;
+		// TODO implement isApplicable logic for the named component, 
+		// verify how it is different from other condition checks
+//		if (fNamedComponent.isAnonymous())
+//			return false;
+//		if (! Checks.isAvailable(fType))
+//			return false;
+//		if (isSpecialCase(fType))
+//			return false;
+		return true;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
+	 */
+	public RefactoringStatus checkNewElementName(String newName){
+		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
+		// TODO: implement new name checking
+//		RefactoringStatus result = Checks.checkTypeName(newName);
+//		if (Checks.isAlreadyNamed(fType, newName))
+//			result.addFatalError(RefactoringCoreMessages.getString("RenameTypeRefactoring.choose_another_name"));	 //$NON-NLS-1$
+		return new RefactoringStatus();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#getNewElement()
+	 */
+	public Object getNewElement() throws CoreException {
+		// TODO implement this method, it's used for updating selection on new element
+		return null;
+	}
+	
+//	private void computeNameMatches(IProgressMonitor pm) throws CoreException {
+//	
+//	    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+//	    try {
+//			URL fileURL = Platform.resolve(new URL(fNamedComponent.getSchema().getSchemaLocation()));
+//			IFile file = workspaceRoot.getFileForLocation(new Path(fileURL.getPath()));
+//			if (fNameSearchResult == null)
+//				fNameSearchResult= new QualifiedNameSearchResult();
+//			QualifiedNameFinder.process(fNameSearchResult, getNamedComponent().getName(),  
+//				getNewElementName(), 
+//				"*.xsd", file.getProject(), pm);
+//		} catch (IOException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//	}
+	
+	public final RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
+		RenameArguments arguments= new RenameArguments(getNewElementName(), true);
+		String[] natures= getAffectedProjectNatures();
+		List result= new ArrayList();
+		loadElementParticipants(status, result, arguments, natures, sharedParticipants);
+		loadDerivedParticipants(status, result, natures, sharedParticipants);
+		return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
+	}
+	
+	protected void loadElementParticipants(RefactoringStatus status, List result, RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
+		Object[] elements= getElements();
+		for (int i= 0; i < elements.length; i++) {
+			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
+				this,  elements[i],
+				arguments, natures, shared)));
+		}
+	}
+	
+	
+	public void setNewElementName(String newName) {
+		
+		fNewElementName= newName;
+	}
+
+	public String getNewElementName() {
+		return fNewElementName;
+	}
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameInputWizardPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameInputWizardPage.java
new file mode 100644
index 0000000..c072b5e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameInputWizardPage.java
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+
+/**
+ * @author ebelisar
+ *
+ */
+public class RenameInputWizardPage  extends UserInputWizardPage{
+	private String fInitialValue;
+	private Text fTextField;
+	private Button fUpdateReferences;
+	/**
+	 * Creates a new text input page.
+	 * @param isLastUserPage <code>true</code> if this page is the wizard's last
+	 *  user input page. Otherwise <code>false</code>.
+	 */
+	public RenameInputWizardPage(String description, boolean isLastUserPage) {
+		this(description, isLastUserPage, ""); //$NON-NLS-1$
+	}
+	
+	/**
+	 * Creates a new text input page.
+	 * @param isLastUserPage <code>true</code> if this page is the wizard's last
+	 *  user input page. Otherwise <code>false</code>
+	 * @param initialValue the initial value
+	 */
+	public RenameInputWizardPage(String description, boolean isLastUserPage, String initialValue) {
+	    super("RenameInputWizardPage");
+		Assert.isNotNull(initialValue);
+		setDescription(description);
+		fInitialValue= initialValue;
+	}
+	
+	/**
+	 * Returns whether the initial input is valid. Typically it is not, because the 
+	 * user is required to provide some information e.g. a new type name etc.
+	 * 
+	 * @return <code>true</code> iff the input provided at initialization is valid
+	 */
+	protected boolean isInitialInputValid(){
+		return false;
+	}
+	
+	/**
+	 * Returns whether an empty string is a valid input. Typically it is not, because 
+	 * the user is required to provide some information e.g. a new type name etc.
+	 * 
+	 * @return <code>true</code> iff an empty string is valid
+	 */
+	protected boolean isEmptyInputValid(){
+		return false;
+	}
+	
+	/**
+	 * Returns the content of the text input field.
+	 * 
+	 * @return the content of the text input field. Returns <code>null</code> if
+	 * not text input field has been created
+	 */
+	protected String getText() {
+		if (fTextField == null)
+			return null;
+		return fTextField.getText();	
+	}
+	
+	/**
+	 * Sets the new text for the text field. Does nothing if the text field has not been created.
+	 * @param text the new value
+	 */
+	protected void setText(String text) {
+		if (fTextField == null)
+			return;
+		fTextField.setText(text);
+	}
+	
+	/**
+	 * Performs input validation. Returns a <code>RefactoringStatus</code> which
+	 * describes the result of input validation. <code>Null<code> is interpreted
+	 * as no error.
+	 */
+	protected RefactoringStatus validateTextField(String text){
+		return null;
+	}
+	
+	protected Text createTextInputField(Composite parent) {
+		return createTextInputField(parent, SWT.BORDER);
+	}
+	
+	protected Text createTextInputField(Composite parent, int style) {
+		fTextField= new Text(parent, style);
+		fTextField.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				textModified(getText());
+			}
+		});
+		fTextField.setText(fInitialValue);
+		return fTextField;
+	}
+	
+	/**
+	 * Checks the page's state and issues a corresponding error message. The page validation
+	 * is computed by calling <code>validatePage</code>.
+	 */
+	protected void textModified(String text) {	
+		if (! isEmptyInputValid() && text.equals("")){ //$NON-NLS-1$
+			setPageComplete(false);
+			setErrorMessage(null);
+			restoreMessage();
+			return;
+		}
+		if ((! isInitialInputValid()) && text.equals(fInitialValue)){
+			setPageComplete(false);
+			setErrorMessage(null);
+			restoreMessage();
+			return;
+		}
+		
+		setPageComplete(validateTextField(text));
+		
+//		 TODO: enable preview in M4
+		getRefactoringWizard().setForcePreviewReview(false);
+		getContainer().updateButtons();
+	
+	}
+	
+	/**
+	 * Subclasses can override if they want to restore the message differently.
+	 * This implementation calls <code>setMessage(null)</code>, which clears the message 
+	 * thus exposing the description.
+	 */
+	protected void restoreMessage(){
+		setMessage(null);
+	}
+	
+	/* (non-Javadoc)
+	 * Method declared in IDialogPage
+	 */
+	public void dispose() {
+		fTextField= null;	
+	}
+	
+	/* (non-Javadoc)
+	 * Method declared in WizardPage
+	 */
+	public void setVisible(boolean visible) {
+		if (visible) {
+			textModified(getText());
+		}
+		super.setVisible(visible);
+		if (visible && fTextField != null) {
+			fTextField.setFocus();
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+	 */
+	public void createControl(Composite parent) {
+		Composite superComposite= new Composite(parent, SWT.NONE);
+		setControl(superComposite);
+		initializeDialogUnits(superComposite);
+		
+		superComposite.setLayout(new GridLayout());
+		Composite composite= new Composite(superComposite, SWT.NONE);
+		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));	
+		
+		GridLayout layout= new GridLayout();
+		layout.numColumns= 2;
+		layout.verticalSpacing= 8;
+		composite.setLayout(layout);
+		
+		
+		Label label= new Label(composite, SWT.NONE);
+		label.setText(getLabelText());
+		
+		Text text= createTextInputField(composite);
+		text.selectAll();
+		GridData gd= new GridData(GridData.FILL_HORIZONTAL);
+		gd.widthHint= convertWidthInCharsToPixels(25);
+		text.setLayoutData(gd);
+		
+		addOptionalUpdateReferencesCheckbox(superComposite);
+		gd= new GridData(GridData.FILL_HORIZONTAL);
+		text.setLayoutData(gd);
+		
+		// TODO: enable preview in M4
+		getRefactoringWizard().setForcePreviewReview(false);
+		
+		Dialog.applyDialogFont(superComposite);
+		//WorkbenchHelp.setHelp(getControl(), fHelpContextID);
+
+	}
+	
+	private static Button createCheckbox(Composite parent, String title, boolean value) {
+		Button checkBox= new Button(parent, SWT.CHECK);
+		checkBox.setText(title);
+		checkBox.setSelection(value);
+		return checkBox;		
+	}
+	
+	private void addOptionalUpdateReferencesCheckbox(Composite result) {
+//		 TODO: enable update reference optioin in M4
+//		final IReferenceUpdating ref= (IReferenceUpdating)getRefactoring().getAdapter(IReferenceUpdating.class);
+//		if (ref == null || !ref.canEnableUpdateReferences())	
+//			return;
+		String title= RefactoringMessages.getString("RenameInputWizardPage.update_references"); //$NON-NLS-1$
+		boolean defaultValue= true; 
+		fUpdateReferences= createCheckbox(result, title, defaultValue);
+//		ref.setUpdateReferences(fUpdateReferences.getSelection());
+		fUpdateReferences.addSelectionListener(new SelectionAdapter(){
+			public void widgetSelected(SelectionEvent e) {
+//		ref.setUpdateReferences(fUpdateReferences.getSelection());
+			}
+		});		
+		
+		fUpdateReferences.setEnabled(false);
+		
+	}
+	
+	protected String getLabelText() {
+		return RefactoringMessages.getString("RenameInputWizardPage.new_name"); //$NON-NLS-1$
+	}
+	
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameRefactoringWizard.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameRefactoringWizard.java
new file mode 100644
index 0000000..4a31f2e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameRefactoringWizard.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+
+public class RenameRefactoringWizard extends RefactoringWizard {
+	
+	private final String fInputPageDescription;
+
+	private final ImageDescriptor fInputPageImageDescriptor;
+	
+	public RenameRefactoringWizard(Refactoring refactoring, String defaultPageTitle, String inputPageDescription, 
+			ImageDescriptor inputPageImageDescriptor) {
+		super(refactoring, DIALOG_BASED_USER_INTERFACE);
+		setDefaultPageTitle(defaultPageTitle);
+    	fInputPageDescription= inputPageDescription;
+		fInputPageImageDescriptor= inputPageImageDescriptor;
+
+	}
+
+	/* non java-doc
+	 * @see RefactoringWizard#addUserInputPages
+	 */ 
+	protected void addUserInputPages() {
+		String initialSetting= getProcessor().getCurrentElementName();
+		RenameInputWizardPage inputPage= createInputPage(fInputPageDescription, initialSetting);
+		inputPage.setImageDescriptor(fInputPageImageDescriptor);
+		addPage(inputPage);
+	}
+
+	protected INameUpdating getProcessor() {
+		
+		return (INameUpdating)getRefactoring().getAdapter(INameUpdating.class);	
+	}
+	
+	
+	protected RenameInputWizardPage createInputPage(String message, String initialSetting) {
+		return new RenameInputWizardPage(message, true, initialSetting) {
+			protected RefactoringStatus validateTextField(String text) {
+				return validateNewName(text);
+			}	
+		};
+	}
+	
+	protected RefactoringStatus validateNewName(String newName) {
+		INameUpdating ref= getProcessor();
+		ref.setNewElementName(newName);
+//		try{
+			return ref.checkNewElementName(newName);
+//		} catch (CoreException e){
+//			//XXX: should log the exception
+//			String msg= e.getMessage() == null ? "": e.getMessage(); //$NON-NLS-1$
+//			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getFormattedString("RenameRefactoringWizard.internal_error", msg));//$NON-NLS-1$
+//		}	
+	}
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
new file mode 100644
index 0000000..fd326c4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package  org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+
+public class RenameResourceProcessor extends RenameProcessor implements INameUpdating {
+
+	private IResource fResource;
+	private String fNewElementName;
+		
+	public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.renameResourceProcessor"; //$NON-NLS-1$
+	
+	public RenameResourceProcessor(IResource resource) {
+		fResource= resource;
+		if (fResource != null) {
+			setNewElementName(fResource.getName());
+		}
+	}
+
+	//---- INameUpdating ---------------------------------------------------
+	
+	public void setNewElementName(String newName) {
+		Assert.isNotNull(newName);
+		fNewElementName= newName;
+	}
+
+	public String getNewElementName() {
+		return fNewElementName;
+	}
+	
+	//---- IRenameProcessor methods ---------------------------------------
+		
+	public String getIdentifier() {
+		return IDENTIFIER;
+	}
+	
+	public boolean isApplicable()  {
+		if (fResource == null)
+			return false;
+		if (! fResource.exists())
+			return false;
+		if (! fResource.isAccessible())	
+			return false;
+		return true;			
+	}
+	
+	public String getProcessorName() {
+		String message= RefactoringMessages.getFormattedString("RenameResourceProcessor.name", //$NON-NLS-1$
+				new String[]{getCurrentElementName(), getNewElementName()});
+		return message;
+	}
+	
+	public Object[] getElements() {
+		return new Object[] {fResource};
+	}
+	
+	public String getCurrentElementName() {
+		return fResource.getName();
+	}
+	
+	public String[] getAffectedProjectNatures() throws CoreException {
+		return new String[0];
+	}
+
+	public Object getNewElement() {
+		return ResourcesPlugin.getWorkspace().getRoot().findMember(createNewPath(getNewElementName()));
+	}
+
+	public boolean getUpdateReferences() {
+		return true;
+	}
+	
+	public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants shared) throws CoreException {
+		Object[] elements= getElements();
+		String[] natures= getAffectedProjectNatures();
+		List result= new ArrayList();
+		RenameArguments arguments= new RenameArguments(getNewElementName(), getUpdateReferences());
+		for (int i= 0; i < elements.length; i++) {
+			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
+				this, elements[i],
+				arguments, natures, shared)));
+		}
+		return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
+	}
+	
+	//--- Condition checking --------------------------------------------
+
+	public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
+		return new RefactoringStatus();
+	}
+	
+	/* non java-doc
+	 * @see IRenameRefactoring#checkNewName()
+	 */
+	public RefactoringStatus checkNewElementName(String newName)  {
+		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
+		IContainer c= fResource.getParent();
+		if (c == null)
+			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.Internal_Error")); //$NON-NLS-1$
+						
+		if (c.findMember(newName) != null)
+			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.alread_exists")); //$NON-NLS-1$
+			
+		if (!c.getFullPath().isValidSegment(newName))
+			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.invalidName")); //$NON-NLS-1$
+	
+		RefactoringStatus result= RefactoringStatus.create(c.getWorkspace().validateName(newName, fResource.getType()));
+		if (! result.hasFatalError())
+			result.merge(RefactoringStatus.create(c.getWorkspace().validatePath(createNewPath(newName), fResource.getType())));		
+		return result;		
+	}
+	
+	/* non java-doc
+	 * @see Refactoring#checkInput(IProgressMonitor)
+	 */
+	public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context)  {
+		pm.beginTask("", 1); //$NON-NLS-1$
+		try{
+			return new RefactoringStatus();
+		} finally{
+			pm.done();
+		}	
+	}
+
+	private String createNewPath(String newName){
+		return fResource.getFullPath().removeLastSegments(1).append(newName).toString();
+	}
+		
+	//--- changes 
+	
+	/* non java-doc 
+	 * @see IRefactoring#createChange(IProgressMonitor)
+	 */
+	public Change createChange(IProgressMonitor pm) {
+		pm.beginTask("", 1); //$NON-NLS-1$
+		try{
+			return new ResourceRenameChange(fResource, getNewElementName());
+		} finally{
+			pm.done();
+		}	
+	}
+}
+
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameSupport.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameSupport.java
new file mode 100644
index 0000000..a923f3f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameSupport.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.actions.GlobalBuildAction;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.xsd.XSDNamedComponent;
+
+
+
+/**
+ * Central access point to execute rename refactorings.
+ * <p>
+ * Note: this class is not intended to be subclassed.
+ * </p>
+ */
+public class RenameSupport {
+
+	private RenameRefactoring fRefactoring;
+	private RefactoringStatus fPreCheckStatus;
+	
+	/**
+	 * Executes some light weight precondition checking. If the returned status
+	 * is an error then the refactoring can't be executed at all. However,
+	 * returning an OK status doesn't guarantee that the refactoring can be
+	 * executed. It may still fail while performing the exhaustive precondition
+	 * checking done inside the methods <code>openDialog</code> or
+	 * <code>perform</code>.
+	 * 
+	 * The method is mainly used to determine enable/disablement of actions.
+	 * 
+	 * @return the result of the light weight precondition checking.
+	 * 
+	 * @throws CoreException if an unexpected exception occurs while performing the checking.
+	 * 
+	 * @see #openDialog(Shell)
+	 * @see #perform(Shell, IRunnableContext)
+	 */
+	public IStatus preCheck() throws CoreException {
+		ensureChecked();
+		if (fPreCheckStatus.hasFatalError())
+			return asStatus(fPreCheckStatus.getEntryMatchingSeverity(RefactoringStatus.FATAL));
+		else
+			return new Status(IStatus.OK, XSDEditorPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
+	}
+
+	/**
+	 * Opens the refactoring dialog for this rename support. 
+	 * 
+	 * @param parent a shell used as a parent for the refactoring dialog.
+	 * @throws CoreException if an unexpected exception occurs while opening the
+	 * dialog.
+	 */
+	public void openDialog(Shell parent) throws CoreException {
+		ensureChecked();
+		if (fPreCheckStatus.hasFatalError()) {
+			showInformation(parent, fPreCheckStatus);
+			return; 
+		}
+		try {
+			RefactoringWizard wizard = new RenameRefactoringWizard(
+					fRefactoring,
+					RefactoringMessages.getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
+					RefactoringMessages.getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
+					null);
+			RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
+			int result= op.run(parent, wizard.getDefaultPageTitle());
+			op.getInitialConditionCheckingStatus();
+			if (result == IDialogConstants.CANCEL_ID || result == RefactoringWizardOpenOperation.INITIAL_CONDITION_CHECKING_FAILED)
+				triggerBuild();
+		} catch (InterruptedException e) {
+			// do nothing. User action got cancelled
+		}
+	
+	}
+	
+	public void triggerBuild() {
+		if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
+			new GlobalBuildAction(XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow(), IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
+		}
+	}
+	
+	/**
+	 * Executes the rename refactoring without showing a dialog to gather
+	 * additional user input (for example the new name of the <tt>IJavaElement</tt>).
+	 * Only an error dialog is shown (if necessary) to present the result
+	 * of the refactoring's full precondition checking.
+	 * <p>
+	 * The method has to be called from within the UI thread. 
+	 * </p>
+	 * 
+	 * @param parent a shell used as a parent for the error dialog.
+	 * @param context a {@link IRunnableContext} to execute the operation.
+	 * 
+	 * @throws InterruptedException if the operation has been cancelled by the
+	 * user.
+	 * @throws InvocationTargetException if an error occurred while executing the
+	 * operation.
+	 * 
+	 * @see #openDialog(Shell)
+	 * @see IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
+	 */
+	public void perform(Shell parent, IRunnableContext context) throws InterruptedException, InvocationTargetException {
+		try {
+			ensureChecked();
+			if (fPreCheckStatus.hasFatalError()) {
+				showInformation(parent, fPreCheckStatus);
+				return; 
+			}
+		} catch (CoreException e){
+			throw new InvocationTargetException(e);
+		}
+	}
+	
+
+
+	
+	private RenameSupport(RenameComponentProcessor processor, String newName) throws CoreException {
+		fRefactoring= new RenameRefactoring(processor);
+		
+	}
+
+	
+	/**
+	 * Creates a new rename support for the given {@link IPackageFragment}.
+	 * 
+	 * @param fragment the {@link IPackageFragment} to be renamed.
+	 * @param newName the package fragment's new name. <code>null</code> is a
+	 * valid value indicating that no new name is provided.
+	 * @param flags flags controlling additional parameters. Valid flags are
+	 * <code>UPDATE_REFERENCES</code>, and <code>UPDATE_TEXTUAL_MATCHES</code>,
+	 * or their bitwise OR, or <code>NONE</code>.
+	 * @return the {@link RenameSupport}.
+	 * @throws CoreException if an unexpected error occurred while creating
+	 * the {@link RenameSupport}.
+	 */
+	public static RenameSupport create(XSDNamedComponent component, String newName) throws CoreException {
+		RenameComponentProcessor processor= new RenameComponentProcessor(component, newName);
+		return new RenameSupport(processor, newName);
+	}
+	
+	
+	private void ensureChecked() throws CoreException {
+		if (fPreCheckStatus == null) {
+			if (!fRefactoring.isApplicable()) {
+				fPreCheckStatus= RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameSupport.not_available")); //$NON-NLS-1$
+			} else {
+				fPreCheckStatus= new RefactoringStatus();
+			}
+		}
+	}
+	
+	private void showInformation(Shell parent, RefactoringStatus status) {
+		String message= status.getMessageMatchingSeverity(RefactoringStatus.FATAL);
+		MessageDialog.openInformation(parent, RefactoringMessages.getString("RenameSupport.dialog.title"), message); //$NON-NLS-1$
+	}
+	
+	private static IStatus asStatus(RefactoringStatusEntry entry) {
+		int statusSeverity= IStatus.ERROR;
+		switch (entry.getSeverity()) {
+			case RefactoringStatus.OK :
+				statusSeverity= IStatus.OK;
+				break;
+			case RefactoringStatus.INFO :
+				statusSeverity= IStatus.INFO;
+				break;
+			case RefactoringStatus.WARNING :
+			case RefactoringStatus.ERROR :
+				statusSeverity= IStatus.WARNING;
+				break;
+		}
+		String pluginId= entry.getPluginId();
+		int code= entry.getCode();
+		if (pluginId == null) {
+			pluginId= XSDEditorPlugin.PLUGIN_ID;
+			code= IStatus.ERROR;
+		}
+		return new Status(statusSeverity, pluginId, code, entry.getMessage(), null);
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
new file mode 100644
index 0000000..c232e2b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+
+/**
+ * Represents a change that renames a given resource
+ */
+public class ResourceRenameChange extends Change {
+
+	/*
+	 * we cannot use handles because they became invalid when you rename the resource.
+	 * paths do not.
+	 */
+	private IPath fResourcePath;
+
+	private String fNewName;
+
+	/**
+	 * @param newName includes the extension
+	 */
+	public ResourceRenameChange(IResource resource, String newName) {
+		this(resource.getFullPath(), newName);
+	}
+
+	private ResourceRenameChange(IPath resourcePath, String newName) {
+		fResourcePath= resourcePath;
+		fNewName= newName;
+	}
+
+	private IResource getResource() {
+		return ResourcesPlugin.getWorkspace().getRoot().findMember(fResourcePath);
+	}
+
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
+		
+		// TODO: implement file validation, see JDTChange
+		return new RefactoringStatus();
+	}
+	
+	/*
+	 * to avoid the exception senders should check if a resource with the new name
+	 * already exists
+	 */
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		try {
+			if (false)
+				throw new NullPointerException();
+			pm.beginTask(RefactoringMessages.getString("XSDRenameResourceChange.rename_resource"), 1); //$NON-NLS-1$
+
+			getResource().move(renamedResourcePath(fResourcePath, fNewName), getCoreRenameFlags(), pm);
+
+			String oldName= fResourcePath.lastSegment();
+			IPath newPath= renamedResourcePath(fResourcePath, fNewName);
+			return new ResourceRenameChange(newPath, oldName);
+		} finally {
+			pm.done();
+		}
+	}
+
+	private int getCoreRenameFlags() {
+		if (getResource().isLinked())
+			return IResource.SHALLOW;
+		else
+			return IResource.NONE;
+	}
+
+	/*
+	 * changes resource names /s/p/A.java renamed to B.java becomes /s/p/B.java
+	 */
+	public static IPath renamedResourcePath(IPath path, String newName) {
+		return path.removeLastSegments(1).append(newName);
+	}
+
+	public String getName() {
+		return RefactoringMessages.getFormattedString(
+			"XSDRenameResourceChange.name", new String[]{fResourcePath.toString(), //$NON-NLS-1$
+			renamedResourcePath(fResourcePath, fNewName).toString()});
+	}
+
+	public Object getModifiedElement() {
+		return getResource();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void initializeValidationData(IProgressMonitor pm) {
+		// TODO Auto-generated method stub
+
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
new file mode 100644
index 0000000..e469981
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+
+/**
+ * @author ebelisar
+ */
+public class ResourceRenameParticipant extends RenameParticipant {
+	
+	private IFile fFile = null;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+	 */
+	protected boolean initialize(Object element) {
+		if(element instanceof IFile) {
+			this.fFile = (IFile) element;
+			return true;
+		}
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	public String getName() {
+		String name = ""; //$NON-NLS-1$
+		if(this.fFile != null) {
+			name = fFile.getName();
+		}
+		return name;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	public RefactoringStatus checkConditions(IProgressMonitor pm,
+			CheckConditionsContext context) throws OperationCanceledException {
+		// TODO add check for file content type
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change createChange(IProgressMonitor pm) throws CoreException,
+			OperationCanceledException {
+		//computeQualifiedNameMatches(pm);	
+		//Change[] changes = fQualifiedNameSearchResult.getAllChanges();
+		return new CompositeChange(RefactoringMessages.getString("XSDResourceRenameParticipant.compositeChangeName"));
+		
+	}
+	
+//	private void computeQualifiedNameMatches(IProgressMonitor pm) throws CoreException {
+//		IPath fragment= fFile.getFullPath();
+//		if (fQualifiedNameSearchResult == null)
+//			fQualifiedNameSearchResult= new QualifiedNameSearchResult();
+//		QualifiedNameFinder.process(fQualifiedNameSearchResult, fFile.getName(),  
+//			getArguments().getNewName(), 
+//			"*.xsd", fFile.getProject(), pm);
+//	}
+	
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/SchemaPrefixChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/SchemaPrefixChangeHandler.java
new file mode 100644
index 0000000..35e90a3
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/SchemaPrefixChangeHandler.java
@@ -0,0 +1,211 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class SchemaPrefixChangeHandler
+{
+  String newPrefix;
+  XSDSchema xsdSchema;
+
+  public SchemaPrefixChangeHandler(XSDSchema xsdSchema, String newPrefix)
+  {
+    this.xsdSchema = xsdSchema;
+    this.newPrefix= newPrefix;
+  }
+  
+  public void resolve()
+  {
+    XSDSchemaPrefixRenamer xsdSchemaPrefixRenamer = new XSDSchemaPrefixRenamer();
+    xsdSchemaPrefixRenamer.visitSchema(xsdSchema);
+  }
+
+  public String getNewQName(XSDTypeDefinition comp, String value, String newXSDPrefix)
+  {
+    String qName = null;
+    if (value != null)
+    {
+      qName = newXSDPrefix;
+      if (qName != null && qName.length() > 0)
+      {
+        qName += ":" + value;
+      }
+      else
+      {
+        qName = value; 
+      }
+    }
+    else
+    {
+      qName = value;
+    }
+    
+    return qName;
+  }
+
+  
+  class XSDSchemaPrefixRenamer extends XSDVisitor
+  {
+    public XSDSchemaPrefixRenamer()
+    {
+      super();
+    }
+    
+    public void visitElementDeclaration(XSDElementDeclaration element)
+    {
+      super.visitElementDeclaration(element);
+      XSDTypeDefinition type = element.getType();
+      if (type != null)
+      {
+        String ns = type.getTargetNamespace();
+        if (ns == null) ns = "";
+//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
+        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))        
+        {
+          Element domElement = element.getElement();
+          if (domElement != null && domElement instanceof IDOMNode)
+          {
+            Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
+            if (typeAttr != null)
+            {
+              element.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));            
+            }
+          }
+        }
+      }
+    }
+    
+    public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition simpleType)
+    {
+      super.visitSimpleTypeDefinition(simpleType);
+      XSDTypeDefinition baseType = simpleType.getBaseTypeDefinition();
+      
+      if (baseType != null)
+      {
+        String ns = baseType.getTargetNamespace();
+        if (ns == null) ns = "";
+//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
+//        System.out.println(xsdSchema.getSchemaForSchemaNamespace());
+        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+        {
+          XSDDOMHelper domHelper = new XSDDOMHelper();
+          Element derivedBy = domHelper.getDerivedByElement(simpleType.getElement());
+          if (derivedBy != null && derivedBy instanceof IDOMNode)
+          {
+            Attr typeAttr = derivedBy.getAttributeNode(XSDConstants.BASE_ATTRIBUTE);
+            if (typeAttr != null)
+            {
+              derivedBy.setAttribute(XSDConstants.BASE_ATTRIBUTE, getNewQName(baseType, baseType.getName(), newPrefix));
+            }
+          }
+        }
+      }
+      
+      XSDSimpleTypeDefinition itemType = simpleType.getItemTypeDefinition();
+      if (itemType != null)
+      {
+        String ns = itemType.getTargetNamespace();
+        if (ns == null) ns = "";
+        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+        {
+          XSDDOMHelper domHelper = new XSDDOMHelper();
+          Node listNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.LIST_ELEMENT_TAG);
+          if (listNode != null && listNode instanceof Element)
+          {
+            Element listElement = (Element)listNode;          
+            if (listElement instanceof IDOMNode)
+            {
+              Attr typeAttr = listElement.getAttributeNode(XSDConstants.ITEMTYPE_ATTRIBUTE);
+              if (typeAttr != null)
+              {
+                listElement.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, getNewQName(itemType, itemType.getName(), newPrefix));
+              }
+            }
+          }
+        }
+      }
+      
+      List memberTypes = simpleType.getMemberTypeDefinitions();
+      if (memberTypes.size() > 0)
+      {
+        XSDDOMHelper domHelper = new XSDDOMHelper();
+        Node unionNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.UNION_ELEMENT_TAG);
+        if (unionNode != null && unionNode instanceof Element)
+        {
+          Element unionElement = (Element)unionNode;          
+          if (unionElement instanceof IDOMNode)
+          {
+            StringBuffer sb = new StringBuffer("");
+            for (Iterator i = memberTypes.iterator(); i.hasNext(); )
+            {
+              XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)i.next();
+              String ns = st.getTargetNamespace();
+              if (ns == null) ns = "";
+              if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+              {
+                sb.append(getNewQName(st, st.getName(), newPrefix));                
+              }
+              else
+              {
+                sb.append(st.getQName(xsdSchema));
+              }
+              if (i.hasNext())
+              {
+                sb.append(" ");
+              }
+            }
+            unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, sb.toString());
+          }
+        }
+      }
+    }
+
+    public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
+    {
+      super.visitAttributeDeclaration(attr);
+      XSDTypeDefinition type = attr.getType();
+      if (type != null)
+      {
+        String ns = type.getTargetNamespace();
+        if (ns == null) ns = "";
+//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
+        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+        {
+          Element domElement = attr.getElement();
+          if (domElement != null && domElement instanceof IDOMNode)
+          {
+            Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
+            if (typeAttr != null)
+            {
+              attr.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));            
+            }
+          }
+        }
+      }
+    }
+  }    
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/TargetNamespaceChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/TargetNamespaceChangeHandler.java
new file mode 100644
index 0000000..ef996b1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/TargetNamespaceChangeHandler.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+
+
+public class TargetNamespaceChangeHandler
+{
+  String newNS;
+  String oldNS;
+  XSDSchema xsdSchema;
+
+  public TargetNamespaceChangeHandler(XSDSchema xsdSchema, String oldNS, String newNS)
+  {
+    this.xsdSchema = xsdSchema;
+    this.oldNS= oldNS;
+    this.newNS= newNS;
+  }
+  
+  public void resolve()
+  {
+    ElementReferenceRenamer elementReferenceRenamer = new ElementReferenceRenamer();
+    elementReferenceRenamer.visitSchema(xsdSchema);
+    AttributeReferenceRenamer attributeReferenceRenamer = new AttributeReferenceRenamer();
+    attributeReferenceRenamer.visitSchema(xsdSchema);
+  }
+
+  class ElementReferenceRenamer extends XSDVisitor
+  {
+    public ElementReferenceRenamer()
+    {
+      super();
+    }
+    
+    public void visitElementDeclaration(XSDElementDeclaration element)
+    {
+      super.visitElementDeclaration(element);
+      if (element.isElementDeclarationReference())
+      {
+      	if (element.getResolvedElementDeclaration().getTargetNamespace() != null)
+      	{
+      	  if (element.getResolvedElementDeclaration().getTargetNamespace().equals(oldNS))
+          {
+            // set the resolved element's declaration to new ns
+            // this is defect 237518 - target namespace rename creates a new namespace
+            element.getResolvedElementDeclaration().setTargetNamespace(newNS);
+          }
+        }
+        else
+        {
+        	if (oldNS == null || (oldNS != null && oldNS.equals("")))
+        	{
+						element.getResolvedElementDeclaration().setTargetNamespace(newNS);
+        	}
+        }
+      }
+    }
+  }
+  
+  // Similar to defect 237518 but for attributes
+  class AttributeReferenceRenamer extends XSDVisitor
+  {
+    public AttributeReferenceRenamer()
+    {
+      super();
+    }
+    
+    public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+    {
+      super.visitComplexTypeDefinition(type);
+      if (type.getAttributeContents() != null)
+      {
+        for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+        {
+          XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+          if (attrGroupContent instanceof XSDAttributeUse)
+          {
+            XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
+            XSDAttributeDeclaration attrDecl = attrUse.getContent();
+            
+            if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
+            {
+							if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
+							{
+                if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
+                {
+                  attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
+                }
+              }
+              else
+              {
+								if (oldNS == null || (oldNS != null && oldNS.equals("")))
+								{
+									attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
+								}
+              }
+            }
+          }
+        }
+      }
+    }
+  
+    public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
+    {
+      super.visitAttributeGroupDefinition(attributeGroup);
+      EList list = attributeGroup.getAttributeUses();
+      if (list != null)
+      {
+        for (Iterator iter = list.iterator(); iter.hasNext(); )
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
+          XSDAttributeDeclaration attrDecl = attrUse.getContent();
+
+          if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
+          {
+						if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
+						{
+              if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
+              {
+                attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
+              }
+            }
+            else
+            {
+							if (oldNS == null || (oldNS != null && oldNS.equals("")))
+							{
+								attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
+							}
+            }
+          }
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDExternalFileCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDExternalFileCleanup.java
new file mode 100644
index 0000000..e96619e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDExternalFileCleanup.java
@@ -0,0 +1,298 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.text.MessageFormat;
+import java.util.Iterator;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaContent;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class XSDExternalFileCleanup extends BaseCleanup
+{
+  /**
+   * Constructor for XSDExternalFileCleanup.
+   */
+  public XSDExternalFileCleanup(String oldFilename)
+  {
+    super();
+    this.oldFilename = oldFilename;
+  }
+  
+  protected XSDSchema deletedSchema;
+  public XSDExternalFileCleanup(XSDSchema deletedSchema)
+  {
+    this.deletedSchema = deletedSchema;
+  }
+
+  protected String oldFilename;
+  
+  /**
+   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
+   */
+  public void visitElementDeclaration(XSDElementDeclaration element)
+  {
+    boolean addMessage = true;
+    String schemaLocation = element.getSchema().getSchemaLocation();
+    if (schemaLocation!= null)
+    {
+      if (!schemaLocation.equals(schema.getSchemaLocation()))
+      {
+        addMessage = false;
+      }
+    }
+    if (element.isElementDeclarationReference())
+    {
+      if (isFromDeletedSchema(element.getResolvedElementDeclaration()))
+      {
+        if (addMessage)
+        {
+          // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ELEMENT_REFERENCE") + " <" + getNamedComponentName(element.getContainer()) + ">";
+					String msg = "_INFO_REMOVE_ELEMENT_REFERENCE" + " <" + getNamedComponentName(element.getContainer()) + ">";
+          addMessage(msg, element.getContainer());
+        }
+        childrenToRemove.add(element.getElement());
+//        Element domElement = element.getElement();
+//        domElement.getParentNode().removeChild(domElement);     
+      }
+    }
+    else if (removeType(element))
+    {
+      String msg = "";
+      if (element.isGlobal())
+      {
+      	// String pattern = XSDPlugin.getSchemaString("_INFO_RESET_GLOBAL_ELEMENT");
+				String pattern = "_INFO_RESET_GLOBAL_ELEMENT";
+        Object args[] = {element.getName()};
+        msg = MessageFormat.format(pattern, args);
+      }
+      else
+      {
+      	// msg = XSDPlugin.getSchemaString("_INFO_RESET_ELEMENT");
+				msg = "_INFO_RESET_ELEMENT";
+      	// msg += "<" + element.getName() + "> " + XSDPlugin.getSchemaString("_UI_TO_TYPE_STRING");
+				msg += "<" + element.getName() + "> " + "_UI_TO_TYPE_STRING";
+      }
+      if (addMessage)
+      {
+        addMessage(msg, element);
+      }
+    }
+
+
+    super.visitElementDeclaration(element);
+  }
+
+  protected void resetTypeToString(Element element)
+  {
+    String prefix = element.getPrefix();
+    prefix = (prefix == null) ? "" : (prefix + ":");
+    
+    element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, prefix + "string"); 
+  }
+  
+  protected boolean removeType(XSDElementDeclaration element)
+  {
+  	if (removeType(element.getTypeDefinition()))
+  	{
+      resetTypeToString(element.getElement());
+  	  return true;
+  	}
+  	return false;
+  }
+  
+  protected boolean isFromDeletedSchema(XSDConcreteComponent component)
+  {
+    if (component == null)
+    {
+      return false;
+    }
+    XSDConcreteComponent root = component.getRootContainer();
+
+    boolean isFromDeletedSchema = false;
+    if (deletedSchema.getContents() != null)
+    {
+      Iterator contents = deletedSchema.getContents().iterator();
+      while (contents.hasNext())
+      {
+        XSDSchemaContent content = (XSDSchemaContent)contents.next();
+        if (content instanceof XSDSchemaDirective)
+        {
+          XSDSchema aSchema = ((XSDSchemaDirective)content).getResolvedSchema();
+          if (root != null && root.equals(aSchema))
+          {
+            isFromDeletedSchema = true;
+          }
+        }
+      }
+    }
+    if (root != null && root.equals(deletedSchema))
+    {
+      isFromDeletedSchema = true;
+    }
+    return isFromDeletedSchema;
+  }
+      
+  /**
+   * Remove the type from the element if it belongs to the external file
+   */
+  protected boolean removeType(XSDTypeDefinition typeDef)
+  {
+    if (typeDef == null)
+    {
+      return false;
+    }
+    return isFromDeletedSchema(typeDef);
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
+   */
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    super.visitComplexTypeDefinition(type);
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
+        if (attrGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
+          XSDAttributeDeclaration attrDecl = attrUse.getContent();
+          
+          // now is this a reference?
+          if (attrDecl.isAttributeDeclarationReference())
+          {
+            if (isFromDeletedSchema(attrDecl.getResolvedAttributeDeclaration()))
+            {
+              String name = getNamedComponentName(type);
+              // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_REFERENCE") +
+							String msg = "_INFO_REMOVE_ATTRIBUTE_REFERENCE" +
+                       " <" + name + ">";
+              addMessage(msg, attrDecl.getContainer());
+              
+              childrenToRemove.add(attrDecl.getElement());
+            }
+          }
+          // otherwise check the type of the attribute and see if it is from the deleted schema
+          else
+          {
+            if (removeType(attrDecl.getTypeDefinition()))
+            {
+              // reset the type of the attribute decl to string
+              // String msg = XSDPlugin.getSchemaString("_INFO_RESET_ATTRIBUTE") +
+							String msg = "_INFO_RESET_ATTRIBUTE" +
+                          " <" + attrDecl.getName() + "> " +
+                          // XSDPlugin.getSchemaString("_UI_TO_TYPE_STRING");
+							            "_UI_TO_TYPE_STRING";
+              addMessage(msg, attrDecl);
+              resetTypeToString(attrDecl.getElement());
+
+            }
+          }
+        }
+        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
+        {
+          XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
+          
+          if (isFromDeletedSchema(attrGroupDef.getResolvedAttributeGroupDefinition()))
+          {
+          	// remove the attribute group reference
+            String name = getNamedComponentName(type);
+            // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE") + " <" + name + ">";
+						String msg = "_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE" + " <" + name + ">";
+
+            addMessage(msg, attrGroupDef.getContainer());
+            
+            childrenToRemove.add(attrGroupDef.getElement());
+          }
+        }
+      }
+    }
+
+    // For the complex type with simple content case, see the visitComplexTypeDefinition method
+    XSDTypeDefinition base = type.getBaseTypeDefinition();
+    if (base instanceof XSDSimpleTypeDefinition)
+    {
+      XSDSimpleTypeDefinition baseType = (XSDSimpleTypeDefinition)base;
+      if (isFromDeletedSchema(baseType))
+      {
+        // String msg = XSDPlugin.getSchemaString("_INFO_RESET_COMPLEX_TYPE") +
+				String msg = "_INFO_RESET_COMPLEX_TYPE" +
+                " <" + getNamedComponentName(type) + "> " +
+                // XSDPlugin.getSchemaString("_UI_DERIVATION");
+				        "_UI_DERIVATION";
+        addMessage(msg, type);
+      
+        type.setBaseTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"));
+      }
+    }
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitModelGroupDefinition(XSDModelGroupDefinition)
+   */
+  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
+  {
+    super.visitModelGroupDefinition(modelGroup);
+    if (modelGroup.isModelGroupDefinitionReference())
+    {
+      if (isFromDeletedSchema(modelGroup.getResolvedModelGroupDefinition()))
+      {
+        String name = getNamedComponentName(modelGroup);
+        // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_GROUP_REFERENCE") + " <" + name + ">";
+				String msg = "_INFO_REMOVE_GROUP_REFERENCE" + " <" + name + ">";
+        addMessage(msg, modelGroup.getContainer());
+        childrenToRemove.add(modelGroup.getElement());
+      }
+    }      
+  }
+
+  /**
+   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitSimpleTypeDefinition(XSDSimpleTypeDefinition)
+   */
+  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
+  {
+    super.visitSimpleTypeDefinition(type);
+    XSDSimpleTypeDefinition baseType = type.getBaseTypeDefinition();
+    if (isFromDeletedSchema(baseType))
+    {
+      // String msg = XSDPlugin.getSchemaString("_INFO_RESET_SIMPLE_TYPE") +
+			String msg = "_INFO_RESET_SIMPLE_TYPE" +
+              " <" + getNamedComponentName(type) + "> " +
+              // XSDPlugin.getSchemaString("_UI_DERIVATION");
+			        "_UI_DERIVATION";
+      addMessage(msg, type);
+      
+
+    // This will set the simple Type base to string 
+    // For the complex type with simple content case, see the visitComplexTypeDefinition method
+
+      type.getFacetContents().clear();
+      type.getFacets().clear();
+      type.setBaseTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"));
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDVisitor.java
new file mode 100644
index 0000000..4acf32d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDVisitor.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.rename;
+
+import java.util.Iterator;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeContent;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNotationDeclaration;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+
+public class XSDVisitor
+{
+  public XSDVisitor()
+  {
+  }
+  
+  protected XSDSchema schema;
+  
+  public void visitSchema(XSDSchema schema)
+  {
+    this.schema = schema;
+    for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
+    {
+      XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
+      visitAttributeDeclaration(attr);
+    }
+    for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
+    {
+      XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
+      visitTypeDefinition(type);
+    }
+    for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
+    {
+      XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
+      visitElementDeclaration(element);
+    }
+    for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
+    {
+      XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
+      visitIdentityConstraintDefinition(identityConstraint);
+    }
+    for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
+    {
+      XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
+      visitModelGroupDefinition(modelGroup);
+    }
+    for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
+    {
+      XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
+      visitAttributeGroupDefinition(attributeGroup);
+    }
+    for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
+    {
+      XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
+      visitNotationDeclaration(element);
+    }
+    
+  }
+  
+  public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
+  {
+  }
+  
+  public void visitTypeDefinition(XSDTypeDefinition type)
+  {
+    if (type instanceof XSDSimpleTypeDefinition)
+    {
+      visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
+    }
+    else if (type instanceof XSDComplexTypeDefinition)
+    {
+      visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
+    }
+  }
+  
+  public void visitElementDeclaration(XSDElementDeclaration element)
+  {
+    if (element.isElementDeclarationReference())
+    {
+    }
+    else if (element.getAnonymousTypeDefinition() != null)
+    {
+      visitTypeDefinition(element.getAnonymousTypeDefinition());
+    }
+  }
+  
+  public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
+  {
+  }
+  
+  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
+  {
+    if (!modelGroupDef.isModelGroupDefinitionReference())
+    {
+      if (modelGroupDef.getModelGroup() != null)
+      {
+        visitModelGroup(modelGroupDef.getModelGroup());
+      }
+    }
+  }
+  
+  public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
+  {
+    if (attributeGroup.getAttributeUses() != null)
+    {
+      for (Iterator iter = attributeGroup.getAttributeUses().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
+        visitAttributeDeclaration(attrUse.getContent());
+      }
+    }
+  }
+  
+  public void visitNotationDeclaration(XSDNotationDeclaration notation)
+  {
+  }
+  
+  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
+  {
+  }
+  
+  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
+  {
+    if (type.getContentType() != null)
+    {
+      XSDComplexTypeContent complexContent = (XSDComplexTypeContent) type.getContentType();
+      if (complexContent instanceof XSDSimpleTypeDefinition)
+      {
+        visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
+      }
+      else if (complexContent instanceof XSDParticle)
+      {
+        visitParticle((XSDParticle) complexContent);
+      }
+    }
+    
+    if (type.getAttributeContents() != null)
+    {
+      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
+      {
+        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
+        if (attrGroupContent instanceof XSDAttributeUse)
+        {
+          XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
+          visitAttributeDeclaration(attrUse.getContent());
+        }
+        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
+        {
+          visitAttributeGroupDefinition((XSDAttributeGroupDefinition)attrGroupContent);
+        }
+      }
+    }
+  }
+  
+  public void visitParticle(XSDParticle particle)
+  {
+    visitParticleContent(particle.getContent());
+  }
+  
+  public void visitParticleContent(XSDParticleContent particleContent)
+  {
+    if (particleContent instanceof XSDModelGroupDefinition)
+    {
+      visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
+    }
+    else if (particleContent instanceof XSDModelGroup)
+    {
+      visitModelGroup((XSDModelGroup)particleContent);
+    }
+    else if (particleContent instanceof XSDElementDeclaration)
+    {
+      visitElementDeclaration((XSDElementDeclaration)particleContent);
+    }
+    else if (particleContent instanceof XSDWildcard)
+    {
+      visitWildcard((XSDWildcard)particleContent);
+    }
+  }
+  
+  public void visitModelGroup(XSDModelGroup modelGroup)
+  {
+    if (modelGroup.getContents() != null)
+    {
+      for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
+      {
+        XSDParticle particle = (XSDParticle) iterator.next();
+        visitParticle(particle);
+      }
+    }
+  }
+  
+  public void visitWildcard(XSDWildcard wildcard)
+  {
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
new file mode 100644
index 0000000..80a6ac0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.refactor.structure;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.text.Assert;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.commands.MakeAnonymousTypeGlobalCommand;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+/**
+ * @author ebelisar
+ * 
+ */
+public class MakeTypeGlobalChange extends Change {
+
+	private Map fChanges;
+
+	private String fNewName;
+
+	private XSDTypeDefinition fTypeComponent;
+
+	public MakeTypeGlobalChange(XSDTypeDefinition component, 
+			String newName) {
+		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
+
+		fTypeComponent = component;
+		fNewName = newName;
+	}
+
+	// public static Change[] createChangesFor(XSDNamedComponent component,
+	// String newName) {
+	// // TODO: P1 implement search of XSD files
+	// XSDSearchSupport support = XSDSearchSupport.getInstance();
+	// RefactorSearchRequestor requestor = new
+	// RefactorSearchRequestor(component, newName);
+	// support.searchRunnable(component, IXSDSearchConstants.WORKSPACE_SCOPE,
+	// requestor);
+	//
+	// return requestor.getChanges();
+	//
+	// }
+
+	protected Change createUndoChange() {
+		return new MakeTypeGlobalChange(fTypeComponent, getNewName());
+	}
+
+	protected void doRename(IProgressMonitor pm) throws CoreException {
+		// TODO P1 change temporary rename of XSD model components
+		performModify(getNewName());
+	}
+
+	public void performModify(final String value) {
+			DelayedRenameRunnable runnable = new DelayedRenameRunnable(
+					fTypeComponent, value);
+			Display.getCurrent().asyncExec(runnable);
+	}
+
+	protected static class DelayedRenameRunnable implements Runnable {
+		protected XSDTypeDefinition component;
+
+		protected String name;
+
+		public DelayedRenameRunnable(XSDTypeDefinition component, String name) {
+			this.component = component;
+			this.name = name;
+		}
+
+		public void run() {
+			DocumentImpl doc = (DocumentImpl) component.getElement().getOwnerDocument();
+			doc.getModel().beginRecording(
+							this,
+							XSDEditorPlugin
+									.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"));
+			MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
+					component, name);
+			command.run();
+			doc.getModel().endRecording(this);
+		}
+	}
+
+	public TextChange getChange(IFile file) {
+		TextChange result = (TextChange) fChanges.get(file);
+		if (result == null) {
+			result = new TextFileChange(file.getName(), file);
+			fChanges.put(file, result);
+		}
+		return result;
+	}
+
+	public String getName() {
+		return RefactoringMessages
+				.getFormattedString(
+						"MakeTypeGlobalChange.name", new String[] {getNewName() }); //$NON-NLS-1$
+	}
+
+	public final Change perform(IProgressMonitor pm) throws CoreException {
+		try {
+			pm.beginTask(RefactoringMessages
+					.getString("XSDComponentRenameChange.Renaming"), 1); //$NON-NLS-1$
+			Change result = createUndoChange();
+			doRename(new SubProgressMonitor(pm, 1));
+			return result;
+		} finally {
+			pm.done();
+		}
+	}
+
+	/**
+	 * Gets the newName.
+	 * 
+	 * @return Returns a String
+	 */
+	protected String getNewName() {
+		return fNewName;
+	}
+
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
+	 */
+	public Object getModifiedElement() {
+		// TODO Auto-generated method stub
+		return fTypeComponent;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void initializeValidationData(IProgressMonitor pm) {
+		// TODO Auto-generated method stub
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
+			OperationCanceledException {
+		// TODO implement change validation
+		return new RefactoringStatus();
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
new file mode 100644
index 0000000..d94fd26
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.structure;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.INameUpdating;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+public class MakeTypeGlobalProcessor extends RenameProcessor implements INameUpdating{
+	
+	private XSDTypeDefinition fTypeComponent;
+	private String fNewElementName;
+
+	public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.makeTypeGlobalProcessor"; //$NON-NLS-1$
+
+	//private QualifiedNameSearchResult fNameSearchResult;
+	
+	public MakeTypeGlobalProcessor(XSDTypeDefinition element, String newName) {
+		fTypeComponent= element;
+		fNewElementName = newName;
+		
+	}
+	
+	public XSDTypeDefinition getTypeComponent() {
+		return fTypeComponent;
+	}
+
+	
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
+	 */
+	public boolean canEnableTextUpdating() {
+		return true;
+	}
+
+	protected String[] getAffectedProjectNatures() throws CoreException {
+		//TODO: find project natures of the files that are going to be refactored
+		return new String[0];
+	}
+	
+	protected void loadDerivedParticipants(RefactoringStatus status,
+			List result, String[] natures, SharableParticipants shared)
+			throws CoreException {
+		// TODO: provide a way to load rename participants
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+			CheckConditionsContext context) throws CoreException,
+			OperationCanceledException {
+		// TODO add code to check final conditions for component rename
+		return new RefactoringStatus();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
+			throws CoreException, OperationCanceledException {
+//		 TODO add code to check initial conditions for component rename
+		return new RefactoringStatus();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change createChange(IProgressMonitor pm) throws CoreException,
+			OperationCanceledException {
+		// TODO P1 add change creation
+//		Change[] changes = XSDComponentRenameChange.createChangesFor(this.fNamedComponent, getNewElementName());
+//		CompositeChange multiChange = null; 
+//			if(changes.length > 0)
+//				multiChange  = new CompositeChange("XSD component rename participant changes", changes); //$NON-NLS-1$ TODO: externalize string
+//		return multiChange;
+		
+//		computeNameMatches(pm);	
+//		Change[] changes = fNameSearchResult.getAllChanges();
+//		return new CompositeChange("XSD file rename participant changes", changes); //TODO: externalize string
+		pm.beginTask("", 1); //$NON-NLS-1$
+		try{
+			return new MakeTypeGlobalChange(fTypeComponent, getNewElementName());
+		} finally{
+			pm.done();
+		}	 
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
+	 */
+	public Object[] getElements() {
+		
+		return new Object[] {fTypeComponent};
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
+	 */
+	public String getIdentifier() {
+		return IDENTIFIER;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
+	 */
+	public String getProcessorName() {
+		return RefactoringMessages.getFormattedString(
+				"MakeLocalTypeGlobalRefactoring.name",  //$NON-NLS-1$
+				new String[]{getNewElementName()});
+
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
+	 */
+	public boolean isApplicable() throws CoreException {
+		if (fTypeComponent == null)
+			return false;
+		// TODO implement isApplicable logic for the named component, 
+		// verify how it is different from other condition checks
+//		if (fNamedComponent.isAnonymous())
+//			return false;
+//		if (! Checks.isAvailable(fType))
+//			return false;
+//		if (isSpecialCase(fType))
+//			return false;
+		return true;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
+	 */
+	public RefactoringStatus checkNewElementName(String newName){
+		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
+		// TODO: implement new name checking
+//		RefactoringStatus result = Checks.checkTypeName(newName);
+//		if (Checks.isAlreadyNamed(fType, newName))
+//			result.addFatalError(RefactoringCoreMessages.getString("RenameTypeRefactoring.choose_another_name"));	 //$NON-NLS-1$
+		return new RefactoringStatus();
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#getNewElement()
+	 */
+	public Object getNewElement() throws CoreException {
+		// TODO implement this method, it's used for updating selection on new element
+		return null;
+	}
+	
+//	private void computeNameMatches(IProgressMonitor pm) throws CoreException {
+//	
+//	    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+//	    try {
+//			URL fileURL = Platform.resolve(new URL(fNamedComponent.getSchema().getSchemaLocation()));
+//			IFile file = workspaceRoot.getFileForLocation(new Path(fileURL.getPath()));
+//			if (fNameSearchResult == null)
+//				fNameSearchResult= new QualifiedNameSearchResult();
+//			QualifiedNameFinder.process(fNameSearchResult, getNamedComponent().getName(),  
+//				getNewElementName(), 
+//				"*.xsd", file.getProject(), pm);
+//		} catch (IOException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//	}
+	
+	public final RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
+		RenameArguments arguments= new RenameArguments(getNewElementName(), true);
+		String[] natures= getAffectedProjectNatures();
+		List result= new ArrayList();
+		loadElementParticipants(status, result, arguments, natures, sharedParticipants);
+		loadDerivedParticipants(status, result, natures, sharedParticipants);
+		return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
+	}
+	
+	protected void loadElementParticipants(RefactoringStatus status, List result, RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
+		Object[] elements= getElements();
+		for (int i= 0; i < elements.length; i++) {
+			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
+				this,  elements[i],
+				arguments, natures, shared)));
+		}
+	}
+	
+	
+	public void setNewElementName(String newName) {
+		
+		fNewElementName= newName;
+	}
+
+	public String getNewElementName() {
+		return fNewElementName;
+	}
+
+	public String getCurrentElementName() {
+		// TODO Auto-generated method stub
+		return fNewElementName;
+	}
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/OpenOnSelectionHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/OpenOnSelectionHelper.java
new file mode 100644
index 0000000..549dcd1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/OpenOnSelectionHelper.java
@@ -0,0 +1,329 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.util;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditor;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDIdentityConstraintDefinition;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+
+
+public class OpenOnSelectionHelper
+{
+  
+  protected StructuredTextEditor textEditor;
+  protected XSDSchema xsdSchema;
+
+ 
+  public OpenOnSelectionHelper(StructuredTextEditor textEditor, XSDSchema xsdSchema)
+  {
+  	this.textEditor = textEditor;
+  	this.xsdSchema = xsdSchema;
+  }
+  
+
+  boolean lastResult;
+  
+  public static void openXSDEditor(String schemaLocation)
+  {
+		IPath schemaPath = new Path(schemaLocation);
+		
+		final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
+	
+		Display.getDefault().syncExec(new Runnable()
+		{
+			/**
+			 * @see java.lang.Runnable#run()
+			 */
+			public void run()
+			{
+				final IWorkbenchWindow workbenchWindow = XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
+				if (workbenchWindow != null)
+				{
+					try
+					{
+					  workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.XSD_EDITOR_ID);
+					}
+					catch (PartInitException initEx)
+					{
+					  initEx.printStackTrace();
+//						XSDEditorPlugin.getPlugin().getMsgLogger().write(initEx);
+					}
+					catch(Exception e)
+					{
+					  e.printStackTrace();
+					}
+				}          
+			}
+		});
+  }
+  
+  protected boolean revealObject(final XSDConcreteComponent component)
+  {
+    if (component.getRootContainer().equals(xsdSchema))
+    {
+      Node element = component.getElement();
+      if (element instanceof IndexedRegion)
+      {
+        IndexedRegion indexNode = (IndexedRegion) element;
+        textEditor.getTextViewer().setRangeIndication(indexNode.getStartOffset(), indexNode.getEndOffset() - indexNode.getStartOffset(), true);
+        return true;
+      }
+      return false;
+    }
+    else
+    {
+      lastResult = false;
+      if (component.getSchema() != null)
+      {
+				String schemaLocation = URIHelper.removePlatformResourceProtocol(component.getSchema().getSchemaLocation());
+        IPath schemaPath = new Path(schemaLocation);
+				final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
+        Display.getDefault().syncExec(new Runnable()
+        {
+	        /**
+	         * @see java.lang.Runnable#run()
+	         */
+	        public void run()
+	        {
+		        final IWorkbenchWindow workbenchWindow = XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
+		        if (workbenchWindow != null)
+		        {
+							try
+							{
+							  // IEditorPart editorPart = workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), textEditor.getXSDEditor().getEditorSite().getId());
+								IEditorPart editorPart = workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.getPlugin().PLUGIN_ID);
+								if (editorPart instanceof XSDEditor)
+								{
+									((XSDEditor)editorPart).openOnGlobalReference(component);
+									lastResult = true;
+								}
+							}
+							catch (PartInitException initEx)
+							{
+//								XSDEditorPlugin.getPlugin().getMsgLogger().write(initEx);
+							}
+						}          
+					}
+				});
+      }
+      return lastResult;
+    }
+  }
+  
+  public void openOnGlobalReference(XSDConcreteComponent comp)
+  {
+    XSDSchema schema = xsdSchema;
+    String name = null;
+    if (comp instanceof XSDNamedComponent)
+    {
+      name = ((XSDNamedComponent) comp).getName();
+    }
+    
+    if (schema == null || name == null)
+    {
+      return;
+    }
+
+    List objects = null;    
+    if (comp instanceof XSDElementDeclaration)
+    {
+      objects = schema.getElementDeclarations();
+    }
+    else if (comp instanceof XSDTypeDefinition)
+    {
+      objects = schema.getTypeDefinitions();
+    }
+
+    if (objects != null)
+    {
+      for (Iterator iter = objects.iterator(); iter.hasNext();)
+      {
+        XSDNamedComponent namedComp = (XSDNamedComponent) iter.next();
+        
+        if (namedComp.getName().equals(name))
+        {
+          revealObject(namedComp);
+        }
+      }
+    }
+  }
+  
+  public boolean openOnSelection()
+  {
+    List selectedNodes = null;
+    ISelection selection = textEditor.getSelectionProvider().getSelection();
+    if (selection instanceof IStructuredSelection) {
+      selectedNodes = ((IStructuredSelection) selection).toList();
+    }
+
+    if (selectedNodes != null && !selectedNodes.isEmpty())
+    {
+      for (Iterator i = selectedNodes.iterator(); i.hasNext();)
+      {
+        Object obj = i.next();
+        if (xsdSchema != null)
+        {
+          XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent((Node)obj);
+          XSDConcreteComponent objectToReveal = null;
+
+          if (xsdComp instanceof XSDElementDeclaration)
+          {
+            XSDElementDeclaration elementDecl = (XSDElementDeclaration) xsdComp;
+            if (elementDecl.isElementDeclarationReference())
+            {
+              objectToReveal = elementDecl.getResolvedElementDeclaration();
+            }
+            else
+            {
+              XSDConcreteComponent typeDef = null;
+              if (elementDecl.getAnonymousTypeDefinition() == null)
+              {
+                typeDef = elementDecl.getTypeDefinition();
+              }
+              
+              XSDConcreteComponent subGroupAffiliation = elementDecl.getSubstitutionGroupAffiliation();
+              
+              if (typeDef != null && subGroupAffiliation != null)
+              {
+                // we have 2 things we can navigate to, if the cursor is anywhere on the substitution attribute
+                // then jump to that, otherwise just go to the typeDef.
+                if (obj instanceof Attr && ((Attr)obj).getLocalName().equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
+                {
+                  objectToReveal = subGroupAffiliation;
+                }
+                else
+                {
+                  // try to reveal the type now.  On success, then we return true.
+                  // if we fail, set the substitution group as the object to reveal as a backup plan.
+                  if (revealObject(typeDef))
+                  {
+                    return true;
+                  }
+                  else
+                  {
+                    objectToReveal = subGroupAffiliation;
+                  }
+                }
+              }
+              else
+              {
+                // one or more of these is null.  If the typeDef is non-null, use it.  Otherwise
+                // try and use the substitution group
+                objectToReveal = typeDef != null ? typeDef : subGroupAffiliation;
+              }
+            }
+          }
+          else if (xsdComp instanceof XSDModelGroupDefinition)
+          {
+            XSDModelGroupDefinition elementDecl = (XSDModelGroupDefinition) xsdComp;
+            if (elementDecl.isModelGroupDefinitionReference())
+            {
+              objectToReveal = elementDecl.getResolvedModelGroupDefinition();
+            }
+          }
+          else if (xsdComp instanceof XSDAttributeDeclaration)
+          {
+            XSDAttributeDeclaration attrDecl = (XSDAttributeDeclaration) xsdComp;
+            if (attrDecl.isAttributeDeclarationReference())
+            {
+              objectToReveal = attrDecl.getResolvedAttributeDeclaration();
+            }
+            else if (attrDecl.getAnonymousTypeDefinition() == null)
+            {
+              objectToReveal = attrDecl.getTypeDefinition();
+            }              
+          }
+          else if (xsdComp instanceof XSDAttributeGroupDefinition)
+          {
+            XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) xsdComp;
+            if (attrGroupDef.isAttributeGroupDefinitionReference())
+            {
+              objectToReveal = attrGroupDef.getResolvedAttributeGroupDefinition();
+            }
+          }
+          else if (xsdComp instanceof XSDIdentityConstraintDefinition)
+          {
+            XSDIdentityConstraintDefinition idConstraintDef = (XSDIdentityConstraintDefinition) xsdComp;
+            if (idConstraintDef.getReferencedKey() != null)
+            {
+              objectToReveal = idConstraintDef.getReferencedKey();
+            }
+          }
+          else if (xsdComp instanceof XSDSimpleTypeDefinition)
+          {
+            XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComp;
+            objectToReveal = typeDef.getItemTypeDefinition();
+            if (objectToReveal == null)
+            {
+              // if itemType attribute is not set, then check for memberType
+              List memberTypes = typeDef.getMemberTypeDefinitions();
+              if (memberTypes != null && memberTypes.size() > 0)
+              {
+                objectToReveal = (XSDConcreteComponent)memberTypes.get(0);
+              }              
+            }
+          }
+          else if (xsdComp instanceof XSDTypeDefinition)
+          {
+            XSDTypeDefinition typeDef = (XSDTypeDefinition) xsdComp;
+            objectToReveal = typeDef.getBaseType();
+          }
+          else if (xsdComp instanceof XSDSchemaDirective)
+          {
+          	XSDSchemaDirective directive = (XSDSchemaDirective) xsdComp;
+//						String schemaLocation = URIHelper.removePlatformResourceProtocol(directive.getResolvedSchema().getSchemaLocation());
+//						openXSDEditor(schemaLocation);
+//						return false;
+            objectToReveal = directive.getResolvedSchema();						          	          	
+          }
+
+          // now reveal the object if this isn't null
+          if (objectToReveal != null)
+          {
+            return revealObject(objectToReveal);
+          }
+        }
+      }
+    }
+    return false;
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
new file mode 100644
index 0000000..006cfd6
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
@@ -0,0 +1,714 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaContent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.impl.XSDImportImpl;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+public class TypesHelper
+{
+  XSDSchema xsdSchema;
+  Vector list = new Vector();
+
+  public TypesHelper(XSDSchema xsdSchema)
+  {
+    this.xsdSchema = xsdSchema;
+  }
+
+  public void updateExternalImportGlobals()
+  {
+    if (xsdSchema != null)
+    {
+      Iterator contents = xsdSchema.getContents().iterator();
+      while (contents.hasNext())
+      {
+        XSDSchemaContent content = (XSDSchemaContent) contents.next();
+        if (content instanceof XSDImportImpl)
+        {
+          XSDImportImpl anImport = (XSDImportImpl) content;
+          try
+          {
+            if (anImport.getSchemaLocation() != null)
+            {
+              anImport.importSchema();
+            }
+          }
+          catch (Exception e)
+          {
+            
+          }
+        }
+      }
+    }
+  }
+
+
+  private Vector addExternalImportedGlobalElements(Vector items)
+  {
+    if (xsdSchema != null)
+    {
+      Iterator contents = xsdSchema.getContents().iterator();
+      while (contents.hasNext())
+      {
+        XSDSchemaContent content = (XSDSchemaContent) contents.next();
+        if (content instanceof XSDImportImpl)
+        {
+          XSDImportImpl anImport = (XSDImportImpl) content;
+
+          XSDSchema impSchema = anImport.getResolvedSchema();
+
+          try
+          {
+            if (impSchema == null)
+            {
+              impSchema = anImport.importSchema();
+            }
+          }
+          catch (Exception e)
+          {
+            
+          }
+
+          if (impSchema != null)
+          {
+            Iterator i = impSchema.getElementDeclarations().iterator();
+            while (i.hasNext())
+            {
+              XSDElementDeclaration anElement = (XSDElementDeclaration) i.next();
+              if (anElement.getName() != null)
+              {
+                items.addAll(getPrefixedNames(anElement.getTargetNamespace(), anElement.getName()));
+              }
+            }
+          }
+        }
+      }
+    }
+    return items;
+  }
+
+  private Vector addExternalImportedAttributes(Vector items)
+  {
+    if (xsdSchema != null)
+    {
+      Iterator contents = xsdSchema.getContents().iterator();
+      while (contents.hasNext())
+      {
+        XSDSchemaContent content = (XSDSchemaContent) contents.next();
+        if (content instanceof XSDImportImpl)
+        {
+          XSDImportImpl anImport = (XSDImportImpl) content;
+
+          XSDSchema impSchema = anImport.getResolvedSchema();
+
+          try
+          {
+            if (impSchema == null)
+            {
+              impSchema = anImport.importSchema();
+            }
+          }
+          catch (Exception e)
+          {
+            
+          }
+
+          if (impSchema != null)
+          {
+            Iterator i = impSchema.getAttributeDeclarations().iterator();
+            while (i.hasNext())
+            {
+              XSDAttributeDeclaration attrib = (XSDAttributeDeclaration) i.next();
+              if (attrib.getName() != null)
+              {
+                items.addAll(getPrefixedNames(attrib.getTargetNamespace(), attrib.getName()));
+              }
+            }
+          }
+        }
+      }
+    }
+    return items;
+  }
+
+  private Vector addExternalImportedAttributeGroups(Vector items)
+  {
+    if (xsdSchema != null)
+    {
+      Iterator contents = xsdSchema.getContents().iterator();
+      while (contents.hasNext())
+      {
+        XSDSchemaContent content = (XSDSchemaContent) contents.next();
+        if (content instanceof XSDImportImpl)
+        {
+          XSDImportImpl anImport = (XSDImportImpl) content;
+
+          XSDSchema impSchema = anImport.getResolvedSchema();
+
+          try
+          {
+            if (impSchema == null)
+            {
+              impSchema = anImport.importSchema();
+            }
+          }
+          catch (Exception e)
+          {
+            
+          }
+
+          if (impSchema != null)
+          {
+            Iterator i = impSchema.getAttributeGroupDefinitions().iterator();
+            while (i.hasNext())
+            {
+              XSDAttributeGroupDefinition attrib = (XSDAttributeGroupDefinition) i.next();
+              if (attrib.getName() != null)
+              {
+                items.addAll(getPrefixedNames(attrib.getTargetNamespace(), attrib.getName()));
+              }
+            }
+          }
+        }
+      }
+    }
+    return items;
+  }
+
+  private Vector addExternalImportedGroups(Vector items)
+  {
+    if (xsdSchema != null)
+    {
+      Iterator contents = xsdSchema.getContents().iterator();
+      while (contents.hasNext())
+      {
+        XSDSchemaContent content = (XSDSchemaContent) contents.next();
+        if (content instanceof XSDImportImpl)
+        {
+          XSDImportImpl anImport = (XSDImportImpl) content;
+
+          XSDSchema impSchema = anImport.getResolvedSchema();
+
+          try
+          {
+            if (impSchema == null)
+            {
+              impSchema = anImport.importSchema();
+            }
+          }
+          catch (Exception e)
+          {
+          }
+
+          if (impSchema != null)
+          {
+            Iterator i = impSchema.getModelGroupDefinitions().iterator();
+            while (i.hasNext())
+            {
+              XSDModelGroupDefinition aGroup = (XSDModelGroupDefinition) i.next();
+              if (aGroup.getName() != null)
+              {
+                items.addAll(getPrefixedNames(aGroup.getTargetNamespace(), aGroup.getName()));
+              }
+            }
+          }
+        }
+      }
+    }
+    return items;
+  }
+
+  public java.util.List getBuiltInTypeNamesList()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
+      if (xsdForXSDPrefix != null && xsdForXSDPrefix.length() > 0)
+      {
+        xsdForXSDPrefix = xsdForXSDPrefix + ":";
+      }
+      else
+      {
+        xsdForXSDPrefix = "";
+      }
+
+      for (int i = 0; i < XSDDOMHelper.dataType.length; i++)
+      {
+        items.add(xsdForXSDPrefix + XSDDOMHelper.dataType[i][0]);
+      }
+    }
+    return items;
+  }
+  
+  public java.util.List getBuiltInTypeNamesList2()
+  {
+    List result = new ArrayList();
+    if (xsdSchema != null)
+    {
+      List prefixes = getPrefixesForNamespace(xsdSchema.getSchemaForSchemaNamespace());
+      for (int i = 0; i < XSDDOMHelper.dataType.length; i++)
+      {
+        for (Iterator j = prefixes.iterator(); j.hasNext();)
+        {
+          String prefix = (String) j.next();
+          String localName = XSDDOMHelper.dataType[i][0]; 
+          String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName; 
+          result.add(prefixedName);
+        }
+      }
+    }
+    return result;
+  }
+
+  public java.util.List getUserSimpleTypeNamesList()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      Iterator i = xsdSchema.getTypeDefinitions().iterator();
+      while (i.hasNext())
+      {
+        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
+        if (typeDefinition instanceof XSDSimpleTypeDefinition)
+        {
+          items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));
+          //System.out.println(typeDefinition.getQName(xsdSchema));
+          //items.add(typeDefinition.getQName(xsdSchema));
+        }
+      }
+      items.add(getPrefix(xsdSchema.getSchemaForSchemaNamespace(), true) + "anyType");
+      
+      //      items = addExternalImportedUserSimpleTypes(items);
+      items = (Vector) sortList(items);
+    }
+    return items;
+  }
+
+  public java.util.List getUserComplexTypeNamesList()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      Iterator i = xsdSchema.getTypeDefinitions().iterator();
+      while (i.hasNext())
+      {
+        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
+        if (typeDefinition instanceof XSDComplexTypeDefinition)
+        {
+			    items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));         
+        }
+      }
+      items = (Vector) sortList(items);
+    }
+    return items;
+  }
+  
+  public java.util.List getUserSimpleTypes()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      Iterator i = xsdSchema.getTypeDefinitions().iterator();
+      while (i.hasNext())
+      {
+        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
+        if (typeDefinition instanceof XSDSimpleTypeDefinition)
+        {
+          items.add(typeDefinition);
+          //System.out.println(typeDefinition.getQName(xsdSchema));
+          //items.add(typeDefinition.getQName(xsdSchema));
+        }
+      }
+      // We need to add the anyType
+//      items.add(getPrefix(xsdSchema.getSchemaForSchemaNamespace(), true) + "anyType");
+      
+      //      items = addExternalImportedUserSimpleTypes(items);
+      //items = (Vector) sortList(items);
+    }
+    return items;
+  }
+
+  public String getPrefix(String ns, boolean withColon)
+  {
+    String key = "";
+
+    if (xsdSchema != null)
+    {
+      Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+      Iterator iter = map.keySet().iterator();
+      while (iter.hasNext())
+      {
+        Object keyObj = iter.next();
+        Object value = map.get(keyObj);
+        if (value != null && value.toString().equals(ns))
+        {
+          if (keyObj != null)
+          {
+            key = keyObj.toString();
+          }
+          else
+          {
+            key = "";
+          }
+          break;
+        }
+      }
+      if (!key.equals(""))
+      {
+        if (withColon)
+        {
+          key = key + ":";
+        }
+      }
+    }
+    return key;
+  }
+
+  public java.util.List getUserComplexTypes()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      Iterator i = xsdSchema.getTypeDefinitions().iterator();
+      while (i.hasNext())
+      {
+        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
+        if (typeDefinition instanceof XSDComplexTypeDefinition)
+        {
+			    items.add(typeDefinition);         
+        }
+      }
+    }
+    return items;
+  }
+  
+  public java.util.List getGlobalElements()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      if (xsdSchema.getElementDeclarations() != null)
+      {
+        Iterator i = xsdSchema.getElementDeclarations().iterator();
+        while (i.hasNext())
+        {
+          XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) i.next();
+          String name = elementDeclaration.getQName(xsdSchema);
+          if (name != null)
+          {
+            items.add(name);
+          }
+        }
+      }
+      //      items = addExternalImportedGlobalElements(items);
+      items = (Vector) sortList(items);
+    }
+    return items;
+  }
+
+  public String getGlobalElement(XSDSchema relativeComponent)
+  {
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      if (xsdSchema.getElementDeclarations() != null)
+      {
+        Iterator i = xsdSchema.getElementDeclarations().iterator();
+        while (i.hasNext()) // just get the first one
+        {
+          XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) i.next();
+          if (elementDeclaration.getQName(relativeComponent) != null)
+          {
+            return elementDeclaration.getQName(relativeComponent);
+          }
+        }
+      }
+
+      Vector items = new Vector();
+      items = addExternalImportedGlobalElements(items);
+      if (items != null && items.size() > 0)
+      {
+        return items.get(0).toString();
+      }
+    }
+    return null; // for disabling menu
+  }
+
+  public java.util.List getGlobalAttributes()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      if (xsdSchema.getAttributeDeclarations() != null)
+      {
+        Iterator i = xsdSchema.getAttributeDeclarations().iterator();
+        while (i.hasNext())
+        {
+          XSDAttributeDeclaration attributeDeclaration = (XSDAttributeDeclaration) i.next();
+          if (attributeDeclaration.getTargetNamespace() == null || (attributeDeclaration.getTargetNamespace() != null && !attributeDeclaration.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
+          {
+            String name = attributeDeclaration.getQName(xsdSchema);
+            if (name != null)
+            {
+              items.add(name);
+            }
+          }
+        }
+      }
+      //      items = addExternalImportedAttributes(items);
+      items = (Vector) sortList(items);
+    }
+    return items;
+  }
+
+  public String getGlobalAttribute(XSDSchema relativeComponent)
+  {
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      if (xsdSchema.getAttributeDeclarations() != null)
+      {
+        Iterator i = xsdSchema.getAttributeDeclarations().iterator();
+        while (i.hasNext()) // just get the first one
+        {
+          XSDAttributeDeclaration attributeDeclaration = (XSDAttributeDeclaration) i.next();
+          // Filter out attributes from the schema namespace
+          if (!(attributeDeclaration.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
+          {
+            if (attributeDeclaration.getQName(relativeComponent) != null)
+            {
+              return attributeDeclaration.getQName(relativeComponent);
+            }
+          }
+        }
+      }
+
+      Vector items = new Vector();
+      items = addExternalImportedAttributes(items);
+      if (items != null && items.size() > 0)
+      {
+        return items.get(0).toString();
+      }
+    }
+    return null; // for disabling menu
+  }
+
+  public java.util.List getGlobalAttributeGroups()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      if (xsdSchema.getAttributeGroupDefinitions() != null)
+      {
+        Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator();
+        while (i.hasNext())
+        {
+          XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) i.next();
+          String name = attributeGroupDefinition.getQName(xsdSchema);
+          if (name != null)
+          {
+            items.add(name);
+          }
+        }
+      }
+      //      items = addExternalImportedAttributeGroups(items);
+      items = (Vector) sortList(items);
+    }
+    return items;
+  }
+
+  public String getGlobalAttributeGroup(XSDSchema relativeComponent)
+  {
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      if (xsdSchema.getAttributeGroupDefinitions() != null)
+      {
+        Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator();
+        while (i.hasNext()) // just get the first one
+        {
+          XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) i.next();
+          if (attributeGroupDefinition.getQName(relativeComponent) != null)
+          {
+            return attributeGroupDefinition.getQName(relativeComponent);
+          }
+        }
+      }
+
+      Vector items = new Vector();
+      items = addExternalImportedAttributeGroups(items);
+      if (items != null && items.size() > 0)
+      {
+        return items.get(0).toString();
+      }
+    }
+    return null; // for disabling menu
+  }
+
+  public java.util.List getModelGroups()
+  {
+    Vector items = new Vector();
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      if (xsdSchema.getModelGroupDefinitions() != null)
+      {
+        Iterator i = xsdSchema.getModelGroupDefinitions().iterator();
+        while (i.hasNext())
+        {
+          XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) i.next();
+          String name = modelGroupDefinition.getQName(xsdSchema);
+          if (name != null)
+          {
+            items.add(name);
+          }
+        }
+      }
+      //      items = addExternalImportedGroups(items);
+      items = (Vector) sortList(items);
+    }
+    return items;
+  }
+
+  public static java.util.List sortList(java.util.List types)
+  {
+    try
+    {
+      java.util.Collections.sort(types); // performance?  n*log(n)
+    }
+    catch (Exception e)
+    {
+//      XSDEditorPlugin.getPlugin().getMsgLogger().write("Sort failed");
+    }
+    return types;
+  }
+
+  public String getModelGroup(XSDSchema relativeComponent)
+  {
+    if (xsdSchema != null)
+    {
+      updateExternalImportGlobals();
+      if (xsdSchema.getModelGroupDefinitions() != null)
+      {
+        Iterator i = xsdSchema.getModelGroupDefinitions().iterator();
+        while (i.hasNext()) // just get the first one
+        {
+          XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) i.next();
+          if (modelGroupDefinition.getQName(relativeComponent) != null)
+          {
+            return modelGroupDefinition.getQName(relativeComponent);
+          }
+        }
+      }
+
+      Vector items = new Vector();
+      items = addExternalImportedGroups(items);
+      if (items != null && items.size() > 0)
+      {
+        return items.get(0).toString();
+      }
+    }
+    return null; // for disabling menu
+  }
+
+  public void updateMapAfterDelete(XSDImport deletedNode)
+  {
+    String ns = deletedNode.getNamespace();
+    if (ns != null)
+    {
+      String prefix = getPrefix(ns, false);
+      if (prefix != null)
+      {
+        prefix = prefix.trim();
+      }
+      String xmlnsAttr = (prefix == "") ? "xmlns" : "xmlns:" + prefix;
+
+      if (prefix == "")
+      {
+        prefix = null;
+      }
+
+      if (xsdSchema != null)
+      {
+        Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+        map.remove(prefix);
+        Element schemaElement = xsdSchema.getElement();
+        schemaElement.removeAttribute(xmlnsAttr);
+      }
+    }
+  }
+
+  public List getPrefixedNames(String namespace, String localName)
+  {
+    List list = new ArrayList();
+    if (namespace == null)
+    {
+      namespace = "";    			
+    }
+    if (xsdSchema != null && localName != null)
+    {
+      List prefixes = getPrefixesForNamespace(namespace);
+      for (Iterator i = prefixes.iterator(); i.hasNext(); )
+      {
+      	String prefix = (String)i.next();
+      	if (prefix == null) prefix = "";
+        String prefixedName = prefix.length() > 0 ? prefix + ":" + localName : localName;
+        list.add(prefixedName);               
+      }
+      if (prefixes.size() == 0)
+      {
+        list.add(localName);
+      }
+    }
+    return list;
+  }
+  
+  protected List getPrefixesForNamespace(String namespace)
+  {
+    List list = new ArrayList();
+    Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+    for (Iterator iter = map.keySet().iterator(); iter.hasNext();)
+    {
+      String prefix = (String) iter.next();
+      Object value = map.get(prefix);
+      if (value != null && value.toString().equals(namespace))
+      {
+       list.add(prefix);
+      }
+    }
+    return list;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
new file mode 100644
index 0000000..3e71a8a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
@@ -0,0 +1,429 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.util;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+
+public class ViewUtility
+{
+  private static Font font;
+
+  public static Font getFont()
+  {
+    if (font == null)
+    {              
+      font = new Font(Display.getCurrent(), "ms sans serif", 8, SWT.NORMAL);  
+    }
+    return font;
+  }
+
+  public static void setFont(Font newFont)
+  {
+    font = newFont;
+  }
+
+  public static void setComposite(Composite comp)
+  {
+    // deprecated.  Remove later
+  }
+  public static Composite createComposite(Composite parent, int numColumns)
+  {
+    Composite composite = new Composite(parent, SWT.NONE);
+
+    composite.setFont(getFont());
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = numColumns;
+    composite.setLayout(layout);
+
+    GridData data = new GridData();
+    data.verticalAlignment = GridData.FILL;
+    data.horizontalAlignment = GridData.FILL;
+    composite.setLayoutData(data);
+    return composite;
+  }
+
+  public static Composite createComposite(Composite parent, int numColumns, boolean horizontalFill)
+  {
+    if (!horizontalFill)
+    {
+      createComposite(parent, numColumns);
+    }
+
+    Composite composite = new Composite(parent, SWT.NONE);
+
+    composite.setFont(getFont());
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = numColumns;
+    composite.setLayout(layout);
+
+    GridData data = new GridData();
+    data.verticalAlignment = GridData.FILL;
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    composite.setLayoutData(data);
+
+    return composite;
+  }
+
+  public static Composite createComposite(Composite parent, int numColumns, boolean horizontalFill, boolean verticalFill)
+  {
+    if (!horizontalFill && !verticalFill)
+    {
+      createComposite(parent, numColumns);
+    }
+
+    Composite composite = new Composite(parent, SWT.NONE);
+
+    composite.setFont(getFont());
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = numColumns;
+    composite.setLayout(layout);
+
+    GridData data = new GridData();
+    data.verticalAlignment = GridData.FILL;
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    data.grabExcessVerticalSpace = true;
+    composite.setLayoutData(data);
+
+    return composite;
+  }
+
+  public static Label createHorizontalFiller(Composite parent, int horizontalSpan) 
+  {
+    Label label = new Label(parent, SWT.LEFT);
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.horizontalSpan = horizontalSpan;
+    label.setLayoutData(data);
+    return label;
+  }
+
+  /**
+   * Helper method for creating labels.
+   */
+  public static Label createLabel(Composite parent, String text) 
+  {
+    Label label = new Label(parent, SWT.LEFT);
+    label.setText(text);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    label.setLayoutData(data);
+    return label;
+  }
+
+	public Label createLabel(Composite parent, int style, String text)
+	{
+		Label label = new Label(parent, style);
+//		setColor(label);
+		label.setText(text);
+
+		GridData data = new GridData();
+		data.horizontalAlignment = GridData.FILL;
+		label.setLayoutData(data);
+		return label;
+	}
+  
+  public static Label createLabel(Composite parent, String text, int alignment)
+  {
+    Label label = new Label(parent, SWT.LEFT);
+    label.setText(text);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.verticalAlignment = alignment;
+    label.setLayoutData(data);
+    return label;
+  }
+
+  /**
+   * Helper method for creating buttons.
+   */
+  public static Button createPushButton(Composite parent, String label) 
+  {
+    Button button = new Button(parent, SWT.PUSH);
+    button.setText(label);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    button.setLayoutData(data);
+
+    return button;
+  }
+
+  public static Table createTable(Composite parent)
+  {
+    Table table = new Table(parent, SWT.SINGLE | SWT.BORDER);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    table.setLayoutData(data);
+
+    return table;
+  }
+
+  /**
+   * Create radio button
+   */
+  public static Button createRadioButton(Composite parent, String label)
+  {
+    Button button = new Button(parent, SWT.RADIO);
+    button.setText(label);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    button.setLayoutData(data);
+
+    return button;
+  }
+
+  /**
+   * Helper method for creating check box
+   */
+  public static Button createCheckBox(Composite parent, String label) 
+  {
+    Button button = new Button(parent, SWT.CHECK);
+    button.setText(label);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    button.setLayoutData(data);
+    return button;
+  }
+
+  public static Combo createComboBox(Composite parent)
+  {
+    return createComboBox(parent, true);
+  }
+
+  public static Combo createComboBox(Composite parent, boolean isReadOnly)
+  {
+    int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
+
+    Combo combo = new Combo(parent, style);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    combo.setLayoutData(data);
+    return combo;
+  }
+
+  public static List createListBox(Composite parent, int width, boolean isMultiSelect)
+  {
+    int style = isMultiSelect ? SWT.MULTI : SWT.SINGLE;
+    List list = new List(parent, style | SWT.BORDER);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    data.widthHint = width;
+    list.setLayoutData(data);
+
+    return list;
+  }
+
+  public static List createListBox(Composite parent, int style)
+  {
+    List list = new List(parent, style);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.verticalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    data.grabExcessVerticalSpace = true;
+    list.setLayoutData(data);
+
+    return list;
+  }
+
+	public Text createTextField(Composite parent)
+	{
+		Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
+		GridData data = new GridData();
+		data.horizontalAlignment = GridData.FILL;
+		data.verticalAlignment = GridData.FILL;
+		data.grabExcessHorizontalSpace = true;
+		text.setLayoutData(data);
+//		text.addKeyListener(keyboardHandler);
+		return text;
+	}
+  
+  public static Text createTextField(Composite parent, int width)
+  {
+    Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    data.widthHint = width;
+    text.setLayoutData(data);
+
+    return text;
+  }
+
+  /**
+   * <code>createWrappedMultiTextField</code> creates a wrapped multitext field
+   *
+   * @param parent a <code>Composite</code> value
+   * @param width an <code>int</code> value
+   * @param numLines an <code>int</code> value representing number of characters in height
+   * @param verticalFill a <code>boolean</code> value
+   * @return a <code>Text</code> value
+   */
+  public static Text createWrappedMultiTextField(Composite parent, int width, int numLines, boolean verticalFill)
+  {
+    Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    if (verticalFill)
+    {
+      data.verticalAlignment = GridData.FILL;
+      data.grabExcessVerticalSpace = true;
+    }      
+    data.widthHint = width;
+    FontData[] fontData = getFont().getFontData();
+    // hack for now where on Windows, only 1 fontdata exists
+    data.heightHint = numLines * fontData[0].getHeight();
+    text.setLayoutData(data);
+
+    return text;
+  }
+
+  public static Text createMultiTextField(Composite parent, int width, int height, boolean verticalFill)
+  {
+    Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    if (verticalFill)
+    {
+      data.verticalAlignment = GridData.FILL;
+      data.grabExcessVerticalSpace = true;
+    }      
+    data.widthHint = width;
+    data.heightHint = height;
+    text.setLayoutData(data);
+
+    return text;
+  }
+
+  public static Group createGroup(Composite parent, int numColumns, String text, boolean verticalFill) 
+  {
+    Group group = new Group(parent, SWT.SHADOW_ETCHED_IN);
+    group.setText(text);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    if (verticalFill)
+    {
+      data.verticalAlignment = GridData.FILL;
+      data.grabExcessVerticalSpace = true;
+    }      
+    group.setLayoutData(data);
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = numColumns;
+    group.setLayout(layout);
+    return group;
+  }
+
+ public static Group createGroup(Composite parent, int numColumns, String text, boolean verticalFill, int alignment) 
+  {
+    Group group = new Group(parent, SWT.SHADOW_ETCHED_IN);
+    group.setText(text);
+
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.FILL;
+    data.grabExcessHorizontalSpace = true;
+    data.verticalAlignment = alignment;
+    if (verticalFill)
+    {
+      data.verticalAlignment = GridData.FILL;
+      data.grabExcessVerticalSpace = true;
+    }      
+    group.setLayoutData(data);
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = numColumns;
+    group.setLayout(layout);
+    return group;
+  }
+
+  public static Label createVerticalFiller(Composite parent, int verticalSpan) 
+  {
+    Label label = new Label(parent, SWT.LEFT);
+    label.setFont(getFont());
+
+    GridData data = new GridData();
+    data.verticalAlignment = GridData.FILL;
+    data.verticalSpan = verticalSpan;
+    label.setLayoutData(data);
+
+    return label;
+  }
+
+  /**
+   * Creates a grid data object that occupies vertical and horizontal
+   * space.
+   */
+  static public GridData createFill()
+  {
+    GridData gd= new GridData();
+    gd.horizontalAlignment= GridData.FILL;
+    gd.grabExcessHorizontalSpace= true;
+    gd.verticalAlignment= GridData.FILL;
+    gd.grabExcessVerticalSpace= true;
+    return gd;
+  }
+  /**
+   * Creates a grid data object that occupies horizontal space.
+   */
+  static public GridData createHorizontalFill()
+  {
+    GridData gd= new GridData();
+    gd.horizontalAlignment= GridData.FILL;
+    gd.grabExcessHorizontalSpace= true;
+    return gd;
+  }
+  /**
+   * Creates a grid data object that occupies vertical space.
+   */
+  static public GridData createVerticalFill()
+  {
+    GridData gd= new GridData();
+    gd.verticalAlignment= GridData.FILL;
+    gd.grabExcessVerticalSpace= true;
+    return gd;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
new file mode 100644
index 0000000..8d18a11
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
@@ -0,0 +1,1136 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.util;
+
+import java.util.ArrayList;
+
+import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+public class XSDDOMHelper
+{
+  public static final int LENGTH_FACET        =  1;
+  public static final int MIN_LENGTH_FACET    =  2;
+  public static final int MAX_LENGTH_FACET    =  3;
+  public static final int PATTERN_FACET       =  4;
+  public static final int ENUM_FACET          =  5;
+  public static final int WHITE_SPACE_FACET   =  6;
+
+  public static final int MAX_INCLUSIVE_FACET =  7;
+  public static final int MAX_EXCLUSIVE_FACET =  8;
+  public static final int MIN_INCLUSIVE_FACET =  9;
+  public static final int MIN_EXCLUSIVE_FACET =  10;
+
+  public static final int TOTAL_DIGITS_FACET     = 11;
+  public static final int FRACTION_DIGITS_FACET  = 12;
+
+  public static final int N_FACETS            = 13;
+
+  public static String[][] dataType =
+  {
+    //
+    // Table format:
+    // Type
+    //  Length, MinLength, MaxLength, Pattern, Enumeration,whiteSpace
+    //  MaxInclusive, MaxExclusive, MinInclusive, MinExclusive, TotalDigits, FractionDigits
+    //
+
+    // 0
+    { "anySimpleType",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 1
+    { "anyType",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+
+    // 2
+    { "anyURI",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 3
+    { "base64Binary",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 4
+    { "boolean",
+        "N", "N", "N", "Y", "N", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 5
+    { "byte",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 6
+    { "date",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 7
+    { "dateTime",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 8
+    { "decimal",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+
+    // 9
+    { "double",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 10
+    { "duration",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 11
+    { "ENTITY",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 12
+    { "ENTITIES",
+        "Y", "Y", "Y", "N", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 13
+    { "float",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 14
+    { "gDay",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 15
+    { "gMonth",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 16
+    { "gMonthDay",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 17
+    { "gYear",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 18
+    { "gYearMonth",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 19
+    { "hexBinary",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 20
+    { "ID",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 21
+    { "IDREF",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 22
+    { "IDREFS",
+        "Y", "Y", "Y", "N", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 23
+    { "int",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 24
+    { "integer",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 25
+    { "language",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 26
+    { "long",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 27
+    { "Name",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+
+    // 28
+    { "NCName",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 29
+    { "negativeInteger",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 30
+    { "NMTOKEN",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 31
+    { "NMTOKENS",
+        "Y", "Y", "Y", "N", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 32
+    { "nonNegativeInteger",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 33
+    { "nonPositiveInteger",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 34
+    { "normalizedString",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+
+    },
+
+    // 35
+    { "NOTATION",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+
+    },
+
+    // 36
+    { "positiveInteger",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 37
+    { "QName",
+        "N", "N", "N", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 38
+    { "short",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 39
+    { "string",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 40
+    { "time",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "N", "N",
+    },
+
+    // 41
+    { "token",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+        "N", "N", "N", "N", "N", "N",
+    },
+
+    // 42
+    { "unsignedByte",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 43
+    { "unsignedInt",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 44
+    { "unsignedLong",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+    // 45
+    { "unsignedShort",
+        "N", "N", "N", "Y", "Y", "Y",
+        "Y", "Y", "Y", "Y", "Y", "Y",
+    },
+
+  };
+
+  public static String XMLSchemaURI = "http://www.w3.org/2001/XMLSchema";
+
+  /**
+   * Constructor for XSDDOMHelper.
+   */
+  public XSDDOMHelper()
+  {
+    super();
+  }
+
+  public Node getChildNode(Element parent, String childName)
+  {
+/*    NodeList nodeList = parent.getElementsByTagNameNS(XMLSchemaURI, childName);
+    if (nodeList.getLength() > 0)
+      return nodeList.item(0);
+    return null;
+*/
+    NodeList list = null;
+    if (parent != null)
+    {
+      list = parent.getChildNodes();
+    }
+
+    if (list != null)
+    {
+      // Performance issue perhaps?
+      for (int i = 0; i < list.getLength(); i++)
+      {
+        if (list.item(i) instanceof Element)
+        {
+          if (list.item(i).getLocalName().equals(childName))
+          {
+            return list.item(i);
+          }
+        }
+      }
+    }
+    return null;
+  }
+
+  public static String SIMPLE_TYPE = "Simple";
+  public static String USER_SIMPLE_TYPE = "simpleType";
+  public static String USER_COMPLEX_TYPE = "complexType";
+/*
+  public void setElementType(Element element, String type)
+  {
+    Document doc = element.getOwnerDocument();
+    if (type.equals(SIMPLE_TYPE))
+    {
+      removeChild(element, USER_SIMPLE_TYPE);
+      removeChild(element, USER_COMPLEX_TYPE);
+      element.setAttribute("type","xsd:string");
+      return;
+    }
+    else if (type.equals(USER_SIMPLE_TYPE))
+    {
+      removeChild(element, USER_COMPLEX_TYPE);
+    }
+    else
+    {
+      removeChild(element, USER_SIMPLE_TYPE);
+    }
+    element.removeAttribute("type");
+    element.appendChild(doc.createElement("xsd:"+type));
+  }
+
+  public String getElementType(Element element)
+  {
+    String tagName = element.getLocalName();
+
+    if (tagName.equals(XSDConstants.ELEMENT_ELEMENT_TAG) ||
+        tagName.equals(XSDConstants.ATTRIBUTE_ELEMENT_TAG))
+    {
+      if (element.hasAttribute("type"))
+      {
+        return SIMPLE_TYPE;
+      }
+      NodeList nodes = element.getElementsByTagNameNS(XMLSchemaURI, USER_SIMPLE_TYPE);
+      if (nodes.getLength() > 0)
+      {
+        return USER_SIMPLE_TYPE;
+      }
+      nodes = element.getElementsByTagNameNS(XMLSchemaURI, USER_COMPLEX_TYPE);
+      if (nodes.getLength() > 0)
+      {
+        return USER_COMPLEX_TYPE;
+      }
+    }
+    return "";
+  }
+*/
+  public void removeDerivedByElement(Element element)
+  {
+    removeChild(element, XSDConstants.RESTRICTION_ELEMENT_TAG);
+    removeChild(element, XSDConstants.EXTENSION_ELEMENT_TAG);
+  }
+
+  public String getBaseType(Element element) // for SimpleContent and ComplexContent
+  {
+    Node restrictionChild = getChildNode(element, "restriction");
+    Node extensionChild = getChildNode(element, "extension");
+    String baseType = "";
+    if (restrictionChild != null)
+    {
+      if (restrictionChild instanceof Element)
+      {
+        baseType = ((Element)restrictionChild).getAttribute("base");
+//        String prefix = element.getPrefix();
+//        if (prefix != null && prefix.length() > 0)
+//        {
+//          baseType = baseType.substring(baseType.indexOf(prefix) + prefix.length() + 1);
+//        }
+      }
+    }
+    else if (extensionChild != null) // should be one or the other
+    {
+      if (extensionChild instanceof Element)
+      {
+        baseType = ((Element)extensionChild).getAttribute("base");
+//        String prefix = element.getPrefix();
+//        if (prefix != null && prefix.length() > 0)
+//        {
+//          baseType = baseType.substring(baseType.indexOf(prefix) + prefix.length() + 1);
+//        }
+      }
+    }
+    return baseType;
+  }
+
+  public void setDerivedByBaseType(Element element, String derivedByType, String type)
+  {
+    Document doc = element.getOwnerDocument();
+
+    Element derivedByElement = getDerivedByElement(element);
+    if (derivedByElement != null)
+    {
+      derivedByElement.setAttribute("base", type);
+    }
+    else  // there really should be one already...base is required.
+    {
+      Element newElement = doc.createElement(derivedByType);
+      newElement.setAttribute("base", type);
+      element.appendChild(newElement);
+    }
+  }
+
+  public void changeDerivedByType(Element element, String derivedByType, String type)
+  {
+    Document doc = element.getOwnerDocument();
+
+    String prefix = element.getPrefix();
+    prefix = prefix == null ? "" : prefix + ":";
+
+    Element derivedByElement = getDerivedByElement(element);
+    
+    if (derivedByElement != null && derivedByElement.getLocalName().equals(derivedByType))
+    {
+    	return; // it's already the derived by type
+    }
+    Element newNode;
+  	if (derivedByType.equals("restriction"))
+  	{
+    	newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
+    }
+    else
+    {
+    	newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.EXTENSION_ELEMENT_TAG);
+    }
+	
+    newNode.setAttribute("base", type);
+
+    if (derivedByElement != null)
+    {
+      if (derivedByElement.hasChildNodes())
+      {        
+        NodeList nodes = derivedByElement.getChildNodes();
+        // use clones so we don't have a refresh problem
+        for (int i = 0; i < nodes.getLength(); i++)
+        {
+          Node node = nodes.item(i);       
+          newNode.appendChild(node.cloneNode(true));
+        }
+      }
+	  element.replaceChild(newNode, derivedByElement);
+    }
+    else 
+	{
+		Element parent = (Element) element.getParentNode();				// get back to complexType
+        NodeList nodes = parent.getChildNodes();
+		ArrayList nodeSaveList = new ArrayList();
+		
+		// save children. (nodes turns out to be the same object as parent;
+		// deleting them from parent will delete them from nodes.)
+        for (int i = 0; i < nodes.getLength(); i++)			
+        {
+          Node node = nodes.item(i);      
+		  nodeSaveList.add(node);
+        }
+
+        // remove children so we can surround them by complexContent
+        for (int i = 0; i < nodeSaveList.size(); i++)			
+        {
+          Node node = (Node) nodeSaveList.get(i);      
+          parent.removeChild(node);
+        }
+		
+		// build a complexContent element
+		Element complexContent = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.COMPLEXCONTENT_ELEMENT_TAG);
+		parent.appendChild(complexContent);					// insert into complexType
+		complexContent.appendChild(newNode);				// insert derivation type
+        for (int i = 0; i < nodeSaveList.size(); i++)			// insert children previously of complexType
+        {
+          Node node = (Node) nodeSaveList.get(i);       
+          newNode.appendChild(node.cloneNode(true));
+        }
+		
+		parent.appendChild(complexContent);
+		formatChild(complexContent);
+    }
+  }
+
+  public void setSimpleContentType(Element element, String type)
+  {
+    String contentTypeName = element.getLocalName();
+
+    if (contentTypeName.equals(XSDConstants.UNION_ELEMENT_TAG))
+    {
+      element.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, type);
+    }
+    else if (contentTypeName.equals(XSDConstants.LIST_ELEMENT_TAG))
+    {
+      element.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, type);
+    }
+    else if (contentTypeName.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
+    {
+      element.setAttribute(XSDConstants.BASE_ATTRIBUTE, type);
+    }
+  }
+
+  public void removeSimpleTypeContent(Element element)
+  {
+    String contentTypeName = element.getLocalName();
+    if (contentTypeName.equals(XSDConstants.UNION_ELEMENT_TAG))
+    {
+      element.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
+    }
+    else if (contentTypeName.equals(XSDConstants.LIST_ELEMENT_TAG))
+    {
+      element.removeAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
+    }
+    else if (contentTypeName.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
+    {
+      element.removeAttribute(XSDConstants.BASE_ATTRIBUTE);
+    }
+  }
+
+  public String getDerivedByName(Element element)
+  {
+    Node restrictionChild = getChildNode(element, "restriction");
+    Node extensionChild = getChildNode(element, "extension");
+    if (restrictionChild != null)
+    {
+      return "restriction";
+    }
+    if (extensionChild != null)
+    {
+      return "extension";
+    }
+    return "";
+  }
+
+  /**
+   * Get the derived by node given the complexContent or simpleContent node
+   */
+  public Element getDerivedByElement(Element element)
+  {
+    Node restrictionChild = getChildNode(element, "restriction");
+    Node extensionChild = getChildNode(element, "extension");
+    if (restrictionChild != null)
+    {
+      if (restrictionChild instanceof Element)
+      {
+        return (Element)restrictionChild;
+      }
+    }
+    
+    if (extensionChild != null)
+    {
+      if (extensionChild instanceof Element)
+      {
+        return (Element)extensionChild;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Get the derived by node given the ComplexType node
+   * Returns the first one, if say, the INVALID schema has more than one
+   */
+  public Element getDerivedByElementFromComplexType(Element element)
+  {
+    NodeList nl = element.getChildNodes();
+    int j = 0;
+    for (j = 0; j < nl.getLength(); j++)
+    {
+      Node aNode = nl.item(j);
+      if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+      {
+        break; 
+      }
+      else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+      {
+        break;
+      }
+    }
+    Element derivedByNode = getDerivedByElement((Element)nl.item(j));
+    return derivedByNode;
+  }
+
+  /**
+   * Get the content model given the ComplexType node
+   * Returns the first one, if say, the INVALID schema has more than one
+   */
+  public Element getContentModelFromParent(Element element)
+  {
+    NodeList nl = element.getChildNodes();
+    int j = 0;
+    boolean modelExists = false;
+    int length = nl.getLength();
+    for (j = 0; j < length; j++)
+    {
+      Node aNode = nl.item(j);
+      if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
+      {
+        modelExists = true;
+        break; 
+      }
+      else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
+      {
+        modelExists = true;
+        break;
+      }
+      else if (inputEquals(aNode, XSDConstants.SEQUENCE_ELEMENT_TAG, false))
+      {
+        modelExists = true;
+        break;
+      }
+      else if (inputEquals(aNode, XSDConstants.CHOICE_ELEMENT_TAG, false))
+      {
+        modelExists = true;
+        break;
+      }
+      else if (inputEquals(aNode, XSDConstants.ALL_ELEMENT_TAG, false))
+      {
+        modelExists = true;
+        break;
+      }
+    }
+    if (!modelExists)
+    {
+      return null;
+    }
+
+    Element derivedByNode = (Element)nl.item(j);
+    return derivedByNode;
+  }
+
+  /**
+   * 
+   */
+  public void changeContentModel(Element complexTypeElement, String contentModel, Element sequenceChoiceOrAllElement)
+  {
+    Document doc = complexTypeElement.getOwnerDocument();
+
+    String prefix = complexTypeElement.getPrefix();
+    prefix = prefix == null ? "" : prefix + ":";
+    
+    Element contentModelElement = getContentModelFromParent(complexTypeElement);
+
+    if (contentModelElement.getLocalName().equals(contentModel))
+    {
+      return; // it's already the content model 
+    }
+    Element newNode;
+    newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
+
+    if (contentModelElement.hasChildNodes())
+    {        
+      NodeList nodes = contentModelElement.getChildNodes();
+      // use clones so we don't have a refresh problem
+      for (int i = 0; i < nodes.getLength(); i++)
+      {
+        Node node = nodes.item(i);
+        if (node instanceof Element)
+        {
+          if (node.getLocalName().equals(XSDConstants.ANNOTATION_ELEMENT_TAG))
+          {
+            if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
+                XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
+                XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.ALL_ELEMENT_TAG, false)))
+            {
+              newNode.appendChild(node.cloneNode(true));
+            }
+          }
+          else if (node.getLocalName().equals(XSDConstants.RESTRICTION_ELEMENT_TAG) ||
+                    node.getLocalName().equals(XSDConstants.EXTENSION_ELEMENT_TAG))
+          {
+            newNode.appendChild(node.cloneNode(true));
+            if (sequenceChoiceOrAllElement != null)
+            {
+              node.appendChild(sequenceChoiceOrAllElement);
+            }
+          }
+          else
+          {
+            removeNodeAndWhitespace(node);
+          }
+        }
+        else
+        {
+          newNode.appendChild(node.cloneNode(true)); 
+        }
+      }
+    }
+    complexTypeElement.replaceChild(newNode, contentModelElement);
+  }
+
+  public Element cloneElement(Element parent, Element sourceNode)
+  {
+    Document doc = parent.getOwnerDocument();
+    String prefix = parent.getPrefix();
+    prefix = prefix == null ? "" : prefix + ":";
+    
+    Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + sourceNode.getLocalName());
+
+    if (sourceNode.hasChildNodes())
+    {        
+      NodeList nodes = sourceNode.getChildNodes();
+      // use clones so we don't have a refresh problem
+      for (int i = 0; i < nodes.getLength(); i++)
+      {
+        Node node = nodes.item(i);
+        newNode.appendChild(node.cloneNode(true));
+      }
+    }
+    return newNode;
+//    parent.replaceChild(newNode, sourceNode);
+  }
+
+  public boolean hasElementChildren(Element parentNode)
+  {
+    boolean hasChildrenElements = false;
+    if (parentNode != null && parentNode.hasChildNodes())
+    {
+      NodeList nodes = parentNode.getChildNodes();
+      for (int i = 0; i < nodes.getLength(); i++)
+      {
+        if (nodes.item(i) instanceof Element)
+        {
+          hasChildrenElements = true;
+          break;
+        }
+      }
+    }
+    return hasChildrenElements;
+  }
+
+  public void removeChild(Element node, String childName)
+  {
+    Node child = getChildNode(node,childName);
+    if (child != null)
+    {
+      node.removeChild(child);
+    }
+  }
+
+  public static boolean isFacet(Object obj)
+  {
+    if (XSDDOMHelper.inputEquals(obj, XSDConstants.LENGTH_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.MINLENGTH_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.MAXLENGTH_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.WHITESPACE_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.MAXINCLUSIVE_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.MININCLUSIVE_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.MINEXCLUSIVE_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.TOTALDIGITS_ELEMENT_TAG, false) ||
+        XSDDOMHelper.inputEquals(obj, XSDConstants.FRACTIONDIGITS_ELEMENT_TAG, false))
+    {
+      return true;
+    }
+    return false;
+  }
+
+  public static void removeNodeAndWhitespace(Node node)
+  {
+    Node parentNode = node.getParentNode();
+    
+    Node nextElement = getNextElementNode(node);
+    Node previousElement = getPreviousElementNode(node);
+
+    Node nextSibling = node.getNextSibling();
+    if (nextSibling instanceof Text)
+    {
+      parentNode.removeChild(nextSibling);
+    }
+
+    if (parentNode != null)
+    {
+		  parentNode.removeChild(node);
+    }
+
+    if (nextElement != null)
+    {
+			formatChild(nextElement);
+    }
+
+		if (previousElement != null)
+		{
+			formatChild(previousElement);
+		}
+  }
+
+	public static void formatChild(Node child)
+	{
+    if (child instanceof IDOMNode)
+    {
+      IDOMModel model = ((IDOMNode)child).getModel();
+      try
+      {
+        // tell the model that we are about to make a big model change
+        model.aboutToChangeModel();
+        
+	      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
+		    formatProcessor.formatNode(child);
+      }
+      finally
+      {
+        // tell the model that we are done with the big model change
+        model.changedModel(); 
+      }
+    }
+  }
+  
+  public static Node getLastElementNode(Node parent)
+  {
+    Node lastChild = parent.getLastChild();
+    
+    while (!(lastChild instanceof Element) && lastChild != null)
+    {
+      lastChild = lastChild.getPreviousSibling();
+    }
+    return lastChild;
+  }
+
+  public static Node getNextElementNode(Node node)
+  {
+    Node next = node.getNextSibling();
+    
+    while (!(next instanceof Element) && next != null)
+    {
+      next = next.getNextSibling();
+    }
+    if (next instanceof Text)
+    {
+    	return null;
+    }
+    return next;
+  }
+
+	public static Node getPreviousElementNode(Node node)
+	{
+		Node previous = node.getPreviousSibling();
+    
+		while (!(previous instanceof Element) && previous != null)
+		{
+			previous = previous.getPreviousSibling();
+		}
+    if (previous instanceof Text)
+    {
+      return null;
+    }
+    return previous;
+	}
+
+  public static void moveNode(Node referenceNode, Node nodeToMove, boolean isBefore)
+  {
+    // this assumes that the referenceNode and node to move have the same parent
+    Node parent = referenceNode.getParentNode();
+
+    // Get reference nodes next and previous text strings
+    String referenceNodeNextString = "";
+    String referenceNodePreviousString = "";
+    if (referenceNode != null)
+    {
+      Node referenceNodeNextSibling = referenceNode.getNextSibling();
+      Node referenceNodePreviousSibling = referenceNode.getPreviousSibling();
+      if (referenceNodeNextSibling instanceof Text)
+      {
+        referenceNodeNextString = ((Text)referenceNodeNextSibling).getData();
+      }
+      if (referenceNodePreviousSibling instanceof Text)
+      {
+        referenceNodePreviousString = ((Text)referenceNodePreviousSibling).getData();
+      }
+    }
+    // Get the dragged node's next and previous text strings
+    Node nodeToMoveNextSibling = nodeToMove.getNextSibling();
+    Node nodeToMovePreviousSibling = nodeToMove.getPreviousSibling();
+    Node nodeToMoveNextText = null;
+    String nodeToMoveNextString = "";
+    String nodeToMovePreviousString = "";
+    if (nodeToMoveNextSibling instanceof Text)
+    {
+      nodeToMoveNextText = (Text)nodeToMoveNextSibling;
+      nodeToMoveNextString = ((Text)nodeToMoveNextSibling).getData();
+    }
+    if (nodeToMovePreviousSibling instanceof Text)
+    {
+      nodeToMovePreviousString = ((Text)nodeToMovePreviousSibling).getData();
+    }
+
+    // Get the last element's next and previous text strings
+    Node lastElement = getLastElementNode(parent);
+    Node lastElementNextSibling = lastElement.getNextSibling();
+    Node lastElementPreviousSibling = lastElement.getPreviousSibling();
+    String lastElementNextString = "";
+    String lastElementPreviousString = "";		
+    if (lastElementNextSibling instanceof Text)
+    {
+      lastElementNextString = ((Text)lastElementNextSibling).getData();
+    }
+    if (lastElementPreviousSibling instanceof Text)
+    {
+      lastElementPreviousString = ((Text)lastElementPreviousSibling).getData();
+    }
+
+    boolean isLastElement = false; // whether the last element is dragged/moved
+    if (lastElement == nodeToMove)
+    {
+      isLastElement = true;
+    }
+		
+    // defect 221056 this test is required or else the node will
+    // be removed from the tree and the insert will fail
+    if (referenceNode != nodeToMove)
+    {
+      parent.removeChild(nodeToMove);
+      if (referenceNode != null)
+      {
+        if (!isBefore)
+        {
+          referenceNode = getNextElementNode(referenceNode);
+//        referenceNode = referenceNode.getNextSibling();
+        }
+      }
+
+      if (referenceNode != null)
+      {
+        insertBefore(nodeToMove, referenceNode);
+      }
+      else
+      {
+        parent.appendChild(nodeToMove);
+      }
+
+      Node newLastElement = getLastElementNode(parent);
+      if (referenceNode != null)
+      {
+        if (referenceNode != newLastElement) 
+        {
+          if (!isLastElement)
+          {
+            setTextData(referenceNode, nodeToMoveNextString, nodeToMovePreviousString);
+          }
+        }
+        setTextData(nodeToMove, referenceNodeNextString, referenceNodePreviousString);
+      }
+      // Remove the empty space left by the dragged node
+      if (nodeToMoveNextText != null)
+      {
+    	  parent.removeChild(nodeToMoveNextText);
+      }
+      // special case for the last element
+      if ((newLastElement == nodeToMove) || isLastElement)
+      {
+        setTextData(newLastElement, lastElementNextString, lastElementPreviousString);
+      }
+    }
+  }
+
+  public static void setTextData(Node target, String nextText, String previousText)
+  {
+    Node parent = target.getParentNode();
+    Node nextSibling = target.getNextSibling();
+    Node previousSibling = target.getPreviousSibling();
+    if (nextSibling instanceof Text)
+    {
+      ((Text)nextSibling).setData(nextText);	
+    }
+    if (nextSibling == null || nextSibling instanceof Element)
+    {
+      Text textNode = parent.getOwnerDocument().createTextNode("");
+      textNode.setData(nextText);
+      if (nextSibling != null)
+      {
+        parent.insertBefore(textNode, nextSibling);
+      }
+      else
+      {
+        parent.insertBefore(textNode, getNextElementNode(target));
+      }
+    }				
+
+    if (previousSibling instanceof Text)
+    {
+      ((Text)previousSibling).setData(previousText);
+    }
+    if (previousSibling == null || previousSibling instanceof Element)
+    {
+      Text textNode = parent.getOwnerDocument().createTextNode("");
+      textNode.setData(previousText);
+      parent.insertBefore(textNode, target);
+    }				
+  }
+
+  public static void insertBefore(Node nodeToInsert, Node referenceNode)
+  {
+    // this assumes that the referenceNode and node to move have the same parent
+    Node parent = referenceNode.getParentNode();
+    parent.insertBefore(nodeToInsert, referenceNode);
+  }
+
+  public static boolean inputEquals(Object input, String tagname, boolean isRef)
+  {
+    if (input instanceof Element)
+    {
+      Element element = (Element) input;
+      if (element.getLocalName().equals(tagname))
+      {
+        boolean refPresent = element.hasAttribute("ref");
+
+        return refPresent == isRef;
+      }
+    }
+    return false;
+  }
+
+  public static void updateElementToNotAnonymous(Element element)
+  {
+    if (element != null)
+    {
+      NodeList children = element.getChildNodes();
+      if (children != null)
+      {
+        for (int i = 0; i < children.getLength(); i++)
+        {
+          Node node = (Node)children.item(i);
+          if (node instanceof Element)
+          {
+            if (node.getLocalName().equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG) ||
+                node.getLocalName().equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
+            {
+              XSDDOMHelper.removeNodeAndWhitespace(node);
+              i=0;
+            }
+          }
+        }
+      }
+    }
+  }
+  
+  public static boolean isAttributeRef(Element ct, String attrName, String ns)
+  {
+    NodeList list = ct.getChildNodes();
+    int length = list.getLength();
+    for (int i = 0; i < length; i++)
+    {
+      if (list.item(i) instanceof Element)
+      {
+        Element aChild = (Element)list.item(i);
+        if (aChild.getLocalName().equals(XSDConstants.ATTRIBUTE_ELEMENT_TAG))
+        {
+          if (aChild.hasAttribute(XSDConstants.REF_ATTRIBUTE))
+          {
+            String refValue = aChild.getAttribute(XSDConstants.REF_ATTRIBUTE);
+            if (refValue.equals(attrName))
+            {
+              return true;
+            }
+          }
+        }
+      }
+      
+    }
+    
+    return false;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaHelper.java
new file mode 100644
index 0000000..a57e619
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaHelper.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.util;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.xsd.XSDConcreteComponent;
+
+// TODO: KC remove this
+
+public class XSDSchemaHelper
+{
+  /**
+   * Constructor for XSDSchemaHelper.
+   */
+  public XSDSchemaHelper()
+  {
+    super();
+  }
+  
+  public static void updateElement(XSDConcreteComponent concreteComp)
+  {
+    try
+    {
+      concreteComp.updateElement();
+    }
+    catch (Exception e)
+    {
+      for (Iterator containments = concreteComp.eClass().getEAllReferences().iterator(); containments.hasNext(); )
+      {
+        EReference eReference = (EReference)containments.next();
+        if (eReference.isContainment())
+        {
+          if (eReference.isMany())
+          {
+            for (Iterator objects = ((Collection)concreteComp.eGet(eReference)).iterator(); objects.hasNext(); )
+            {
+              XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)objects.next();
+              try
+              {
+                xsdConcreteComponent.updateElement();
+              }
+              catch (Exception ex) {}
+            }
+          }
+          else
+          {
+            XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)concreteComp.eGet(eReference);
+            if (xsdConcreteComponent != null)
+            {
+              try
+              {
+                xsdConcreteComponent.updateElement();
+              }
+              catch (Exception ex) {}
+            }
+          }
+        }
+      }
+    }
+  }    
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
new file mode 100644
index 0000000..240b0bd
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.validation;
+
+import org.eclipse.wst.validation.internal.provisional.ValidationFactory;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator;
+
+/**
+ * This performs the as-you-type validation
+ * @author Mark Hutchinson
+ *
+ */
+public class DelegatingSourceValidatorForXSD extends DelegatingSourceValidator
+{                                                
+  final private static String VALIDATOR_CLASS = "org.eclipse.wst.xsd.ui.internal.validation.Validator"; 
+
+  public DelegatingSourceValidatorForXSD()
+  { super();
+  }
+  
+  protected IValidator getDelegateValidator()
+  {
+    try
+    { return ValidationFactory.instance.getValidator(VALIDATOR_CLASS);
+    }
+    catch (Exception e)
+    { //
+    }
+    return null;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java
new file mode 100644
index 0000000..eba2c64
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.widgets;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+
+
+/**
+ * Dialog to help define a list of enumerations
+ * for a join. This might be replaced once we know how to
+ * initiate a drag tracker
+ */
+
+public class EnumerationsDialog extends org.eclipse.jface.dialogs.Dialog
+{
+  public EnumerationsDialog(Shell shell)
+  {
+    super(shell);
+  }
+
+  protected void configureShell(Shell shell)
+  {
+    super.configureShell(shell);
+    shell.setText(XSDEditorPlugin.getXSDString("_UI_ENUMERATIONS_DIALOG_TITLE"));
+  }
+
+  protected void buttonPressed(int buttonId)
+  {
+    if (buttonId == Dialog.OK)
+    {
+      text = textField.getText();
+      delimiter = delimiterField.getText();
+      isPreserve = preserveWhitespace.getSelection();
+    }
+    super.buttonPressed(buttonId);
+  }
+
+  private String text, delimiter;
+  private boolean isPreserve;
+  public String getText() { return text; }
+  public String getDelimiter() { return delimiter; }
+  public boolean isPreserveWhitespace() { return isPreserve; }
+
+  private Text textField;
+  private Button preserveWhitespace;
+  private Combo delimiterField;
+  //
+  // Create the controls
+  //
+  public Control createDialogArea(Composite parent)
+  {
+    Control[] tabOrder = new Control[3];
+  	int tabIndex = 0;
+    Composite client = (Composite)super.createDialogArea(parent);
+    GridLayout layout = (GridLayout)client.getLayout();
+    layout.numColumns = 2;
+    client.setLayout(layout); 
+
+    textField = ViewUtility.createWrappedMultiTextField(client, 400, 20, true);
+    GridData gd = (GridData) textField.getLayoutData();
+    gd.horizontalSpan = 2;
+    tabOrder[tabIndex++] = textField;
+
+    ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_DELIMITER_CHAR"));
+    delimiterField = ViewUtility.createComboBox(client, false);
+    gd = (GridData) delimiterField.getLayoutData();
+    gd.grabExcessHorizontalSpace = false;
+    gd.horizontalAlignment = GridData.BEGINNING;
+    gd.widthHint = 30;
+    tabOrder[tabIndex++] = delimiterField;
+
+    // add default delimiters
+    delimiterField.add(":");
+    delimiterField.add(",");
+    delimiterField.add(" ");
+    // set the current one to be ','
+    delimiterField.setText(",");
+
+    preserveWhitespace = ViewUtility.createCheckBox(client, XSDEditorPlugin.getXSDString("_UI_LABEL_PRESERVE_WHITESPACE"));
+    gd = (GridData) preserveWhitespace.getLayoutData();
+    gd.horizontalSpan = 2;
+    tabOrder[tabIndex++] = preserveWhitespace;
+    
+    client.setTabList(tabOrder);
+
+    return client;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/SetBaseTypeDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/SetBaseTypeDialog.java
new file mode 100644
index 0000000..21c32ab
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/SetBaseTypeDialog.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.widgets;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+
+
+
+public class SetBaseTypeDialog extends Dialog implements SelectionListener
+{
+  protected Combo baseTypeCombo;
+  protected Combo derivedByCombo;
+  protected XSDSchema xsdSchema;
+  protected Element element;  // the complex type element
+  private String type = "";
+  private String derivedByString = "";
+  
+  /**
+   * Constructor for SetBaseTypeDialog.
+   * @param arg0
+   */
+  public SetBaseTypeDialog(Shell arg0, XSDSchema xsdSchema, Element element)
+  {
+    super(arg0);
+    this.xsdSchema = xsdSchema;
+    this.element = element;
+  }
+
+  protected void configureShell(Shell shell)
+  {
+    super.configureShell(shell);
+    shell.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_BASE_TYPE"));
+  }
+
+
+  protected void buttonPressed(int buttonId)
+  {
+    if (buttonId == Dialog.OK)
+    {
+      type = baseTypeCombo.getText();
+      derivedByString = derivedByCombo.getText();
+    }
+    super.buttonPressed(buttonId);
+  }
+  
+  public String getBaseType()
+  {
+    return type;
+  }
+
+  public String getDerivedBy()
+  {
+    return derivedByString;
+  }
+  
+  public void setCurrentBaseType(String type)
+  {
+    this.type = type;
+  }
+  
+  public void setCurrentDerivedBy(String derivedByString)
+  {
+    this.derivedByString = derivedByString;
+  }
+
+  //
+  // Create the controls
+  //
+  public Control createDialogArea(Composite parent)
+  {
+    Composite nameComposite = (Composite)super.createDialogArea(parent);
+    GridLayout layout = (GridLayout)nameComposite.getLayout();
+    layout.numColumns = 2;
+    nameComposite.setLayout(layout); 
+
+    ViewUtility.createLabel(nameComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON"));
+    baseTypeCombo = ViewUtility.createComboBox(nameComposite, true); // readonly
+    baseTypeCombo.addSelectionListener(this);
+    
+    ViewUtility.createLabel(nameComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY")); 
+    derivedByCombo = ViewUtility.createComboBox(nameComposite, true); // readonly
+
+    derivedByCombo.add(XSDConstants.EXTENSION_ELEMENT_TAG);
+    derivedByCombo.add(XSDConstants.RESTRICTION_ELEMENT_TAG);
+    derivedByCombo.setText(derivedByString);
+    initializeBaseTypeCombo();
+
+    if (type.equals(""))
+    {
+      derivedByCombo.setText("");
+      derivedByCombo.setEnabled(false);
+    }
+        
+    return nameComposite;
+  }
+
+  private void initializeBaseTypeCombo()
+  {
+    ArrayList list = new ArrayList();
+    TypesHelper helper = new TypesHelper(xsdSchema);
+
+    String prefix = helper.getPrefix(xsdSchema.getTargetNamespace(), true);
+
+    list.add("");
+    list.addAll(helper.getBuiltInTypeNamesList());
+    list.addAll(helper.getUserSimpleTypeNamesList());
+    list.addAll(helper.getUserComplexTypeNamesList());
+
+    // remove the current CT from the list
+    list.remove(prefix + element.getAttribute("name"));
+
+    baseTypeCombo.removeAll();
+    for (int i = 0; i < list.size(); i++)
+    {
+      baseTypeCombo.add(list.get(i).toString());
+    }
+    baseTypeCombo.setText(type);
+    handleBaseTypeComboChange();
+  }
+  
+  private void handleBaseTypeComboChange()
+  {
+    String tempChoice = baseTypeCombo.getText();
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    if (helper.getBuiltInTypeNamesList().contains(tempChoice) ||
+        helper.getUserSimpleTypeNamesList().contains(tempChoice))
+    {
+      derivedByCombo.setText(XSDConstants.EXTENSION_ELEMENT_TAG);
+      derivedByCombo.setEnabled(false);
+    }
+    else if (helper.getUserComplexTypeNamesList().contains(tempChoice))
+    {
+      derivedByCombo.setEnabled(true); 
+    }
+    else
+    {
+      derivedByCombo.setText("");
+      derivedByCombo.setEnabled(false); 
+    }
+  }
+
+  public void widgetSelected(SelectionEvent e)
+  {
+    if (e.widget == baseTypeCombo)
+    {
+      handleBaseTypeComboChange();
+    }
+    
+  }
+
+  public void widgetDefaultSelected(SelectionEvent e)
+  {
+    
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
new file mode 100644
index 0000000..e5b6bdc
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
@@ -0,0 +1,335 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.widgets;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.xsd.XSDSchema;
+
+public class TypeSection
+{
+  /**
+   * Constructor for TypeSection.
+   * @param parent
+   */
+  public TypeSection(Composite parent)
+  {
+  }
+
+  protected Button  simpleType;
+  protected Button  userSimpleType;
+  protected Button  userComplexType;
+  protected Button  noneRadio;
+  protected Combo   typeList;
+  protected Combo   derivedByCombo;
+  protected boolean showUserComplexType = true;
+  protected boolean showUserSimpleType  = true;
+  protected boolean showNone            = false;
+  protected boolean showDerivedBy       = false;
+  protected String  derivedByChoices[]  = { "restriction", "extension" };
+  public final int  NONE                = 1;
+  public final int  BUILT_IN            = 2;
+  public final int  SIMPLE              = 3;
+  public final int  COMPLEX             = 4;
+
+  String            sectionTitle        = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
+  String            currentObjectUuid   = "";
+
+  /*
+   * @see FlatPageSection#createClient(Composite, WidgetFactory)
+   */
+  public Composite createClient(Composite parent)
+  {
+    Composite client = new Composite(parent, SWT.NONE);
+    GridLayout gl = new GridLayout(1, true);
+    gl.verticalSpacing = 0;
+    client.setLayout(gl);
+
+    if (showNone)
+    {
+      noneRadio = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_NONE"));
+      WorkbenchHelp.setHelp(noneRadio, XSDEditorContextIds.XSDE_TYPE_HELPER_NONE);
+    }
+
+    simpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_BUILT_IN_SIMPLE_TYPE"));
+    WorkbenchHelp.setHelp(simpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_BUILT_IN);
+
+    if (showUserSimpleType)
+    {
+      userSimpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_SIMPLE_TYPE"));
+      WorkbenchHelp.setHelp(userSimpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE);
+    }
+
+    if (showUserComplexType)
+    {
+      userComplexType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_COMPLEX_TYPE"));
+      WorkbenchHelp.setHelp(userComplexType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX);
+    }
+
+    //	  typeList = utility.createComboBox(client);
+    //	  WorkbenchHelp.setHelp(typeList, XSDEditorContextIds.XSDE_TYPE_HELPER_TYPE);
+    //    utility.createHeadingLabel(client, "Type",null);
+
+    if (showDerivedBy)
+    {
+      Composite derivedByComposite = ViewUtility.createComposite(client, 2);
+      ViewUtility.createLabel(derivedByComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY"));
+      derivedByCombo = ViewUtility.createComboBox(derivedByComposite);
+      populateDerivedByCombo();
+      WorkbenchHelp.setHelp(derivedByCombo, XSDEditorContextIds.XSDE_SIMPLE_CONTENT_DERIVED);
+      derivedByCombo.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_DERIVED_BY"));
+    }
+    // Set the default selection
+    if (showNone)
+    {
+      //		noneRadio.setSelection(true);
+      //		typeList.setEnabled(false);
+    }
+    else
+    {
+      simpleType.setSelection(true);
+    }
+    return client;
+  }
+
+  public void setIsDerivedBy(boolean derive)
+  {
+    if (derive)
+    {
+      sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE");
+    }
+    else
+    {
+      sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
+    }
+    //	setHeaderText(sectionTitle);
+  }
+
+  /**
+   * Set to true if called by Complex Type & Simple Type
+   */
+  public void setShowDerivedBy(boolean derive)
+  {
+    showDerivedBy = derive;
+  }
+
+  /**
+   * Gets the derivedByField
+   * @return Returns a Button
+   */
+  public Combo getDerivedByCombo()
+  {
+    return derivedByCombo;
+  }
+
+  /**
+   * Gets the noneRadio.
+   * @return Returns a Button
+   */
+  public Button getNoneRadio()
+  {
+    return noneRadio;
+  }
+
+  /**
+   * Gets the simpleType.
+   * @return Returns a Button
+   */
+  public Button getSimpleType()
+  {
+    return simpleType;
+  }
+
+  /**
+   * Gets the userComplexType.
+   * @return Returns a Button
+   */
+  public Button getUserComplexType()
+  {
+    return userComplexType;
+  }
+
+  /**
+   * Gets the userSimpleType.
+   * @return Returns a Button
+   */
+  public Button getUserSimpleType()
+  {
+    return userSimpleType;
+  }
+
+  /**
+   * Gets the typeList.
+   * @return Returns a CCombo
+   */
+  public Combo getTypeList()
+  {
+    return typeList;
+  }
+
+  /**
+   * Populate combo box with built-in simple types
+   */
+  public void populateBuiltInType(XSDSchema xsdSchema)
+  {
+    getTypeList().removeAll();
+    List items = getBuiltInTypeNamesList(xsdSchema);
+    for (int i = 0; i < items.size(); i++)
+    {
+      getTypeList().add(items.get(i).toString());
+    }
+  }
+
+  public java.util.List getBuiltInTypeNamesList(XSDSchema xsdSchema)
+  {
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    return helper.getBuiltInTypeNamesList();
+  }
+
+  /**
+   * Populate combo box with user defined complex types
+   */
+  public void populateUserComplexType(XSDSchema xsdSchema, boolean showAnonymous)
+  {
+    getTypeList().removeAll();
+    if (showAnonymous)
+    {
+      getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
+    }
+
+    List items = getUserComplexTypeNamesList(xsdSchema);
+    for (int i = 0; i < items.size(); i++)
+    {
+      getTypeList().add(items.get(i).toString());
+    }
+  }
+
+  public java.util.List getUserComplexTypeNamesList(XSDSchema xsdSchema)
+  {
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    return helper.getUserComplexTypeNamesList();
+  }
+
+  public void populateUserSimpleType(XSDSchema xsdSchema, boolean showAnonymous)
+  {
+    getTypeList().removeAll();
+    if (showAnonymous)
+    {
+      getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
+    }
+    List items = getUserSimpleTypeNamesList(xsdSchema);
+    for (int i = 0; i < items.size(); i++)
+    {
+      getTypeList().add(items.get(i).toString());
+    }
+  }
+
+  /**
+   * Populate combo box with user defined simple types
+   */
+  public void populateUserSimpleType(XSDSchema xsdSchema)
+  {
+    getTypeList().removeAll();
+    List items = getUserSimpleTypeNamesList(xsdSchema);
+    for (int i = 0; i < items.size(); i++)
+    {
+      getTypeList().add(items.get(i).toString());
+    }
+  }
+
+  public java.util.List getUserSimpleTypeNamesList(XSDSchema xsdSchema)
+  {
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    return helper.getUserSimpleTypeNamesList();
+  }
+
+  public String getPrefix(String ns, XSDSchema xsdSchema)
+  {
+    TypesHelper helper = new TypesHelper(xsdSchema);
+    String key = helper.getPrefix(ns, true);
+    return key;
+  }
+
+  /**
+   * Populate combo box with derived by choices
+   */
+  protected void populateDerivedByCombo()
+  {
+    for (int i = 0; i < derivedByChoices.length; i++)
+    {
+      getDerivedByCombo().add(derivedByChoices[i]);
+    }
+  }
+
+  /**
+   * Gets the showUserComplexType.
+   * @return Returns a boolean
+   */
+  public boolean getShowUserComplexType()
+  {
+    return showUserComplexType;
+  }
+
+  /**
+   * Gets the showUserSimpleType.
+   * @return Returns a boolean
+   */
+  public boolean getShowUserSimpleType()
+  {
+    return showUserSimpleType;
+  }
+
+  /**
+   * Gets the showNone.
+   * @return Returns a boolean
+   */
+  public boolean getShowNone()
+  {
+    return showNone;
+  }
+
+  /**
+   * Sets the showUserComplexType.
+   * @param showUserComplexType The showUserComplexType to set
+   */
+  public void setShowUserComplexType(boolean showUserComplexType)
+  {
+    this.showUserComplexType = showUserComplexType;
+  }
+
+  /**
+   * Sets the showUserSimpleType.
+   * @param showUserSimpleType The showUserSimpleType to set
+   */
+  public void setShowUserSimpleType(boolean showUserSimpleType)
+  {
+    this.showUserSimpleType = showUserSimpleType;
+  }
+
+  /**
+   * Sets the showNone
+   * @param showUserSimpleType The showNone to set
+   */
+  public void setShowNone(boolean showNone)
+  {
+    this.showNone = showNone;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
similarity index 100%
rename from bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java
new file mode 100644
index 0000000..cdb003a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.wizards;
+
+import java.io.ByteArrayInputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+
+
+public class NewXSDWizard extends Wizard implements INewWizard {
+	private XSDNewFilePage newFilePage;
+	private IStructuredSelection selection;
+	private IWorkbench workbench;
+
+	public NewXSDWizard() {
+	}
+
+	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
+		this.selection = aSelection;
+		this.workbench = aWorkbench;
+
+		this.setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/NewXSD.gif"));
+		this.setWindowTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_CREATE_XSD_MODEL_TITLE"));
+	}
+
+	public void addPages() {
+		newFilePage = new XSDNewFilePage(selection);
+		addPage(newFilePage);
+	}
+
+	public boolean performFinish() {
+		IFile file = newFilePage.createNewFile();
+
+		//
+		// Get the xsd schema name from the full path name
+		// e.g. f:/b2b/po.xsd => schema name = po
+		//
+		IPath iPath = file.getFullPath().removeFileExtension();
+		// String schemaName = iPath.lastSegment();
+		String schemaName = iPath.lastSegment();
+		String schemaPrefix = "tns";
+		String prefixForSchemaNamespace = "";
+		String schemaNamespaceAttribute = "xmlns";
+		if (XSDEditorPlugin.getPlugin().isQualifyXMLSchemaLanguage()) {
+			// Added this if check before disallowing blank prefixes in the
+			// preferences...
+			// Can take this out. See also XSDEditor
+			if (XSDEditorPlugin.getPlugin().getXMLSchemaPrefix().trim().length() > 0) {
+				prefixForSchemaNamespace = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix() + ":";
+				schemaNamespaceAttribute += ":" + XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
+			}
+		}
+
+		Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
+		String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+		if (charSet == null || charSet.trim().equals("")) {
+			charSet = "UTF-8";
+		}
+
+		String newContents = "<?xml version=\"1.0\" encoding=\"" + charSet + "\"?>\n";
+
+		String defaultTargetURI = XSDEditorPlugin.getPlugin().getXMLSchemaTargetNamespace();
+		newContents += "<" + prefixForSchemaNamespace + "schema " + schemaNamespaceAttribute + "=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"" + defaultTargetURI + schemaName + "\" xmlns:" + schemaPrefix + "=\"" + defaultTargetURI + schemaName + "\">\n</" + prefixForSchemaNamespace + "schema>";
+
+		try {
+			byte[] bytes = newContents.getBytes(charSet);
+			ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
+
+			file.setContents(inputStream, true, false, null);
+			inputStream.close();
+		}
+		catch (Exception e) {
+			// XSDEditorPlugin.getPlugin().getMsgLogger().write("Error writing
+			// default content:\n" + newContents);
+			// XSDEditorPlugin.getPlugin().getMsgLogger().write(e);
+		}
+
+		if (file != null) {
+			revealSelection(new StructuredSelection(file));
+		}
+
+		openEditor(file);
+
+		return true;
+	}
+
+	private void revealSelection(final ISelection selection) {
+		if (selection != null) {
+			IWorkbench workbench2;
+			if (workbench == null)
+			{
+			  workbench2 = XSDEditorPlugin.getPlugin().getWorkbench();
+			}
+			else
+			{
+			  workbench2 = workbench;
+			}
+			final IWorkbenchWindow workbenchWindow = workbench2.getActiveWorkbenchWindow();
+			final IWorkbenchPart focusPart = workbenchWindow.getActivePage().getActivePart();
+			if (focusPart instanceof ISetSelectionTarget) {
+				Display.getCurrent().asyncExec(new Runnable() {
+					public void run() {
+						((ISetSelectionTarget) focusPart).selectReveal(selection);
+					}
+				});
+			}
+		}
+	}
+
+	public void openEditor(final IFile iFile) {
+		if (iFile != null) {
+			IWorkbench workbench2;
+			if (workbench == null)
+			{
+			  workbench2 = XSDEditorPlugin.getPlugin().getWorkbench();
+			}
+			else
+			{
+			  workbench2 = workbench;
+			}
+			final IWorkbenchWindow workbenchWindow = workbench2.getActiveWorkbenchWindow();
+
+			Display.getDefault().asyncExec(new Runnable() {
+				public void run() {
+					try {
+						workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), XSDEditorPlugin.XSD_EDITOR_ID);
+					}
+					catch (PartInitException ex) {
+					}
+				}
+			});
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java
new file mode 100644
index 0000000..e7923d6
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java
@@ -0,0 +1,958 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+// Based on version 1.12 of original xsdeditor
+package org.eclipse.wst.xsd.ui.internal.wizards;
+
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.xsd.XSDPatternFacet;
+
+
+
+/*
+-other regex features (eg case sensitivity, ^ or $, |, etc etc)
+-smarter model
+-better keyboard navigation
+-update list of tokens 
+*/
+
+public class RegexCompositionPage extends WizardPage
+{
+  private static final boolean debug = false;
+
+  /* The text representation of our pattern. */
+  private StyledText value; 
+
+  /* The StyleRange used to color code the current parse error. */
+  private StyleRange currentError;
+
+  /* The regex terms we can form tokens from. */
+  private Combo terms;
+
+  /* The checkbox for activating auto-escape mode. */  
+  private Button escapeCheckbox;
+  
+  /* On/off status of auto-escape mode. */ 
+  private boolean autoEscapeStatus;
+
+  /* The Add Token button. */
+  private Button add;
+
+
+  // The following controls are used in the occurrence selection group
+
+  private Text repeatValue;
+
+  private Text rangeMinValue;
+  private Text rangeMaxValue;
+  private Label rangeToLabel;  
+
+  private Button singleRadio;
+  private Button starRadio;
+  private Button plusRadio;
+  private Button optionalRadio; 
+  private Button repeatRadio;
+  private Button rangeRadio;
+
+  
+  // The following variables used as part of the model. 
+
+  /* Our pattern. */
+  private XSDPatternFacet pattern;
+
+  /* Model used to store the current token. */
+  private RegexNode node;    
+
+  /* The flags passed to the new RegularExpression object.  Default value includes:
+      X = XMLSchema mode    */
+  private String regexFlags = "X";
+      
+
+  /* Is the current regex token valid? */
+  private boolean isValidToken;
+
+  /* The label used to indicate the value's caret position when it looses focus. */
+  private Label caretLabel;
+
+  /* The pixel offsets needed to align the label icon with the caret location.
+     These are dependent on the icon used. */
+  private static final int CARET_LABEL_X_OFFSET = -3;
+  private static final int CARET_LABEL_Y_OFFSET = 19;
+
+  
+  /* Enumerated constants for specifying the type of an error message. */
+  private static final int TOKEN = 0;
+  private static final int SELECTION = 1;
+  private static final int PARSE = 2;
+  
+  private static final int NUM_ERROR_MESSAGE_TYPES = 3;
+  
+  /* The current error message for each type of error.  A value of null indicates no message. 
+     The array is indexed according to the above constants.
+  */
+  private String[] currentErrorMessages;
+
+
+  public RegexCompositionPage(XSDPatternFacet pattern)
+  {
+    super(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE"));
+    this.pattern = pattern;
+
+    setTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE"));
+    setDescription(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_DESCRIPTION"));
+  }
+
+  public void createControl(Composite parent)
+  {
+    // Set up our model and validator
+    node = new RegexNode();
+        
+    isValidToken = true;
+
+    currentErrorMessages = new String[NUM_ERROR_MESSAGE_TYPES];
+
+    // The main composite
+    Composite composite= new Composite(parent, SWT.NONE);
+    WorkbenchHelp.setHelp(composite, XSDEditorContextIds.XSDR_COMPOSITION_PAGE);
+    composite.setLayout(new GridLayout());
+
+
+    // The composite for the token combo box, label, and auto-escape checkbox
+    Composite tokenComposite = new Composite (composite, SWT.NONE);
+    GridLayout tokenCompositeLayout = new GridLayout();
+    tokenCompositeLayout.numColumns = 3;
+    tokenCompositeLayout.marginWidth = 0;
+    tokenComposite.setLayout(tokenCompositeLayout);
+
+
+    new Label(tokenComposite, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TOKEN_LABEL"));
+    
+    terms = new Combo(tokenComposite, SWT.DROP_DOWN);
+    WorkbenchHelp.setHelp(terms, XSDEditorContextIds.XSDR_COMPOSITION_TOKEN);
+    for (int i = 0; i < RegexNode.getNumRegexTerms(); i++)
+    {
+      terms.add(RegexNode.getRegexTermText(i));
+    }
+    terms.addListener(SWT.Modify, new ComboListener());
+    terms.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_TERMS"));
+
+    escapeCheckbox = new Button(tokenComposite, SWT.CHECK);
+    escapeCheckbox.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL"));
+    escapeCheckbox.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX")); 
+    escapeCheckbox.addSelectionListener(new CheckboxListener());
+    autoEscapeStatus = false;
+    
+    tokenComposite.pack();
+
+
+    // Set up the composites pertaining to the selection of occurrence quantifiers
+
+    Group occurrenceSelectionArea = new Group(composite, SWT.NONE);
+    occurrenceSelectionArea.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_OCCURENCE_LABEL"));
+    WorkbenchHelp.setHelp(occurrenceSelectionArea, XSDEditorContextIds.XSDR_COMPOSITION_OCCURRENCE_GROUP);
+    GridLayout selectionAreaLayout = new GridLayout();
+    selectionAreaLayout.numColumns = 2;
+    occurrenceSelectionArea.setLayout(selectionAreaLayout);
+
+    // Listener used for all of the text fields
+    TextListener textListener = new TextListener();
+    
+
+    // Add the radio buttons
+    RadioSelectListener radioSelectListener = new RadioSelectListener();
+
+    singleRadio = addOccurenceRadioButton(RegexNode.SINGLE, occurrenceSelectionArea, radioSelectListener);
+    WorkbenchHelp.setHelp(singleRadio, XSDEditorContextIds.XSDR_COMPOSITION_JUST_ONCE);
+    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
+
+    starRadio = addOccurenceRadioButton(RegexNode.STAR, occurrenceSelectionArea, radioSelectListener);
+    WorkbenchHelp.setHelp(starRadio, XSDEditorContextIds.XSDR_COMPOSITION_ZERO_OR_MORE);
+    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
+
+    plusRadio = addOccurenceRadioButton(RegexNode.PLUS, occurrenceSelectionArea, radioSelectListener);
+    WorkbenchHelp.setHelp(plusRadio, XSDEditorContextIds.XSDR_COMPOSITION_ONE_OR_MORE);
+    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
+
+    optionalRadio = addOccurenceRadioButton(RegexNode.OPTIONAL, occurrenceSelectionArea, radioSelectListener);
+    WorkbenchHelp.setHelp(optionalRadio, XSDEditorContextIds.XSDR_COMPOSITION_OPTIONAL);
+    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
+
+    repeatRadio = addOccurenceRadioButton(RegexNode.REPEAT, occurrenceSelectionArea, radioSelectListener);
+    WorkbenchHelp.setHelp(repeatRadio, XSDEditorContextIds.XSDR_COMPOSITION_REPEAT);
+
+    // Add text field for specifying number of repeats
+    Composite repeatWidgets = new Composite(occurrenceSelectionArea, SWT.NONE);
+    RowLayout repeatWidgetsLayout = new RowLayout();
+    repeatWidgetsLayout.marginTop = 0;
+    repeatWidgetsLayout.marginBottom = 0;
+    repeatWidgetsLayout.marginLeft = 0;
+    repeatWidgetsLayout.marginRight = 0;
+    repeatWidgets.setLayout(repeatWidgetsLayout);        
+    
+    repeatValue = new Text(repeatWidgets, SWT.SINGLE | SWT.BORDER);
+    repeatValue.addListener(SWT.Modify, textListener);
+    WorkbenchHelp.setHelp(repeatValue, XSDEditorContextIds.XSDR_COMPOSITION_REPEAT_TEXT);
+    repeatValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_REPEAT"));
+    setEnabledStatus(RegexNode.REPEAT, false);
+    
+    repeatWidgets.pack();
+    
+    rangeRadio = addOccurenceRadioButton(RegexNode.RANGE, occurrenceSelectionArea, radioSelectListener);
+    WorkbenchHelp.setHelp(rangeRadio, XSDEditorContextIds.XSDR_COMPOSITION_RANGE);
+
+    // Add text fields and labels for specifying the range    
+    Composite rangeWidgets = new Composite(occurrenceSelectionArea, SWT.NONE);
+    RowLayout rangeWidgetsLayout = new RowLayout();
+    rangeWidgetsLayout.marginTop = 0;
+    rangeWidgetsLayout.marginBottom = 0;
+    rangeWidgetsLayout.marginLeft = 0;
+    rangeWidgetsLayout.marginRight = 0;
+    rangeWidgets.setLayout(rangeWidgetsLayout);
+    
+    rangeMinValue = new Text(rangeWidgets, SWT.SINGLE | SWT.BORDER);
+    rangeMinValue.addListener(SWT.Modify, textListener);
+    WorkbenchHelp.setHelp(rangeMinValue, XSDEditorContextIds.XSDR_COMPOSITION_RANGE_MIN);
+    rangeMinValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_MIN"));
+    
+    rangeToLabel = new Label(rangeWidgets, SWT.NONE);
+    rangeToLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TO_LABEL"));
+    
+    rangeMaxValue = new Text(rangeWidgets, SWT.SINGLE | SWT.BORDER);
+    rangeMaxValue.addListener(SWT.Modify, textListener);
+    rangeMaxValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_MAX"));
+    WorkbenchHelp.setHelp(rangeMaxValue, XSDEditorContextIds.XSDR_COMPOSITION_RANGE_MAX);
+
+    setEnabledStatus(RegexNode.RANGE, false);
+    rangeWidgets.pack();
+    
+    singleRadio.setSelection(true);
+    
+    occurrenceSelectionArea.pack();
+
+    // The add button
+    add = new Button(composite, SWT.PUSH);
+    add.addSelectionListener(new ButtonSelectListener());
+    add.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"));
+    WorkbenchHelp.setHelp(add, XSDEditorContextIds.XSDR_COMPOSITION_ADD);
+    add.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_ADD_BUTTON"));
+
+    
+    Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
+    separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+    
+    // Our main text box
+
+    Label valueLabel= new Label(composite, SWT.LEFT);
+    valueLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL"));
+    
+    value = new StyledText(composite, SWT.SINGLE | SWT.BORDER);
+    value.addListener(SWT.Modify, textListener);
+    value.addListener(SWT.Selection, textListener);
+    WorkbenchHelp.setHelp(value, XSDEditorContextIds.XSDR_COMPOSITION_CURRENT);
+    value.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_CURRENT_REGEX"));
+    value.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+    value.setFocus();
+
+    // StyleRange used for highlighting parse errors
+    currentError = new StyleRange();
+    currentError.length = 1;
+    currentError.foreground = parent.getDisplay().getSystemColor(SWT.COLOR_RED);
+
+    // The caret label
+    caretLabel = new Label(composite, SWT.LEFT);
+    caretLabel.setImage(XSDEditorPlugin.getXSDImage("icons/RegexWizardArrow.gif"));
+    caretLabel.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_CARET_LABEL"));
+    setShowCaretLabel(true);
+
+    value.addFocusListener(new TextFocusListener());
+
+    terms.select(0);
+
+
+    setControl(composite);
+  }
+
+
+  public void setVisible(boolean visible)
+  {
+    super.setVisible(visible);
+
+    value.setText(pattern.getLexicalValue());
+    value.setCaretOffset(value.getCharCount());
+  }
+
+  public void dispose()
+  {
+    super.dispose();
+  }
+
+
+  /**
+   * Sets the visible status of caretLabel to status.  If status is true, then we also update the position
+   * of caretLabel in one of two ways.  If there is no active selection in value, we set caretLabel's
+   * position to correspond with the position of the actual caret.  Alternatively, if there is an active selection
+   * in value, we set caretLabel's position to the beginning of the selection.
+   *
+   * @param The new visibility status of caretLabel.
+   */
+  private void setShowCaretLabel(boolean status)
+  {
+    if (status)
+    {
+  
+      int offset;
+      
+      if (value.getSelectionText().equals(""))
+      {
+        offset = value.getCaretOffset();
+      }
+      else
+      {
+        offset = value.getSelection().x;
+      }
+  
+      Point p = value.getLocationAtOffset(offset);
+      
+      p.x += value.getLocation().x;
+      p.y = value.getLocation().y;
+      
+      // Place the label under value, and make sure it is aligned with the caret.
+      // The offsets are dependent on the icon used.
+      p.x += CARET_LABEL_X_OFFSET;
+      p.y += CARET_LABEL_Y_OFFSET;
+  
+      if (debug)
+      {
+        System.out.println("POINT: " + p);
+      }
+      
+      caretLabel.setLocation(p);
+      caretLabel.setVisible(true);
+    }
+    else
+    {
+      caretLabel.setVisible(false);
+    }
+  }
+
+
+  /**
+   * Adds a new radio button to Composite c with SelectionListener l.  The text of the button is the String associated with
+   * quantifier.
+   *
+   * @param quantifier The desired quantifier, as enumerated in RegexNode.
+   * @param c The Composite to add the buttons to (normally occurrenceRadioButtons).
+   * @param l The SelectionListener (normally radioSelectionListener).
+   * @return The newly created button.
+   */
+  private Button addOccurenceRadioButton(int quantifier, Composite c, SelectionListener l)
+  {
+    Button result = new Button(c, SWT.RADIO);
+    result.setText(RegexNode.getQuantifierText(quantifier));
+    result.addSelectionListener(l);
+    return result;
+  }
+
+
+  /**
+   * Validates the regex in value.  If the regex is valid, clears the Wizard's error message.  If it's not valid,
+   *  sets the Wizard's error message accordingly.
+   *
+   * @return Whether the regex is valid.
+   */
+  private boolean validateRegex()
+  {
+
+    boolean isValid;
+    try
+    {
+      // We validate the regex by checking whether we get a ParseException.
+      // By default, we assume that it's valid unless we determine otherwise.
+      isValid = true;
+      displayRegexErrorMessage(null);
+      value.setStyleRange(null);
+
+      Pattern.compile(value.getText());
+    }
+    catch (PatternSyntaxException pe)
+    {
+      isValid = false;
+      displayRegexErrorMessage(pe.getMessage());
+
+      // An off-by-one bug in the xerces regex parser will sometimes return a location for the parseError that
+      //  is off the end of the string.  If this is the case, then we want to highlight the last character.
+      if (pe.getIndex() >= value.getText().length())
+      {
+        currentError.start = value.getText().length() - 1;
+      }
+      else
+      {
+        currentError.start = pe.getIndex();
+      }
+
+      if (debug)
+      {
+        System.out.println("Parse Error location: " + pe.getIndex());
+        System.out.println("currentError.start: " + currentError.start);
+      }
+
+      value.setStyleRange(currentError);
+
+    }
+
+    // Another bug in the xerces parser will sometimes throw a RuntimeException instead of a ParseException.
+    //  When we get a RuntimeException, we aren't provided with the additional information we need to highlight
+    //  the parse error.  So, we merely report that there is an error.
+    catch (RuntimeException re)
+    {
+      displayRegexErrorMessage("");
+      value.setStyleRange(null);
+      isValid = false;
+    }
+    
+    setPageComplete(isValid);    
+    return isValid;
+  }
+
+  
+  /**
+   * Manages the display of error messages.
+   * Sets the error message for type to errorMessage.  If errorMessage != null, then we set the Wizard's error message
+   * to errorMessage.  If errorMessage == null, then we check whether we have a pending message of another type.
+   * If we do, then it is displayed as the Wizard's error message.  If we don't, then the Wizard's error message field
+   * is cleared.
+   *
+   * @param errorMessage The text of the new error message.  A value of null indicates that the error message should
+   *  be cleared.
+   * @param type The error type, one of PARSE, TOKEN, or SELECTION.
+   */ 
+  private void displayErrorMessage(String errorMessage, int type)
+  {
+    String messageToDisplay = null;
+
+
+    currentErrorMessages[type] = errorMessage;
+
+    messageToDisplay = errorMessage;
+
+    for (int i = 0; i < NUM_ERROR_MESSAGE_TYPES; i++)
+    {
+      if (messageToDisplay != null)
+      {
+        break;
+      }
+      messageToDisplay = currentErrorMessages[i];
+    }
+
+    setErrorMessage(messageToDisplay);
+  }
+
+
+  /**
+   * Sets the Wizard's error message to message, preceded by a standard prefix.
+   *
+   * @param message The new error message (or null to clear it).
+   */
+  private void displayRegexErrorMessage (String errorMessage)
+  {
+    if (errorMessage == null)
+    {
+      displayErrorMessage(null, PARSE);
+    }
+    else
+    {
+    	if (errorMessage.trim().equals("")) // when there is no error message available.
+    	{
+        displayErrorMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REGEX_ERROR"),
+                           PARSE);
+      }
+      else
+      {
+        displayErrorMessage(errorMessage, PARSE);
+      }
+    }
+  }
+
+
+  /**
+   * Updates the token status.  Sets isValidToken to status && the status of the other error type.
+   * If status is true, we clear the wizard's error message for this type; if it is false, we set it to errorMessage.
+   *
+   * @param status The new isValidToken value.
+   * @param errorMessage The new error message.
+   * @param type The type of the error (either TOKEN or SELECTION).
+   */
+  private void setTokenStatus (boolean status, String errorMessage, int type)
+  {
+    boolean otherTypeStatus =     (type == TOKEN) ? 
+                                  currentErrorMessages[SELECTION] == null :
+                                  currentErrorMessages[TOKEN] == null;
+    
+    isValidToken = status && otherTypeStatus;
+    add.setEnabled(isValidToken);
+
+    if (status)
+    {
+      displayErrorMessage(null, type);
+    }
+    else
+    {
+    	if (errorMessage != null && errorMessage.trim().equals("")) // when there is no error message available.
+    	{
+        displayErrorMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR"),
+                           type);
+      }
+      else
+      {
+        displayErrorMessage(errorMessage, type);
+      }
+    }
+  }
+
+  
+  /**
+   * Updates the token status.  Sets isValidToken to status && the status of the other error type.
+   * Also clears the wizard's error message for this type.
+   * Usually used to set isValidToken to true.
+   *
+   * @param status The new isValidToken value.
+   * @param type The type of the error (either TOKEN or SELECTION).
+   */
+  private void setTokenStatus(boolean status, int type)
+  {
+    setTokenStatus(status, null, type);
+  }
+
+
+
+  /**
+   * Sets the enabled status of the text fields and labels associated with the specified quantifier.
+   * If status is true, then fields and labels associated with other quantifiers are disabled.
+   * @param quantifier The quantifier whose elements' enabled status we wish to change
+   *   (as enumerated in RegexNode).
+   * @param status The new status of the elements.  If true, then all elements associated with other buttons
+   *               are disabled.
+   */    
+  private void setEnabledStatus(int quantifier, boolean status)
+  {
+    switch (quantifier)
+    {
+    
+    case RegexNode.REPEAT:
+      repeatValue.setEnabled(status);
+      if (status)
+      {
+        rangeMinValue.setEnabled(false);
+        rangeMaxValue.setEnabled(false);
+        rangeToLabel.setEnabled(false);
+      }
+      break;
+
+    case RegexNode.RANGE:
+      rangeMinValue.setEnabled(status);
+      rangeMaxValue.setEnabled(status);
+      rangeToLabel.setEnabled(status);
+      if (status)
+      {
+        repeatValue.setEnabled(false);
+      }
+      break;
+
+    }
+  }
+
+  /**
+   * Checks to see if there is a selection in value.  If there is not, we set the Wizard's error message accordingly.
+   * If there is, we update the contents of node.  If "Current Selection" is not the current token, then
+   * we clear the Selection error message.
+   */
+  private void updateCurrentSelectionStatus()
+  {
+    if (terms.getSelectionIndex() == RegexNode.SELECTION)
+    {
+      String selection = value.getSelectionText();
+      if (selection.equals(""))
+      {
+        setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_SELECTION_ERROR"), SELECTION);
+      }
+      else
+      {
+        setTokenStatus(true, SELECTION);
+        node.setContents(selection);
+        node.setHasParens(true);
+      }
+    }
+    else
+    {
+      setTokenStatus(true, SELECTION);
+    }
+  }
+
+  /**
+   * Updates the enabled status of the auto-escape checkbox.  If status is true, we enable the checkbox, and
+   * set its selection status and node's auto-escape status to the value of autoEscapeStatus.  If status is
+   * false, then we disable and deselect the checkbox, and set node's status to false.
+   *
+   * @param status The new enabled status.
+   */
+  private void setEscapeCheckboxEnabledStatus(boolean status)
+  {
+    if (status)
+    {
+      escapeCheckbox.setEnabled(true);
+      escapeCheckbox.setSelection(autoEscapeStatus);
+      node.setAutoEscapeStatus(autoEscapeStatus);
+    }
+    else
+    {
+      escapeCheckbox.setEnabled(false);
+      escapeCheckbox.setSelection(false);
+      node.setAutoEscapeStatus(false);
+    }
+  }
+
+
+  /**
+   * Returns the current regex flags.
+   */
+  String getFlags()
+  {
+    return regexFlags;
+  }
+
+  /**
+   * Returns the current XSDPattern model.
+   */
+  XSDPatternFacet getPattern()
+  {
+    return pattern;
+  }
+
+
+  /**
+   * Returns a string consisting of the values of min, max, and repeat stored in node.
+   * Used for debugging purposes only.
+   */  
+  private String getAllFieldValues()
+  {
+      String result = "";
+      result += "Min: " + node.getMin() + "\n";
+      result += "Max: " + node.getMax() + "\n";
+      result += "Repeat: " + node.getRepeat() + "\n";
+      result += "\n";
+      return result;
+  }
+  
+
+  /* Listener for the add button. */
+  class ButtonSelectListener implements SelectionListener
+  {
+    public void widgetDefaultSelected(SelectionEvent e)
+    {
+    }
+
+    // Precondition: isValidToken == true  
+    public void widgetSelected(SelectionEvent e)
+    {
+      if (!isValidToken) // should never happen
+      {
+        System.out.println("Attempted to add an invalid token.");
+        System.out.println(node.toString());
+        System.out.println(getAllFieldValues());
+        return;
+      }
+
+      // Whether there is anything selected in value.
+      boolean isActiveSelection = value.getSelectionCount() != 0;
+      
+      value.insert(node.toString());
+
+      if (terms.getSelectionIndex() == RegexNode.SELECTION)
+      {
+        updateCurrentSelectionStatus();
+      }
+
+      // If nothing is selected, then we need to advance the caret location.
+      if (!isActiveSelection)
+      {
+        value.setCaretOffset(value.getCaretOffset() + node.toString().length());
+      }
+
+      value.setFocus();
+
+    }
+
+  }
+ 
+
+  /* Listener for the terms combo box. */
+  class ComboListener implements Listener
+  {
+    public void handleEvent(Event e)
+    {
+      
+      updateCurrentSelectionStatus();
+
+      // If the user has typed in a token
+      if (terms.getSelectionIndex() == -1)
+      {
+        setEscapeCheckboxEnabledStatus(true);
+        node.setContents(terms.getText());
+        node.setHasParens(true);
+        
+
+        if (debug)
+        {
+          System.out.println(terms.getText());
+        }
+
+      }
+      else if (terms.getSelectionIndex() == RegexNode.SELECTION)
+      {
+        setEscapeCheckboxEnabledStatus(false);
+      }
+      else
+      {
+        node.setContents(RegexNode.getRegexTermValue(terms.getSelectionIndex()));
+        node.setHasParens(false);
+        setEscapeCheckboxEnabledStatus(false);
+      }
+    }
+  }
+
+
+  /* Listener for enabling/disabling caretLabel. */
+  class TextFocusListener implements FocusListener
+  {
+    public void focusGained(FocusEvent e)
+    {
+      setShowCaretLabel(false);
+    }
+    public void focusLost(FocusEvent e)
+    {
+      setShowCaretLabel(true);
+    }
+  }
+
+
+
+  /* Listener for the text fields. */
+  class TextListener implements Listener
+  {
+    public void handleEvent (Event e)
+    {
+
+      if (debug)
+      {
+        System.out.println("Inside TextListener handler");
+        System.out.println(e);
+        System.out.println(getAllFieldValues());
+      }
+
+
+      if ( (e.widget == value) && (e.type == SWT.Modify) )
+      {
+        pattern.setLexicalValue(value.getText());
+        validateRegex();
+      }
+
+      else if (e.widget == value && e.type == SWT.Selection)
+      {
+        if (terms.getSelectionIndex() == RegexNode.SELECTION)
+        {
+          updateCurrentSelectionStatus();
+        }
+      }
+
+      else if (e.widget == rangeMinValue)
+      {
+        boolean isValid = node.setMin(rangeMinValue.getText());
+
+        if (isValid)
+        {
+          setTokenStatus(true, null, TOKEN);
+        }
+        else
+        {
+          setTokenStatus(false,  XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX"), TOKEN);
+        }
+      }
+
+      else if (e.widget == rangeMaxValue)
+      {
+        boolean isValid = node.setMax(rangeMaxValue.getText());
+
+        if (node.getMin() == RegexNode.EMPTY)
+        {
+          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MISSING_MIN_ERROR_SUFFIX"), TOKEN);
+        }
+        else if (isValid)
+        {
+          setTokenStatus(true, null, TOKEN);
+        }
+        else
+        {
+          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX"), TOKEN);
+        }
+      }
+
+      else  // (e.widget == repeatValue)
+      {
+        boolean isValid = node.setRepeat(repeatValue.getText());
+        if (isValid)
+        {
+          setTokenStatus(true, null, TOKEN);
+        }
+        else
+        {
+          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX"), TOKEN);
+        }
+      }
+    }
+  }
+
+  /* Listener for the auto-escape checkbox. */
+  class CheckboxListener implements SelectionListener
+  {
+    public void widgetDefaultSelected(SelectionEvent e)
+    {
+    }
+
+    public void widgetSelected(SelectionEvent e)
+    {
+      boolean newStatus = !autoEscapeStatus;
+      node.setAutoEscapeStatus(newStatus);
+      autoEscapeStatus = newStatus;
+      
+      if (debug)
+      {
+        System.out.println("AutoEscape Status: " + node.getAutoEscapeStatus());
+      }
+    }
+
+  }
+
+
+  /* Listener for the radio buttons. */
+  class RadioSelectListener implements SelectionListener
+  {
+    public void widgetDefaultSelected(SelectionEvent e)
+    {
+    }
+
+    public void widgetSelected(SelectionEvent e)
+    {
+      if (debug)
+      {
+        System.out.println(getAllFieldValues());
+      }
+
+
+      int currentQuantifier = getQuantifier(e);
+
+      node.setQuantifier(currentQuantifier);
+
+      switch (currentQuantifier)
+      {
+      case RegexNode.SINGLE:                     
+      case RegexNode.STAR:
+      case RegexNode.PLUS:
+      case RegexNode.OPTIONAL:
+        setEnabledStatus(RegexNode.REPEAT, false);
+        setEnabledStatus(RegexNode.RANGE, false);
+        setTokenStatus(true, TOKEN);
+        break; 
+
+      case RegexNode.REPEAT:
+        setEnabledStatus(RegexNode.REPEAT, true);
+        setTokenStatus(node.hasValidRepeat(), XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX"), TOKEN);
+        repeatValue.setFocus();
+        break;
+
+      case RegexNode.RANGE:
+        setEnabledStatus(RegexNode.RANGE, true);
+        String error = (node.hasValidMin()) ? 
+                            XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX") : 
+                            XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX");
+
+        setTokenStatus( node.hasValidMin() && node.hasValidMax(), error, TOKEN);
+        rangeMinValue.setFocus();
+        break;
+      }
+    }
+
+    private int getQuantifier(SelectionEvent e)
+    {
+
+      if (e.widget == singleRadio)
+      {
+        return RegexNode.SINGLE;
+      }
+      
+      else if (e.widget == starRadio)
+      {
+        return RegexNode.STAR;
+      }
+      
+      else if (e.widget == plusRadio)
+      {
+        return RegexNode.PLUS;
+      }
+      
+      else if (e.widget == optionalRadio)
+      {
+        return RegexNode.OPTIONAL;
+      }
+      
+      else if (e.widget == repeatRadio)
+      {
+        return RegexNode.REPEAT;
+      }
+      
+      else if (e.widget == rangeRadio)
+      {
+        return RegexNode.RANGE;
+      }
+      
+      else // can't get here
+      { 
+        return RegexNode.EMPTY;
+      }
+    } 
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
new file mode 100644
index 0000000..2844709
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
@@ -0,0 +1,421 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.wizards;
+
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+
+
+class RegexNode
+{
+  private String contents;
+  private int min;
+  private int max;
+  private int repeat;
+  private int quantifier;
+  private boolean hasParens;
+  private boolean autoEscapeStatus;
+
+  
+  /* Quantifiers. */
+  public static final int SINGLE = 0;    
+  public static final int STAR = 1;
+  public static final int PLUS = 2;
+  public static final int OPTIONAL = 3;
+  public static final int REPEAT = 4; 
+  public static final int RANGE = 5;
+
+  /* Regex quantifiers.  First column is the on-screen textual representation, second column is the 
+   on-screen regex representation.  The two are concatenated together to form the on-screen
+   representation.
+   Indexing of this array must correspond to the values of the quantifier constants above.
+  */
+  private static final String[][] regexQuantifiers =
+  { 
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_SINGLE"),   ""  },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_STAR"),     "*" },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_PLUS"),     "+" },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL"), "?" },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_REPEAT"),   ""  },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_RANGE"),    ""  },
+  };
+
+
+  /* Regex tokens.  First column is the on-screen representation, second column is the regex representation. 
+     More tokens can be added, but it is assumed that "Current Selection" is the last element in the array.
+     If this is not the case, then the value of the SELECTION constant below will need to be changed 
+     accordingly.
+     Also note that because these are java Strings, backslashes must be escaped (this is only relevant to the
+     second column of the array).
+   */
+  private static final String[][] regexTerms =
+  { 
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ANY_CHAR"),   "."     },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ALPHANUMERIC_CHAR"),   "\\w"     },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_WHITESPACE"), "\\s"   },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_DIGIT"),      "\\d"   },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_UPPER"),      "[A-Z]" },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_LOWER"),      "[a-z]" },
+    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_SELECTION"),  ""      },
+  };
+
+  /* Token enumerated constants. */
+
+  // SELECTION must correspond to the index in regexTerms of "Current Selection".  This is assumed to be
+  //  the last element.
+  public static final int SELECTION = regexTerms.length - 1;
+
+  public static final int EMPTY = -1;
+
+  /* 
+  The metacharacters recognized by XML Schema.
+  Note that the double backslash ("\\") actually represents an escaped single backslash character ("\").
+  */ 
+  private static final String metacharacters = ".\\?*+{}()[]";
+
+
+  public static String getRegexTermText(int i)
+  {
+    if (i == SELECTION)
+    {
+      return regexTerms[i][0];
+    }
+    else
+    {
+      return regexTerms[i][0] + " ( " + regexTerms[i][1] + " )";
+    }
+  }
+
+  public static String getRegexTermValue(int i)
+  {
+    if (i == SELECTION) // shouldn't happen
+    {
+      return "";
+    }
+    else
+    {
+      return regexTerms[i][1];
+    }
+  }
+
+  public static int getNumRegexTerms()
+  {
+    return regexTerms.length;
+  }
+
+  public static String getQuantifierText(int i)
+  {
+    String result = regexQuantifiers[i][0];
+    
+    if (!regexQuantifiers[i][1].equals(""))
+    {
+      result += " ( ";
+      result += regexQuantifiers[i][1];
+      result += " )";
+    }
+
+    return result;
+  }
+
+  public RegexNode()
+  {
+    this.contents = "";
+    this.quantifier = SINGLE;
+    this.min = EMPTY;
+    this.max = EMPTY;
+    this.repeat = EMPTY;
+    this.hasParens = false;
+
+  }
+
+  
+  public String getContents()
+  {
+    return contents;
+  }
+  
+  public void setContents(String contents)
+  {
+    this.contents = contents;
+  }
+
+
+  public int getQuantifier()
+  {
+    return quantifier;
+  }
+
+  public void setQuantifier(int quantifier)
+  {
+    this.quantifier = quantifier;
+  }
+
+
+  public int getMin()
+  {
+    return min;
+  }
+
+  public void setMin(int min)
+  {
+    this.min = min;
+  }
+
+  /**
+   * Sets this.min to the integer representation of min iff min is a valid value (i.e. greater than 0).
+   * Sets this.min to EMPTY if it is not.
+   *
+   * @param min The new min value
+   * @returns Whether min was a valid value
+   */  
+  public boolean setMin(String min)
+  {
+    this.min = convertToInt(min);
+
+    // min > max is an invalid case, unless max is EMPTY (since EMPTY == -1).
+    if ( (this.max != EMPTY) && (this.min > this.max) )
+    {
+      return false;
+    }
+    
+    return (this.min >= 0);
+  }
+
+  
+  public int getMax()
+  {
+    return max;
+  }
+  
+  public void setMax(int max)
+  {
+    this.max = max;
+  }
+
+  /**
+   * Sets this.max to the integer representation of max iff max is a valid value (i.e. greater than 0).
+   * Sets this.max to EMPTY if it is not.
+   *
+   * @param max The new max value
+   * @returns Whether max was a valid value, or (whether max == the empty string && min has a valid value)
+   */ 
+  public boolean setMax(String max)
+  {
+    this.max = convertToInt(max);
+
+    // The empty string is a valid max value iff min has a valid value.
+    // This is due to the fact that {n,} means "at least n times" in regex parlance.
+    if (max.equals("") && this.min != EMPTY)
+    {
+      return true;
+    }
+    
+    else if (this.max < this.min)
+    {
+      return false;
+    }
+    
+    else
+    {
+      return (this.max >= 0);
+    }
+  }
+
+
+ 
+  public int getRepeat()
+  {
+    return repeat;
+  }
+
+  public void setRepeat(int repeat)
+  {
+    this.repeat = repeat;
+  }
+
+  /**
+   * Sets this.repeat to the integer representation of repeat iff repeat is a valid value (i.e. greater than 0).
+   * Sets this.repeat to EMPTY if it is not.
+   *
+   * @param repeat The new repeat value
+   * @returns Whether repeat was a valid value
+   */
+  public boolean setRepeat(String repeat)
+  {
+    this.repeat = convertToInt(repeat);
+    return (this.repeat >= 0);
+  }
+
+
+
+  /**
+   * Returns the integer representation of s.  If s is less than zero, or if s is not an int
+   * (i.e. if Integer.parseInt would throw a NumberFormatException), then returns EMPTY.
+   *
+   * @param s The String to convert.
+   * @returns The integer representation of s.
+   */
+  private int convertToInt(String s)
+  {
+    int result;
+    try
+    {
+      result = Integer.parseInt(s);
+      if (result < 0)
+      {
+        result = EMPTY;
+      }
+    }
+    catch (NumberFormatException e)
+    {
+      result = EMPTY;
+    }
+
+    return result;
+  }
+
+
+  public boolean getHasParens()
+  {
+    return hasParens;
+  }
+
+  public void setHasParens(boolean status)
+  {
+    this.hasParens = status;
+  }
+
+  public boolean getAutoEscapeStatus()
+  {
+    return autoEscapeStatus;
+  }
+
+  public void setAutoEscapeStatus(boolean status)
+  {
+    this.autoEscapeStatus = status;
+  }
+
+  /**
+   * Returns an escaped version of s.  In other words, each occurrence of a metacharacter ( .\?*+{}()[] )
+   * is replaced by that character preceded by a backslash.
+   *
+   * @param s The String to escape.
+   * @returns An escaped version of s.
+   */
+  private String addEscapeCharacters(String s)
+  {
+    StringBuffer result = new StringBuffer("");
+
+    for (int i = 0; i < s.length(); i++)
+    {
+      char currentChar = s.charAt(i);
+
+      if (isMetachar(currentChar))
+      {
+        result.append("\\"); // Note that this is an escaped backslash, not a double backslash.
+      }
+      result.append(currentChar);
+
+    }
+
+    return result.toString();
+  }
+
+  /**
+   * Checks whether c is a metacharacter as defined in the static variable metacharacters.
+   *
+   * @param c The character to check.
+   * @returns Whether c is a metacharacter.
+   */
+  private boolean isMetachar(char c)
+  {
+    return metacharacters.indexOf(c) != -1;
+  }
+  
+
+  public boolean hasValidMin()
+  {
+    return (min != EMPTY);
+  }
+
+  public boolean hasValidMax()
+  {
+    return(max != EMPTY);
+  }
+
+  public boolean hasValidRepeat()
+  {
+    return(repeat != EMPTY);
+  }
+
+  public String toString()
+  {
+    String result = "";
+    
+    if (hasParens)
+    {
+      result += "(";
+    }
+    
+    if (autoEscapeStatus)
+    {
+       result += addEscapeCharacters(contents);
+    }
+    else 
+    {
+      result += contents;
+    }
+
+
+    if (hasParens)
+    {
+      result += ")";
+    }
+    
+    switch (quantifier)
+    {
+      case STAR:
+        result += "*";
+        break;
+      
+      case PLUS:
+        result += "+";
+        break;
+      
+      case OPTIONAL:
+        result += "?";
+        break;
+      
+      case REPEAT:
+        result += "{" + repeat + "}";
+        break;
+      
+      case RANGE:
+        result += "{" + min + ",";
+        if (max == EMPTY)
+        {
+          result += "";
+        }
+        else
+        {
+          result += max;
+        }       
+        result += "}";
+        break;
+      
+      // SINGLE is a fall through           
+
+    }
+    return result;
+
+  }
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
new file mode 100644
index 0000000..9abe271
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+// Based on version 1.6 of original xsdeditor
+package org.eclipse.wst.xsd.ui.internal.wizards;
+
+import java.util.regex.Pattern;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+
+
+public class RegexTestingPage extends WizardPage
+{
+  /* Validator from xerces package. */
+//  private RegularExpression validator;
+  
+  /* Displays the status of the match. */
+  private Label matchLabel;
+
+
+  /* The regex. */
+  private Text value;
+  
+  /* The string the user is trying to match against the regex. */
+  private StyledText testString;
+
+  public RegexTestingPage()
+  {
+    super(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_TITLE"));
+
+    setTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_TITLE"));
+    setDescription(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
+  }
+
+
+  public void createControl(Composite parent)
+  {
+    Composite composite = ViewUtility.createComposite(parent, 1);
+    WorkbenchHelp.setHelp(composite, XSDEditorContextIds.XSDR_TEST_PAGE);
+
+    matchLabel = new Label(composite, SWT.WRAP);
+    matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
+    FontData[] fontData = matchLabel.getFont().getFontData();
+    GridData dataF = new GridData();
+    dataF.widthHint = 400;
+    dataF.heightHint = 6 * fontData[0].getHeight();
+    matchLabel.setLayoutData(dataF);
+    
+    Composite controls = new Composite(composite, SWT.NONE);
+    GridLayout controlsLayout = new GridLayout();
+    controlsLayout.numColumns = 2;
+    controls.setLayout(controlsLayout);
+    controls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+    new Label(controls, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_REGEX_LABEL"));
+    value = new Text(controls, SWT.BORDER | SWT.READ_ONLY);
+    value.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+
+    new Label(controls, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_SAMPLE_TEXT"));
+    testString = new StyledText(controls, SWT.SINGLE | SWT.BORDER);
+    WorkbenchHelp.setHelp(testString, XSDEditorContextIds.XSDR_TEST_SAMPLE);
+    testString.addListener(SWT.Modify, new TestStringListener());
+    testString.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+    
+    controls.pack();
+    
+    Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
+    GC gc = new GC(separator);
+    Point pointSize = gc.stringExtent(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
+    GridData gd = new GridData();
+    gd.widthHint = (int)(pointSize.x / 2 + gc.getAdvanceWidth('M')*11);
+    gd.horizontalAlignment= GridData.FILL;
+    separator.setLayoutData(gd);
+    
+    composite.pack();
+
+    setControl(composite);
+  }
+
+
+  private String getPatternValue()
+  {
+    return ( (RegexCompositionPage)getPreviousPage() ).getPattern().getLexicalValue();
+  }
+
+  private String getFlags()
+  {
+    return ( (RegexCompositionPage)getPreviousPage() ).getFlags();
+  }
+
+  public void setVisible(boolean visible)
+  {
+    super.setVisible(visible);
+
+    String pattern = getPatternValue();
+    getFlags();
+
+    value.setText(pattern);
+    
+    updateMatchStatus();
+
+    testString.setFocus();
+  }
+
+  class TestStringListener implements Listener
+  {
+    public void handleEvent(Event e)
+    {
+      updateMatchStatus();
+    }
+  }
+
+  private void updateMatchStatus()
+  {
+    if (Pattern.matches(getPatternValue(), testString.getText()))
+    {
+//      matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MATCHES"));
+      setMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MATCHES"), 1);
+    }
+    else
+    {
+      setMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_DOES_NOT_MATCH"), 2);
+//      matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_DOES_NOT_MATCH"));
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
new file mode 100644
index 0000000..95da3f7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.wizards;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.xsd.XSDPatternFacet;
+import org.eclipse.xsd.impl.XSDFactoryImpl;
+
+
+public class RegexWizard extends Wizard 
+{
+  private RegexCompositionPage compositionPage;
+  private RegexTestingPage testingPage;
+
+  /* The original, unchanged pattern. */  
+  private XSDPatternFacet originalPattern;
+  
+  /* A copy of the original pattern that is passed into the wizard. */
+  private XSDPatternFacet modifiedPattern;
+
+  String pattern;
+
+  public RegexWizard(String expr)
+  {
+    super();
+    setWindowTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TITLE"));
+    setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/regx_wiz.gif"));
+
+    XSDFactoryImpl factory = new XSDFactoryImpl();
+    modifiedPattern = factory.createXSDPatternFacet();
+    modifiedPattern.setLexicalValue(expr);
+
+    originalPattern = factory.createXSDPatternFacet();
+    originalPattern.setLexicalValue(expr);
+
+    compositionPage = new RegexCompositionPage(modifiedPattern);
+    addPage(compositionPage);
+
+    testingPage = new RegexTestingPage();
+    addPage(testingPage);
+  }
+
+  public String getPattern()
+  {
+    return pattern;
+  }
+
+  public boolean performFinish()
+  {
+    pattern = modifiedPattern.getLexicalValue();
+    return true;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
new file mode 100644
index 0000000..204ff2d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.wizards;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+
+
+public class XSDLocationChoicePage extends WizardPage 
+{
+  protected Button radioButton1;
+  protected Button radioButton2;
+    
+  public XSDLocationChoicePage()
+  {
+    super("XSDLocationChoicePage");
+
+    this.setTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_TITLE"));
+    this.setDescription(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_DESC"));
+  }
+    
+  public boolean isPageComplete()
+  {
+    return true;
+  }
+    
+  public void createControl(Composite parent)
+  {
+    Composite base = new Composite(parent, SWT.NONE);
+    base.setLayout(new GridLayout());
+      
+    ViewUtility.createLabel(base, XSDEditorPlugin.getXSDString("_UI_LABEL_INCLUDE_URL_FILE"));
+    Composite radioButtonsGroup = ViewUtility.createComposite(base, 1, true);
+
+    radioButton1 = ViewUtility.createRadioButton(radioButtonsGroup, 
+                                                 XSDEditorPlugin.getXSDString("_UI_RADIO_FILE"));
+      
+    radioButton2 = ViewUtility.createRadioButton(radioButtonsGroup,
+                                                 XSDEditorPlugin.getXSDString("_UI_RADIO_URL"));
+
+    radioButton1.setSelection(true);
+
+    setControl(base);
+  }
+
+  // actions on finish
+  public boolean performFinish()
+  {
+    return true;
+  }
+
+  public boolean isURL()
+  {
+    return radioButton2.getSelection();
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
new file mode 100644
index 0000000..db12cd6
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.wizards;
+ 
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+
+
+public class XSDNewFilePage extends WizardNewFileCreationPage
+{
+  public XSDNewFilePage(IStructuredSelection selection) 
+  {
+    super(XSDEditorPlugin.getXSDString("_UI_CREATEXSD"), selection);
+    setTitle(XSDEditorPlugin.getXSDString("_UI_NEW_XML_SCHEMA_TITLE"));
+    setDescription(XSDEditorPlugin.getXSDString("_UI_CREATE_A_NEW_XML_SCHEMA_DESC"));
+  }
+
+  public void createControl(Composite parent) 
+  {
+    // inherit default container and name specification widgets
+    super.createControl(parent);
+
+    this.setFileName(computeDefaultFileName());
+
+    setPageComplete(validatePage());
+  }
+
+  protected boolean validatePage()
+  {
+    Path newName = new Path(getFileName());
+    String fullFileName = getFileName();
+    String extension = newName.getFileExtension();
+    if (extension == null || !extension.equalsIgnoreCase("xsd")) 
+    {
+      setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_FILENAME_MUST_END_XSD"));
+      return false;
+    }
+    else 
+    {
+      setErrorMessage(null);
+    }
+
+    // check for file should be case insensitive
+    String sameName = existsFileAnyCase(fullFileName);
+    if (sameName != null) 
+    {
+      setErrorMessage(XSDEditorPlugin.getPlugin().getString("_ERROR_FILE_ALREADY_EXISTS", sameName)); //$NON-NLS-1$
+      return false;
+    }
+
+    return super.validatePage();
+  }
+
+  public String defaultName = "NewXMLSchema"; //$NON-NLS-1$
+  public String defaultFileExtension = ".xsd"; //$NON-NLS-1$
+  public String[] filterExtensions = { "*.xsd"}; //$NON-NLS-1$
+
+  protected String computeDefaultFileName()
+  {
+    int count = 0;
+    String fileName = defaultName + defaultFileExtension;
+    IPath containerFullPath = getContainerFullPath();
+    if (containerFullPath != null)
+    {
+      while (true)
+      {
+        IPath path = containerFullPath.append(fileName);
+        if (ResourcesPlugin.getWorkspace().getRoot().exists(path))
+        {
+          count++;
+          fileName = defaultName + count + defaultFileExtension;
+        }
+        else
+        {
+          break;
+        }
+      }
+    }
+    return fileName;
+  }
+
+  // returns true if file of specified name exists in any case for selected container
+  protected String existsFileAnyCase(String fileName)
+  {
+    if ( (getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false)
+        && (fileName.compareTo("") != 0))
+    {
+      //look through all resources at the specified container - compare in upper case
+      IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
+      if (parent instanceof IContainer)
+      {
+        IContainer container = (IContainer) parent;
+        try
+        {
+          IResource[] members = container.members();
+          String enteredFileUpper = fileName.toUpperCase();
+          for (int i=0; i<members.length; i++)
+          {
+            String resourceUpperName = members[i].getName().toUpperCase();
+            if (resourceUpperName.equals(enteredFileUpper))
+            {  
+              return members[i].getName();    
+            }
+          }
+        }
+        catch (CoreException e)
+        {
+        }
+      }
+    }
+    return null;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
new file mode 100644
index 0000000..16e2ac7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
@@ -0,0 +1,371 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFilePage;
+import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDParser;
+
+
+/**
+ * Extend the base wizard to select a file from the project or outside the workbench
+ * and add error handling
+ */
+public class XSDSelectIncludeFileWizard extends Wizard implements INewWizard
+{
+  boolean isInclude;
+  XSDSchema mainSchema;
+  XSDSchema externalSchema;
+
+  XSDLocationChoicePage choicePage;
+  XSDSelectSingleFilePage filePage;
+  XSDURLPage urlPage;
+
+  IFile resultFile;
+  String resultURL;
+  String namespace = "";
+
+  public XSDSelectIncludeFileWizard(XSDSchema mainSchema, boolean isInclude,
+                                    String title, String desc, 
+                                    ViewerFilter filter,
+                                    IStructuredSelection selection)
+  {
+    super();
+    setWindowTitle(title);
+    setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/NewXSD.gif"));
+
+    setNeedsProgressMonitor(true);
+
+    // Choice Page
+    choicePage = new XSDLocationChoicePage();
+
+    // Select File Page
+    filePage = new XSDSelectSingleFilePage(PlatformUI.getWorkbench(),  selection, true);
+    filePage.setTitle(title);
+    filePage.setDescription(desc);
+    filePage.addFilter(filter);
+
+    // URL Page
+    urlPage = new XSDURLPage();
+    urlPage.setTitle(title);
+    urlPage.setDescription(XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_URL"));
+    
+    this.mainSchema = mainSchema;
+    this.isInclude = isInclude;
+  }
+
+  public void init(IWorkbench aWorkbench, IStructuredSelection aSelection)
+  { 
+  }
+
+  public void addPages()
+  {
+    addPage(choicePage);
+    addPage(filePage);
+    addPage(urlPage);
+  }
+
+  public IWizardPage getNextPage(IWizardPage currentPage)
+  {
+    WizardPage nextPage = null;
+
+    if (currentPage == choicePage)
+    {
+      if (choicePage.isURL()) 
+      {
+        nextPage = urlPage;
+      }
+      else
+      {
+        nextPage = filePage;
+      }
+    }
+    return nextPage;
+  }
+
+  public boolean canFinish()
+  {
+    if (!choicePage.isURL())
+    {
+      return filePage.isPageComplete(); 
+    }
+    return true;
+  }
+
+  public boolean performFinish()
+  { 
+    if (choicePage.isURL())
+    {
+      try 
+      {
+        getContainer().run(false, true, urlPage.getRunnable());
+        resultURL = urlPage.getURL();
+      }
+      catch (Exception e)
+      {
+        return false;
+      }
+      return true;
+    }
+    else
+    {  
+      resultFile = filePage.getFile();
+    }
+    return true;
+  }
+
+  /**
+   * Get the MOF object that represents the external file
+   */
+  public XSDSchema getExternalSchema()
+  {
+    return externalSchema;
+  }
+
+  public IFile getResultFile()
+  {
+    return resultFile;
+  }
+
+  public String getURL()
+  {
+    return resultURL;
+  }
+  
+  public String getNamespace()
+  {
+  	return namespace;
+  }
+
+  /**
+   * Create a MOF model for the imported file
+   */
+  protected String doLoadExternalModel(IProgressMonitor monitor, String xsdModelFile, String xsdFileName)
+  { 
+    String errorMessage = null;
+    String currentNameSpace = mainSchema.getTargetNamespace();
+
+    monitor.beginTask("Loading XML Schema", 100);
+    monitor.worked(50);
+
+    XSDParser parser = new XSDParser();
+    parser.parse(xsdModelFile);
+
+    externalSchema = parser.getSchema();
+    if (externalSchema != null)
+    {
+      String extNamespace = externalSchema.getTargetNamespace();
+      namespace = extNamespace;
+     
+      if (externalSchema.getDiagnostics() != null &&
+          externalSchema.getDiagnostics().size() > 0)
+      {
+        errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
+      }  
+      else
+      {
+        if (isInclude) 
+        {  
+          // Check the namespace to make sure they are the same as current file
+          if (extNamespace != null)
+          {
+            if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
+            {
+              errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_DIFFERENT_NAME_SPACE", xsdFileName);
+            }
+          }
+        }
+        else
+        {  
+          // Check the namespace to make sure they are different from the current file
+          if (extNamespace != null)
+          {
+            if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
+            {
+              errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_SAME_NAME_SPACE", xsdFileName);
+            }
+          }
+        }
+      }
+    }
+    else
+    {
+      errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
+    }
+
+    monitor.subTask("Finish Loading");
+    monitor.worked(80);
+
+    return errorMessage;
+  }
+
+ 
+  /**
+   * URL page
+   */
+  class XSDURLPage extends WizardPage
+  { 
+    Text urlField;
+    String saveString;
+
+    public XSDURLPage()
+    {
+      super("URLPage");
+    }
+
+    public void createControl(Composite parent)
+    {
+      Composite client = ViewUtility.createComposite(parent,2);
+      ViewUtility.setComposite(client);
+
+      ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_URL"));
+      ViewUtility.createLabel(client, "");
+
+      urlField = ViewUtility.createTextField(client, 50);
+      saveString = "http://";
+      urlField.setText(saveString);
+
+      setControl(client);
+    }
+
+    public String getURL()
+    {
+      return urlField.getText();
+    }
+
+    private boolean openExternalSchema(IProgressMonitor monitor)
+    {
+      String text = urlField.getText();
+//      if (text.equals(saveString)) 
+//      {
+//        return false;
+//      }
+//      saveString = text;
+
+      if (text.equals(""))
+      {
+        setErrorMessage(XSDEditorPlugin.getXSDString("_UI_SPECIFY_URL"));
+        return false;
+      }
+
+      if ( !text.startsWith("http://") )
+      {
+        setErrorMessage(XSDEditorPlugin.getXSDString("_UI_URL_START_WITH"));
+        return false;
+      }
+
+      setErrorMessage(null);
+      String errorMessage = doLoadExternalModel(monitor, text, text);
+      if (errorMessage != null) 
+      {
+        setErrorMessage(errorMessage); 
+        return false;
+      }
+      else
+      {
+        return true;
+      }
+    }
+
+    public IRunnableWithProgress getRunnable()
+    {
+      return new IRunnableWithProgress()
+      {
+        public void run(IProgressMonitor monitor)   
+          throws InvocationTargetException, InterruptedException
+        {
+          if (monitor == null)
+          {
+            monitor= new NullProgressMonitor();
+          }
+          monitor.beginTask("", 6);
+        
+          boolean ok = openExternalSchema(monitor);
+
+          if (!ok) 
+          { 
+            throw new InvocationTargetException(new java.lang.Error());
+          }
+
+          monitor.done();
+        }
+      };
+    }
+  }
+
+  /**
+   * Select XML Schema File
+   */
+  class XSDSelectSingleFilePage extends SelectSingleFilePage
+  {
+    public XSDSelectSingleFilePage(IWorkbench workbench, IStructuredSelection selection, boolean isFileMandatory)
+    {          
+      super(workbench,selection,isFileMandatory);
+    }
+
+    private boolean openExternalSchema()
+    {
+      // Get the fully-qualified file name
+      IFile iFile = getFile();
+      if (iFile == null) 
+        return false;
+
+      setErrorMessage(null);
+
+      String xsdModelFile = iFile.getLocation().toOSString();
+      String xsdFileName = iFile.getName();
+      String errorMessage = doLoadExternalModel(new NullProgressMonitor(), xsdModelFile, xsdFileName);
+
+      if (errorMessage != null) 
+      {
+        setErrorMessage(errorMessage);
+        return false;
+      }
+      else
+      {
+        return true;
+      }
+    }
+
+    public boolean isPageComplete()
+    {  
+      if (choicePage.isURL()) 
+      {
+        return true;
+      }
+
+      if (super.isPageComplete()) 
+      {
+        return openExternalSchema();
+      }
+      return super.isPageComplete();
+    }
+  }
+}
diff --git a/development/org.eclipse.wst.sse.unittests/.classpath b/development/org.eclipse.wst.sse.unittests/.classpath
deleted file mode 100644
index 751c8f2..0000000
--- a/development/org.eclipse.wst.sse.unittests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/development/org.eclipse.wst.sse.unittests/.cvsignore b/development/org.eclipse.wst.sse.unittests/.cvsignore
deleted file mode 100644
index a37b9c5..0000000
--- a/development/org.eclipse.wst.sse.unittests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.properties
-build.xml
-ssejunit.jar
-temp.folder
diff --git a/development/org.eclipse.wst.sse.unittests/.project b/development/org.eclipse.wst.sse.unittests/.project
deleted file mode 100644
index e6f5109..0000000
--- a/development/org.eclipse.wst.sse.unittests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.sse.unittests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs b/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c1373fb..0000000
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,58 +0,0 @@
-#Mon May 30 19:10:44 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.pde.prefs b/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index ec4f796..0000000
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Tue Apr 04 01:49:59 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/development/org.eclipse.wst.sse.unittests/META-INF/MANIFEST.MF b/development/org.eclipse.wst.sse.unittests/META-INF/MANIFEST.MF
deleted file mode 100644
index c14ec7b..0000000
--- a/development/org.eclipse.wst.sse.unittests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,38 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.sse.unittests; singleton:=true
-Bundle-Version: 0.7.0
-Bundle-ClassPath: sseunittests.jar
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.unittests,
- org.eclipse.wst.sse.unittests.minortools
-Require-Bundle: org.junit,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jst.jsp.core.tests,
- org.eclipse.jst.jsp.tests.encoding,
- org.eclipse.jst.jsp.ui.tests,
- org.eclipse.jst.jsp.ui.tests.performance,
- org.eclipse.wst.css.core.tests,
- org.eclipse.wst.css.tests.encoding,
- org.eclipse.wst.css.ui.tests.performance,
- org.eclipse.wst.dtd.ui.tests,
- org.eclipse.wst.html.core.tests,
- org.eclipse.wst.html.tests.encoding,
- org.eclipse.wst.html.ui.tests,
- org.eclipse.wst.html.ui.tests.performance,
- org.eclipse.wst.sse.core.tests,
- org.eclipse.wst.sse.ui.tests,
- org.eclipse.wst.sse.ui.tests.performance,
- org.eclipse.wst.xml.core.tests,
- org.eclipse.wst.xml.tests.encoding,
- org.eclipse.wst.xml.ui.tests.performance,
- org.eclipse.wst.xml.validation.tests,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.javascript.ui,
- org.eclipse.wst.xsd.validation.tests,
- org.eclipse.wst.css.ui.tests,
- org.eclipse.wst.sse.ui,
- org.eclipse.wst.xml.ui.tests
diff --git a/development/org.eclipse.wst.sse.unittests/icons/sourceEditor.gif b/development/org.eclipse.wst.sse.unittests/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8..0000000
--- a/development/org.eclipse.wst.sse.unittests/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/development/org.eclipse.wst.sse.unittests/plugin.properties b/development/org.eclipse.wst.sse.unittests/plugin.properties
deleted file mode 100644
index 47e0b23..0000000
--- a/development/org.eclipse.wst.sse.unittests/plugin.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 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
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-#     
-###############################################################################
-XML_Source_Page_Editor.name=XML Source Page Editor
-JavaScript_Source_Page_Editor.name=JavaScript Source Page Editor
-
-
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = Unittests
\ No newline at end of file
diff --git a/development/org.eclipse.wst.sse.unittests/plugin.xml b/development/org.eclipse.wst.sse.unittests/plugin.xml
deleted file mode 100644
index c869906..0000000
--- a/development/org.eclipse.wst.sse.unittests/plugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-        <extension point="org.eclipse.ui.editors">
-                <editor
-                        name="%XML_Source_Page_Editor.name"
-                        icon="icons/sourceEditor.gif"
-                        contributorClass="org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML"
-                        class="org.eclipse.wst.sse.ui.StructuredTextEditor"
-                        symbolicFontName="org.eclipse.wst.sse.ui.textfont"
-                        id="org.eclipse.core.runtime.xml.source">
-                        <contentTypeBinding
-                                contentTypeId="org.eclipse.core.runtime.xml" />
-                        <contentTypeBinding
-                                contentTypeId="org.eclipse.wst.xml.core.xmlsource" />
-                </editor>
-        </extension>
-        	<extension point="org.eclipse.ui.editors">
-		<editor
-			name="%JavaScript_Source_Page_Editor.name"
-			icon="icons/sourceEditor.gif"
-			extensions="js"
-			contributorClass="org.eclipse.wst.javascript.ui.internal.actions.ActionContributorJS"
-			class="org.eclipse.wst.javascript.ui.internal.editor.JSEditor"
-			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
-			id="org.eclipse.wst.javascript.core.javascriptsource.source">
-			<contentTypeBinding
-				contentTypeId="org.eclipse.wst.javascript.core.javascriptsource" />
-		</editor>
-	</extension>
-</plugin>
\ No newline at end of file
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java
deleted file mode 100644
index a2ea5b3..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.sse.unittests;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsp.core.tests.JSPCoreTestSuite;
-import org.eclipse.jst.jsp.tests.encoding.JSPEncodingTestSuite;
-import org.eclipse.jst.jsp.ui.tests.JSPUITestSuite;
-import org.eclipse.wst.css.core.tests.CSSCoreTestSuite;
-import org.eclipse.wst.css.tests.encoding.CSSEncodingTestSuite;
-import org.eclipse.wst.css.ui.tests.CSSUITestSuite;
-import org.eclipse.wst.dtd.ui.tests.DTDUITestSuite;
-import org.eclipse.wst.html.core.tests.HTMLCoreTestSuite;
-import org.eclipse.wst.html.tests.encoding.HTMLEncodingTestSuite;
-import org.eclipse.wst.html.ui.tests.HTMLUITestSuite;
-import org.eclipse.wst.sse.core.tests.SSEModelTestSuite;
-import org.eclipse.wst.sse.ui.tests.SSEUITestSuite;
-import org.eclipse.wst.xml.core.tests.SSEModelXMLTestSuite;
-import org.eclipse.wst.xml.tests.encoding.EncodingTestSuite;
-import org.eclipse.wst.xml.ui.tests.XMLUITestSuite;
-import org.eclipse.wst.xml.validation.tests.internal.AllXMLTests;
-import org.eclipse.wst.xsd.validation.tests.internal.AllXSDTests;
-
-/*****************************************************************************
- * Copyright (c) 2004 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 http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: IBM Corporation - initial API and implementation
- * 
- ****************************************************************************/
-
-public class MasterListTestSuite extends TestSuite {
-
-	public MasterListTestSuite() {
-		super("All Tests");
-		
-		System.setProperty("wtp.autotest.noninteractive", "true");
-
-		addTest(SSEModelTestSuite.suite());
-		addTest(SSEModelXMLTestSuite.suite());
-		addTest(CSSCoreTestSuite.suite());
-		addTest(HTMLCoreTestSuite.suite());
-		addTest(JSPCoreTestSuite.suite());
-
-		addTest(AllXMLTests.suite());
-		
-		addTest(EncodingTestSuite.suite());
-		addTest(CSSEncodingTestSuite.suite());
-		addTest(HTMLEncodingTestSuite.suite());
-		addTest(JSPEncodingTestSuite.suite());
-
-		addTest(CSSUITestSuite.suite());
-		addTest(HTMLUITestSuite.suite());
-		addTest(SSEUITestSuite.suite());
-		addTest(XMLUITestSuite.suite());
-		addTest(DTDUITestSuite.suite());
-		addTest(JSPUITestSuite.suite());
-		
-		addTest(AllXSDTests.suite());
-		//addTest(RegressionBucket.suite());
-		//addTest(AllTestCases.suite());
-
-	}
-
-	public void testAll() {
-		// this method needs to exist, but doesn't really do anything
-		// other than to signal to create an instance of this class.
-		// The rest it automatic from the tests added in constructor. 
-	}
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java
deleted file mode 100644
index 8491014..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.sse.unittests;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsp.ui.tests.performance.JSPUIPerformanceTests;
-import org.eclipse.wst.css.ui.tests.performance.CSSUIPerformanceTestSuite;
-import org.eclipse.wst.html.ui.tests.performance.HTMLUIPerformanceTestSuite;
-import org.eclipse.wst.sse.ui.tests.performance.SSEUIPerformanceTestSuite;
-import org.eclipse.wst.xml.ui.tests.performance.XMLUIPerformanceTestSuite;
-
-/*****************************************************************************
- * Copyright (c) 2004 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 http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: IBM Corporation - initial API and implementation
- * 
- ****************************************************************************/
-
-public class MasterPerformanceTestSuite extends TestSuite {
-
-	public MasterPerformanceTestSuite() {
-		super("All Tests");
-
-		addTest(JSPUIPerformanceTests.suite());
-		addTest(CSSUIPerformanceTestSuite.suite());
-		addTest(HTMLUIPerformanceTestSuite.suite());
-		addTest(SSEUIPerformanceTestSuite.suite());
-		addTest(XMLUIPerformanceTestSuite.suite());
-
-
-	}
-
-	public void testAll() {
-		// this method needs to exist, but doesn't really do anything
-	}
-
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java
deleted file mode 100644
index 300d5e5..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.unittests.minortools;
-
-
-
-public class TestStringUtils {
-
-	/**
-	 * TestStringUtils constructor comment.
-	 */
-	private TestStringUtils() {
-		super();
-	}
-
-	/**
-	 * Replace matching literal portions of a string with another string
-	 */
-	public static String replace(String aString, String source, String target) {
-		if (aString == null)
-			return null;
-		String normalString = ""; //$NON-NLS-1$
-		int length = aString.length();
-		int position = 0;
-		int previous = 0;
-		int spacer = source.length();
-		while (position + spacer - 1 < length && aString.indexOf(source, position) > -1) {
-			position = aString.indexOf(source, previous);
-			normalString = normalString + aString.substring(previous, position) + target;
-			position += spacer;
-			previous = position;
-		}
-		normalString = normalString + aString.substring(position, aString.length());
-
-		return normalString;
-	}
-
-}
\ No newline at end of file
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java
deleted file mode 100644
index 811a668..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.unittests.minortools;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.eclipse.wst.xml.core.tests.util.CommonXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-
-
-/**
- * Modifies plugin.xml and fragment.xml files to not require specific versions
- * of their plugin dependencies.
- * 
- * @author nitin
- */
-public class VersionRemover {
-
-	char[] charbuff = new char[2048];
-	StringBuffer s = null;
-
-	public VersionRemover() {
-		super();
-	}
-
-
-
-	public static void main(String[] args) {
-		if (args.length < 1)
-			new VersionRemover().visit(new File("d:/target"));
-		else
-			new VersionRemover().visit(new File(args[0]));
-	}
-
-
-
-	protected void visit(File file) {
-		// Skip directories like org.eclipse.*, org.apache.*, and org.junit.*
-		if (file.isDirectory() && !file.getName().startsWith("org.eclipse.") && !file.getName().startsWith("org.apache") && !file.getName().startsWith("org.junit")) {
-			String[] contents = file.list();
-			for (int i = 0; i < contents.length; i++)
-				visit(new File(file.getAbsolutePath() + '/' + contents[i]));
-		}
-		else {
-			fixupFile(file);
-		}
-	}
-
-	protected void fixupFile(File file) {
-		// only load and fixup files named plugin.xml or fragment.xml under eclipse\plugins\XXXXXXX.*
-		if (!(file.getName().equalsIgnoreCase("plugin.xml") || file.getName().equalsIgnoreCase("fragment.xml")) || file.getAbsolutePath().indexOf("eclipse\\plugins\\XXXXXXX.") == -1)
-			return;
-		//		System.out.println(file.getAbsolutePath());
-		try {
-			Document doc = CommonXML.getDocumentBuilder().parse(file);
-			NodeList imports = null;
-			if (file.getName().equalsIgnoreCase("plugin.xml"))
-				imports = doc.getElementsByTagName("import");
-			else if (file.getName().equalsIgnoreCase("fragment.xml"))
-				imports = doc.getElementsByTagName("fragment");
-			boolean changed = false;
-			for (int i = 0; i < imports.getLength(); i++) {
-				Node importNode = imports.item(i);
-				if (importNode.getNodeName().equalsIgnoreCase("import") && importNode.getAttributes().getNamedItem("version") != null) {
-					changed = true;
-					importNode.getAttributes().removeNamedItem("version");
-				}
-				if (importNode.getAttributes().getNamedItem("plugin-version") != null) {
-					changed = true;
-					importNode.getAttributes().removeNamedItem("plugin-version");
-				}
-				if (importNode.getAttributes().getNamedItem("match") != null) {
-					importNode.getAttributes().removeNamedItem("match");
-					changed = true;
-				}
-			}
-			if (changed) {
-				FileOutputStream ostream = new FileOutputStream(file.getAbsolutePath());
-				CommonXML.serialize(doc, ostream);
-				ostream.close();
-				System.out.println("Modified " + file.getAbsolutePath());
-			}
-		}
-		catch (SAXException e) {
-			System.err.println(file.getPath() + ": " + e);
-		}
-		catch (IOException e) {
-			System.err.println(file.getPath() + ": " + e);
-		}
-	}
-}
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/.project b/docs/org.eclipse.wst.doc.user/.project
index 94c75b9..cd8121a 100644
--- a/docs/org.eclipse.wst.doc.user/.project
+++ b/docs/org.eclipse.wst.doc.user/.project
@@ -2,18 +2,15 @@
 <projectDescription>
 	<name>org.eclipse.wst.doc.user</name>
 	<comment></comment>
-	<projects>
-	</projects>
+	<projects></projects>
 	<buildSpec>
 		<buildCommand>
 			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
+			<arguments></arguments>
 		</buildCommand>
 		<buildCommand>
 			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
+			<arguments></arguments>
 		</buildCommand>
 	</buildSpec>
 	<natures>
diff --git a/docs/org.eclipse.wst.doc.user/toc.xml b/docs/org.eclipse.wst.doc.user/toc.xml
index 7ac352e..84f6f6c 100644
--- a/docs/org.eclipse.wst.doc.user/toc.xml
+++ b/docs/org.eclipse.wst.doc.user/toc.xml
@@ -13,7 +13,7 @@
 <!-- ============================================================================= -->
 <!-- Define the top level topics                                                   -->
 <!-- ============================================================================= -->
-<toc label="Web Application Development User Guide"
+<toc label="Web Application Development Guide"
 	topic="topics/overview.html">
 
 	<topic label="Creating Web applications">
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
index 17c96df..b7ecc4e 100644
--- a/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
@@ -5,3 +5,4 @@
 Bundle-Version: 1.0.1.qualifier
 Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
+Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF
index a027178..0b50faf 100644
--- a/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF
@@ -1,7 +1,8 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
+Bundle-Name: HTML editor infopops
 Bundle-SymbolicName: org.eclipse.wst.html.ui.infopop; singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
+Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.html.ui.infopop/plugin.properties b/docs/org.eclipse.wst.html.ui.infopop/plugin.properties
deleted file mode 100644
index a24444c..0000000
--- a/docs/org.eclipse.wst.html.ui.infopop/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# properties file for org.eclipse.wst.html.ui.infopop
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = HTML editor infopops
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF
index be98fc3..4829ed3 100644
--- a/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF
@@ -1,7 +1,8 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
+Bundle-Name: Structured text editor and snippets documentation
 Bundle-SymbolicName: org.eclipse.wst.sse.doc.user; singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
+Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.sse.doc.user/plugin.properties b/docs/org.eclipse.wst.sse.doc.user/plugin.properties
deleted file mode 100644
index d97c2f1..0000000
--- a/docs/org.eclipse.wst.sse.doc.user/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# properties file for org.eclipse.wst.sse.doc.user
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = Structured text editor and snippets documentation
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
index a4eb952..6af73d3 100644
--- a/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
@@ -1,7 +1,8 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
+Bundle-Name: SSE infopops
 Bundle-SymbolicName: org.eclipse.wst.sse.ui.infopop; singleton:=true
 Bundle-Version: 1.0.1.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
+Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties b/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties
deleted file mode 100644
index 84f306f..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# properties file for org.eclipse.wst.sse.ui.infopop
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = SSE infopops
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF
index 79df078..34068a0 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF
@@ -5,3 +5,4 @@
 Bundle-Version: 1.0.1.qualifier
 Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
+Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/build.properties b/docs/org.eclipse.wst.xml.ui.infopop/build.properties
index 29a969b..c491d33 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/build.properties
+++ b/docs/org.eclipse.wst.xml.ui.infopop/build.properties
@@ -3,6 +3,7 @@
                EditorXmlContexts2.xml,\
                about.html,\
                plugin.properties,\
-               plugin.xml
-src.includes = XMLWizardContexts.xml,\
+               plugin.xml,\
+               src.includes = build.properties,\
+               XMLWizardContexts.xml,\
                TableTree.xml
diff --git a/features/org.eclipse.wst.web_core.feature/build.properties b/features/org.eclipse.wst.web_core.feature/build.properties
index 7f47694..d6a4dce 100644
--- a/features/org.eclipse.wst.web_core.feature/build.properties
+++ b/features/org.eclipse.wst.web_core.feature/build.properties
@@ -3,3 +3,8 @@
                epl-v10.html,\
                license.html,\
                feature.properties
+src.includes = license.html,\
+               feature.xml,\
+               epl-v10.html,\
+               eclipse_update_120.jpg,\
+               build.properties
diff --git a/features/org.eclipse.wst.web_core.feature/feature.xml b/features/org.eclipse.wst.web_core.feature/feature.xml
index 0f27779..f95f6d6 100644
--- a/features/org.eclipse.wst.web_core.feature/feature.xml
+++ b/features/org.eclipse.wst.web_core.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.web_core.feature"
       label="WDT Web Core Feature"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="Eclipse.org">
 
    <description>
@@ -14,11 +14,11 @@
    </license>
 
    <requires>
-      <import feature="org.eclipse.platform" version="3.2" match="equivalent"/>
-      <import feature="org.eclipse.emf" version="2.2" match="equivalent"/>
-      <import feature="org.eclipse.jem" version="1.2" match="equivalent"/>
-      <import feature="org.eclipse.wst.server_core.feature" version="1.0.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.wst.common_core.feature" version="1.0.0" match="greaterOrEqual"/>
+      <import feature="org.eclipse.platform" version="3.1.1" match="equivalent"/>
+      <import feature="org.eclipse.emf" version="2.1.1" match="equivalent"/>
+      <import feature="org.eclipse.jem" version="1.1.0.1" match="equivalent"/>
+      <import feature="org.eclipse.wst.server_core.feature" version="1.0.2" match="equivalent"/>
+      <import feature="org.eclipse.wst.common_core.feature" version="1.0.2" match="equivalent"/>
    </requires>
 
    <plugin
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.xml b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.xml
index 9708bad..28ef80f 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.xml
+++ b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.web_core.feature.source"
       label="%featureName"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="%providerName">
 
    <description>
diff --git a/features/org.eclipse.wst.web_sdk.feature/feature.xml b/features/org.eclipse.wst.web_sdk.feature/feature.xml
index d7496f9..5a3bab9 100644
--- a/features/org.eclipse.wst.web_sdk.feature/feature.xml
+++ b/features/org.eclipse.wst.web_sdk.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.web_sdk.feature"
       label="WST Web SDK Feature"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="Eclipse.org">
 
    <description>
diff --git a/features/org.eclipse.wst.web_ui.feature/feature.xml b/features/org.eclipse.wst.web_ui.feature/feature.xml
index 2eb5498..de8797c 100644
--- a/features/org.eclipse.wst.web_ui.feature/feature.xml
+++ b/features/org.eclipse.wst.web_ui.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.web_ui.feature"
       label="org.eclipse.wst.web_ui.feature"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="Eclipse.org">
 
    <description>
@@ -22,7 +22,7 @@
          version="0.0.0"/>
 
    <requires>
-      <import feature="org.eclipse.wst.web_core.feature" version="1.0.0" match="greaterOrEqual"/>
+      <import feature="org.eclipse.wst.web_core.feature" version="1.0.2" match="equivalent" />
    </requires>
 
    <plugin
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.xml b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.xml
index 39d4833..cfacab0 100644
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.xml
+++ b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.web_ui.feature.source"
       label="Source for WST Web UI Feature"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="%providerName">
 
    <description>
diff --git a/features/org.eclipse.wst.web_userdoc.feature/feature.xml b/features/org.eclipse.wst.web_userdoc.feature/feature.xml
index d8d4474..d2f0bcb 100644
--- a/features/org.eclipse.wst.web_userdoc.feature/feature.xml
+++ b/features/org.eclipse.wst.web_userdoc.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.web_userdoc.feature"
       label="WST Web User Doc Feature"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="Eclipse.org">
 
    <description>
diff --git a/features/org.eclipse.wst.xml_core.feature/feature.xml b/features/org.eclipse.wst.xml_core.feature/feature.xml
index 2bbb855..7110289 100644
--- a/features/org.eclipse.wst.xml_core.feature/feature.xml
+++ b/features/org.eclipse.wst.xml_core.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_core.feature"
       label="XML Core Feature"
-      version="1.5.0.qualifier">
+      version="1.0.2.qualifier">
 
    <description>
       %description
@@ -11,18 +11,18 @@
    <license url="license.html">
       %license
    </license>
-   
+
    <url>
       <update label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates/"/>
    </url>
 
    <requires>
-      <import feature="org.apache.xerces.feature" version="2.8.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.rcp" version="3.2" match="equivalent"/>
-      <import feature="org.eclipse.platform" version="3.2" match="equivalent"/>
-      <import feature="org.eclipse.emf" version="2.2" match="equivalent"/>
-      <import feature="org.eclipse.wst.common_core.feature" version="1.0.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.xsd" version="2.2" match="equivalent"/>
+      <import feature="org.apache.xerces.feature" version="2.7.0" match="equivalent"/>
+      <import feature="org.eclipse.rcp" version="3.1.2" match="equivalent"/>
+      <import feature="org.eclipse.platform" version="3.1.2" match="equivalent"/>
+      <import feature="org.eclipse.emf" version="2.1.1" match="equivalent"/>
+      <import feature="org.eclipse.wst.common_core.feature" version="1.0.2" match="equivalent"/>
+      <import feature="org.eclipse.xsd" version="2.1.1" match="equivalent"/>
    </requires>
 
    <plugin
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.xml b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.xml
index 4902d05..0966476 100644
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.xml
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_core.feature.source"
       label="%featureName"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="%providerName">
 
    <description>
@@ -21,6 +21,8 @@
       <update label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates/"/>
    </url>
 
+
+
    <plugin
          id="org.eclipse.wst.xml_core.feature.source"
          download-size="0"
diff --git a/features/org.eclipse.wst.xml_sdk.feature/feature.xml b/features/org.eclipse.wst.xml_sdk.feature/feature.xml
index ddf1d89..01e843a 100644
--- a/features/org.eclipse.wst.xml_sdk.feature/feature.xml
+++ b/features/org.eclipse.wst.xml_sdk.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_sdk.feature"
       label="SDK for XML Components"
-      version="1.5.0.qualifier">
+      version="1.0.2.qualifier">
 
    <description>
       %description
@@ -11,11 +11,11 @@
    <license url="license.html">
       %license
    </license>
-   
+
    <url>
       <update label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates/"/>
    </url>
-   
+
    <includes
          id="org.eclipse.wst.xml_ui.feature.source"
          version="0.0.0"/>
diff --git a/features/org.eclipse.wst.xml_ui.feature/.cvsignore b/features/org.eclipse.wst.xml_ui.feature/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.wst.xml_ui.feature/feature.xml b/features/org.eclipse.wst.xml_ui.feature/feature.xml
index c040fa7..6881984 100644
--- a/features/org.eclipse.wst.xml_ui.feature/feature.xml
+++ b/features/org.eclipse.wst.xml_ui.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_ui.feature"
       label="XML UI Feature"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="%providerName">
 
    <description>
@@ -22,10 +22,10 @@
          version="0.0.0"/>
 
    <requires>
-      <import feature="org.apache.xerces.feature" version="2.8.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.wst.xml_core.feature" version="1.1.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.wst.common_ui.feature" version="1.0.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.gef" version="3.2" match="equivalent"/>
+      <import feature="org.apache.xerces.feature" version="2.7.0" match="greaterOrEqual"/>
+      <import feature="org.eclipse.wst.xml_core.feature" version="1.0.2" match="equivalent"/>
+      <import feature="org.eclipse.wst.common_ui.feature" version="1.0.2" match="equivalent"/>
+      <import feature="org.eclipse.gef" version="3.1.1" match="equivalent"/>
    </requires>
 
    <plugin
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.xml b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.xml
index eef1bb5..4f78dc9 100644
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.xml
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_ui.feature.source"
       label="%featureName"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="%providerName">
 
    <description>
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/feature.xml b/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
index 771c4d2..bd7e7b0 100644
--- a/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
+++ b/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_userdoc.feature"
       label="WTP XML User Documentation"
-      version="1.5.0.qualifier"
+      version="1.0.2.qualifier"
       provider-name="%providerName">
 
    <description>