Merge branch 'master' of ssh://git.eclipse.org/gitroot/e4/org.eclipse.orion.client
diff --git a/bundles/org.eclipse.orion.client.core/web/navigate/tree.css b/bundles/org.eclipse.orion.client.core/web/navigate/tree.css
deleted file mode 100644
index bfadb7f..0000000
--- a/bundles/org.eclipse.orion.client.core/web/navigate/tree.css
+++ /dev/null
@@ -1,19 +0,0 @@
-@import "../org.dojotoolkit/dojo/resources/dojo.css";
-
-@import "../org.dojotoolkit/dijit/themes/nihilo/nihilo.css";
-
-@import "../org.dojotoolkit/dijit/themes/nihilo/layout/BorderContainer.css";
-
-@import "../org.dojotoolkit/dijit/themes/nihilo/form/Common.css";
-
-@import "../org.dojotoolkit/dijit/themes/nihilo/form/Button.css";
-
-@import "../org.dojotoolkit/dijit/themes/nihilo/ProgressBar.css";
-
-@import "../org.dojotoolkit/dojox/form/resources/FileUploader.css";
-
-@import "../css/ide.css";
-
-@import "../css/breadcrumbs.css";
-
-@import "../css/commands.css";
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.core/web/navigate/tree.html b/bundles/org.eclipse.orion.client.core/web/navigate/tree.html
deleted file mode 100644
index 782869d..0000000
--- a/bundles/org.eclipse.orion.client.core/web/navigate/tree.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!doctype html>
-<html style="height: 100%" >
-    <head>
-		<meta name="copyright" content="Copyright (c) IBM Corporation and others 2010." >
-		<meta http-equiv="Content-Language" content="en-us">
-		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-    	<title>Orion Navigator</title>
-    	<link rel="stylesheet" type="text/css" href="tree.css" />  
-    
-    <script type="text/javascript">
-        var djConfig = {
-		isDebug: true,
-		modulePaths: {'widgets': '/orion/widgets'},
-		parseOnLoad: true
-        };
-    </script>
-    <script type="text/javascript" src="/org.dojotoolkit/dojo/dojo.js.uncompressed.js"></script>
-    <script type="text/javascript" src="/org.dojotoolkit/orion/orion.js.uncompressed.js"></script>
-    <script type="text/javascript">
-	dojo.require("dijit.Dialog");
-	dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.ComboBox");
-	dojo.require("dijit.form.CheckBox");
-	dojo.require("dojo.data.ItemFileReadStore");
-	dojo.require("widgets.NewItemDialog");
-	dojo.require("widgets.OpenResourceDialog");
-	dojo.require("widgets.ImportDialog");
- 	</script>    	
-	
-	<!-- Authentication (required for handleAuthenticationError) -->
-	<script type="text/javascript" src="js/auth.js"></script>
-   </head>
-
-    <body style="height: 100%" class="nihilo">
-    
-	
-    <!-- Extension Registry -->
-	<script src="/orion/serviceregistry.js"></script>
-	<script src="/orion/pluginregistry.js"></script>
-	
-    <!-- Eclipse Application Services -->
-    <!-- START:eas.js -->
- 	<script src="/orion/util.js"></script>
- 	<script src="/orion/commands.js"></script>
- 	<script src="/orion/dialogs.js"></script>
- 	<script src="/orion/log.js"></script>
- 	<script src="/orion/preferences.js"></script>
- 	<script src="/orion/selection.js"></script>
- 	<script src="/orion/status.js"></script>
- 	<script src="/orion/users.js"></script>
-     
- 	<script src="/orion/fileClient.js"></script>
-	<script src="/orion/favorites.js"></script>
-	<script src="/orion/searchClient.js"></script>
-	<script src="/orion/ssh/sshTools.js"></script>
-	<!-- END:eas.js -->
-	<!-- INSERT:eas.js -->
-      
- 	<!-- Breadcrumbs, Tree -->
- 	<!-- START:navigate-tree.js -->
- 	<script src="/orion/globalCommands.js"></script>
-  	<script src="/orion/breadcrumbs.js"></script> 
-	<script src="/orion/explorer-tree.js"></script>
-	<script src="/orion/fileCommands.js"></script>
-	<script src="tree.js"></script>
-	<!-- END:navigate-tree.js -->
-	<!-- INSERT:navigate-tree.js -->
-	
-    <div dojoType="dijit.layout.BorderContainer" design="headline" liveSplitters="true" persist="true" gutters="false" style="width: 100%; height: 100%;">
-		<div class="toolbar" id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
-		</div>
-		
-		<div class="paneScrolled" style="margin-left: 8px; width: 20%" id="leftPane" dojoType="dijit.layout.ContentPane" region="leading" splitter="true">
-				<div id="favorites">
-				<h2>Favorites</h2>
-				<div  id="favoriteProgress">Loading favorites...</div>
-				</div>
-		</div>
-
-		<div class="paneScrolled" style="margin-left: 8px;" id="rightPane" dojoType="dijit.layout.ContentPane" region="center" splitter="false">
-			<div id="explorer-tree" class="navigator">
-				<!-- Breadcrumbs, tree content go here -->
-			</div>
-			<ul dojoType="dijit.Menu" id="treeContextMenu" style="display: none;">
-			</ul>
-		</div>
-	</div>
-
-</body>
-</html>
diff --git a/bundles/org.eclipse.orion.client.core/web/navigate/tree.js b/bundles/org.eclipse.orion.client.core/web/navigate/tree.js
deleted file mode 100644
index 4679228..0000000
--- a/bundles/org.eclipse.orion.client.core/web/navigate/tree.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials are made 
- * available under the terms of the Eclipse Public License v1.0 
- * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
- * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*global dojo dijit window eclipse serviceRegistry:true widgets*/
-dojo.addOnLoad(function(){
-	
-	// initialize service registry and EAS services
-	serviceRegistry = new eclipse.ServiceRegistry();
-	var pluginRegistry = new eclipse.PluginRegistry(serviceRegistry);
-	dojo.addOnWindowUnload(function() {
-		pluginRegistry.shutdown();
-	});
-	new eclipse.StatusReportingService(serviceRegistry, "statusPane", "notifications");
-	new eclipse.DialogService(serviceRegistry);
-	new eclipse.UserService(serviceRegistry);
-	new eclipse.SelectionService(serviceRegistry);
-	new eclipse.SshService(serviceRegistry);
-	var preferenceService = new eclipse.PreferencesService(serviceRegistry, "/prefs/user");
-	var commandService = new eclipse.CommandService({serviceRegistry: serviceRegistry});
-	
-	// Favorites
-	new eclipse.FavoritesService({serviceRegistry: serviceRegistry});
-
-	var treeRoot = {
-		children:[]
-	};
-	var searcher = new eclipse.Searcher({serviceRegistry: serviceRegistry});
-	
-	var fileClient = new eclipse.FileClient(serviceRegistry, pluginRegistry);
-	
-	var contextMenu = dijit.byId("treeContextMenu");
-	
-	var explorer = new eclipse.ExplorerTree(serviceRegistry, treeRoot,
-			searcher, fileClient, "explorer-tree", "navToolBar", contextMenu);
-			
-	var favorites = new eclipse.Favorites({parent: "favoriteProgress", serviceRegistry: serviceRegistry});
-	
-	// global commands
-	eclipse.globalCommandUtils.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher, explorer);
-			
-	// commands shared among navigators
-	eclipse.fileCommandUtils.createFileCommands(serviceRegistry, commandService, explorer, "navToolBar");
-
-	// define the command contributions - where things appear
-	commandService.addCommandGroup("eclipse.fileGroup", 100);
-	commandService.addCommandGroup("eclipse.newResources", 100, "New", "eclipse.fileGroup");
-	commandService.registerCommandContribution("eclipse.makeFavorite", 1);
-	commandService.registerCommandContribution("eclipse.downloadFile", 2);
-	commandService.registerCommandContribution("eclipse.openResource", 500, "navToolBar");
-	commandService.registerCommandContribution("eclipse.deleteFile", 1, null, "eclipse.fileGroup");
-	commandService.registerCommandContribution("eclipse.copyFile", 2, null, "eclipse.fileGroup");
-	commandService.registerCommandContribution("eclipse.moveFile", 3, null, "eclipse.fileGroup");
-	commandService.registerCommandContribution("eclipse.importCommand", 4, null, "eclipse.fileGroup");
-	commandService.registerCommandContribution("eclipse.importSFTPCommand", 5, null, "eclipse.fileGroup");
-	commandService.registerCommandContribution("eclipse.exportSFTPCommand", 6, null, "eclipse.fileGroup");
-	commandService.registerCommandContribution("eclipse.newFile", 1, null, "eclipse.fileGroup/eclipse.newResources");
-	commandService.registerCommandContribution("eclipse.newFolder", 2, null, "eclipse.fileGroup/eclipse.newResources");
-	commandService.registerCommandContribution("eclipse.newProject", 1, "navToolBar", "eclipse.fileGroup");
-	commandService.registerCommandContribution("eclipse.linkProject", 2, "navToolBar", "eclipse.fileGroup");
-
-	eclipse.fileCommandUtils.createAndPlaceFileCommandsExtension(serviceRegistry, commandService, explorer, "navToolBar", null, "eclipse.fileGroup");
-	
-	// commands specific to this page
-	var tableViewCommand = new eclipse.Command({
-		name : "Table View",
-		image : "/images/flatLayout.gif",
-		id: "eclipse.tableViewCommand",
-		callback : function() {
-			serviceRegistry.getService("orion.core.preference").then(function(service) {
-				service.put("window/orientation", "/navigate/table.html");
-			});
-			window.location.replace("/navigate/table.html#" + dojo.hash());
-		}});
-	commandService.addCommand(tableViewCommand, "dom");
-	commandService.addCommandGroup("eclipse.viewGroup", 800);
-	commandService.registerCommandContribution("eclipse.tableViewCommand", 1, "navToolBar", "eclipse.viewGroup");
-
-	explorer.loadResourceList(dojo.hash());
-	
-
-	//every time the user manually changes the hash, we need to load the workspace with that name
-	dojo.subscribe("/dojo/hashchange", explorer, function() {
-		explorer.loadResourceList(dojo.hash());
-	});
-});
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/explorer-tree.js b/bundles/org.eclipse.orion.client.core/web/orion/explorer-tree.js
deleted file mode 100644
index c88858a..0000000
--- a/bundles/org.eclipse.orion.client.core/web/orion/explorer-tree.js
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials are made 
- * available under the terms of the Eclipse Public License v1.0 
- * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
- * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
- * 
- * Contributors: IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-/*global dijit dojo eclipse:true widgets*/
-/*jslint browser:true*/
-
-dojo.require("dijit.Tree");
-dojo.require("dijit.Menu");
-dojo.require("dijit.MenuItem");
-dojo.require("dijit._Widget");
-dojo.require("dijit.form.Button");
-dojo.require("dijit.form.FilteringSelect");
-dojo.require("dijit.layout.BorderContainer");
-dojo.require("dijit.layout.ContentPane");
-dojo.require("dijit.TitlePane");
-dojo.require("dojo.data.ItemFileReadStore");
-dojo.require("widgets.ExplorerTree");
-dojo.require("widgets.NewItemDialog");
-
-var eclipse = eclipse || {};
-eclipse.ExplorerTree = (function() {
-	function ExplorerTree(serviceRegistry, treeRoot, searcher, fileClient, parentId, toolbarId,
-			/**dijit.Menu*/ contextMenu) {
-		this.registry = serviceRegistry;
-		this.treeRoot = treeRoot;
-		this.searcher = searcher;
-		this.fileClient = fileClient;
-		this.parentId = parentId;

-		this.toolbarId = toolbarId;
-		
-		this.contextMenu = contextMenu;		
-		this.model = null;
-		this.myTree = null; /**{dijit.Widget}*/
-
-		this._selectedItem = null;
-		this._selectedNode = null;
-		this._lastHash = null;
-	}
-	ExplorerTree.prototype = {
-		selected : function(item, treeNode) {
-			this._selectedItem = item;
-			this._selectedNode = treeNode;
-			if (item.Directory===false && item.Location) {
-				this.registry.getService("orion.page.selection").then(function(service) {
-					service.setSelections(item.Location);
-				});
-			}
-			
-		},
-		getSelectedItem : function() {
-			return this._selectedItem;
-		},
-		getCurrentContainerPath : function() {
-			if (this._selectedItem) {
-				if (this._selectedItem.file) {
-				  return this._selectedItem.path.substring(0, this._selectedItem.path.length - this._selectedItem.name.length - 1);
-				}
-				return this._selectedItem.path;
-			}
-		},
-		// we have changed an item on the server at the specified parent node
-		changedItem: function(parent) {
-			var self = this;
-			this.fileClient.fetchChildren(parent.ChildrenLocation).then(function(children) {

-				eclipse.util.processNavigatorParent(parent, children);

-				dojo.hitch(self.model, self.model.onChildrenChange)(parent, children);

-			});

-		},
-		removeResourceList: function() {
-			if (this.myTree) {
-				this.myTree.destroyRecursive();
-			}
-			// there may be something else, such as a progress div, occupying this space.
-			// TODO kind of hokey that we use the same id
-			var container = dojo.byId(this.parentId);
-			var another = dojo.byId("myTree");
-				if (another) {
-				container.removeChild(another);
-			}
-		},
-		
-
-		// TODO right now we blow away the tree because we might be replacing it
-		// with a search div.  We could optimize by detecting when we go tree to tree
-		// and simply update the model.
-		loadResourceList: function(path) {
-			path = eclipse.util.makeRelative(path);
-			if (path === this._lastHash) {
-				return;
-			}
-			
-			this._lastHash = path;
-			dojo.hash(path, true);
-			
-			var container = dojo.byId(this.parentId);
-			// Progress indicator
-
-			// we are refetching everything so clean up the root
-			this.treeRoot = {};
-			
-			if (path !== this.treeRoot.Path) {
-				//the tree root object has changed so we need to load the new one
-				
-				// Progress indicator
-				var progressTimeout = setTimeout(function() {
-					var progress = document.createElement('div');
-					
-					dojo.place(document.createTextNode("Loading "), progress);
-					var b = dojo.create("b", null, progress);
-					dojo.place(document.createTextNode(path), b);
-					dojo.place(document.createTextNode("..."), progress);
-					
-					progress.id = "myTree";
-					this.removeResourceList();
-					dojo.place(progress, container, "only");
-				}, 500); // wait 500ms before displaying
-				
-				this.treeRoot.Path = path;
-				var self = this;
-				this.fileClient.loadWorkspace(path).then(
-					dojo.hitch(self, function(loadedWorkspace) {
-						clearTimeout(progressTimeout);
-						//copy fields of resulting object into the tree root
-						for (var i in loadedWorkspace) {
-							this.treeRoot[i] = loadedWorkspace[i];
-						}
-						eclipse.util.processNavigatorParent(this.treeRoot, loadedWorkspace.Children);
-						new eclipse.BreadCrumbs({container: this.parentId, resource: this.treeRoot});
-						eclipse.fileCommandUtils.updateNavTools(this.registry, this, this.parentId, this.toolbarId, this.treeRoot);

-						this.createTree();
-					}),
-					dojo.hitch(self, function(error) {
-						clearTimeout(progressTimeout);
-						// TODO: Show an error message when a problem happens during getting the workspace
-					})
-				);
-			}
-		},
-		createTree: function(){
-			this.model = new eclipse.TreeModel(this.registry, this.treeRoot, this.fileClient);
-			
-			// remove any existing tree or other DOM element occupying that space
-			this.removeResourceList();
-
-			this.myTree = new widgets.ExplorerTree({
-				id: "myTree",
-				model: this.model,
-				showRoot: false,
-				persist: false,
-				openOnClick: true,
-				getLabel: function(item) {
-					return item.Name;
-				},
-				getIconClass: function(/* dojo.data.Item */ item, /* Boolean */ opened){
-					if (item.Directory != false) {
-						return "folderItem";
-					}
-					return "fileItem";
-				},
-				getFollowClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened) {
-					if (!item.Directory) {
-						return "followFile";
-					}
-				},
-				updateFollowLink: function(/*dojo.data.Item*/ item, /*HTMLLinkElement*/ link) {
-					link.href = "/edit/edit.html#" + item.Location;
-				}
-//				onFollowClick: function(/* dojo.data */ item, /*TreeNode*/ node, /*Event*/ evt) {
-//					this.selected(item, node, event);
-//				}
-			});
-			this.myTree.startup();
-			var container = dojo.byId(this.parentId);
-			container.appendChild(this.myTree.domNode);
-			if (this.contextMenu) {

-				var contextMenu = this.contextMenu;
-				contextMenu.bindDomNode(this.myTree.domNode);
-				// establish which item the menu applies to
-				dojo.connect(contextMenu, "_openMyself", this, function(event) {

-					// see http://bugs.dojotoolkit.org/ticket/10296

-					contextMenu.focusedChild = null;

-					dojo.forEach(contextMenu.getChildren(), function(child) {

-						contextMenu.removeChild(child);

-						child.destroy();

-					});
-					var treeNode = dijit.getEnclosingWidget(event.target);
-					var tree = treeNode.get("tree");
-					var selectedNodes = tree._getSelectedNodes();
-					if (dojo.indexOf(selectedNodes, treeNode) === -1) {
-						// change selection to match where menu appears
-						tree._selectNode(treeNode);
-					}
-					// contact the command service to render appropriate commands here.

-					this.registry.getService("orion.page.command").then(function(service) {

-						service.renderCommands(contextMenu, "object", tree.getSelectedItems(), this, "menu");

-					});

-				});
-			}
-		},
-		updateCommands: function(){
-			//commands build dynamically, no need to refresh
-		}
-	};
-	return ExplorerTree;
-}());
-
-eclipse.TreeModel = (function() {
-	/**
-	 * @class Tree model used by eclipse.ExplorerTree.
-	 * TODO Consolidate with eclipse.Model.
-	 */
-	function TreeModel(serviceRegistry, root, fileClient) {
-		this.registry = serviceRegistry;
-		this.root = root;
-		this.fileClient = fileClient;
-	}
-	TreeModel.prototype = {
-		destroy: function(){
-		},
-		getRoot: function(onItem){
-			onItem(this.root);
-		},
-		mayHaveChildren: function(/* dojo.data.Item */ item){
-			return item.Directory !== false;
-		},
-		getChildren: function(/* dojo.data.Item */ parentItem, /* function(items) */ onComplete){
-			// the parent item may already have the children fetched
-			if (parentItem.children) {
-				onComplete(parentItem.children);
-			} else if (parentItem.Directory!==undefined && parentItem.Directory===false) {
-				onComplete([]);
-			} else if (parentItem.Location) {
-				this.fileClient.fetchChildren(parentItem.ChildrenLocation).then(

-					dojo.hitch(this, function(children) {

-						eclipse.util.processNavigatorParent(parentItem, children);

-						onComplete(children);

-					}));

-			} else {
-				onComplete([]);
-			}
-		},
-		getIdentity: function(/* item */ item){
-			var result;
-			if (item.Name) {
-				result = item.Location;
-			} else {
-				result = "ROOT";
-			}
-			return result;
-		},
-		getLabel: function(/* dojo.data.Item */ item){
-			return item.Name;
-		},
-		onChildrenChange: function(/* dojo.data.Item */ parent, /* dojo.data.Item[] */ newChildrenList) {
-			// No implementation is necessary, this method is here so client code
-			// can connect to it
-		}
-	};
-	return TreeModel;
-}());
-