|
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; |