Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartEditor.java

Issue 12092075: Rename nav menu items. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/actions/ActionUtil.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartEditor.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartEditor.java (revision 17863)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartEditor.java (working copy)
@@ -55,6 +55,7 @@
import com.google.dart.tools.ui.actions.OpenEditorActionGroup;
import com.google.dart.tools.ui.actions.OpenViewActionGroup;
import com.google.dart.tools.ui.actions.RefactorActionGroup;
+import com.google.dart.tools.ui.actions.ShowSelectionLabelAction;
import com.google.dart.tools.ui.callhierarchy.OpenCallHierarchyAction;
import com.google.dart.tools.ui.internal.actions.ActionUtil;
import com.google.dart.tools.ui.internal.actions.FoldingActionGroup;
@@ -1829,6 +1830,7 @@
private boolean isEditable;
private OpenCallHierarchyAction openCallHierarchy;
+ private ShowSelectionLabelAction showSelectionLabel = new ShowSelectionLabelAction();
/**
* Default constructor.
@@ -1955,15 +1957,19 @@
menu.add(new Separator(ITextEditorActionConstants.GROUP_RESTORE));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ ISelection selection = createElementSelection();
+ DartElementSelection elementSelection = null;
+ if (selection instanceof DartElementSelection) {
+ elementSelection = (DartElementSelection) selection;
+ }
+
// Open Declaration action
- ActionContext context = new ActionContext(createElementSelection());
+ ActionContext context = new ActionContext(selection);
setContextMenuContext(menu, context); // This context contains a DartElementSelection for menus.
// Quick Type Hierarchy
{
- ISelection selection = context.getSelection();
- if (selection instanceof DartElementSelection
- && ActionUtil.isOpenHierarchyAvailable((DartElementSelection) selection)) {
+ if (elementSelection != null && ActionUtil.isOpenHierarchyAvailable(elementSelection)) {
IAction action = getAction(DartEditorActionDefinitionIds.OPEN_HIERARCHY);
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, action);
}
@@ -1971,7 +1977,6 @@
// Quick Outline
{
- ISelection selection = context.getSelection();
if ((selection instanceof TextSelection) && ((TextSelection) selection).getLength() == 0) {
IAction action = getAction(DartEditorActionDefinitionIds.SHOW_OUTLINE);
menu.appendToGroup(ITextEditorActionConstants.GROUP_RESTORE, action);
@@ -1997,6 +2002,11 @@
addAction(menu, RefactorActionGroup.GROUP_REORG, ITextEditorActionConstants.QUICK_ASSIST);
}
}
+ if (elementSelection != null && ActionUtil.isSelectionShowing((DartElementSelection) selection)) {
+ showSelectionLabel.update(elementSelection);
+ showSelectionLabel.setEnabled(false);
+ menu.prependToGroup(IContextMenuConstants.GROUP_OPEN, showSelectionLabel);
+ }
}
/*
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/actions/ActionUtil.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698