bug 391086: Search and filter the model editor tree. 

The filtered tree can now be switched on with java argument: 
-Dorg.eclipse.e4.tools.modeleditor.filteredtree.enabled.xmitab.disabled

This will enable the filtered tree but disable editing in the XMI tab.
This is a temp fix until we either solve the root cause or can set
preferences in some way.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=391086
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
index 4c933c0..1514248 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
@@ -58,6 +58,7 @@
 import org.eclipse.e4.tools.emf.ui.common.Util;
 import org.eclipse.e4.tools.emf.ui.common.component.AbstractComponentEditor;
 import org.eclipse.e4.tools.emf.ui.internal.Messages;
+import org.eclipse.e4.tools.emf.ui.internal.PatternFilter;
 import org.eclipse.e4.tools.emf.ui.internal.ResourceProvider;
 import org.eclipse.e4.tools.emf.ui.internal.ShadowComposite;
 import org.eclipse.e4.tools.emf.ui.internal.common.component.AddonsEditor;
@@ -153,6 +154,7 @@
 import org.eclipse.e4.ui.model.fragment.MModelFragments;
 import org.eclipse.e4.ui.model.fragment.impl.FragmentPackageImpl;
 import org.eclipse.e4.ui.model.internal.ModelUtils;
+import org.eclipse.e4.ui.workbench.swt.internal.copy.FilteredTree;
 import org.eclipse.emf.common.command.Command;
 import org.eclipse.emf.databinding.EMFProperties;
 import org.eclipse.emf.databinding.FeaturePath;
@@ -231,6 +233,8 @@
 import org.eclipse.swt.widgets.TreeItem;
 
 public class ModelEditor {
+	private static final String ORG_ECLIPSE_E4_TOOLS_MODELEDITOR_FILTEREDTREE_ENABLED_XMITAB_DISABLED = "org.eclipse.e4.tools.modeleditor.filteredtree.enabled.xmitab.disabled";
+
 	public static final String CSS_CLASS_KEY = "org.eclipse.e4.ui.css.CssClassName"; //$NON-NLS-1$
 
 	public static final String VIRTUAL_PART_MENU = ModelEditor.class.getName() + ".VIRTUAL_PART_MENU"; //$NON-NLS-1$
@@ -463,6 +467,12 @@
 			}
 		});
 
+		String property = System.getProperty(ORG_ECLIPSE_E4_TOOLS_MODELEDITOR_FILTEREDTREE_ENABLED_XMITAB_DISABLED);
+		if (property != null) {
+			sourceViewer.setEditable(false);
+			sourceViewer.getTextWidget().setEnabled(false);
+		}
+
 		return sourceViewer.getControl();
 	}
 
@@ -973,12 +983,15 @@
 		treeArea.setData(CSS_CLASS_KEY, "formContainer"); //$NON-NLS-1$
 		treeArea.setBackgroundMode(SWT.INHERIT_DEFAULT);
 
-		// final FilteredTree viewParent = new FilteredTree(treeArea,
-		// SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL, new
-		// PatternFilter(), true);
-		// final TreeViewer viewer = viewParent.getViewer();
-
-		final TreeViewer viewer = new TreeViewer(treeArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+		TreeViewer tempViewer = null;
+		String property = System.getProperty(ORG_ECLIPSE_E4_TOOLS_MODELEDITOR_FILTEREDTREE_ENABLED_XMITAB_DISABLED);
+		if (property != null) {
+			FilteredTree viewParent = new FilteredTree(treeArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL, new PatternFilter(), true);
+			tempViewer = viewParent.getViewer();
+		} else {
+			tempViewer = new TreeViewer(treeArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+		}
+		final TreeViewer viewer = tempViewer;
 
 		viewer.setLabelProvider(new ComponentLabelProvider(this, messages));
 		ObservableListTreeContentProvider contentProvider = new ObservableListTreeContentProvider(new ObservableFactoryImpl(), new TreeStructureAdvisorImpl());