summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Zahl2012-12-03 15:12:50 (EST)
committerLars Vogel2012-12-03 15:12:50 (EST)
commite2cd56776a1596e39621a4c28034c7eb097e069a (patch)
treeefac954783d5f1fc317295ce920a35bd122fbb13
parent837789ede639ed5a8b4ea77a41fa875b9700a7fa (diff)
downloadorg.eclipse.e4.tools-e2cd56776a1596e39621a4c28034c7eb097e069a.zip
org.eclipse.e4.tools-e2cd56776a1596e39621a4c28034c7eb097e069a.tar.gz
org.eclipse.e4.tools-e2cd56776a1596e39621a4c28034c7eb097e069a.tar.bz2
Context menu for expanding a selected tree element
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java1
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties1
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java9
3 files changed, 11 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
index 8419240..e4991d9 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
@@ -597,6 +597,7 @@ public class Messages {
public String AreaIconDialogEditor_DialogMessage;
public String ModelEditor_Delete;
+ public String ModelEditor_ExpandSubtree;
public String ModelEditor_Form;
public String ModelEditor_XMI;
public String ModelEditor_ExternalizeStrings;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
index 9fb51c7..8044596 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
@@ -598,6 +598,7 @@ AreaIconDialogEditor_DialogTitle=Area Icon Search
AreaIconDialogEditor_DialogMessage=Search for GIF, PNG and JPG icons in the current project
ModelEditor_Delete=Remove
+ModelEditor_ExpandSubtree=Expand subtree
ModelEditor_Form=Form
ModelEditor_XMI=XMI
ModelEditor_ExternalizeStrings=Externalize Strings
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 be8be02..2912de0 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
@@ -610,6 +610,15 @@ public class ModelEditor {
manager.add(addMenu);
}
+ manager.add(new Action(messages.ModelEditor_ExpandSubtree) {
+ public void run() {
+ if (!s.isEmpty())
+ viewer.expandToLevel(s.getFirstElement(), TreeViewer.ALL_LEVELS);
+ }
+ });
+
+ manager.add(new Separator());
+
// build the extract action
if ((!((VirtualEntry<?>) s.getFirstElement()).getList().isEmpty()) && (!isModelFragment()))
manager.add(new Action(messages.ModelEditor_ExtractFragment, ImageDescriptor.createFromImage(resourcePool.getImageUnchecked(ResourceProvider.IMG_ModelFragments))) {