Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 438886 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.core/web/orion/pluginregistry.js (-1 / +18 lines)
Lines 1-6 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * @license
2
 * @license
3
 * Copyright (c) 2010-2012 IBM Corporation and others.
3
 * Copyright (c) 2010, 2014 IBM Corporation and others.
4
 * All rights reserved. This program and the accompanying materials are made 
4
 * All rights reserved. This program and the accompanying materials are made 
5
 * available under the terms of the Eclipse Public License v1.0 
5
 * available under the terms of the Eclipse Public License v1.0 
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
Lines 587-592 Link Here
587
        this.getState = function() {
587
        this.getState = function() {
588
            return _state;
588
            return _state;
589
        };
589
        };
590
        
591
         /**
592
         * @name orion.pluginregistry.Plugin#getProblemStarting
593
         * @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.
594
         * @private
595
         * @function
596
         * @returns {String} Return an true if there was a problem loading this plug-in.
597
         */
598
        this.getProblemStarting = function() {
599
            if (_this._problemLoading){
600
            	return true;
601
            }
602
            return false;
603
        };
590
604
591
        this.start = function(optOptions) {
605
        this.start = function(optOptions) {
592
            if (_state === "uninstalled") {
606
            if (_state === "uninstalled") {
Lines 714-719 Link Here
714
        };
728
        };
715
729
716
        _update = function(input) {
730
        _update = function(input) {
731
        	_this.problemLoading = null;
732
        	
717
            if (_state === "uninstalled") {
733
            if (_state === "uninstalled") {
718
                return new Deferred().reject(new Error("Plugin is uninstalled"));
734
                return new Deferred().reject(new Error("Plugin is uninstalled"));
719
            }
735
            }
Lines 724-729 Link Here
724
                    _persist();
740
                    _persist();
725
                }
741
                }
726
                return _internalRegistry.loadManifest(_url).then(_update, function() {
742
                return _internalRegistry.loadManifest(_url).then(_update, function() {
743
                	_this._problemLoading = true;
727
                	if (_this._default) {
744
                	if (_this._default) {
728
                		_lastModified = 0;
745
                		_lastModified = 0;
729
                		_persist();
746
                		_persist();
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/settings/nls/root/messages.js (-3 / +9 lines)
Lines 1-6 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * @license
2
 * @license
3
 * Copyright (c) 2012 IBM Corporation and others.
3
 * Copyright (c) 2012, 2014 IBM Corporation and others.
4
 * All rights reserved. This program and the accompanying materials are made
4
 * All rights reserved. This program and the accompanying materials are made
5
 * available under the terms of the Eclipse Public License v1.0
5
 * available under the terms of the Eclipse Public License v1.0
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
Lines 83-89 Link Here
83
	"Author Name:": "Author Name:",
83
	"Author Name:": "Author Name:",
84
	"Licence:": "Licence:",
84
	"Licence:": "Licence:",
85
	"Description:": "Description:",
85
	"Description:": "Description:",
86
	"A plugin for Eclipse Orion": "A plugin for Eclipse Orion",
86
	"A plugin for Orion": "A plugin for Orion",
87
	"Plugin Link": "Plugin Link",
87
	"Plugin Link": "Plugin Link",
88
	"Install": "Install",
88
	"Install": "Install",
89
	"Install a plugin by specifying its URL": "Install a plugin by specifying its URL",
89
	"Install a plugin by specifying its URL": "Install a plugin by specifying its URL",
Lines 225-229 Link Here
225
	"splitEditors": "Split Editors",
225
	"splitEditors": "Split Editors",
226
	"splitOrientation": "Split Orientation",
226
	"splitOrientation": "Split Orientation",
227
	"horizontal": "Horizontal",
227
	"horizontal": "Horizontal",
228
	"vertical": "Vertical"
228
	"vertical": "Vertical",
229
	"pluginStatusNotLoaded": "This plug-in is not loaded.",
230
	"pluginStatusNotRunning": "This plug-in is disabled.",
231
	"pluginStatusBroken": "This plug-in could not be loaded.",
232
	"Website": "Website",
233
	"License": "License",
234
	"Login": "Login"
229
});
235
});
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginEntry.js (-15 / +55 lines)
Lines 44-49 Link Here
44
	
44
	
45
		if (last === '') {
45
		if (last === '') {
46
			last = location;
46
			last = location;
47
		} else {
48
			last = last + ' - ' + location;  //$NON-NLS-0$
47
		}
49
		}
48
		return last;
50
		return last;
49
	}
51
	}
Lines 52-59 Link Here
52
		var serviceDescriptions = [];
54
		var serviceDescriptions = [];
53
		plugin.getServiceReferences().forEach(function(reference) {
55
		plugin.getServiceReferences().forEach(function(reference) {
54
			var serviceName = "";
56
			var serviceName = "";
55
			if (reference.getProperty("objectClass")){
57
			if (reference.getProperty("objectClass")){   //$NON-NLS-0$ 
56
				serviceName = reference.getProperty("objectClass").join(" ");
58
				serviceName = reference.getProperty("objectClass").join(" ");   //$NON-NLS-0$   //$NON-NLS-1$ 
57
			}
59
			}
58
			
60
			
59
			var serviceDescription = {
61
			var serviceDescription = {
Lines 87-92 Link Here
87
									'<span class="plugin-commands"></span>' + //$NON-NLS-0$
89
									'<span class="plugin-commands"></span>' + //$NON-NLS-0$
88
									'<div class="stretch">' + //$NON-NLS-0$
90
									'<div class="stretch">' + //$NON-NLS-0$
89
										'<span class="plugin-title"></span>' + //$NON-NLS-0$
91
										'<span class="plugin-title"></span>' + //$NON-NLS-0$
92
										'<div class="plugin-status"></div>' + //$NON-NLS-0$
90
										'<div></div>' + //$NON-NLS-0$
93
										'<div></div>' + //$NON-NLS-0$
91
										'<span class="plugin-description"></span>' + //$NON-NLS-0$
94
										'<span class="plugin-description"></span>' + //$NON-NLS-0$
92
										'<div class="plugin-links" style="font-size:11px"></div>' + //$NON-NLS-0$ 
95
										'<div class="plugin-links" style="font-size:11px"></div>' + //$NON-NLS-0$ 
Lines 99-109 Link Here
99
102
100
		createElements: function() {
103
		createElements: function() {
101
			this.node.innerHTML = this.templateString;
104
			this.node.innerHTML = this.templateString;
102
			this.pluginTitle = lib.$(".plugin-title", this.node);
105
			this.pluginTitle = lib.$(".plugin-title", this.node);  //$NON-NLS-0$ 
103
			this.pluginDescription = lib.$(".plugin-description", this.node);
106
			this.pluginStatus = lib.$(".plugin-status", this.node);  //$NON-NLS-0$ 
104
			this.pluginLinks = lib.$(".plugin-links", this.node);
107
			this.pluginDescription = lib.$(".plugin-description", this.node);  //$NON-NLS-0$ 
105
			this.commandSpan = lib.$(".plugin-commands", this.node);
108
			this.pluginLinks = lib.$(".plugin-links", this.node);  //$NON-NLS-0$ 
106
			this.serviceContainer = lib.$(".plugin-service-item", this.node);
109
			this.commandSpan = lib.$(".plugin-commands", this.node);  //$NON-NLS-0$ 
110
			this.serviceContainer = lib.$(".plugin-service-item", this.node);  //$NON-NLS-0$ 
107
			this.postCreate();
111
			this.postCreate();
108
		},
112
		},
109
		destroy: function() {
113
		destroy: function() {
Lines 116-122 Link Here
116
		},
120
		},
117
		addPluginLink: function(name, url)  {
121
		addPluginLink: function(name, url)  {
118
			if (!PageUtil.validateURLScheme(url)) {
122
			if (!PageUtil.validateURLScheme(url)) {
119
				console.log("Illegal "+ name +" URL: " + url);
123
				console.log("Illegal "+ name +" URL: " + url);  //$NON-NLS-0$  //$NON-NLS-1$
120
				return;
124
				return;
121
			}
125
			}
122
			var link = document.createElement("a"); //$NON-NLS-0$
126
			var link = document.createElement("a"); //$NON-NLS-0$
Lines 129-147 Link Here
129
		postCreate: function(){	
133
		postCreate: function(){	
130
			var headers = this.plugin.getHeaders();
134
			var headers = this.plugin.getHeaders();
131
			var location = this.plugin.getLocation();
135
			var location = this.plugin.getLocation();
132
			this.pluginTitle.textContent = headers.name || formatLocationAsPluginName(location);
136
			var state = this.plugin.getState();
133
			this.pluginDescription.textContent = headers.description || messages['A plugin for Eclipse Orion'];
137
			if (this.plugin.getProblemStarting()){
138
				state = "broken"; //$NON-NLS-0$
139
			}
140
			
141
			if (PageUtil.validateURLScheme(location)){
142
				var link = document.createElement("a"); //$NON-NLS-0$
143
				link.href = location;
144
				link.title = headers.name || formatLocationAsPluginName(location);
145
				link.textContent = headers.name || formatLocationAsPluginName(location);
146
				this.pluginTitle.appendChild(link);
147
			} else {
148
				this.pluginTitle.textContent = headers.name || formatLocationAsPluginName(location);
149
			}			
150
			
151
			if (state){
152
				switch (state){
153
					// Ignore active, starting and stopping states
154
					case "uninstalled":  //$NON-NLS-0$
155
						this.pluginStatus.textContent = messages['pluginStatusNotLoaded'];  // Not installed
156
						break;
157
					case "installed": //$NON-NLS-0$
158
						this.pluginStatus.textContent = messages['pluginStatusNotLoaded']; // Dependencies not satisfied
159
						break;
160
					case "resolved": //$NON-NLS-0$
161
						this.pluginStatus.textContent = messages['pluginStatusNotRunning']; // User disabled
162
						break;
163
					case "broken": //$NON-NLS-0$
164
						var icon = document.createElement("span"); //$NON-NLS-0$
165
						icon.className = "core-sprite-error modelDecorationSprite"; //$NON-NLS-0$
166
						var content = document.createElement("span"); //$NON-NLS-0$
167
						content.textContent = messages['pluginStatusBroken']; // Problem during update/starting
168
						this.pluginStatus.appendChild(icon);
169
						this.pluginStatus.appendChild(content);
170
						break;
171
				}
172
			}
173
			
174
			this.pluginDescription.textContent = headers.description || messages['A plugin for Orion'];
134
175
135
			// Plugin Links
176
			// Additional Links
136
			this.addPluginLink("Plugin", location);
137
			if (headers.website) {
177
			if (headers.website) {
138
				this.addPluginLink("Website", headers.website);
178
				this.addPluginLink(messages["Website"], headers.website);
139
			}
179
			}
140
			if (headers.license) {
180
			if (headers.license) {
141
				this.addPluginLink("License", headers.license);
181
				this.addPluginLink(messages["License"], headers.license);
142
			}
182
			}
143
			if (headers.login) {
183
			if (headers.login) {
144
				this.addPluginLink("Login", headers.login);
184
				this.addPluginLink(messages["Login"], headers.login);
145
			}
185
			}
146
			
186
			
147
			this.commandSpan.id = location;
187
			this.commandSpan.id = location;
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginList.js (-4 / +52 lines)
Lines 1-6 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * @license
2
 * @license
3
 * Copyright (c) 2012 IBM Corporation and others.
3
 * Copyright (c) 2012, 2014 IBM Corporation and others.
4
 * All rights reserved. This program and the accompanying materials are made 
4
 * All rights reserved. This program and the accompanying materials are made 
5
 * available under the terms of the Eclipse Public License v1.0 
5
 * available under the terms of the Eclipse Public License v1.0 
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
Lines 282-288 Link Here
282
			});			
282
			});			
283
			this.commandService.addCommand(enablePluginCommand);
283
			this.commandService.addCommand(enablePluginCommand);
284
			this.commandService.registerCommandContribution("pluginCommand", "orion.enablePlugin", 4); //$NON-NLS-1$ //$NON-NLS-0$
284
			this.commandService.registerCommandContribution("pluginCommand", "orion.enablePlugin", 4); //$NON-NLS-1$ //$NON-NLS-0$
285
286
		
285
		
287
			var list = this.pluginList;
286
			var list = this.pluginList;
288
		
287
		
Lines 295-306 Link Here
295
			var plugins = this.settings.pluginRegistry.getPlugins();
294
			var plugins = this.settings.pluginRegistry.getPlugins();
296
			this.pluginTitle.textContent = messages['Plugins'];
295
			this.pluginTitle.textContent = messages['Plugins'];
297
			this.pluginCount.textContent = plugins.length;
296
			this.pluginCount.textContent = plugins.length;
298
297
			
298
			for (var i=0; i<plugins.length; i++) {
299
				if (defaultPluginURLs[plugins[i].getLocation()]) {
300
					plugins[i].isDefaultPlugin = true;
301
				}
302
			}			
303
			plugins.sort(this._sortPlugins); 
304
			
299
			// TODO maybe this should only be done once
305
			// TODO maybe this should only be done once
300
			this.explorer = new PluginListExplorer(this.commandService);
306
			this.explorer = new PluginListExplorer(this.commandService);
301
			this.pluginListTree = this.explorer.createTree(this.pluginList.id, new mExplorer.SimpleFlatModel(plugins, "plugin", function(item) { //$NON-NLS-1$ //$NON-NLS-0$
307
			this.pluginListTree = this.explorer.createTree(this.pluginList.id, new mExplorer.SimpleFlatModel(plugins, "plugin", function(item) { //$NON-NLS-1$ //$NON-NLS-0$
302
				return item.getLocation();
308
				return item.getLocation();
303
			}), { setFocus: false });
309
			}), { /*setFocus: false,*/ noSelection: true});
304
310
305
//			for( var p = 0; p < plugins.length; p++ ){
311
//			for( var p = 0; p < plugins.length; p++ ){
306
//				var pluginEntry = new PluginEntry( {plugin: plugins[p], commandService:this.commandService}  );
312
//				var pluginEntry = new PluginEntry( {plugin: plugins[p], commandService:this.commandService}  );
Lines 308-313 Link Here
308
//				pluginEntry.show();
314
//				pluginEntry.show();
309
//			}
315
//			}
310
		},
316
		},
317
		
318
		/**
319
		 * @name _sortPlugins
320
		 * @description sorts plugins by state, then default config, then name
321
		 * @function
322
		 * @private
323
		 * @param a first object to compare
324
		 * @param b second object to return
325
		 * @returns -1 for a first, 1 for b first, 0 if equals
326
		 */
327
		_sortPlugins: function(a, b) {
328
			var aState = a.getState();
329
			var bState = b.getState();
330
			var aHeaders = a.getHeaders();
331
			var bHeaders = b.getHeaders();
332
333
			if (a.getProblemStarting() && !b.getProblemStarting()){
334
				return -1;
335
			}
336
			if (b.getProblemStarting() && !a.getProblemStarting()){
337
				return 1;
338
			}
339
			
340
			if (b.isDefaultPlugin && !a.isDefaultPlugin){
341
				return -1;
342
			}
343
			if (a.isDefaultPlugin && !b.isDefaultPlugin){
344
				return 1;
345
			}
346
			
347
			if (!aHeaders || !aHeaders.name){
348
				return -1;
349
			}
350
			if (!bHeaders || !bHeaders.name){
351
				return 1;
352
			}
353
			var n1 = aHeaders.name && aHeaders.name.toLowerCase();
354
			var n2 = bHeaders.name && bHeaders.name.toLowerCase();
355
			if (n1 < n2) { return -1; }
356
			if (n1 > n2) { return 1; }
357
			return 0;
358
		},
311
				
359
				
312
		pluginURLFocus: function(){
360
		pluginURLFocus: function(){
313
			this.pluginUrlEntry.value = '';
361
			this.pluginUrlEntry.value = '';
(-)a/bundles/org.eclipse.orion.client.ui/web/settings/settings.css (-4 / +8 lines)
Lines 282-290 Link Here
282
282
283
.plugin-entry {
283
.plugin-entry {
284
	border-bottom: solid 1px #EEE;
284
	border-bottom: solid 1px #EEE;
285
	padding-bottom: 10px;
285
	padding: 10px 10px 10px 10px;
286
287
	padding: 15px 10px 15px 10px;
288
}
286
}
289
287
290
.plugin-icon {
288
.plugin-icon {
Lines 343-348 Link Here
343
	position:relative;
341
	position:relative;
344
}
342
}
345
343
344
.plugin-status {
345
	font-size: 11px;
346
	white-space: normal;
347
	color: #b94a48;
348
}
349
346
.plugin-description {
350
.plugin-description {
347
	font-size: 11px;
351
	font-size: 11px;
348
	white-space: normal;
352
	white-space: normal;
Lines 360-366 Link Here
360
	clear: left;
364
	clear: left;
361
	outline: none;
365
	outline: none;
362
	line-height:14px;
366
	line-height:14px;
363
	padding-top: 10px;
367
	padding-top: 5px;
364
}
368
}
365
369
366
.serviceCount {
370
.serviceCount {

Return to bug 438886