Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaafar Bouayad2015-12-17 09:31:18 +0000
committerMickael ADAM2017-01-17 07:18:17 +0000
commit09b55cc7202c39de03a85b6d0d5291424c66d7cb (patch)
tree07c4228d73267347ddfefe6aed170ab77522bed0
parenteeb3df76e39d67ec28948ee3a7a0a0eb47430bde (diff)
downloadorg.eclipse.papyrus-09b55cc7202c39de03a85b6d0d5291424c66d7cb.tar.gz
org.eclipse.papyrus-09b55cc7202c39de03a85b6d0d5291424c66d7cb.tar.xz
org.eclipse.papyrus-09b55cc7202c39de03a85b6d0d5291424c66d7cb.zip
Bug 404980 - [Model Explorer] Model Explorer elements should not always
expand on double click https://bugs.eclipse.org/bugs/show_bug.cgi?id=404980 Change-Id: I04c68f47d9cf3eaea95b0f866beef81f3dc395b5 Signed-off-by: Jaafar Bouayad <jaafar.bouayad@atos.net> Signed-off-by: Mickael ADAM <mickael.adam@ALL4TEC.net> Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java9
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/INavigatorPreferenceConstants.java5
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/NavigatorPreferenceInitializer.java5
3 files changed, 19 insertions, 0 deletions
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
index d25b7fc021d..309bdaa67bc 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
@@ -48,6 +48,7 @@ import org.eclipse.emf.transaction.Transaction;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.util.Policy;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
+import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -97,6 +98,7 @@ import org.eclipse.papyrus.views.modelexplorer.matching.LinkItemMatchingItem;
import org.eclipse.papyrus.views.modelexplorer.matching.ModelElementItemMatchingItem;
import org.eclipse.papyrus.views.modelexplorer.matching.ReferencableMatchingItem;
import org.eclipse.papyrus.views.modelexplorer.preferences.IFilterPreferenceConstants;
+import org.eclipse.papyrus.views.modelexplorer.preferences.INavigatorPreferenceConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@@ -356,6 +358,13 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
}
}
+ @Override
+ protected void handleDoubleClick(DoubleClickEvent anEvent) {
+ if (Activator.getDefault().getPreferenceStore().getBoolean(INavigatorPreferenceConstants.PREF_EXPAND_NODE_ON_DOUBLE_CLICK)) {
+ super.handleDoubleClick(anEvent);
+ }
+ }
+
/**
* Handle a selection change in the editor.
*
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/INavigatorPreferenceConstants.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/INavigatorPreferenceConstants.java
index 2a2b86fda94..08b437a85da 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/INavigatorPreferenceConstants.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/INavigatorPreferenceConstants.java
@@ -25,4 +25,9 @@ public interface INavigatorPreferenceConstants {
* transform into another one
*/
public static final String PREF_NAVIGATOR_TRANSFORM_INTO_SHOW_POPUP = "org.eclipse.papyrus.navigator.TransformInto.showPopupDialog"; //$NON-NLS-1$
+
+ /**
+ * If this preferences is set to true. Then the model explorer will expand node on double click.
+ */
+ public static final String PREF_EXPAND_NODE_ON_DOUBLE_CLICK = "org.eclipse.papyrus.modelexplorer.ModelExplorerView.expandOnDoubleClick"; //$NON-NLS-1$
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/NavigatorPreferenceInitializer.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/NavigatorPreferenceInitializer.java
index 2d415f0ed8a..b90d91406db 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/NavigatorPreferenceInitializer.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/preferences/NavigatorPreferenceInitializer.java
@@ -36,6 +36,11 @@ public class NavigatorPreferenceInitializer extends
store.setDefault(
INavigatorPreferenceConstants.PREF_NAVIGATOR_TRANSFORM_INTO_SHOW_POPUP,
false);
+
+ // By default the model explorer expand node on double click
+ store.setDefault(
+ INavigatorPreferenceConstants.PREF_EXPAND_NODE_ON_DOUBLE_CLICK,
+ true);
}
/**

Back to the top