aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Macdonald2011-01-10 17:49:13 (EST)
committerBoris Bokowski2011-01-10 17:49:13 (EST)
commit3caa00095b8ed1c8f2a001453b29e850fe74aa65 (patch)
tree8cf2d9200bcb735d8c64a687930d993f98f05ab4
parentcb3bc789c273f9bb3506a347acc36a552d67cc3c (diff)
downloadorg.eclipse.orion.client-3caa00095b8ed1c8f2a001453b29e850fe74aa65.zip
org.eclipse.orion.client-3caa00095b8ed1c8f2a001453b29e850fe74aa65.tar.gz
org.eclipse.orion.client-3caa00095b8ed1c8f2a001453b29e850fe74aa65.tar.bz2
cleanup, replaced attr with get or set, registry view
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/auth.js2
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/coding/coding.js4
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/commands.js4
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/editorContainer.js4
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/explorer-tree.js6
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/favorites.js2
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/input.js4
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/jsunit-test/jsunit-test-config.js12
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/view-registry/view-registry.js84
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/widgets/ExplorerTree.js6
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/widgets/NewItemDialog.js22
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/widgets/OpenResourceDialog.js2
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/widgets/RegistryTree.js184
-rw-r--r--bundles/org.eclipse.e4.webide/static/js/widgets/eWebBorderContainer.js6
-rw-r--r--bundles/org.eclipse.e4.webide/static/jsunit-test-new.html2
-rw-r--r--bundles/org.eclipse.e4.webide/static/view-registry.html73
16 files changed, 379 insertions, 38 deletions
diff --git a/bundles/org.eclipse.e4.webide/static/js/auth.js b/bundles/org.eclipse.e4.webide/static/js/auth.js
index 565c8db..d3a5b0a 100644
--- a/bundles/org.eclipse.e4.webide/static/js/auth.js
+++ b/bundles/org.eclipse.e4.webide/static/js/auth.js
@@ -59,7 +59,7 @@ function handleAuthenticationError(ioArgs, channelListener) {
title: "Forbidden access"
});
- forbiddenAccessDlg.attr("content", "No rights to access <b>" + ioArgs.url + "</b>");
+ forbiddenAccessDlg.set("content", "No rights to access <b>" + ioArgs.url + "</b>");
forbiddenAccessDlg.show();
}
if (ioArgs.xhr.status == 401) {
diff --git a/bundles/org.eclipse.e4.webide/static/js/coding/coding.js b/bundles/org.eclipse.e4.webide/static/js/coding/coding.js
index 60b2678..8661db1 100644
--- a/bundles/org.eclipse.e4.webide/static/js/coding/coding.js
+++ b/bundles/org.eclipse.e4.webide/static/js/coding/coding.js
@@ -88,7 +88,7 @@ dojo.addOnLoad(function(){
topContainerWidget, contentassist, leftPane, searchFloat);
// The eWebBorderContainer widget needs to know the editorContainer
- topContainerWidget.attr("editorContainer", editorContainer);
+ topContainerWidget.set("editorContainer", editorContainer);
var syntaxChecker = new eclipse.SyntaxChecker(registry, editorContainer);
@@ -96,7 +96,7 @@ dojo.addOnLoad(function(){
new eclipse.Outliner({parent: outlineDomNode, serviceRegistry: registry});
// FIXME: only leaving this here because editorContainer's verifyInputChange handler doesn't work
- // see https://kanrtc01.ottawa.ibm.com:9446/ies/web/projects/EclipseWeb#action=com.ibm.team.workitem.viewWorkItem&id=408
+ // see WorkItem 408
window.onbeforeunload = function() {
if (editorContainer.isDirty()) {
return "There are unsaved changes.";
diff --git a/bundles/org.eclipse.e4.webide/static/js/commands.js b/bundles/org.eclipse.e4.webide/static/js/commands.js
index c8d24c3..d8682b4 100644
--- a/bundles/org.eclipse.e4.webide/static/js/commands.js
+++ b/bundles/org.eclipse.e4.webide/static/js/commands.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
+ * 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 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@@ -50,7 +50,7 @@ eclipse.CommandService = (function() {
* this might be the id of the page or of a dom element.
*/
- // see https://kanrtc01.ottawa.ibm.com:9446/ies/web/projects/EclipseWeb#action=com.ibm.team.workitem.viewWorkItem&id=414
+ // see WorkItem 414
addCommand: function(command, scope, scopeId) {
switch (scope) {
case "global":
diff --git a/bundles/org.eclipse.e4.webide/static/js/editorContainer.js b/bundles/org.eclipse.e4.webide/static/js/editorContainer.js
index 433bbc9..eb912ba 100644
--- a/bundles/org.eclipse.e4.webide/static/js/editorContainer.js
+++ b/bundles/org.eclipse.e4.webide/static/js/editorContainer.js
@@ -138,7 +138,7 @@ eclipse.EditorContainer = (function() {
},
getTitle : function() {
if (this._codeTitle instanceof dijit._Widget) {
- return this._codeTitle.attr("title");
+ return this._codeTitle.get("title");
} else if (this._codeTitle.innerHTML) {
return this._codeTitle.innerHTML;
}
@@ -195,7 +195,7 @@ eclipse.EditorContainer = (function() {
if (this._editor) {
var titlePane = this._codeTitle;
if (titlePane instanceof dijit._Widget) {
- titlePane.attr("title", shortTitle);
+ titlePane.set("title", shortTitle);
} else {
titlePane = this._codeTitle;
if (titlePane) {
diff --git a/bundles/org.eclipse.e4.webide/static/js/explorer-tree.js b/bundles/org.eclipse.e4.webide/static/js/explorer-tree.js
index fbd1a03..486dfad 100644
--- a/bundles/org.eclipse.e4.webide/static/js/explorer-tree.js
+++ b/bundles/org.eclipse.e4.webide/static/js/explorer-tree.js
@@ -78,7 +78,7 @@ eclipse.ExplorerTree = (function() {
},
makeFavorite: function() {
if (this._contextMenuNode) {
- var items = this._contextMenuNode.attr("tree").getSelectedItems();
+ var items = this._contextMenuNode.get("tree").getSelectedItems();
this.registry.callService("IFavorites", "makeFavorites", null, [items]);
}
},
@@ -113,7 +113,7 @@ eclipse.ExplorerTree = (function() {
deleteFiles: function() {
if (this._contextMenuNode) {
- var items = this._contextMenuNode.attr("tree").getSelectedItems();
+ var items = this._contextMenuNode.get("tree").getSelectedItems();
if (items.length < 1) {
return;
}
@@ -245,7 +245,7 @@ eclipse.ExplorerTree = (function() {
// establish which item the menu applies to
dojo.connect(this.contextMenu, "_openMyself", this, function(event) {
var treeNode = dijit.getEnclosingWidget(event.target);
- var tree = treeNode.attr("tree");
+ var tree = treeNode.get("tree");
var selectedNodes = tree._getSelectedNodes();
if (dojo.indexOf(selectedNodes, treeNode) === -1) {
// change selection to match where menu appears
diff --git a/bundles/org.eclipse.e4.webide/static/js/favorites.js b/bundles/org.eclipse.e4.webide/static/js/favorites.js
index 4ba1e4d..57879c6 100644
--- a/bundles/org.eclipse.e4.webide/static/js/favorites.js
+++ b/bundles/org.eclipse.e4.webide/static/js/favorites.js
@@ -226,7 +226,7 @@ eclipse.Favorites = (function() {
return (function (oldName, path, id) {
return function(event) {
var editBox = dijit.byId(id + "EditBox"),
- newName = editBox.attr("value");
+ newName = editBox.get("value");
if (isKeyEvent && event.keyCode !== dojo.keys.ENTER) {
return;
} else if (!editBox.isValid() || newName === oldName) {
diff --git a/bundles/org.eclipse.e4.webide/static/js/input.js b/bundles/org.eclipse.e4.webide/static/js/input.js
index 244f70f..4762071 100644
--- a/bundles/org.eclipse.e4.webide/static/js/input.js
+++ b/bundles/org.eclipse.e4.webide/static/js/input.js
@@ -45,7 +45,7 @@ eclipse.InputService.prototype = {
this._previousInput = dojo.hash();
var input = this;
// I'm beginning to think this is a bad idea, that we shouldn't be the ones monitoring hashes.
- // See https://kanrtc01.ottawa.ibm.com:9446/ies/web/projects/EclipseWeb#action=com.ibm.team.workitem.viewWorkItem&id=408
+ // See WorkItem 408
dojo.subscribe("/dojo/hashchange", input, function() {
// if we are restoring the hash to what we think it should be, ignore
if (dojo.hash() === this._previousInput)
@@ -75,7 +75,7 @@ eclipse.InputService.prototype = {
// TODO This callback is used by parties that want to veto the input change from afar. For the editor,
// it is not necessary because the onunload performs the check.
- // See https://kanrtc01.ottawa.ibm.com:9446/ies/web/projects/EclipseWeb#action=com.ibm.team.workitem.viewWorkItem&id=408
+ // See WorkItem 408
verifyInputChange : function(callback) {
this._checkSubscribed();
this._verifyInputChangeCallback.push(callback);
diff --git a/bundles/org.eclipse.e4.webide/static/js/jsunit-test/jsunit-test-config.js b/bundles/org.eclipse.e4.webide/static/js/jsunit-test/jsunit-test-config.js
index 58f5168..9d02818 100644
--- a/bundles/org.eclipse.e4.webide/static/js/jsunit-test/jsunit-test-config.js
+++ b/bundles/org.eclipse.e4.webide/static/js/jsunit-test/jsunit-test-config.js
@@ -149,8 +149,8 @@ eclipse.TestConfigurator = (function() {
dojo.connect(this._configSelDiv, "onchange", function() {
self._onSelChange();
});
- this._delConfigBtnDiv.attr('disabled' , true);
- this._editConfigBtnDiv.attr('disabled' , true);
+ this._delConfigBtnDiv.set('disabled' , true);
+ this._editConfigBtnDiv.set('disabled' , true);
this._registry = options.serviceRegistry;
var self = this;
this._registry.callService("ITestConfigs", "addEventListener", null, [function(configs, selIndex) {
@@ -199,11 +199,11 @@ eclipse.TestConfigurator = (function() {
this._resultController.clearResultUI();
var selIndex = this._configSelDiv.selectedIndex;
if(selIndex === 0){
- this._delConfigBtnDiv.attr('disabled' , true);
- this._editConfigBtnDiv.attr('disabled' , true);
+ this._delConfigBtnDiv.set('disabled' , true);
+ this._editConfigBtnDiv.set('disabled' , true);
} else {
- this._delConfigBtnDiv.attr('disabled' , false);
- this._editConfigBtnDiv.attr('disabled' , false);
+ this._delConfigBtnDiv.set('disabled' , false);
+ this._editConfigBtnDiv.set('disabled' , false);
}
this._registry.callService("ITestConfigs", "setCurConfigIndex", null, [selIndex]);
if(selIndex !== 0){
diff --git a/bundles/org.eclipse.e4.webide/static/js/view-registry/view-registry.js b/bundles/org.eclipse.e4.webide/static/js/view-registry/view-registry.js
new file mode 100644
index 0000000..cb50a71
--- /dev/null
+++ b/bundles/org.eclipse.e4.webide/static/js/view-registry/view-registry.js
@@ -0,0 +1,84 @@
+/*jslint browser:true devel:true*/
+/*global dijit dojo eclipse widgets*/
+dojo.require("dijit.tree.ForestStoreModel");
+dojo.require("widgets.RegistryTree");
+
+dojo.addOnLoad(function() {
+
+ // TODO get the registry from somewhere else
+ var registry = new eclipse.Registry();
+ (function() {
+ registry.start();
+
+ var jslintPlugin = registry.getPlugin("/jslintPlugin.html");
+ if (jslintPlugin === null) {
+ registry.loadPlugin("/jslintPlugin.html", function(plugin) {
+ registry.installPlugin(plugin.pluginURL, plugin.pluginData);
+ });
+ }
+
+ // Register EAS
+ registry.registerLocalService("IStatusReporter", "EASStatusReporter", new eclipse.StatusReportingService(registry, "statusPane"));
+ registry.registerLocalService("ILogService", "EASLog", new eclipse.LogService(registry));
+ registry.registerLocalService("IDialogService", "EASDialogs", new eclipse.DialogService(registry));
+ registry.registerLocalService("ISaveable", "EASSaveable", new eclipse.SaveableService(registry));
+ var inputService = new eclipse.InputService(registry);
+ registry.registerLocalService("IInputProvider", "EASInputProvider", inputService);
+ registry.registerLocalService("IUsers", "EASUsers", new eclipse.UserService(registry));
+ registry.registerLocalService("ISelectionService", "EASSelection", new eclipse.SelectionService(registry));
+ var preferenceService = new eclipse.Preferences(registry, "/prefs/user");
+ registry.registerLocalService("IPreferenceService", "EASPreferences", preferenceService);
+
+ // File operations
+ registry.registerLocalService("IFileService", "FileService", new eclipse.FileService());
+
+ // Favorites
+ registry.registerLocalService("IFavorites", "FavoritesService", new eclipse.FavoritesService({serviceRegistry: registry}));
+ }());
+ // end TODO
+
+ var initTree = function() {
+ var tree = new widgets.RegistryTree({ registry: registry }, "registry-tree");
+ tree.startup();
+ };
+
+ // Hook up event handlers
+ var installUrlTextBox = dijit.byId("installUrlTextBox"),
+ installButton = dijit.byId("installButton"),
+ refreshButton = dijit.byId("refreshButton");
+
+ dojo.connect(installUrlTextBox, "onChange", function(evt) {
+ var url = installUrlTextBox.get("value");
+ installButton.set("disabled", !/^\S+$/.test(dojo.trim(url)));
+ });
+ dojo.connect(refreshButton, "onClick", function(evt) {
+ var old = dijit.byId("registry-tree");
+ if (old) {
+ //old.destroyRecursive();
+ dijit.registry.remove("registry-tree");
+ }
+ initTree();
+ });
+ var installHandler = function(evt) {
+ var pluginUrl = installUrlTextBox.get("value");
+ registry.loadPlugin(pluginUrl, function(plugin) {
+ registry.installPlugin(plugin.pluginURL, plugin.pluginData);
+ // FIXME: Add a callback for installPlugin() instead of using a timer
+ setTimeout(function() {
+ refreshButton.onClick();
+ installUrlTextBox.set("value", "");
+ }, 500);
+ });
+ };
+ dojo.connect(installUrlTextBox, "onKeyPress", function(e) {
+ if (dojo.keys.ENTER === e.keyCode) {
+ installHandler(e);
+ }
+ });
+ dojo.connect(installButton, "onClick", installHandler);
+
+ // Wait until the JSLint plugin has (hopefully) loaded, then draw the tree
+ setTimeout(function() {
+ initTree();
+ }, 500);
+}); \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.webide/static/js/widgets/ExplorerTree.js b/bundles/org.eclipse.e4.webide/static/js/widgets/ExplorerTree.js
index 1d44cab..ca8500e 100644
--- a/bundles/org.eclipse.e4.webide/static/js/widgets/ExplorerTree.js
+++ b/bundles/org.eclipse.e4.webide/static/js/widgets/ExplorerTree.js
@@ -195,7 +195,7 @@ dojo.declare(
// Adds or removes node from the selection
_toggleSelectNode: function(/**dijit._TreeNode*/ node) {
- if (this.selectedNodes[node.attr("id")]) {
+ if (this.selectedNodes[node.get("id")]) {
node.setSelected(false);
this._removeFromSelection(node);
} else {
@@ -205,11 +205,11 @@ dojo.declare(
},
_addToSelection: function(node) {
- this.selectedNodes[node.attr("id")] = node;
+ this.selectedNodes[node.get("id")] = node;
},
_removeFromSelection: function(node) {
- delete this.selectedNodes[node.attr("id")];
+ delete this.selectedNodes[node.get("id")];
},
/**
diff --git a/bundles/org.eclipse.e4.webide/static/js/widgets/NewItemDialog.js b/bundles/org.eclipse.e4.webide/static/js/widgets/NewItemDialog.js
index eeac88e..5f1438e 100644
--- a/bundles/org.eclipse.e4.webide/static/js/widgets/NewItemDialog.js
+++ b/bundles/org.eclipse.e4.webide/static/js/widgets/NewItemDialog.js
@@ -50,7 +50,7 @@ dojo.declare("widgets.NewItemDialog", [dijit.Dialog], {
if (this.options.advanced) {
this.itemAdvancedInfo.style.display = "table-row";
this.itemAdvancedInfo1.style.display = "table-row";
- this.protocol.attr('value', 'file');
+ this.protocol.set('value', 'file');
dojo.connect(this.protocol, "onChange", dojo.hitch(this, this.onModuleChange));
dojo.connect(this.itemURL, "onkeyup", dojo.hitch(this, this.onURLChange));
} else {
@@ -71,42 +71,42 @@ dojo.declare("widgets.NewItemDialog", [dijit.Dialog], {
execute: function() {
var url, create;
if (this.options.advanced) {
- var protocol = this.protocol.attr("value");
- url = (protocol !== 'file' ? this.protocol.attr("value") + ":/" : "");
+ var protocol = this.protocol.get("value");
+ url = (protocol !== 'file' ? this.protocol.get("value") + ":/" : "");
url = url + this.itemURL.value.replace(/^\s+|\s+$/g, '');
if (this.module.style.display !== "none") {
url = url + "?/" + this.module.value.replace(/^\s+|\s+$/g, '');
}
- if (this.createCheckbox.attr('disabled')) {
+ if (this.createCheckbox.get('disabled')) {
create = false;
} else {
- create = this.createCheckbox.attr('checked');
+ create = this.createCheckbox.get('checked');
}
}
this.options.func(this.itemName.value, (url && url !== "") ? url : undefined, create);
},
onURLChange : function(evt) {
- var protocol = this.protocol.attr("value");
+ var protocol = this.protocol.get("value");
if (protocol === 'file') {
- this.createCheckbox.attr('disabled', false);
+ this.createCheckbox.set('disabled', false);
return;
}
var url = this.itemURL.value;
if (url.match(new RegExp("^file://"))) {
- this.createCheckbox.attr('disabled', false);
+ this.createCheckbox.set('disabled', false);
return;
}
var remoteRegExp = new RegExp('^[a-zA-Z][a-zA-Z]+\:\/\/.+');
if (url.match(remoteRegExp)) {
- this.createCheckbox.attr('disabled', true);
+ this.createCheckbox.set('disabled', true);
return;
} else {
- this.createCheckbox.attr('disabled', false);
+ this.createCheckbox.set('disabled', false);
return;
}
},
onModuleChange : function(evt) {
- if (this.protocol.attr("value") === 'gitfs') {
+ if (this.protocol.get("value") === 'gitfs') {
this.moduleLabel.style.display = 'inline-block';
this.module.style.display = 'inline-block';
this.itemURL.style.width = '50%';
diff --git a/bundles/org.eclipse.e4.webide/static/js/widgets/OpenResourceDialog.js b/bundles/org.eclipse.e4.webide/static/js/widgets/OpenResourceDialog.js
index 2a7462b..e7626a7 100644
--- a/bundles/org.eclipse.e4.webide/static/js/widgets/OpenResourceDialog.js
+++ b/bundles/org.eclipse.e4.webide/static/js/widgets/OpenResourceDialog.js
@@ -91,7 +91,7 @@ dojo.declare("widgets.OpenResourceDialog", [dijit._Widget, dijit._Templated], {
},
doSearch: function() {
- var text = this.resourceName && this.resourceName.attr("value");
+ var text = this.resourceName && this.resourceName.get("value");
if (!text) {
return;
}
diff --git a/bundles/org.eclipse.e4.webide/static/js/widgets/RegistryTree.js b/bundles/org.eclipse.e4.webide/static/js/widgets/RegistryTree.js
new file mode 100644
index 0000000..5a44c42
--- /dev/null
+++ b/bundles/org.eclipse.e4.webide/static/js/widgets/RegistryTree.js
@@ -0,0 +1,184 @@
+/*jslint forin:true*/
+/*global dijit dojo eclipse widgets*/
+dojo.provide("widgets.RegistryTree");
+
+dojo.require("dijit.Tree");
+dojo.require("dojo.data.ItemFileReadStore");
+dojo.require("dijit.tree.TreeStoreModel");
+
+// TODO re-implement mayHaveChildren so leaves never have expando icons
+dojo.declare("widgets.RegistryTree", [dijit.Tree], {
+ constructor: function(options) {
+ this.inherited(arguments);
+ this.registry = options && options.registry;
+ if (!this.registry) { throw "Option 'registry' is required"; }
+ var registryData = this.buildRegistry(this.registry);
+ var store = new dojo.data.ItemFileReadStore({
+ data: {
+ identifier: "id",
+ label: "label",
+ items: registryData
+ }
+ });
+ console.debug(JSON.stringify(registryData));
+ var model = new dijit.tree.TreeStoreModel({ store: store });
+ this.model = model;
+ },
+ /**
+ * Parse the registry contents into a nice tree
+ * @return {Array.<{{id:string, label:string, children:Array}}>} (The "children" property is optional)
+ */
+ buildRegistry: function(registry) {
+ var plugins = { id: "plugins", label: "Plug-ins", children: this.buildPlugins("plugins", registry) },
+ localServices = { id: "localServices", label: "Local Services", children: this.buildLocalServices("localServices", registry) };
+ var root = {
+ id: "root",
+ label: "Plug-in registry",
+ children: [plugins, localServices]
+ };
+ return [ root ];
+ },
+ buildPlugins: function(prefix, registry) {
+ var nodes = [],
+ plugins = registry.getPlugins();
+ this.forEach(registry.getPlugins(), dojo.hitch(this, function(name, value) {
+ var plugin = value,
+ newPrefix = prefix + "|" + plugin.pluginURL,
+ services = this.buildServices(newPrefix, plugin.pluginData.services),
+ extensions = this.buildExtensions(newPrefix, plugin.pluginData.extensions);
+ nodes.push({
+ id: newPrefix,
+ label: plugin.pluginURL,
+ children: [services, extensions]
+ });
+ }));
+ return nodes;
+ },
+ buildProperties: function(prefix, /** Object */ properties) {
+ var newPrefix = prefix + "|properties",
+ data = [];
+ this.forEach(properties, function(key, value) {
+ data.push({
+ id: newPrefix + "|" + key,
+ value: value
+ });
+ });
+ var result = {
+ id: newPrefix,
+ label: "Properties",
+ children: data
+ };
+ if (data.length === 0) {
+ delete result.children; // looks nicer when empty
+ }
+ return result;
+ },
+ buildServices: function(prefix, /** Array */ services) {
+ var scope = this;
+ function buildInterfaces(prefix, /** Object*/ serviceType) {
+ var interfaces = serviceType.interfaces /** Array */,
+ data = [],
+ newPrefix = prefix + "|interfaces";
+ for (var i=0; i < interfaces.length; i++) {
+ var interfaze = interfaces[i]; /** String */
+ data.push({
+ id: newPrefix + "|" + i,
+ label: interfaze
+ });
+ }
+ return {
+ id: newPrefix,
+ label: "Interfaces",
+ children: data
+ };
+ }
+
+ var data = [];
+ for (var i=0; i < services.length; i++) {
+ var service = services[i],
+ servicePrefix = prefix + "|services|" + i,
+ serviceType = service.serviceType;
+ data.push({
+ id: servicePrefix,
+ label: service.id + " (Service type: " + serviceType.id + ")",
+ children: [buildInterfaces(servicePrefix, serviceType), this.buildProperties(servicePrefix, service.properties)]
+ });
+ }
+ return {
+ id: prefix + "|services",
+ label: "Services",
+ children: data
+ };
+ },
+ buildExtensions: function(prefix, /** eclipse.Plugin? */plugin) {
+ var newPrefix = prefix + "|extensions",
+ extensions = plugin && plugin.extensions,
+ data = [];
+ if (!extensions) {
+ return {
+ id: newPrefix,
+ label: "Extensions"
+ };
+ }
+
+ for (var i=0; i < extensions.length; i++) {
+ var extension = extensions[i];
+ data.push({
+ id: newPrefix + extension.name,
+ label: extension.name + " (Extension point: " + extension.point + ")" });
+ }
+ return {
+ id: newPrefix,
+ label: "Extensions"
+ };
+ },
+ /** @return {Array} */
+ buildLocalServices: function(prefix, registry) {
+ var data = [];
+ this.forEach(registry._localServices, dojo.hitch(this, function(name, localService) {
+ var newPrefix = prefix + "|" + name;
+ data.push({
+ id: newPrefix,
+ label: name,
+ children: this.buildLocalService(newPrefix, localService)
+ });
+ }));
+ return data;
+ },
+ /** @return {Array} */
+ buildLocalService: function(prefix, localService) {
+ // NOTE: localService.instances is an Array which uses noninteger keys
+ var data = [];
+ this.forEach(localService.instances, dojo.hitch(this, function(name, instance) {
+ var newPrefix = prefix + "|" + name;
+ data.push({
+ id: newPrefix,
+ label: "Instance " + name,
+ children: this.buildLocalServiceInstance(newPrefix, instance)
+ }); }));
+ return data;
+ },
+ /** @return {Array} */
+ buildLocalServiceInstance: function(prefix, instance) {
+ var newPrefix = prefix + "|" + instance.id,
+ data = [];
+ data.push(this.buildProperties(newPrefix, instance.properties));
+ data.push({
+ id: newPrefix + "|serviceImpl",
+ label: "serviceImpl: " + instance.serviceImpl
+ });
+ return data;
+ },
+ /**
+ * Invokes callback(key, value) for each key-value pair in object
+ */
+ forEach: function(obj, /**function(propertyName, value, ?obj):void*/callback) {
+ if(!obj) { return; }
+ for (var prop in obj) {
+ callback(prop, obj[prop], obj);
+ }
+ }
+});
+
+
+
diff --git a/bundles/org.eclipse.e4.webide/static/js/widgets/eWebBorderContainer.js b/bundles/org.eclipse.e4.webide/static/js/widgets/eWebBorderContainer.js
index 54ff474..270e577 100644
--- a/bundles/org.eclipse.e4.webide/static/js/widgets/eWebBorderContainer.js
+++ b/bundles/org.eclipse.e4.webide/static/js/widgets/eWebBorderContainer.js
@@ -68,7 +68,7 @@ dojo.declare("widgets.eWebSplitter", dojox.layout.ToggleSplitter,
var persistOpenState = dojo.cookie(this._openStateCookieName);
if(!persistOpenState || persistOpenState == "false" ){
dojo.byId("leftPane").style.width = "0px";
- this.attr("open", false);
+ this.set("open", false);
this._handleOnChange();
} else {
dojo.byId("leftPane").style.width = this.getSizeCookie() + "px";
@@ -145,7 +145,7 @@ dojo.declare("widgets.eWebSplitter", dojox.layout.ToggleSplitter,
_onThumbMouseDown: function(evt){
evt.stopPropagation();
this._removeFocusVisual(evt);
- this.container.attr("editorContainer").toggleLeftPane();
+ this.container.get("editorContainer").toggleLeftPane();
},
_onThumbMouseOver: function(evt){
@@ -178,7 +178,7 @@ dojo.declare("widgets.eWebSplitter", dojox.layout.ToggleSplitter,
},
toggleLeftPaneState: function(){
- this.attr("open", !this.open);
+ this.set("open", !this.open);
dojo.byId("leftPane").style.visibility = this.open ? "visible" : "hidden";
if(this.container.persist){
dojo.cookie(this._openStateCookieName, this.open ? "true" : "false", {expires:365});
diff --git a/bundles/org.eclipse.e4.webide/static/jsunit-test-new.html b/bundles/org.eclipse.e4.webide/static/jsunit-test-new.html
index c6456e9..f73b0ef 100644
--- a/bundles/org.eclipse.e4.webide/static/jsunit-test-new.html
+++ b/bundles/org.eclipse.e4.webide/static/jsunit-test-new.html
@@ -156,7 +156,7 @@
</div>
</div>
-
+ <!-- test -->
<script src="js/jsunit-test/jsunit-test.js"></script>
</body>
diff --git a/bundles/org.eclipse.e4.webide/static/view-registry.html b/bundles/org.eclipse.e4.webide/static/view-registry.html
new file mode 100644
index 0000000..d6eff92
--- /dev/null
+++ b/bundles/org.eclipse.e4.webide/static/view-registry.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html style="height: 100%">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=8">
+ <title>Plug-in Registry Viewer</title>
+<script type="text/javascript">
+ var djConfig = {
+ isDebug : true,
+ modulePaths : {
+ 'widgets' : '/js/widgets'
+ },
+ parseOnLoad : true
+ };
+</script>
+<script src="/org.dojotoolkit/dojo/dojo.js.uncompressed.js"></script>
+<script type="text/javascript">
+ dojo.require("dijit.form.Button");
+ dojo.require("dijit.form.TextBox");
+ dojo.require("dijit.layout.BorderContainer");
+ dojo.require("dijit.layout.ContentPane");
+</script>
+<style type="text/css">
+ @import "/org.dojotoolkit/dojo/resources/dojo.css";
+ @import "/org.dojotoolkit/dijit/themes/soria/soria.css";
+ @import "/org.dojotoolkit/dijit/themes/soria/Tree.css";
+ @import "/org.dojotoolkit/dijit/themes/soria/layout/BorderContainer.css";
+ @import "/org.dojotoolkit/dijit/themes/soria/form/Common.css";
+ @import "/org.dojotoolkit/dijit/themes/soria/form/Button.css";
+ @import "/ide.css";
+</style>
+</head>
+ <body style="height: 100%" class="soria">
+ <script src="/openajax/release/all/OpenAjaxManagedHub-all.js"></script>
+ <script src="js/registry.js"></script>
+ <script src="js/plugin.js"></script>
+ <script type="text/javascript" src="js/auth.js"></script>
+
+ <!-- TODO: scripts below are only for testing, remove later -->
+ <script src="js/util.js"></script>
+ <script src="js/commands.js"></script>
+ <script src="js/dialogs.js"></script>
+ <script src="js/input.js"></script>
+ <script src="js/log.js"></script>
+ <script src="js/preferences.js"></script>
+ <script src="js/saveable.js"></script>
+ <script src="js/selection.js"></script>
+ <script src="js/status.js"></script>
+ <script src="js/users.js"></script>
+ <script src="js/fileClient.js"></script>
+ <script src="js/breadcrumbs.js"></script>
+ <script src="js/favorites.js"></script>
+ <script src="js/searchClient.js"></script>
+
+ <div dojoType="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%;">
+ <div dojoType="dijit.layout.ContentPane" region="top" class="toolbar">
+ <div style="float: left;">
+ <img class="toolbarLabel" src="/images/Eclipse-Logo.gif" alt="Eclipse Logo" align="top">
+ </div>
+ <div style="float: right;" class="innerToolbar">
+ <div id="installUrlTextBox" dojoType="dijit.form.TextBox" placeHolder="Type a plugin URL here" intermediateChanges="true" style="width:25em;"></div>
+ <button id="installButton" dojoType="dijit.form.Button" disabled="disabled">Install</button>
+ </div>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" region="center">
+ <h2>Installed Plug-ins and Services <button id="refreshButton" dojoType="dijit.form.Button" iconClass="refresh"><img src="/images/silk/arrow_refresh.png" alt="Refresh" title="Refresh"></button></h2>
+ <div id="registry-tree">Loading&#8230;</div>
+ </div>
+ </div>
+
+ <!-- Glue -->
+ <script src="js/view-registry/view-registry.js"></script>
+ </body>
+</html> \ No newline at end of file