Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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