diff options
author | Eric Moffatt <emoffatt@ca.ibm.com> | 2015-06-03 11:59:45 -0400 |
---|---|---|
committer | Eric Moffatt <emoffatt@ca.ibm.com> | 2015-06-03 11:59:45 -0400 |
commit | 7458896cc88b6424888df2063e0658056488e866 (patch) | |
tree | cef59a64b934b9cbffc7a863d0757b1b657da647 | |
parent | 46d45825b305d1423acc0b08d16660f59d0f9671 (diff) | |
download | org.eclipse.orion.client-origin/emoffatt/EditorContextMenu.zip org.eclipse.orion.client-origin/emoffatt/EditorContextMenu.tar.gz org.eclipse.orion.client-origin/emoffatt/EditorContextMenu.tar.bz2 |
Bug 467426 - Implement a context menu for editors (menu structure)origin/emoffatt/EditorContextMenu
-rw-r--r-- | bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js index 2d8895d..1536585 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js @@ -242,26 +242,27 @@ define([ }, registerContextMenuCommands: function() { var commandRegistry = this.commandService; + // main context menu commandRegistry.addCommandGroup(this.editorContextMenuId, "orion.editorContextMenuGroup", 100, null, null, null, null, null, "dropdownSelection"); //$NON-NLS-1$ //$NON-NLS-0$ - //commandRegistry.registerCommandContribution("settingsActions", "orion.edit.settings", 1, null, false, new mKeyBinding.KeyBinding("s", true, true), null, this); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.undo", 400, "orion.editorContextMenuGroup", false); - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.redo", 401, "orion.editorContextMenuGroup", false); - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.searchFiles", 1, "orion.editorContextMenuGroup", false); - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.save", 1, "orion.editorContextMenuGroup", false); - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.gotoLine", 3, "orion.editorContextMenuGroup", false); - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.find", 0,"orion.editorContextMenuGroup", false); - commandRegistry.registerCommandContribution(this.editorContextMenuId , "orion.edit.blame", 1, "orion.editorContextMenuGroup", false); - commandRegistry.registerCommandContribution(this.editorContextMenuId , "orion.edit.diff", 2, "orion.editorContextMenuGroup", false); - commandRegistry.registerCommandContribution(this.editorContextMenuId , "orion.edit.showTooltip", 3, "orion.editorContextMenuGroup", false); + var index = 1; + commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.undo", index++, "orion.editorContextMenuGroup/orion.edit.undoGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ + commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.redo", index++, "orion.editorContextMenuGroup/orion.edit.undoGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ + commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.find", index++,"orion.editorContextMenuGroup/orion.findGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ + commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.searchFiles", index++, "orion.editorContextMenuGroup/orion.findGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ + commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.gotoLine", index++, "orion.editorContextMenuGroup/orion.findGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - // Register the commands + // 'Tools' cascade + commandRegistry.addCommandGroup(this.editorContextMenuId, "orion.editorContextMenuToolsGroup", 400, messages["Tools"], "orion.editorContextMenuGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + commandRegistry.registerCommandContribution(this.editorContextMenuId , "orion.edit.blame", 1, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup", false); + commandRegistry.registerCommandContribution(this.editorContextMenuId , "orion.edit.diff", 2, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup", false); + + // Register extra tools commands var commands = this.getEditCommands(); for (var i = 0, position = 100; i < commands.length; i++, position++) { var command = commands[i], info = command.editInfo; - this.commandService.registerCommandContribution(this.editorContextMenuId, command.id, position, "orion.editorContextMenuGroup"); //, info.bindingOnly, createKeyBinding(info.key), null, this); //$NON-NLS-0$ + this.commandService.registerCommandContribution(this.editorContextMenuId, command.id, position, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup"); } -// this.commandService.registerCommandContribution(this.editorContextMenuId , "orion.edit.blame", 1, "orion.editorContextMenuGroup", false); //, new mKeyBinding.KeyBinding('b', true, true), new mCommandRegistry.URLBinding("blame", "blame"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ }, overwriteKeyBindings: function(editor) { var that = this; |