bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js
function(scopeId, commandId, position, parentPath, bindingOnly, keyBinding, urlBinding, handler) {
			if (!this._contributionsByScopeId[scopeId]) {
				this._contributionsByScopeId[scopeId] = {};
			}
			var parentTable = this._contributionsByScopeId[scopeId];
			if (parentPath) {
				parentTable = this._createEntryForPath(parentTable, parentPath);		
			} 
			
			// store the contribution
			parentTable[commandId] = {position: position, handler: handler};
			
			var command;
			if (this._bindingOverrides) {
				var bindingOverride = this.getBindingOverride(commandId, keyBinding);
				if (bindingOverride) {
					keyBinding = bindingOverride;
				}
			}
			// add to the bindings table now
			if (keyBinding) {
				command = this._commandList[commandId];
				if (command) {
					this._addBinding(command, "key", keyBinding, bindingOnly); //$NON-NLS-0$
				} else {
					this._addPendingBinding(commandId, "key", keyBinding, bindingOnly); //$NON-NLS-0$
				}
			}
			
			// add to the url key table
			if (urlBinding) {
				command = this._commandList[commandId];
				if (command) {
					this._addBinding(command, "url", urlBinding, bindingOnly); //$NON-NLS-0$
				} else {
					this._addPendingBinding(commandId, "url", urlBinding, bindingOnly); //$NON-NLS-0$
				}
			}
			// get rid of sort cache because we have a new contribution
			parentTable.sortedContributions = null;
		}
function(scopeId, commandId, position, parentPath, bindingOnly, keyBinding, urlBinding, handler) {
			if (!this._contributionsByScopeId[scopeId]) {
				this._contributionsByScopeId[scopeId] = {};
			}
			var parentTable = this._contributionsByScopeId[scopeId];
			if (parentPath) {
				parentTable = this._createEntryForPath(parentTable, parentPath);		
			} 
			
			// store the contribution
			parentTable[commandId] = {position: position, handler: handler};
			
			var command;
			if (this._bindingOverrides) {
				var bindingOverride = this.getBindingOverride(commandId, keyBinding);
				if (bindingOverride) {
					keyBinding = bindingOverride;
				}
			}
			// add to the bindings table now
			if (keyBinding) {
				command = this._commandList[commandId];
				if (command) {
					this._addBinding(command, "key", keyBinding, bindingOnly); //$NON-NLS-0$
				} else {
					this._addPendingBinding(commandId, "key", keyBinding, bindingOnly); //$NON-NLS-0$
				}
			}
			
			// add to the url key table
			if (urlBinding) {
				command = this._commandList[commandId];
				if (command) {
					this._addBinding(command, "url", urlBinding, bindingOnly); //$NON-NLS-0$
				} else {
					this._addPendingBinding(commandId, "url", urlBinding, bindingOnly); //$NON-NLS-0$
				}
			}
			// get rid of sort cache because we have a new contribution
			parentTable.sortedContributions = null;
		}
function ( scopeId , commandId , position , parentPath , bindingOnly , keyBinding , urlBinding , handler ) { if ( ! this . _contributionsByScopeId [ scopeId ] ) { this . _contributionsByScopeId [ scopeId ] = { } ; } var parentTable = this . _contributionsByScopeId [ scopeId ] ; if ( parentPath ) { parentTable = this . _createEntryForPath ( parentTable , parentPath ) ; } // store the contribution parentTable [ commandId ] = { position : position , handler : handler } ; var command ; if ( this . _bindingOverrides ) { var bindingOverride = this . getBindingOverride ( commandId , keyBinding ) ; if ( bindingOverride ) { keyBinding = bindingOverride ; } } // add to the bindings table now if ( keyBinding ) { command = this . _commandList [ commandId ] ; if ( command ) { this . _addBinding ( command , "key" , keyBinding , bindingOnly ) ; //$NON-NLS-0$ } else { this . _addPendingBinding ( commandId , "key" , keyBinding , bindingOnly ) ; //$NON-NLS-0$ } } // add to the url key table if ( urlBinding ) { command = this . _commandList [ commandId ] ; if ( command ) { this . _addBinding ( command , "url" , urlBinding , bindingOnly ) ; //$NON-NLS-0$ } else { this . _addPendingBinding ( commandId , "url" , urlBinding , bindingOnly ) ; //$NON-NLS-0$ } } // get rid of sort cache because we have a new contribution parentTable . sortedContributions = null ; }
Register a command contribution, which identifies how a command appears
on a page and how it is invoked.
@param {String} scopeId The id describing the scope of the command.  Required.
This scope id is used when rendering commands.
@param {String} commandId the id of the command.  Required.
@param {Number} position the relative position of the command within its parent.  Required.
@param {String} [parentPath=null] the path of any parent groups, separated by '/'.  For example,
a path of "group1Id/group2Id/command" indicates that the command belongs as a child of
group2Id, which is itself a child of group1Id.  Optional.
@param {boolean} [bindingOnly=false] if true, then the command is never rendered, but the key or URL binding is hooked.
@param {orion.KeyBinding} [keyBinding] a keyBinding for the command.  Optional.
@param {orion.commands.URLBinding} [urlBinding] a url binding for the command.  Optional.
@param {Object} [handler] the object that should perform the command for this contribution.  Optional.
Register a command contribution which identifies how a command appears on a page and how it is invoked .