Updates for some ContentOutline actions, and container naming of classfiles/compilation units.
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/java/JSPTranslation.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/java/JSPTranslation.java
index 7db8b03..fea80e8 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/java/JSPTranslation.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/java/JSPTranslation.java
@@ -22,6 +22,7 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.text.Position;
 import org.eclipse.wst.jsdt.core.IBuffer;
+import org.eclipse.wst.jsdt.core.IClasspathEntry;
 import org.eclipse.wst.jsdt.core.ICompilationUnit;
 import org.eclipse.wst.jsdt.core.IJavaElement;
 import org.eclipse.wst.jsdt.core.IJavaProject;
@@ -36,6 +37,7 @@
 import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
 import org.eclipse.wst.jsdt.ui.StandardJavaElementContentProvider;
 import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
 
 /**
  * @author brad childs
@@ -44,6 +46,8 @@
 	// for debugging
 	private static final boolean DEBUG;
 	
+	
+	
 	static {
 		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslation"); //$NON-NLS-1$
 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
@@ -79,7 +83,11 @@
 			fHtmlToJsMap = translator.getHtml2JsRanges();
 			fJsName = translator.getFile().getName();
 			targetFile = translator.getFile();
-			fDocumentScope = new DocumentContextFragmentRoot(fJavaProject, targetFile, WebRootFinder.getWebContentFolder(javaProj.getProject()), WebRootFinder.getServerContextRoot(javaProj.getProject()));
+			fDocumentScope = new DocumentContextFragmentRoot(fJavaProject, 
+															 targetFile, 
+															 WebRootFinder.getWebContentFolder(javaProj.getProject()), 
+															 WebRootFinder.getServerContextRoot(javaProj.getProject()),
+															 JsWebNature.VIRTUAL_SCOPE_ENTRY);
 			fGeneratedFunctionNames = translator.getExcludedElements();
 			importRanges = translator.getImportHtmlRanges();
 			ArrayList rawImports = translator.getRawImports();
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
index 9fa8f87..d13b03e 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
@@ -25,8 +25,9 @@
 	private static final String BUILDER_ID = "org.eclipse.wst.jsdt.web.core.embeded.javascript"; //$NON-NLS-1$
 	//private static final String NATURE_IDS[] = {"org.eclipse.wst.jsdt.web.core.embeded.jsNature",JavaCore.NATURE_ID}; //$NON-NLS-1$
 	private static final String NATURE_IDS[] = {JavaCore.NATURE_ID}; //$NON-NLS-1$
-	private static final String CONTAINER_ID="org.eclipse.wst.jsdt.launching.WebProject";
 	
+	public static final IPath VIRTUAL_CONTAINER_PATH=new Path("org.eclipse.wst.jsdt.launching.WebProject");
+	public static final IClasspathEntry VIRTUAL_SCOPE_ENTRY = JavaCore.newContainerEntry(VIRTUAL_CONTAINER_PATH);
 	
 	public static void addJsNature(IProject project, IProgressMonitor monitor) throws CoreException {
 		if (monitor != null && monitor.isCanceled()) {
@@ -240,12 +241,12 @@
 		}
 	}
 	private IClasspathEntry[] initLocalClassPath() {
-		IClasspathEntry library = JavaCore.newContainerEntry( new Path(CONTAINER_ID));
-		classPathEntries.add(library);
+	//	IClasspathEntry library = JavaCore.newContainerEntry( new Path(CONTAINER_ID));
+		classPathEntries.add(VIRTUAL_SCOPE_ENTRY);
 //		IPath webRoot = WebRootFinder.getWebContentFolder(fCurrProject);
 //		IClasspathEntry source = JavaCore.newSourceEntry(webRoot.append("/"));
 //		classPathEntries.add(source);
-		return new IClasspathEntry[] {library/*, source*/};
+		return new IClasspathEntry[] {VIRTUAL_SCOPE_ENTRY/*, source*/};
 	}
 	private void initOutputPath() {
 		if (fOutputLocation == null) {
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectClassPathContainerInitializer.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectClassPathContainerInitializer.java
index 83fda45..74135a9 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectClassPathContainerInitializer.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectClassPathContainerInitializer.java
@@ -3,10 +3,15 @@
  */
 package org.eclipse.wst.jsdt.web.core.internal.project;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.wst.jsdt.core.ClasspathContainerInitializer;
 import org.eclipse.wst.jsdt.core.IJavaProject;
+import org.eclipse.wst.jsdt.web.core.internal.java.JSP2ServletNameUtil;
 
 /**
  * @author childsb
@@ -14,6 +19,8 @@
  */
 public class WebProjectClassPathContainerInitializer extends ClasspathContainerInitializer {
 
+	private static final String MANGLED_BUTT = ".htm";
+	
 	/* (non-Javadoc)
 	 * @see org.eclipse.wst.jsdt.core.ClasspathContainerInitializer#initialize(org.eclipse.core.runtime.IPath, org.eclipse.wst.jsdt.core.IJavaProject)
 	 */
@@ -34,7 +41,48 @@
 	 * @see org.eclipse.wst.jsdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.wst.jsdt.core.IJavaProject)
 	 */
 	public String getDescription(IPath containerPath, IJavaProject project) {
-		return new String("Web Project support for JSDT");
+		if(containerPath.equals(JsWebNature.VIRTUAL_CONTAINER_PATH)) {
+			return new String("Web Project support for JSDT");
+		}
+		
+		String containerPathString = containerPath.toString();
+			String unmangled =  getUnmangedHtmlPath(containerPathString);
+			if(unmangled!=null) {
+				IPath projectPath = project.getPath();
+				
+				/* Replace the project path with the project name */
+				if(unmangled.indexOf(projectPath.toString()) >=0) {
+					unmangled =  project.getDisplayName() + ":"  + unmangled.substring(projectPath.toString().length());
+				}
+				return unmangled;
+			}
+		return containerPathString;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.core.ClasspathContainerInitializer#getHostPath(org.eclipse.core.runtime.IPath)
+	 */
+	public URI getHostPath(IPath path, IJavaProject project) {
+		// TODO Auto-generated method stub
+		String htmlPath = getUnmangedHtmlPath(path.toString());
+		if(htmlPath!=null) {
+			try {
+				return new URI(htmlPath);
+			} catch (URISyntaxException ex) {
+			
+				ex.printStackTrace();
+			}	
+		}
+		return null;
+	}
+	
+	private static String getUnmangedHtmlPath(String containerPathString) {
+		if(containerPathString==null) return null;
+		
+		if(containerPathString.toLowerCase().indexOf(MANGLED_BUTT)==-1) {
+			return  JSP2ServletNameUtil.unmangle(containerPathString);
+		}
+		return null;
 	}
 	
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
index 228d52c..f48e3a7 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
@@ -3,6 +3,9 @@
 <plugin>
 	
  	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
+ 		<contentOutlineConfiguration
+			class="org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JsContentOutlineConfig"
+			target="org.eclipse.wst.html.core.htmlsource" />		
 		<provisionalConfiguration
 			type="contentassistprocessor"
 			class="org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant"
@@ -54,7 +57,6 @@
 	
 	 <extension
          point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
-
       <hyperlinkDetector
             class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSPJavaHyperlinkDetector"
             id="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.script.JSPJavaHyperlinkDetector"
@@ -68,6 +70,50 @@
             targetId="org.eclipse.wst.html.SCRIPT.EVENT">
       </hyperlinkDetector>  
    </extension>
+  
+  
+    <extension
+         point="org.eclipse.ui.popupMenus">
+
+      <objectContribution
+            objectClass="org.eclipse.wst.jsdt.web.ui.actions.IJavaWebNode"
+            id="org.eclipse.wst.jsdt.web.ui.JavaActions">
+         <menu
+               label="Hierarchy"
+               id="show.hierarchy">
+         </menu>
+         <action
+               label="Open Type Hierarchy"
+               tooltip=""
+               class="org.eclipse.wst.jsdt.web.ui.actions.OpenTypeHierarchy"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.ui.actions.OpenTypeHierarchyAction">
+         </action>
+          <action
+               label="Open Call Hierarchy"          
+               tooltip="Open Call Hierarchy"
+               class="org.eclipse.wst.jsdt.web.ui.actions.OpenCallHierarchyAction"
+               enablesFor="1"
+               id="org.eclipse.wst.jsdt.internal.ui.callhierarchy.OpenCallHierarchyAction">
+         </action>
+      </objectContribution>
+      
+		
+	</extension>
+	
+  <!-- Additional adapters for java elements.. this one is so the element will 
+       be displayed properly in ui
+   -->
+    <!--	
+   <extension point="org.eclipse.core.runtime.adapters">
+		<factory 
+            class="org.eclipse.wst.jsdt.web.ui.JsWebElementAdapterFactory" 
+            adaptableType="org.eclipse.wst.jsdt.core.IJavaElement">
+            <adapter type="org.eclipse.ui.views.properties.IPropertySourceProvider"/>
+   		</factory>
+   </extension>
+   -->
+   
 <!--
 	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
 		<sourceViewerConfiguration
@@ -441,6 +487,7 @@
 	<extension point="org.eclipse.ui.editorActions">
 		<editorContribution
 			id="org.eclipse.wst.jsdt.web.core.jspsource.source.editorActions"
+			contributorClass="org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor"
 			targetID="org.eclipse.wst.html.core.htmlsource">
 			<action
 				id="CleanupDocument"
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/html/internal/validation/HTMLPartValidator.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/html/internal/validation/HTMLPartValidator.java
deleted file mode 100644
index f49fa7f..0000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/html/internal/validation/HTMLPartValidator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.wst.html.internal.validation;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-
-public class HTMLPartValidator extends HTMLValidator {
-
-	private IDocument fDocument;
-	
-	public void connect(IDocument document) {
-		fDocument = document;
-		System.out.println("Unimplemented method:HTMLPartValidator.connect");
-	}
-
-	public void disconnect(IDocument document) {
-		fDocument = null;
-		System.out.println("Unimplemented method:HTMLPartValidator.disconnect");
-		
-	}
-
-	public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
-		// TODO Auto-generated method stub
-		System.out.println("Unimplemented method:HTMLPartValidator.validate");
-		
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/JsWebElementAdapterFactory.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/JsWebElementAdapterFactory.java
new file mode 100644
index 0000000..7f29763
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/JsWebElementAdapterFactory.java
@@ -0,0 +1,46 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.IPropertySourceProvider;
+import org.eclipse.wst.jsdt.core.IJavaElement;
+
+/**
+ * @author childsb
+ *
+ */
+public class JsWebElementAdapterFactory implements IAdapterFactory{
+
+	private static Class[] PROPERTIES= new Class[] {IPropertySourceProvider.class};
+	
+	private static final IPropertySourceProvider provider_instance = new JsWebElementPropertySourceProviderAdapter();
+	
+	public JsWebElementAdapterFactory() {
+		
+	}
+	
+	private static class JsWebElementPropertySourceProviderAdapter implements IPropertySourceProvider{
+		public IPropertySource getPropertySource(Object object) {
+			// TODO Auto-generated method stub
+			System.out.println("Unimplemented method:JsWebElementPropertySourceProvider.getPropertySource");
+			return new JsWebElementPropertySource((IJavaElement)object);
+		}
+	}
+	
+	public Object getAdapter(Object adaptableObject, Class adapterType) {
+		// TODO Auto-generated method stub
+		System.out.println("Unimplemented method:JsWebElementAdapterFactory.getAdapter");
+		if(adapterType== IPropertySourceProvider.class) {
+			return provider_instance;
+		}
+		return null;
+	}
+
+	public Class[] getAdapterList() {
+		return PROPERTIES;
+	}
+	
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/JsWebElementPropertySource.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/JsWebElementPropertySource.java
new file mode 100644
index 0000000..0fcd251
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/JsWebElementPropertySource.java
@@ -0,0 +1,82 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.wst.jsdt.core.IJavaElement;
+
+
+
+/**
+ * @author childsb
+ *
+ */
+public class JsWebElementPropertySource implements IPropertySource {
+
+	private IJavaElement javaElement;
+	
+	public JsWebElementPropertySource(IJavaElement element) {
+		this.javaElement = element;
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+	 */
+	public Object getEditableValue() {
+		// TODO Auto-generated method stub
+		System.out.println("Unimplemented method:JsWebElementProperySource.getEditableValue");
+		return getDefaultPropertySource().getEditableValue();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+	 */
+	public IPropertyDescriptor[] getPropertyDescriptors() {
+		// TODO Auto-generated method stub
+		System.out.println("Unimplemented method:JsWebElementProperySource.getPropertyDescriptors");
+		return getDefaultPropertySource().getPropertyDescriptors();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+	 */
+	public Object getPropertyValue(Object id) {
+		// TODO Auto-generated method stub
+		System.out.println("Unimplemented method:JsWebElementProperySource.getPropertyValue");
+		return getDefaultPropertySource().getPropertyValue(id);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+	 */
+	public boolean isPropertySet(Object id) {
+		// TODO Auto-generated method stub
+		System.out.println("Unimplemented method:JsWebElementProperySource.isPropertySet");
+		return getDefaultPropertySource().isPropertySet(id);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+	 */
+	public void resetPropertyValue(Object id) {
+		// TODO Auto-generated method stub
+		System.out.println("Unimplemented method:JsWebElementProperySource.resetPropertyValue");
+		getDefaultPropertySource().resetPropertyValue(id);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+	 */
+	public void setPropertyValue(Object id, Object value) {
+		// TODO Auto-generated method stub
+		System.out.println("Unimplemented method:JsWebElementProperySource.setPropertyValue");
+		getDefaultPropertySource().setPropertyValue(id, value);
+	}
+	
+	private IPropertySource getDefaultPropertySource() {
+		return (IPropertySource)((IAdaptable)javaElement).getAdapter(IPropertySource.class);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/IJavaWebNode.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/IJavaWebNode.java
new file mode 100644
index 0000000..784568b
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/IJavaWebNode.java
@@ -0,0 +1,20 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.wst.jsdt.core.IJavaElement;
+
+/**
+ * @author childsb
+ *
+ */
+public interface IJavaWebNode {
+	
+	public IJavaElement getJavaElement() ;
+	
+	
+	
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
new file mode 100644
index 0000000..dcc6ddf
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
@@ -0,0 +1,57 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.wst.jsdt.core.IJavaElement;
+
+/**
+ * @author childsb
+ *
+ */
+public class JsElementActionProxy extends SimpleJSDTActionProxy {
+	
+	
+	
+	public Object[] getRunArgs(IAction action) {
+		/* Needs to return an array of IJavaElements.  Since its one arg of type IJavaElement[] need to
+		 * put into an object array
+		 */
+		return new Object[] {getJsElementsFromSelection(getCurrentSelection())};	
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.ui.actions.SimpleJSDTActionProxy#getRunArgTypes()
+	 */
+	public Class[] getRunArgTypes() {
+		return new Class[] {(new IJavaElement[0] ).getClass()};
+	}
+
+	/* Util method to get all the java elements in a selection */
+	public static IJavaElement[] getJsElementsFromSelection(ISelection selection) {
+		if(selection==null) return new IJavaElement[0];
+		ArrayList elements = new ArrayList();
+		
+		if(selection instanceof IStructuredSelection) {
+			Iterator itt = ((IStructuredSelection)selection).iterator();
+			while(itt.hasNext()) {
+				Object element = itt.next();
+				if(element instanceof IJavaElement) {
+					elements.add(element);
+				}
+				if(element instanceof IJavaWebNode) {
+					elements.add(  ((IJavaWebNode)element).getJavaElement()        );
+				}
+			}
+			return (IJavaElement[])elements.toArray(new IJavaElement[elements.size()]);
+		}
+		return new IJavaElement[0];
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
new file mode 100644
index 0000000..8d0eb5e
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
@@ -0,0 +1,32 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.wst.jsdt.core.IJavaElement;
+
+/**
+ * @author childsb
+ *
+ */
+public class OpenCallHierarchyAction extends JsElementActionProxy {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.jsdt.web.ui.actions.SimpleJSDTActionProxy#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+	 */
+	public void selectionChanged(IAction action, ISelection selection) {
+		IJavaElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
+		
+		/* Open call hierarchy needs to be disabled for TYPEs */
+		for(int i = 0;i<elements.length;i++) {
+			if(elements[i].getElementType() == IJavaElement.TYPE) {
+				action.setEnabled(false);
+				return;
+			}
+		}
+		super.selectionChanged(action, selection);
+	}
+	
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
new file mode 100644
index 0000000..7901fb8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
@@ -0,0 +1,32 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.wst.jsdt.core.IJavaElement;
+
+/**
+ * @author childsb
+ *
+ */
+public class OpenTypeHierarchy extends JsElementActionProxy {
+	
+	
+	
+	
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		IJavaElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
+		
+		/* Open call hierarchy needs to be disabled for TYPEs */
+		for(int i = 0;i<elements.length;i++) {
+			if(elements[i].getElementType() != IJavaElement.TYPE) {
+				action.setEnabled(false);
+				return;
+			}
+		}
+		super.selectionChanged(action, selection);
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
new file mode 100644
index 0000000..297497c
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
@@ -0,0 +1,164 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.actions;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.wst.jsdt.ui.actions.ShowInNavigatorViewAction;
+
+/**
+ * @author childsb
+ *
+ */
+public class SimpleJSDTActionProxy implements IObjectActionDelegate  {
+
+	protected IWorkbenchPart targetWorkbenchPart;
+	
+	
+	protected Object 	actionHandlerTarget;
+	protected IAction 	handlerTargetAction;
+	private ISelection currentSelection;
+	
+	public SimpleJSDTActionProxy() {}
+	
+	
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+		this.targetWorkbenchPart = targetPart;
+	}
+
+	public Class[] getRunArgTypes() {
+		return new Class[] {IStructuredSelection.class};
+	}
+	
+	public Class[] getSelectionChangeArgTypes() {
+		return new Class[] {IStructuredSelection.class};
+	}
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	public void run(IAction action) {
+		try {
+			Object handler = getActionHandler(action);
+			executeMethod(handler, "run", getRunArgTypes(), getRunArgs(action) );
+		} catch (IllegalArgumentException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (SecurityException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (IllegalAccessException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (NoSuchMethodException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InstantiationException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InvocationTargetException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		}
+	}
+	
+	public Object[] getRunArgs(IAction action) {
+		return new Object[] {getCurrentSelection()};
+	}
+
+	public Object[] getSelectionChangeArgs(IAction action,  ISelection selection) {
+		return new Object[] {getCurrentSelection()};
+	}
+	
+	public ISelection getCurrentSelection() {
+		return currentSelection;
+	}
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		currentSelection = selection;
+		try {
+			Object handler = getActionHandler(action);
+			Class[] paramTypes = new Class[] {IStructuredSelection.class};
+			Object[] params = new Object[] {selection};
+			executeMethod(handler, "selectionChanged", getSelectionChangeArgTypes(), getSelectionChangeArgs(action, selection) );
+		} catch (IllegalArgumentException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (SecurityException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (IllegalAccessException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (NoSuchMethodException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InstantiationException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		} catch (InvocationTargetException ex) {
+			// TODO Auto-generated catch block
+			ex.printStackTrace();
+		}
+		System.out.println("Unimplemented method:JSDTActionProxy.selectionChanged");
+	}
+	
+	
+	/* Generic reflection util method to execute a named method with unknown paramaters on an object */
+	
+	public static Object executeMethod(Object handler, String methodName, Class[] paramaterTypes ,Object[] paramaterValues) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+		Class target = handler.getClass();
+	
+		Method m = target.getMethod(methodName, paramaterTypes);
+		return m.invoke(handler, paramaterValues);
+	}
+	
+	/* Default way of determining the action handlers class name.. may be subclassed/overridden */
+	protected String getActionHandlerClassName(IAction action) {
+		return action.getId();
+	}
+	
+	/* Most handlers look for WorkBenchSite, so we convert the WorkBenchPart to WorkBenchSite for init */
+	protected Object getActionHandler(IAction action) throws IllegalAccessException, 
+															 NoSuchMethodException, 
+															 IllegalArgumentException, 
+															 InstantiationException, 
+															 InvocationTargetException{
+		/* Target class is cached */
+		
+		if(handlerTargetAction==action && actionHandlerTarget!=null) return actionHandlerTarget;
+		
+		Class target = null;
+		String className = getActionHandlerClassName(action);
+		try {
+		  target = Class.forName(className);
+		} catch (ClassNotFoundException ex) {
+		 System.out.println("Error.. Class target of action handler not found: " + action);
+		 System.out.println("Exception : " + ex);
+		}
+		// use the loaded class
+		
+		Class[] types = new Class[] { IWorkbenchSite.class };
+	    Constructor cons = target.getConstructor(types);
+	    Object[] args = new Object[] { targetWorkbenchPart.getSite() };
+	    
+	    actionHandlerTarget = cons.newInstance(args);
+	    handlerTargetAction = action;
+	    return actionHandlerTarget;
+
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
index 9975e67..dfbb0f5 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
@@ -12,6 +12,7 @@
 
 
 
+import org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JsContentOutlineConfig;
 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;
@@ -24,6 +25,8 @@
  * DOM nodes in a tree.
  */
 public class JFaceNodeAdapterFactoryForJSDT extends JFaceNodeAdapterFactory {
+	
+	
 
 
 	public JFaceNodeAdapterFactoryForJSDT() {
@@ -38,7 +41,11 @@
 		if (singletonAdapter == null) {
 			// create the JFaceNodeAdapter
 			//singletonAdapter = new JFaceNodeAdapterForJSDT(this);
-            singletonAdapter = new JFaceNodeAdapterForJs(this);
+            if(JsContentOutlineConfig.USE_ADVANCED) {
+            	singletonAdapter = new org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JFaceNodeAdapterForJs(this);
+            }else {
+            	singletonAdapter = new org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterForJs(this);
+            }
 			initAdapter(singletonAdapter, node);
 		}
 		return singletonAdapter;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
index bcb4722..158e42e 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
@@ -3,9 +3,11 @@
 
 import java.util.Collection;
 
+import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.jface.text.Position;
 import org.eclipse.wst.jsdt.core.IJavaElement;
 import org.eclipse.wst.jsdt.internal.core.SourceMethod;
+import org.eclipse.wst.jsdt.web.ui.actions.IJavaWebNode;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.AbstractNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
@@ -15,7 +17,7 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
-public class JsJfaceNode extends ElementImpl implements IndexedRegion, INodeNotifier,Node{
+public class JsJfaceNode extends ElementImpl implements IndexedRegion, INodeNotifier,Node, IJavaWebNode{
     
     private FactoryRegistry  adapterRegistry;
     private Position fDocPosition;
@@ -40,11 +42,7 @@
        fDocPosition = structureDocLocation;
        fEnclosedObject = enclosedObject;
        this.parent = parent;
-       if(parent instanceof SourceMethod){
-           SourceMethod method = (SourceMethod)parent;
-           
-        
-       }
+       
        
     
    }
@@ -176,5 +174,9 @@
 		
 		return parent.getOwnerDocument();
 	}
+
+	public IJavaElement getJavaElement() {
+		return (IJavaElement)fEnclosedObject;
+	}
     
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
new file mode 100644
index 0000000..781e02a
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
@@ -0,0 +1,162 @@
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import java.util.Arrays;
+import java.util.Vector;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterForHTML;
+import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IMember;
+import org.eclipse.wst.jsdt.core.JavaModelException;
+import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
+import org.eclipse.wst.jsdt.ui.JavaElementLabelProvider;
+import org.eclipse.wst.jsdt.ui.StandardJavaElementContentProvider;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
+import org.eclipse.wst.jsdt.web.core.internal.java.IJSPTranslation;
+import org.eclipse.wst.jsdt.web.core.internal.java.JSPTranslation;
+import org.eclipse.wst.jsdt.web.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+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.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
+import org.eclipse.wst.xml.core.internal.document.NodeImpl;
+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.contentoutline.JFaceNodeAdapterFactory;
+import org.w3c.dom.Node;
+
+public class JFaceNodeAdapterForJs extends JFaceNodeAdapterForHTML {
+	
+	public JFaceNodeAdapterForJs(JFaceNodeAdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+	
+	public Object[] getChildren(Object object) {
+		if (object instanceof IJavaElement) return getJavaElementProvider().getChildren(object);
+		Node node = (Node) object;
+		if (isJSElementParent(node)) {
+//			Object[] results = getJSElementsFromNode(node.getFirstChild());
+//			IMember[] allResults = new IMember[results.length];
+//			for(int i = 0;i<results.length;i++) {
+//				if(results[i]==null) continue;
+//				IMember member = ((IMember)results[i]);
+//				allResults[i] = member;
+			//}
+			return getJSElementsFromNode(node.getFirstChild());
+		}
+		return super.getChildren(object);
+	}
+	
+	public Object[] getElements(Object object) {
+		if (object instanceof IJavaElement) return getJavaElementProvider().getElements(object);
+		return super.getElements(object);
+	}
+	
+	public String getLabelText(Object node) {
+		if (node instanceof IJavaElement) return getJavaElementLabelProvider().getText((IJavaElement) node);
+		return super.getLabelText(node);
+	}
+	
+	public Image getLabelImage(Object node) {
+		if (node instanceof IJavaElement) return getJavaElementLabelProvider().getImage((IJavaElement) node);
+		return super.getLabelImage(node);
+	}
+	
+	public Object getParent(Object element) {
+		if (element instanceof IJavaElement) return getJavaElementProvider().getParent(element);
+		return super.getParent(element);
+	}
+	
+	public boolean hasChildren(Object object) {
+		if (object instanceof IJavaElement) return getJavaElementProvider().hasChildren(object);
+		Node node = (Node) object;
+		if (isJSElementParent(node)) {
+			Object[] results = getJSElementsFromNode(node.getFirstChild());
+			return (results!=null && results.length>0);
+		}
+		return super.hasChildren(object);
+	}
+	
+	private boolean isJSElementParent(Node node) {
+		return (node.getNodeName().equalsIgnoreCase("script"));
+	}
+	
+	
+	private synchronized Object[]  getJSElementsFromNode(Node node) {
+		if(node==null) return new Object[0];
+		int startOffset = 0;
+		
+		int endOffset = 0;
+		int type = node.getNodeType();
+		IJavaElement[] result = null;
+		JSPTranslation translation = null;
+		if (node.getNodeType() == Node.TEXT_NODE && (node instanceof NodeImpl)) {
+			startOffset = ((NodeImpl) node).getStartOffset();
+			endOffset = ((NodeImpl) node).getEndOffset();
+			translation = getTranslation(node);
+			result = translation.getAllElementsInJsRange(startOffset, endOffset);
+		}
+		
+		return result;
+//			
+//		if (result == null) return null;
+//		Object[] newResults = new Object[result.length];
+//		for (int i = 0; i < result.length; i++) {
+//				int htmllength = 0;
+//				int htmloffset = 0;
+//				Position position = null;
+//				try {
+//					htmllength = ((SourceRefElement) (result[i])).getSourceRange().getLength();
+//					htmloffset = translation.getJspOffset(((SourceRefElement) (result[i])).getSourceRange().getOffset());
+//					position = new Position(htmloffset, htmllength);
+//				} catch (JavaModelException e) {
+//					e.printStackTrace();
+//				}
+//				newResults[i] = getJsNode(node.getParentNode(), (IJavaElement) result[i], position);
+//			}
+//			return newResults;
+		
+	}
+	
+	private JSPTranslation getTranslation(Node node) {
+	
+			IStructuredModel model = null;
+			IModelManager modelManager = StructuredModelManager.getModelManager();
+			IDOMDocument xmlDoc = null;
+			try {
+				if (modelManager != null) {
+					IStructuredDocument doc = ((NodeImpl) node).getStructuredDocument();
+					model = modelManager.getExistingModelForRead(doc);
+					
+					// model = modelManager.getModelForRead(doc);
+				}
+				IDOMModel domModel = (IDOMModel) model;
+				xmlDoc = domModel.getDocument();
+			} catch (Exception e) {
+				Logger.logException(e);
+			} finally {
+				if (model != null) {
+					// model.changedModel();
+					model.releaseFromRead();
+				}
+			}
+			
+			if (xmlDoc == null) return null;
+			JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter)xmlDoc.getAdapterFor(IJSPTranslation.class);
+			return translationAdapter.getJSPTranslation();
+	}
+	
+	
+	private StandardJavaElementContentProvider getJavaElementProvider() {
+		return new StandardJavaElementContentProvider(true);
+	}
+	
+	private JavaElementLabelProvider getJavaElementLabelProvider() {
+		return new JavaElementLabelProvider();
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
new file mode 100644
index 0000000..c3938b4
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
@@ -0,0 +1,68 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.ui.actions.ActionContext;
+import org.eclipse.ui.actions.ActionGroup;
+import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
+import org.eclipse.wst.jsdt.internal.ui.JavaPlugin;
+import org.eclipse.wst.jsdt.internal.ui.actions.CompositeActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.CCPActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.GenerateActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.JavaSearchActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.OpenViewActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.RefactorActionGroup;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
+
+
+
+/**
+ * @author childsb
+ *
+ */
+public class JsContentOutlineConfig extends HTMLContentOutlineConfiguration{
+	
+	ILabelProvider fLabelProvider = null;
+	private CompositeActionGroup fActionGroups;
+	private IMenuListener fMenuListener;
+	
+	public static final boolean USE_ADVANCED = false;
+	
+	
+	public JsContentOutlineConfig() {
+	}
+	
+	public ILabelProvider getLabelProvider(TreeViewer viewer) {
+		if(!USE_ADVANCED) return super.getLabelProvider(viewer);
+		return getJavaLabelProvider();
+	}
+
+	private ILabelProvider getJavaLabelProvider() {
+		if(fLabelProvider==null) {
+			fLabelProvider = new JsLabelProvider();
+		}
+		return fLabelProvider;
+	}
+	public ILabelProvider getStatusLineLabelProvider(TreeViewer treeViewer) {
+		if(!USE_ADVANCED) return super.getStatusLineLabelProvider(treeViewer);
+		return getJavaLabelProvider();
+	}
+
+
+	public IMenuListener getMenuListener(TreeViewer treeViewer) {
+		if(!USE_ADVANCED) return super.getMenuListener(treeViewer);
+		return new JsMenuListener(treeViewer);
+		
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
new file mode 100644
index 0000000..b9b618f
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
@@ -0,0 +1,40 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.ui.JavaElementLabelProvider;
+
+/**
+ * @author childsb
+ * copyright ibm 2007
+ */
+public class JsLabelProvider extends XMLLabelProvider {
+	
+	JavaElementLabelProvider fLabelProvider = null;
+	
+	public String getText(Object o) {
+		
+		if(o instanceof IJavaElement) {
+			return  getJavaElementLabelProvider().getText(o);
+		}
+		return super.getText(o);
+	}
+
+	public Image getImage(Object o) {
+		
+		if(o instanceof IJavaElement) {
+			return  getJavaElementLabelProvider().getImage(o);
+		}
+		return super.getImage(o);
+	}
+	
+	private JavaElementLabelProvider getJavaElementLabelProvider() {
+		if(fLabelProvider==null) {
+			fLabelProvider = new JavaElementLabelProvider();
+		}
+		return fLabelProvider;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
new file mode 100644
index 0000000..e4722ce
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
@@ -0,0 +1,141 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import java.awt.Composite;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionContext;
+import org.eclipse.ui.actions.ActionGroup;
+import org.eclipse.ui.internal.InternalHandlerUtil;
+import org.eclipse.ui.part.Page;
+
+import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.internal.ui.JavaPlugin;
+import org.eclipse.wst.jsdt.internal.ui.actions.CompositeActionGroup;
+import org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor;
+import org.eclipse.wst.jsdt.ui.actions.CCPActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.GenerateActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.JavaSearchActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.OpenViewActionGroup;
+import org.eclipse.wst.jsdt.ui.actions.RefactorActionGroup;
+import org.eclipse.wst.jsdt.web.ui.actions.JSDTActionSetUtil;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
+import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
+
+/**
+ * @author childsb
+ *
+ */
+public class JsMenuListener extends XMLNodeActionManager implements IMenuListener, IReleasable {
+		private XMLNodeActionManager fActionManager;
+		private TreeViewer fTreeViewer;
+		private CompositeActionGroup fActionGroups;
+		CompilationUnitEditorActionContributor contrib;
+		ISelectionProvider selectionProvider;
+		
+		public JsMenuListener(TreeViewer viewer) {
+			super((IStructuredModel) viewer.getInput(), viewer);
+			contrib = new CompilationUnitEditorActionContributor();
+			
+			fTreeViewer = viewer;
+			
+			
+			
+//			
+//			fActionGroups= new CompositeActionGroup(new ActionGroup[] {
+//					new OpenViewActionGroup(getWorkbenchSite(), getSelectionProvider()),
+//					new CCPActionGroup(getWorkbenchSite()),
+//					new GenerateActionGroup(getWorkbenchSite()),
+//					new RefactorActionGroup(getWorkbenchSite()),
+//					new JavaSearchActionGroup(getWorkbenchSite())});
+		}
+
+		private IWorkbenchSite getWorkbenchSite() {
+			
+			return InternalHandlerUtil.getActiveSite(fTreeViewer);
+			
+
+		}
+		
+		private ISelectionProvider getSelectionProvider() {
+			return getWorkbenchSite().getSelectionProvider();
+		}
+		
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
+		 */
+		
+		
+		public void menuAboutToShow(IMenuManager manager) {
+			
+			ISelection selection = fTreeViewer.getSelection();
+			if(selection instanceof TreeSelection) {
+				TreeSelection tselect = (TreeSelection)selection;
+				Object[] elements = tselect.toArray();
+				int javaCount=0;
+				for(int i=0;i<elements.length;i++) {
+					if(elements[i] instanceof IJavaElement) {
+						javaCount++;
+					}
+				}
+				
+				if(javaCount==elements.length && javaCount!=0) {
+					org.eclipse.swt.widgets.Composite parent = fTreeViewer.getTree().getParent();
+					
+					System.out.println("wait......");
+					/* all Java Elements */
+//					
+//					
+//					
+//					JavaPlugin.createStandardGroups(manager);
+//					String[] actionSets = JSDTActionSetUtil.getAllActionSets();
+//
+//					IAction[] actions = JSDTActionSetUtil.getActionsFromSet(actionSets);
+//					for(int i = 0;i<actions.length;i++) {
+//						manager.add(actions[i]);
+//					}
+//					fActionGroups.setContext(new ActionContext(selection));
+//					fActionGroups.fillContextMenu(manager);
+//					
+				}else if(javaCount==0){
+					fillContextMenu(manager, selection);
+				}
+			}
+			
+		}
+
+		public IAction[] getAllJsActions() {
+			
+			return null;
+		}
+		
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
+		 */
+		public void release() {
+			fTreeViewer = null;
+			if (fActionManager != null) {
+				fActionManager.setModel(null);
+			}
+		}
+
+		
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
new file mode 100644
index 0000000..1931632
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
@@ -0,0 +1,15 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.wst.jsdt.ui.StandardJavaElementContentProvider;
+
+/**
+ * @author childsb
+ *
+ */
+public class JsWebElementProvider extends StandardJavaElementContentProvider{
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
new file mode 100644
index 0000000..7669ff5
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
@@ -0,0 +1,111 @@
+/**
+ * 
+ */
+package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
+
+import org.eclipse.wst.sse.core.utils.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;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * @author childsb
+ *
+ */
+public class XMLLabelProvider  extends JFaceNodeLabelProvider {
+
+
+	boolean fShowAttributes = false;
+	
+		public String getText(Object o) {
+			StringBuffer text = new StringBuffer(super.getText(o));
+			if (o instanceof Node) {
+				Node node = (Node) o;
+				if ((node.getNodeType() == Node.ELEMENT_NODE) && fShowAttributes) {
+					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
+					if (node.hasAttributes()) {
+						Element element = (Element) node;
+						NamedNodeMap attributes = element.getAttributes();
+						Node idTypedAttribute = null;
+						Node requiredAttribute = null;
+						boolean hasId = false;
+						boolean hasName = false;
+						Node shownAttribute = null;
+
+						// try to get content model element
+						// declaration
+						CMElementDeclaration elementDecl = null;
+						ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
+						if (mq != null) {
+							elementDecl = mq.getCMElementDeclaration(element);
+						}
+						// find an attribute of type (or just named)
+						// ID
+						if (elementDecl != null) {
+							int i = 0;
+							while ((i < attributes.getLength()) && (idTypedAttribute == null)) {
+								Node attr = attributes.item(i);
+								String attrName = attr.getNodeName();
+								CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) elementDecl.getAttributes().getNamedItem(attrName);
+								if (attrDecl != null) {
+									if ((attrDecl.getAttrType() != null) && (CMDataType.ID.equals(attrDecl.getAttrType().getDataTypeName()))) {
+										idTypedAttribute = attr;
+									}
+									else if ((attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) && (requiredAttribute == null)) {
+										// as a backup, keep tabs on
+										// any required
+										// attributes
+										requiredAttribute = attr;
+									}
+									else {
+										hasId = hasId || attrName.equals("id"); //$NON-NLS-1$
+										hasName = hasName || attrName.equals("name"); //$NON-NLS-1$
+									}
+								}
+								++i;
+							}
+						}
+
+						/*
+						 * If no suitable attribute was found, try using a
+						 * required attribute, if none, then prefer "id" or
+						 * "name", otherwise just use first attribute
+						 */
+						if (idTypedAttribute != null) {
+							shownAttribute = idTypedAttribute;
+						}
+						else if (requiredAttribute != null) {
+							shownAttribute = requiredAttribute;
+						}
+						else if (hasId) {
+							shownAttribute = attributes.getNamedItem("id"); //$NON-NLS-1$
+						}
+						else if (hasName) {
+							shownAttribute = attributes.getNamedItem("name"); //$NON-NLS-1$
+						}
+						if (shownAttribute == null) {
+							shownAttribute = attributes.item(0);
+						}
+
+						// display the attribute and value (without quotes)
+						String attributeName = shownAttribute.getNodeName();
+						if ((attributeName != null) && (attributeName.length() > 0)) {
+							text.append(" " + attributeName); //$NON-NLS-1$
+							String attributeValue = shownAttribute.getNodeValue();
+							if ((attributeValue != null) && (attributeValue.length() > 0)) {
+								text.append("=" + StringUtils.strip(attributeValue)); //$NON-NLS-1$
+							}
+						}
+					}
+				}
+			}
+			return text.toString();
+		}
+	
+}