Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsxenos2005-05-20 01:10:02 +0000
committersxenos2005-05-20 01:10:02 +0000
commitd3affd9490901b15b886032cab5ec483db25eff1 (patch)
tree39a26c1ccc430e5ffd9c2d47f199cc6b617849db /bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
parentb83a66e3ef6fc829ceb945011ea6da0232959a40 (diff)
downloadeclipse.platform.ui-d3affd9490901b15b886032cab5ec483db25eff1.tar.gz
eclipse.platform.ui-d3affd9490901b15b886032cab5ec483db25eff1.tar.xz
eclipse.platform.ui-d3affd9490901b15b886032cab5ec483db25eff1.zip
Added a "new fast view" context menu + fixed exceptions on startup (bug 96045) + fixed missing mnemonics in context menus
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java')
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java49
1 files changed, 33 insertions, 16 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
index acb66f9efd6..e6b0d3671c1 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
@@ -63,18 +63,7 @@ public class ShowViewMenu extends ContributionItem {
}
};
- private Action showDlgAction = new Action(WorkbenchMessages.ShowView_title) {
- final ShowViewHandler handler = new ShowViewHandler();
-
- public void run() {
- try {
- handler.execute(new ExecutionEvent(Collections.EMPTY_MAP, null,
- null));
- } catch (final ExecutionException e) {
- // Do nothing.
- }
- }
- };
+ private Action showDlgAction;
private Map actions = new HashMap(21);
@@ -91,7 +80,20 @@ public class ShowViewMenu extends ContributionItem {
};
protected static Collator collator;
-
+ private boolean makeFast;
+
+ /**
+ * Creates a Show View menu.
+ *
+ * @param window
+ * the window containing the menu
+ * @param id
+ * the id
+ */
+ public ShowViewMenu(IWorkbenchWindow window, String id) {
+ this(window, id, false);
+ }
+
/**
* Creates a Show View menu.
*
@@ -100,15 +102,30 @@ public class ShowViewMenu extends ContributionItem {
* @param id
* the id
*/
- public ShowViewMenu(IWorkbenchWindow window, String id) {
+ public ShowViewMenu(IWorkbenchWindow window, String id, final boolean makeFast) {
super(id);
this.window = window;
- window.getWorkbench().getHelpSystem().setHelp(showDlgAction,
+ showDlgAction = new Action(WorkbenchMessages.ShowView_title) {
+ final ShowViewHandler handler = new ShowViewHandler(makeFast);
+
+ public void run() {
+ try {
+ handler.execute(new ExecutionEvent(Collections.EMPTY_MAP, null,
+ null));
+ } catch (final ExecutionException e) {
+ // Do nothing.
+ }
+ }
+ };
+
+ window.getWorkbench().getHelpSystem().setHelp(showDlgAction,
IWorkbenchHelpContextIds.SHOW_VIEW_OTHER_ACTION);
// indicate that a show views submenu has been created
((WorkbenchWindow) window)
.addSubmenu(WorkbenchWindow.SHOW_VIEW_SUBMENU);
+
showDlgAction.setActionDefinitionId("org.eclipse.ui.views.showView"); //$NON-NLS-1$
+ this.makeFast = makeFast;
}
public boolean isDirty() {
@@ -194,7 +211,7 @@ public class ShowViewMenu extends ContributionItem {
IViewRegistry reg = WorkbenchPlugin.getDefault().getViewRegistry();
IViewDescriptor desc = reg.find(id);
if (desc != null) {
- action = new ShowViewAction(window, desc);
+ action = new ShowViewAction(window, desc, makeFast);
action.setActionDefinitionId(id);
actions.put(id, action);
}

Back to the top