bundles/org.eclipse.orion.client.ui/web/orion/explorers/explorer-table.js
function(item, reroot) {
			var deferred = new Deferred();
			if (!item || !this.model || !this.myTree) {
				return deferred.reject();
			}
			if (!this.myTree.showRoot && (item.Location === this.treeRoot.Location || item.Location === this.treeRoot.ContentLocation)) {
				return deferred.resolve(this.treeRoot);
			}
			var row = this.getRow(item);
			if (row) {
				deferred.resolve(row._item || item);
			} else if (item.Parents && item.Parents.length > 0) {
				item.Parents[0].Parents = item.Parents.slice(1);
				return this.expandItem(item.Parents[0], reroot).then(function(parent) {
					// Handles model out of sync
					var row = this.getRow(item);
					if (!row) {
						return this.changedItem(parent, true).then(function() {
							var row = this.getRow(item);
							if (!row) {
								parent.children.unshift(item);
								this.myTree.refresh(parent, parent.children, false);
								row = this.getRow(item);
							}
							return row ? row._item : new Deferred().reject();
						}.bind(this));
					}
					return row._item || item;
				}.bind(this));
			} else {
				// Handles file not in current tree
				if (reroot === undefined || reroot) {
					return this.reroot(item);
				}
				return deferred.reject();
			}
			return deferred;
		}
function(item, reroot) {
			var deferred = new Deferred();
			if (!item || !this.model || !this.myTree) {
				return deferred.reject();
			}
			if (!this.myTree.showRoot && (item.Location === this.treeRoot.Location || item.Location === this.treeRoot.ContentLocation)) {
				return deferred.resolve(this.treeRoot);
			}
			var row = this.getRow(item);
			if (row) {
				deferred.resolve(row._item || item);
			} else if (item.Parents && item.Parents.length > 0) {
				item.Parents[0].Parents = item.Parents.slice(1);
				return this.expandItem(item.Parents[0], reroot).then(function(parent) {
					// Handles model out of sync
					var row = this.getRow(item);
					if (!row) {
						return this.changedItem(parent, true).then(function() {
							var row = this.getRow(item);
							if (!row) {
								parent.children.unshift(item);
								this.myTree.refresh(parent, parent.children, false);
								row = this.getRow(item);
							}
							return row ? row._item : new Deferred().reject();
						}.bind(this));
					}
					return row._item || item;
				}.bind(this));
			} else {
				// Handles file not in current tree
				if (reroot === undefined || reroot) {
					return this.reroot(item);
				}
				return deferred.reject();
			}
			return deferred;
		}
function ( item , reroot ) { var deferred = new Deferred ( ) ; if ( ! item || ! this . model || ! this . myTree ) { return deferred . reject ( ) ; } if ( ! this . myTree . showRoot && ( item . Location === this . treeRoot . Location || item . Location === this . treeRoot . ContentLocation ) ) { return deferred . resolve ( this . treeRoot ) ; } var row = this . getRow ( item ) ; if ( row ) { deferred . resolve ( row . _item || item ) ; } else if ( item . Parents && item . Parents . length > 0 ) { item . Parents [ 0 ] . Parents = item . Parents . slice ( 1 ) ; return this . expandItem ( item . Parents [ 0 ] , reroot ) . then ( function ( parent ) { // Handles model out of sync var row = this . getRow ( item ) ; if ( ! row ) { return this . changedItem ( parent , true ) . then ( function ( ) { var row = this . getRow ( item ) ; if ( ! row ) { parent . children . unshift ( item ) ; this . myTree . refresh ( parent , parent . children , false ) ; row = this . getRow ( item ) ; } return row ? row . _item : new Deferred ( ) . reject ( ) ; } . bind ( this ) ) ; } return row . _item || item ; } . bind ( this ) ) ; } else { // Handles file not in current tree if ( reroot === undefined || reroot ) { return this . reroot ( item ) ; } return deferred . reject ( ) ; } return deferred ; }
Shows the given item.
@param {Object} The item to be shown.
@param {Booelan} [reroot=true] whether the receiver should re-root the tree if the item is not displayable.
@returns {orion.Promise}
Shows the given item .