Class eclipse.CommandService
The command service manages the available commands.
Defined in: </shared/eclipse/e4/orion/I201106010943/plugins/org.eclipse.orion.client.core/static/js/commands.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
The command service manages the available commands.
|
Method Attributes | Method Name and Description |
---|---|
addCommand(the, scope)
Add a command at a particular scope.
|
|
addCommandGroup(the, the, the, the, the)
Registers a command group and specifies visual information about the group.
|
|
<inner> |
CommandService(options)
|
Return the selection service that is being used when commands should apply against a selection.
|
|
registerCommandContribution(the, scopeId, the, the, a, if)
Register a command contribution, which identifies how a command appears
on a page and how it is invoked.
|
|
renderCommands(parent, scope, items, handler, style, userData, forceText, forceText)
Render the commands that are appropriate for the given scope.
|
|
showKeyBindings(targetNode)
|
Method Detail
addCommand(the, scope)
Add a command at a particular scope.
- Parameters:
- {Command} the
- command being added.
- {String} scope
- The scope to which the command applies. "global" commands apply across the page, "dom" level commands apply only when the specified dom element is rendering commands, and "object" scope applies to particular objects being displayed in widgets such as lists or trees.
addCommandGroup(the, the, the, the, the)
Registers a command group and specifies visual information about the group.
- Parameters:
- {String} the
- id of the group, must be unique. Also used for dom node id
- {Number} the
- relative position of the group within its parent, optional.
- {String} the
- title of the group, optional
- {String} the
- path of parent groups, separated by '/'. For example, a path of "group1Id/group2Id" indicates that the group belongs as a child of group2Id, which is itself a child of group1Id. Optional.
- {String} the
- id of a DOM element related to the command's scope. Optional. For example, if the scope is "dom" level, the scopeId describes which dom id to which this command should be added
<inner>
CommandService(options)
- Parameters:
- options
generateSeparatorImage()
getSelectionService()
Return the selection service that is being used when commands should apply against a selection.
registerCommandContribution(the, scopeId, the, the, a, if)
Register a command contribution, which identifies how a command appears
on a page and how it is invoked.
- Parameters:
- {String} the
- id of the command
- {String} scopeId
- The id related to the scope. Depending on the scope, this might be the id of the page or of a dom element.
- {String} the
- path on which the command is located. Optional.
- {Number} the
- relative position of the command within its parent
- {eclipse.CommandKeyBinding} a
- keyBinding for the command. Optional.
- {boolean} if
- true, then the command is never rendered, but the keybinding is hooked.
renderCommands(parent, scope, items, handler, style, userData, forceText, forceText)
Render the commands that are appropriate for the given scope.
- Parameters:
- {DOMElement} parent
- The element in which commands should be rendered.
- {String} scope
- The scope to which the command applies. "dom" level commands apply only when a specified dom element is rendering commands. "object" scope applies to particular objects/items displayed in widgets such as list or trees.
- {Object} items
- An item or array of items to which the command applies.
- {Object} handler
- The object that will perform the command
- {String} style
- The style in which the command should be rendered. Currently only "image" is implemented, but this should involve into something like "button," "menu," "link," etc.
- {Object} userData
- Optional user data that should be attached to generated command callbacks
- {Boolean} forceText
- Always use text and not the icon when showing the command, regardless of style.
- forceText
showKeyBindings(targetNode)
- Parameters:
- targetNode