Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 245355 Details for
Bug 438886
The plugins settings page should clearly indicate the status of the plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix with checks for loading problems
Bug 438886 - The plugins settings page should clearly indicate the status of the plugin2.patch (text/plain), 13.54 KB, created by
Curtis Windatt
on 2014-07-24 16:54:22 EDT
(
hide
)
Description:
Fix with checks for loading problems
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2014-07-24 16:54:22 EDT
Size:
13.54 KB
patch
obsolete
> ><!-- saved from url=(0490)https://orion.eclipse.org/gitapi/diff/Cached/file/cwindatt-OrionContent/org.eclipse.orion.client-2/?parts=diff&Path=bundles/org.eclipse.orion.client.core/web/orion/pluginregistry.js&Path=bundles/org.eclipse.orion.client.ui/web/orion/settings/nls/root/messages.js&Path=bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginEntry.js&Path=bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginList.js&Path=bundles/org.eclipse.orion.client.ui/web/settings/settings.css --> ><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><style type="text/css"></style></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff --git a/bundles/org.eclipse.orion.client.core/web/orion/pluginregistry.js b/bundles/org.eclipse.orion.client.core/web/orion/pluginregistry.js >index 87a2655..6d1aeba 100644 >--- a/bundles/org.eclipse.orion.client.core/web/orion/pluginregistry.js >+++ b/bundles/org.eclipse.orion.client.core/web/orion/pluginregistry.js >@@ -1,6 +1,6 @@ > /******************************************************************************* > * @license >- * Copyright (c) 2010-2012 IBM Corporation and others. >+ * Copyright (c) 2010, 2014 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 >@@ -587,6 +587,20 @@ > this.getState = function() { > return _state; > }; >+ >+ /** >+ * @name orion.pluginregistry.Plugin#getProblemStarting >+ * @description Returns true if there was a problem loading this plug-in, false otherwise. This function is not API and may change in future releases. >+ * @private >+ * @function >+ * @returns {String} Return an true if there was a problem loading this plug-in. >+ */ >+ this.getProblemStarting = function() { >+ if (_this._problemLoading){ >+ return true; >+ } >+ return false; >+ }; > > this.start = function(optOptions) { > if (_state === "uninstalled") { >@@ -714,6 +728,8 @@ > }; > > _update = function(input) { >+ _this.problemLoading = null; >+ > if (_state === "uninstalled") { > return new Deferred().reject(new Error("Plugin is uninstalled")); > } >@@ -724,6 +740,7 @@ > _persist(); > } > return _internalRegistry.loadManifest(_url).then(_update, function() { >+ _this._problemLoading = true; > if (_this._default) { > _lastModified = 0; > _persist(); >diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/settings/nls/root/messages.js b/bundles/org.eclipse.orion.client.ui/web/orion/settings/nls/root/messages.js >index 073e01b..04e3961 100644 >--- a/bundles/org.eclipse.orion.client.ui/web/orion/settings/nls/root/messages.js >+++ b/bundles/org.eclipse.orion.client.ui/web/orion/settings/nls/root/messages.js >@@ -1,6 +1,6 @@ > /******************************************************************************* > * @license >- * Copyright (c) 2012 IBM Corporation and others. >+ * Copyright (c) 2012, 2014 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 >@@ -83,7 +83,7 @@ > "Author Name:": "Author Name:", > "Licence:": "Licence:", > "Description:": "Description:", >- "A plugin for Eclipse Orion": "A plugin for Eclipse Orion", >+ "A plugin for Orion": "A plugin for Orion", > "Plugin Link": "Plugin Link", > "Install": "Install", > "Install a plugin by specifying its URL": "Install a plugin by specifying its URL", >@@ -225,5 +225,11 @@ > "splitEditors": "Split Editors", > "splitOrientation": "Split Orientation", > "horizontal": "Horizontal", >- "vertical": "Vertical" >+ "vertical": "Vertical", >+ "pluginStatusNotLoaded": "This plug-in is not loaded.", >+ "pluginStatusNotRunning": "This plug-in is disabled.", >+ "pluginStatusBroken": "This plug-in could not be loaded.", >+ "Website": "Website", >+ "License": "License", >+ "Login": "Login" > }); >diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginEntry.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginEntry.js >index b1eb339..f67405d 100644 >--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginEntry.js >+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginEntry.js >@@ -44,6 +44,8 @@ > > if (last === '') { > last = location; >+ } else { >+ last = last + ' - ' + location; //$NON-NLS-0$ > } > return last; > } >@@ -52,8 +54,8 @@ > var serviceDescriptions = []; > plugin.getServiceReferences().forEach(function(reference) { > var serviceName = ""; >- if (reference.getProperty("objectClass")){ >- serviceName = reference.getProperty("objectClass").join(" "); >+ if (reference.getProperty("objectClass")){ //$NON-NLS-0$ >+ serviceName = reference.getProperty("objectClass").join(" "); //$NON-NLS-0$ //$NON-NLS-1$ > } > > var serviceDescription = { >@@ -87,6 +89,7 @@ > '<span class="plugin-commands"></span>' + //$NON-NLS-0$ > '<div class="stretch">' + //$NON-NLS-0$ > '<span class="plugin-title"></span>' + //$NON-NLS-0$ >+ '<div class="plugin-status"></div>' + //$NON-NLS-0$ > '<div></div>' + //$NON-NLS-0$ > '<span class="plugin-description"></span>' + //$NON-NLS-0$ > '<div class="plugin-links" style="font-size:11px"></div>' + //$NON-NLS-0$ >@@ -99,11 +102,12 @@ > > createElements: function() { > this.node.innerHTML = this.templateString; >- this.pluginTitle = lib.$(".plugin-title", this.node); >- this.pluginDescription = lib.$(".plugin-description", this.node); >- this.pluginLinks = lib.$(".plugin-links", this.node); >- this.commandSpan = lib.$(".plugin-commands", this.node); >- this.serviceContainer = lib.$(".plugin-service-item", this.node); >+ this.pluginTitle = lib.$(".plugin-title", this.node); //$NON-NLS-0$ >+ this.pluginStatus = lib.$(".plugin-status", this.node); //$NON-NLS-0$ >+ this.pluginDescription = lib.$(".plugin-description", this.node); //$NON-NLS-0$ >+ this.pluginLinks = lib.$(".plugin-links", this.node); //$NON-NLS-0$ >+ this.commandSpan = lib.$(".plugin-commands", this.node); //$NON-NLS-0$ >+ this.serviceContainer = lib.$(".plugin-service-item", this.node); //$NON-NLS-0$ > this.postCreate(); > }, > destroy: function() { >@@ -116,7 +120,7 @@ > }, > addPluginLink: function(name, url) { > if (!PageUtil.validateURLScheme(url)) { >- console.log("Illegal "+ name +" URL: " + url); >+ console.log("Illegal "+ name +" URL: " + url); //$NON-NLS-0$ //$NON-NLS-1$ > return; > } > var link = document.createElement("a"); //$NON-NLS-0$ >@@ -129,19 +133,55 @@ > postCreate: function(){ > var headers = this.plugin.getHeaders(); > var location = this.plugin.getLocation(); >- this.pluginTitle.textContent = headers.name || formatLocationAsPluginName(location); >- this.pluginDescription.textContent = headers.description || messages['A plugin for Eclipse Orion']; >+ var state = this.plugin.getState(); >+ if (this.plugin.getProblemStarting()){ >+ state = "broken"; //$NON-NLS-0$ >+ } >+ >+ if (PageUtil.validateURLScheme(location)){ >+ var link = document.createElement("a"); //$NON-NLS-0$ >+ link.href = location; >+ link.title = headers.name || formatLocationAsPluginName(location); >+ link.textContent = headers.name || formatLocationAsPluginName(location); >+ this.pluginTitle.appendChild(link); >+ } else { >+ this.pluginTitle.textContent = headers.name || formatLocationAsPluginName(location); >+ } >+ >+ if (state){ >+ switch (state){ >+ // Ignore active, starting and stopping states >+ case "uninstalled": //$NON-NLS-0$ >+ this.pluginStatus.textContent = messages['pluginStatusNotLoaded']; // Not installed >+ break; >+ case "installed": //$NON-NLS-0$ >+ this.pluginStatus.textContent = messages['pluginStatusNotLoaded']; // Dependencies not satisfied >+ break; >+ case "resolved": //$NON-NLS-0$ >+ this.pluginStatus.textContent = messages['pluginStatusNotRunning']; // User disabled >+ break; >+ case "broken": //$NON-NLS-0$ >+ var icon = document.createElement("span"); //$NON-NLS-0$ >+ icon.className = "core-sprite-error modelDecorationSprite"; //$NON-NLS-0$ >+ var content = document.createElement("span"); //$NON-NLS-0$ >+ content.textContent = messages['pluginStatusBroken']; // Problem during update/starting >+ this.pluginStatus.appendChild(icon); >+ this.pluginStatus.appendChild(content); >+ break; >+ } >+ } >+ >+ this.pluginDescription.textContent = headers.description || messages['A plugin for Orion']; > >- // Plugin Links >- this.addPluginLink("Plugin", location); >+ // Additional Links > if (headers.website) { >- this.addPluginLink("Website", headers.website); >+ this.addPluginLink(messages["Website"], headers.website); > } > if (headers.license) { >- this.addPluginLink("License", headers.license); >+ this.addPluginLink(messages["License"], headers.license); > } > if (headers.login) { >- this.addPluginLink("Login", headers.login); >+ this.addPluginLink(messages["Login"], headers.login); > } > > this.commandSpan.id = location; >diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginList.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginList.js >index e5e08e0..fc0bc79 100644 >--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginList.js >+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginList.js >@@ -1,6 +1,6 @@ > /******************************************************************************* > * @license >- * Copyright (c) 2012 IBM Corporation and others. >+ * Copyright (c) 2012, 2014 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 >@@ -282,7 +282,6 @@ > }); > this.commandService.addCommand(enablePluginCommand); > this.commandService.registerCommandContribution("pluginCommand", "orion.enablePlugin", 4); //$NON-NLS-1$ //$NON-NLS-0$ >- > > var list = this.pluginList; > >@@ -295,12 +294,19 @@ > var plugins = this.settings.pluginRegistry.getPlugins(); > this.pluginTitle.textContent = messages['Plugins']; > this.pluginCount.textContent = plugins.length; >- >+ >+ for (var i=0; i<plugins.length; i++) { >+ if (defaultPluginURLs[plugins[i].getLocation()]) { >+ plugins[i].isDefaultPlugin = true; >+ } >+ } >+ plugins.sort(this._sortPlugins); >+ > // TODO maybe this should only be done once > this.explorer = new PluginListExplorer(this.commandService); > this.pluginListTree = this.explorer.createTree(this.pluginList.id, new mExplorer.SimpleFlatModel(plugins, "plugin", function(item) { //$NON-NLS-1$ //$NON-NLS-0$ > return item.getLocation(); >- }), { setFocus: false }); >+ }), { /*setFocus: false,*/ noSelection: true}); > > // for( var p = 0; p < plugins.length; p++ ){ > // var pluginEntry = new PluginEntry( {plugin: plugins[p], commandService:this.commandService} ); >@@ -308,6 +314,48 @@ > // pluginEntry.show(); > // } > }, >+ >+ /** >+ * @name _sortPlugins >+ * @description sorts plugins by state, then default config, then name >+ * @function >+ * @private >+ * @param a first object to compare >+ * @param b second object to return >+ * @returns -1 for a first, 1 for b first, 0 if equals >+ */ >+ _sortPlugins: function(a, b) { >+ var aState = a.getState(); >+ var bState = b.getState(); >+ var aHeaders = a.getHeaders(); >+ var bHeaders = b.getHeaders(); >+ >+ if (a.getProblemStarting() && !b.getProblemStarting()){ >+ return -1; >+ } >+ if (b.getProblemStarting() && !a.getProblemStarting()){ >+ return 1; >+ } >+ >+ if (b.isDefaultPlugin && !a.isDefaultPlugin){ >+ return -1; >+ } >+ if (a.isDefaultPlugin && !b.isDefaultPlugin){ >+ return 1; >+ } >+ >+ if (!aHeaders || !aHeaders.name){ >+ return -1; >+ } >+ if (!bHeaders || !bHeaders.name){ >+ return 1; >+ } >+ var n1 = aHeaders.name && aHeaders.name.toLowerCase(); >+ var n2 = bHeaders.name && bHeaders.name.toLowerCase(); >+ if (n1 < n2) { return -1; } >+ if (n1 > n2) { return 1; } >+ return 0; >+ }, > > pluginURLFocus: function(){ > this.pluginUrlEntry.value = ''; >diff --git a/bundles/org.eclipse.orion.client.ui/web/settings/settings.css b/bundles/org.eclipse.orion.client.ui/web/settings/settings.css >index 1637933..586829a 100644 >--- a/bundles/org.eclipse.orion.client.ui/web/settings/settings.css >+++ b/bundles/org.eclipse.orion.client.ui/web/settings/settings.css >@@ -282,9 +282,7 @@ > > .plugin-entry { > border-bottom: solid 1px #EEE; >- padding-bottom: 10px; >- >- padding: 15px 10px 15px 10px; >+ padding: 10px 10px 10px 10px; > } > > .plugin-icon { >@@ -343,6 +341,12 @@ > position:relative; > } > >+.plugin-status { >+ font-size: 11px; >+ white-space: normal; >+ color: #b94a48; >+} >+ > .plugin-description { > font-size: 11px; > white-space: normal; >@@ -360,7 +364,7 @@ > clear: left; > outline: none; > line-height:14px; >- padding-top: 10px; >+ padding-top: 5px; > } > > .serviceCount { ></pre></body></html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 438886
:
245309
|
245310
|
245355
|
245357
|
245491