diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java
index 3270c78..3f46c13 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java
@@ -38,6 +38,7 @@
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
 import org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlinePage;
 import org.eclipse.wst.xsd.ui.internal.adt.outline.ADTLabelProvider;
+import org.eclipse.wst.xsd.ui.internal.adt.outline.ExtensibleContentOutlinePage;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 
 public abstract class ADTMultiPageEditor extends CommonMultiPageEditor
@@ -125,14 +126,23 @@
   {
     if (fOutlinePage == null || fOutlinePage.getControl() == null || fOutlinePage.getControl().isDisposed())
     {
-      ADTContentOutlinePage outlinePage = new ADTContentOutlinePage(this);
-      //outlinePage.getTreeViewer().removeF(filter);
+      final ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)getAdapter(ProductCustomizationProvider.class);
+      ExtensibleContentOutlinePage outlinePage = null;
+      if (productCustomizationProvider != null)
+      {
+        outlinePage = productCustomizationProvider.getProductContentOutlinePage();
+      }
+      
+      if (outlinePage == null)
+      {
+        outlinePage = new ADTContentOutlinePage();
+      }
+      outlinePage.setEditor(this);
       ITreeContentProvider provider = (ITreeContentProvider)getEditorModeManager().getCurrentMode().getOutlineProvider();
       outlinePage.setContentProvider(provider);
       ADTLabelProvider adtLabelProvider = new ADTLabelProvider();
       outlinePage.setLabelProvider(adtLabelProvider);
       outlinePage.setModel(getModel());
-      
       fOutlinePage = outlinePage;
     }
     return fOutlinePage;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java
index be3d429..9703e50 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2007 IBM Corporation and others.
  * All rights reserved. This program and 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,6 +10,8 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adt.editor;
 
+import org.eclipse.wst.xsd.ui.internal.adt.outline.ExtensibleContentOutlinePage;
+
 public abstract class ProductCustomizationProvider
 {
   public abstract boolean isEditorModeApplicable(String id);
@@ -28,4 +30,9 @@
   public void handleAction(String actionId)
   {    
   }
+
+  public ExtensibleContentOutlinePage getProductContentOutlinePage()
+  {
+    return null;
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
index 12ee02c..322c931 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
@@ -16,7 +16,6 @@
 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;
@@ -27,54 +26,22 @@
 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.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
 import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewContextMenuProvider;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IModelProxy;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDSchema;
 
-public class ADTContentOutlinePage extends ContentOutlinePage
+public class ADTContentOutlinePage extends ExtensibleContentOutlinePage
 {
-  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)
+  public ADTContentOutlinePage()
   {
     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)
@@ -172,7 +139,7 @@
     }
   }
 
-  class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
+  protected class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
   {
     public void selectionChanged(SelectionChangedEvent event)
     {
@@ -221,7 +188,7 @@
 //  }
   
   
-  void updateStatusLine(IStatusLineManager mgr, ISelection selection)
+  protected void updateStatusLine(IStatusLineManager mgr, ISelection selection)
   {
     String text = null;
     Image image = null;
@@ -242,7 +209,7 @@
     }
   }
   
-  private class StatusLineLabelProvider extends JFaceNodeLabelProvider
+  protected class StatusLineLabelProvider extends JFaceNodeLabelProvider
   {
     TreeViewer treeViewer = null;
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java
new file mode 100644
index 0000000..1c668a4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.adt.outline;
+
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+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.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.part.IPageSite;
+import org.eclipse.ui.part.Page;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor;
+
+public class ExtensibleContentOutlinePage extends Page implements IContentOutlinePage, ISelectionChangedListener
+{
+  protected ListenerList selectionChangedListeners = new ListenerList();
+  protected TreeViewer treeViewer;
+  protected Object model;
+  protected ITreeContentProvider contentProvider;
+  protected ILabelProvider labelProvider;
+  protected ADTMultiPageEditor editor;
+
+  protected ExtensibleContentOutlinePage()
+  {
+    super();
+  }
+
+  public void createControl(Composite parent)
+  {
+    treeViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+    treeViewer.addSelectionChangedListener(this);
+  }
+
+  public void setEditor(ADTMultiPageEditor editor)
+  {
+    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;
+  }
+
+  public void setFocus()
+  {
+    treeViewer.getControl().setFocus();
+  }
+
+  public void setSelection(ISelection selection)
+  {
+    if (treeViewer != null)
+    {
+      treeViewer.setSelection(selection);
+    }
+  }
+
+  public void addSelectionChangedListener(ISelectionChangedListener listener)
+  {
+    selectionChangedListeners.add(listener);
+  }
+
+  protected void fireSelectionChanged(ISelection selection)
+  {
+    // create an event
+    final SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
+
+    // fire the event
+    Object[] listeners = selectionChangedListeners.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);
+        }
+      });
+    }
+  }
+
+  public Control getControl()
+  {
+    if (treeViewer == null)
+    {
+      return null;
+    }
+    return treeViewer.getControl();
+  }
+
+  public ISelection getSelection()
+  {
+    if (treeViewer == null)
+    {
+      return StructuredSelection.EMPTY;
+    }
+    return treeViewer.getSelection();
+  }
+
+  public TreeViewer getTreeViewer()
+  {
+    return treeViewer;
+  }
+
+  public void init(IPageSite pageSite)
+  {
+    super.init(pageSite);
+    pageSite.setSelectionProvider(this);
+  }
+
+  public void removeSelectionChangedListener(ISelectionChangedListener listener)
+  {
+    selectionChangedListeners.remove(listener);
+  }
+
+  public void selectionChanged(SelectionChangedEvent event)
+  {
+    fireSelectionChanged(event.getSelection());
+  }
+}
