Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Jongman2013-03-23 17:58:29 -0400
committerWim Jongman2013-03-23 17:58:29 -0400
commit74558234ad7674435657a36dff6ad6d32c7b4a39 (patch)
tree390d6c8bd26aa760eac1499e7b721b14589cce52
parent9a84a8a9b45dd6f28656b07f25d47df9815b3901 (diff)
downloadorg.eclipse.e4.tools-I20130325-2200.tar.gz
org.eclipse.e4.tools-I20130325-2200.tar.xz
org.eclipse.e4.tools-I20130325-2200.zip
bug 391086: Search and filter the model editor tree. I20130325-2200I20130324-2200I20130324-0930I20130323-2200
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
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java25
1 files changed, 19 insertions, 6 deletions
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 4c933c0a..15142485 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.MemoryTransfer;
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.application.ui.menu.impl.MenuPackageImpl;
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.Listener;
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 @@ public class ModelEditor {
}
});
+ 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 @@ public class ModelEditor {
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());

Back to the top