bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js
function(scopeId, parent, items, handler, renderType, userData, domNodeWrapperList) {
			if (typeof(scopeId) !== "string") { //$NON-NLS-0$
				throw "a scope id for rendering must be specified"; //$NON-NLS-0$
			}
			parent = lib.node(parent);
			if (!parent) { 
				throw "no parent";  //$NON-NLS-0$
			}

			var contributions = this._contributionsByScopeId[scopeId];

			if (!items && contributions) {
				var selectionService = contributions.localSelectionService || this._selectionService;
				var self = this;
				if (selectionService) {
					selectionService.getSelections(function(selections) {
						self.renderCommands(scopeId, parent, selections, handler, renderType, userData);
					});
				}
				return;
			} 
			if (contributions) {
				this._render(scopeId, contributions, parent, items, handler, renderType || "button", userData, domNodeWrapperList); //$NON-NLS-0$
				
				// If the last thing we rendered was a group, it's possible there is an unnecessary trailing separator.
				this._checkForTrailingSeparator(parent, renderType, true);
			}
		}
function(scopeId, parent, items, handler, renderType, userData, domNodeWrapperList) {
			if (typeof(scopeId) !== "string") { //$NON-NLS-0$
				throw "a scope id for rendering must be specified"; //$NON-NLS-0$
			}
			parent = lib.node(parent);
			if (!parent) { 
				throw "no parent";  //$NON-NLS-0$
			}

			var contributions = this._contributionsByScopeId[scopeId];

			if (!items && contributions) {
				var selectionService = contributions.localSelectionService || this._selectionService;
				var self = this;
				if (selectionService) {
					selectionService.getSelections(function(selections) {
						self.renderCommands(scopeId, parent, selections, handler, renderType, userData);
					});
				}
				return;
			} 
			if (contributions) {
				this._render(scopeId, contributions, parent, items, handler, renderType || "button", userData, domNodeWrapperList); //$NON-NLS-0$
				
				// If the last thing we rendered was a group, it's possible there is an unnecessary trailing separator.
				this._checkForTrailingSeparator(parent, renderType, true);
			}
		}
function ( scopeId , parent , items , handler , renderType , userData , domNodeWrapperList ) { if ( typeof ( scopeId ) !== "string" ) { //$NON-NLS-0$ throw "a scope id for rendering must be specified" ; //$NON-NLS-0$ } parent = lib . node ( parent ) ; if ( ! parent ) { throw "no parent" ; //$NON-NLS-0$ } var contributions = this . _contributionsByScopeId [ scopeId ] ; if ( ! items && contributions ) { var selectionService = contributions . localSelectionService || this . _selectionService ; var self = this ; if ( selectionService ) { selectionService . getSelections ( function ( selections ) { self . renderCommands ( scopeId , parent , selections , handler , renderType , userData ) ; } ) ; } return ; } if ( contributions ) { this . _render ( scopeId , contributions , parent , items , handler , renderType || "button" , userData , domNodeWrapperList ) ; //$NON-NLS-0$ // If the last thing we rendered was a group, it's possible there is an unnecessary trailing separator. this . _checkForTrailingSeparator ( parent , renderType , true ) ; } }
Render the commands that are appropriate for the given scope.
@param {String} scopeId The id describing the scope for which we are rendering commands.  Required.
Only contributions made to this scope will be rendered.
@param {DOMElement} parent The element in which commands should be rendered.  If commands have been
previously rendered into this element, it is up to the caller to empty any previously generated content.
@param {Object} [items] An item or array of items to which the command applies.  Optional.  If no
items are specified and a selection service was specified at creation time, then the selection
service will be used to determine which items are involved.
@param {Object} handler The object that should perform the command
@param {String} renderType The style in which the command should be rendered.  "tool" will render
a tool image in the dom.  "button" will render a text button.  "menu" will render menu items.
@param {Object} [userData] Optional user data that should be attached to generated command callbacks
@param {Object[]} [domNodeWrapperList] Optional an array used to record any DOM nodes that are rendered during this call.
If an array is provided, then as commands are rendered, an object will be created to represent the command's node.
The object will always have the property "domNode" which contains the node created for the command.  If the command is
rendered using other means (toolkit widget) then the optional property "widget" should contain the toolkit
object that represents the specified dom node.
Render the commands that are appropriate for the given scope .