|
Lines 30-35
Link Here
|
| 30 |
import org.eclipse.jface.resource.ImageDescriptor; |
30 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 31 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
31 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
| 32 |
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; |
32 |
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; |
|
|
33 |
import org.eclipse.mylyn.internal.tasks.core.RepositoryTemplateManager; |
| 33 |
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; |
34 |
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; |
| 34 |
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizer; |
35 |
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizer; |
| 35 |
import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor; |
36 |
import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor; |
|
Lines 239-256
Link Here
|
| 239 |
// NOTE: has to be read first, consider improving |
240 |
// NOTE: has to be read first, consider improving |
| 240 |
initConnectorCores(taskListExternalizer, repositoryManager, registry); |
241 |
initConnectorCores(taskListExternalizer, repositoryManager, registry); |
| 241 |
|
242 |
|
| 242 |
IExtensionPoint templatesExtensionPoint = registry.getExtensionPoint(EXTENSION_TEMPLATES); |
243 |
readRepositoryTemplates(registry, TasksUiPlugin.getRepositoryTemplateManager()); |
| 243 |
IExtension[] templateExtensions = templatesExtensionPoint.getExtensions(); |
|
|
| 244 |
for (IExtension templateExtension : templateExtensions) { |
| 245 |
IConfigurationElement[] elements = templateExtension.getConfigurationElements(); |
| 246 |
for (IConfigurationElement element : elements) { |
| 247 |
if (!isDisabled(element)) { |
| 248 |
if (element.getName().equals(EXTENSION_TMPL_REPOSITORY)) { |
| 249 |
readRepositoryTemplate(element); |
| 250 |
} |
| 251 |
} |
| 252 |
} |
| 253 |
} |
| 254 |
|
244 |
|
| 255 |
IExtensionPoint presentationsExtensionPoint = registry.getExtensionPoint(EXTENSION_PRESENTATIONS); |
245 |
IExtensionPoint presentationsExtensionPoint = registry.getExtensionPoint(EXTENSION_PRESENTATIONS); |
| 256 |
IExtension[] presentations = presentationsExtensionPoint.getExtensions(); |
246 |
IExtension[] presentations = presentationsExtensionPoint.getExtensions(); |
|
Lines 281-286
Link Here
|
| 281 |
} |
271 |
} |
| 282 |
} |
272 |
} |
| 283 |
|
273 |
|
|
|
274 |
/* |
| 275 |
* Public for testing. |
| 276 |
*/ |
| 277 |
public static void readRepositoryTemplates(IExtensionRegistry registry, RepositoryTemplateManager manager) { |
| 278 |
IExtensionPoint templatesExtensionPoint = registry.getExtensionPoint(EXTENSION_TEMPLATES); |
| 279 |
IExtension[] templateExtensions = templatesExtensionPoint.getExtensions(); |
| 280 |
for (IExtension templateExtension : templateExtensions) { |
| 281 |
IConfigurationElement[] elements = templateExtension.getConfigurationElements(); |
| 282 |
for (IConfigurationElement element : elements) { |
| 283 |
if (!isDisabled(element)) { |
| 284 |
if (element.getName().equals(EXTENSION_TMPL_REPOSITORY)) { |
| 285 |
readRepositoryTemplate(element, manager); |
| 286 |
} |
| 287 |
} |
| 288 |
} |
| 289 |
} |
| 290 |
} |
| 291 |
|
| 284 |
private static void initConnectorCores(TaskListExternalizer taskListExternalizer, |
292 |
private static void initConnectorCores(TaskListExternalizer taskListExternalizer, |
| 285 |
TaskRepositoryManager repositoryManager, IExtensionRegistry registry) { |
293 |
TaskRepositoryManager repositoryManager, IExtensionRegistry registry) { |
| 286 |
List<ConnectorDescriptor> descriptors = new ArrayList<ConnectorDescriptor>(); |
294 |
List<ConnectorDescriptor> descriptors = new ArrayList<ConnectorDescriptor>(); |
|
Lines 576-582
Link Here
|
| 576 |
} |
584 |
} |
| 577 |
} |
585 |
} |
| 578 |
|
586 |
|
| 579 |
private static void readRepositoryTemplate(IConfigurationElement element) { |
587 |
private static void readRepositoryTemplate(IConfigurationElement element, RepositoryTemplateManager manager) { |
| 580 |
boolean anonymous = false; |
588 |
boolean anonymous = false; |
| 581 |
boolean addAuto = false; |
589 |
boolean addAuto = false; |
| 582 |
|
590 |
|
|
Lines 596-602
Link Here
|
| 596 |
&& TasksUi.getRepositoryManager().getRepositoryConnector(repKind) != null) { |
604 |
&& TasksUi.getRepositoryManager().getRepositoryConnector(repKind) != null) { |
| 597 |
RepositoryTemplate template = new RepositoryTemplate(label, serverUrl, encoding, version, newTaskUrl, |
605 |
RepositoryTemplate template = new RepositoryTemplate(label, serverUrl, encoding, version, newTaskUrl, |
| 598 |
taskPrefix, taskQueryUrl, newAccountUrl, anonymous, addAuto); |
606 |
taskPrefix, taskQueryUrl, newAccountUrl, anonymous, addAuto); |
| 599 |
TasksUiPlugin.getRepositoryTemplateManager().addTemplate(repKind, template); |
607 |
manager.addTemplate(repKind, template); |
| 600 |
|
608 |
|
| 601 |
for (IConfigurationElement configElement : element.getChildren()) { |
609 |
for (IConfigurationElement configElement : element.getChildren()) { |
| 602 |
String name = configElement.getAttribute("name"); //$NON-NLS-1$ |
610 |
String name = configElement.getAttribute("name"); //$NON-NLS-1$ |