Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-02-09 06:16:36 -0500
committerAnsgar Radermacher2014-02-09 06:16:36 -0500
commitcca01ab216701a80935ed147df7c950862271616 (patch)
tree1bb1be3503ebdddf1f005846674752cb8f5c9ca1 /plugins
parent3576f568fed6c2423e5ff302eda3afce541adcdf (diff)
downloadorg.eclipse.papyrus-cca01ab216701a80935ed147df7c950862271616.tar.gz
org.eclipse.papyrus-cca01ab216701a80935ed147df7c950862271616.tar.xz
org.eclipse.papyrus-cca01ab216701a80935ed147df7c950862271616.zip
Bug 421392 - [Model Explorer] Link with Editor does not work properly
Bug 427740 - [QDesginer] Refactoring - move common utils to papyrus utils plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/CustomCommonViewer.java23
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/xtext/DirectEditorEditingSupport.java2
2 files changed, 16 insertions, 9 deletions
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/CustomCommonViewer.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/CustomCommonViewer.java
index b15a1e4dfb7..9f3c0f967b8 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/CustomCommonViewer.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/CustomCommonViewer.java
@@ -16,7 +16,7 @@ package org.eclipse.papyrus.views.modelexplorer;
import org.eclipse.jface.viewers.ColumnViewerEditor;
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
-import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter;
+import org.eclipse.jface.viewers.FocusCellHighlighter;
import org.eclipse.jface.viewers.IElementComparer;
import org.eclipse.jface.viewers.TreeViewerEditor;
import org.eclipse.jface.viewers.TreeViewerFocusCellManager;
@@ -93,21 +93,28 @@ public class CustomCommonViewer extends CommonViewer {
}
/**
- * Overridden to disable cell editor activation by single click, it can be activated via keystroke instead.
+ * Overridden to disable cell editor activation by single click, it can be activated by double click instead.
*/
@Override
protected ColumnViewerEditor createViewerEditor() {
+ // instantiate abstract focus cell high-lighter as dummy object for focus manager. The sub class
+ // FocusCellOwnerDrawHighlighter would break multi-selections in Papyrus, see bug 419591.
+ // (but we need to create a high-lighter, since the focus cell manager does not accept null pointer. The
+ // TreeViewerEditor could work without focusCellManager, but would ignore keyboard events in this case.)
+ FocusCellHighlighter fch = new FocusCellHighlighter(this) {
+ };
TreeViewerFocusCellManager focusCellManager = new TreeViewerFocusCellManager(
- this, new FocusCellOwnerDrawHighlighter(this));
- TreeViewerEditor.create(this,focusCellManager, new ColumnViewerEditorActivationStrategy(this){
-
+ this, fch);
+
+ TreeViewerEditor.create(this, focusCellManager, new ColumnViewerEditorActivationStrategy(this){
@Override
protected boolean isEditorActivationEvent(
ColumnViewerEditorActivationEvent event) {
- //TODO: Change keyCode to SWT.F2 when rename handler is adopted
- return event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.F3;
+ // activation will in particular with F3 or shift-F2 (standard F2 is already captured)
+ return event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED &&
+ (event.keyCode == SWT.F2 || event.keyCode == SWT.F3);
}
- },ColumnViewerEditor.KEYBOARD_ACTIVATION);
+ }, ColumnViewerEditor.KEYBOARD_ACTIVATION);
ColumnViewerEditor editor = this.getColumnViewerEditor();
return editor;
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/xtext/DirectEditorEditingSupport.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/xtext/DirectEditorEditingSupport.java
index 340a28f7f20..f89cbce87c0 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/xtext/DirectEditorEditingSupport.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/xtext/DirectEditorEditingSupport.java
@@ -80,7 +80,7 @@ public class DirectEditorEditingSupport extends EditingSupport {
+ semanticClassName;
String languagePreferred = store.getString(key);
- if (languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) { //$NON-NLS-1$
IDirectEditorConfiguration configuration = DirectEditorsUtil
.findEditorConfiguration(languagePreferred,
semanticClassName);

Back to the top