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 59443 Details for
Bug 159135
Automatic resolution of links between projects and issue repositories
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]
updated patch
clipboard13652.txt (text/plain), 24.62 KB, created by
Eugene Kuleshov
on 2007-02-20 20:44:44 EST
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Eugene Kuleshov
Created:
2007-02-20 20:44:44 EST
Size:
24.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.tasks.ui >Index: src/org/eclipse/mylar/tasks/ui/properties/ProjectTaskRepositoryPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/tasks/ui/properties/ProjectTaskRepositoryPage.java,v >retrieving revision 1.5 >diff -u -r1.5 ProjectTaskRepositoryPage.java >--- src/org/eclipse/mylar/tasks/ui/properties/ProjectTaskRepositoryPage.java 7 Feb 2007 15:18:47 -0000 1.5 >+++ src/org/eclipse/mylar/tasks/ui/properties/ProjectTaskRepositoryPage.java 21 Feb 2007 01:42:08 -0000 >@@ -104,7 +104,6 @@ > listViewer.setInput(project.getWorkspace()); > > TaskRepository repository = TasksUiPlugin.getDefault().getRepositoryForResource(project, true); >- > if (repository != null) { > listViewer.setCheckedElements(new Object[] { repository }); > } >@@ -118,6 +117,7 @@ > modified = true; > } > }); >+ listViewer.getControl().setEnabled(TasksUiPlugin.getDefault().canSetRepositoryForResource(project)); > > final AddRepositoryAction action = new AddRepositoryAction(); > >@@ -167,7 +167,10 @@ > if (listViewer.getCheckedElements().length > 0) { > TaskRepository selectedRepository = (TaskRepository) listViewer.getCheckedElements()[0]; > try { >- TasksUiPlugin.getDefault().setRepositoryForResource(project, selectedRepository); >+ TasksUiPlugin plugin = TasksUiPlugin.getDefault(); >+ if(plugin.canSetRepositoryForResource(project)) { >+ plugin.setRepositoryForResource(project, selectedRepository); >+ } > } catch (CoreException e) { > MylarStatusHandler.fail(e, "Unable to associate project with task repository", true); > } >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/plugin.xml,v >retrieving revision 1.190 >diff -u -r1.190 plugin.xml >--- plugin.xml 16 Feb 2007 23:32:10 -0000 1.190 >+++ plugin.xml 21 Feb 2007 01:42:08 -0000 >@@ -4,6 +4,7 @@ > <extension-point id="actions" name="Tasklist Actions" schema="schema/actions.exsd"/> > <extension-point id="repositories" name="Task Repositories" schema="schema/repositories.exsd"/> > <extension-point id="editors" name="Task Editors" schema="schema/editors.exsd"/> >+ <extension-point id="projectLinkProviders" name="Linking Provider from Project to the Task Repository" schema="schema/projectLinkProviders.exsd"/> > > <!-- > <extension >@@ -711,6 +712,15 @@ > </commandParameter> > </command> > </extension> >+ <extension >+ point="org.eclipse.mylar.tasks.ui.projectLinkProviders"> >+ <linkProvider >+ class="org.eclipse.mylar.tasks.ui.ProjectPreferencesLinkProvider" >+ name="Default Repository Link" >+ order="1000" >+ id="org.eclipse.mylar.tasks.ui.defaultRepositoryLinkProvider"> >+ </linkProvider> >+ </extension> > > </plugin> > >Index: src/org/eclipse/mylar/tasks/ui/TasksUiPlugin.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/tasks/ui/TasksUiPlugin.java,v >retrieving revision 1.65 >diff -u -r1.65 TasksUiPlugin.java >--- src/org/eclipse/mylar/tasks/ui/TasksUiPlugin.java 21 Feb 2007 01:08:55 -0000 1.65 >+++ src/org/eclipse/mylar/tasks/ui/TasksUiPlugin.java 21 Feb 2007 01:42:08 -0000 >@@ -13,24 +13,22 @@ > import java.io.File; > import java.util.ArrayList; > import java.util.Collection; >+import java.util.Comparator; > import java.util.Date; > import java.util.HashMap; > import java.util.HashSet; > import java.util.List; > import java.util.Map; > import java.util.Set; >+import java.util.TreeSet; > >-import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; >-import org.eclipse.core.resources.ProjectScope; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Preferences.IPropertyChangeListener; > import org.eclipse.core.runtime.Preferences.PropertyChangeEvent; >-import org.eclipse.core.runtime.preferences.IEclipsePreferences; >-import org.eclipse.core.runtime.preferences.IScopeContext; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.jface.resource.ImageDescriptor; >@@ -84,7 +82,6 @@ > import org.eclipse.ui.plugin.AbstractUIPlugin; > import org.osgi.framework.Bundle; > import org.osgi.framework.BundleContext; >-import org.osgi.service.prefs.BackingStoreException; > > /** > * @author Mik Kersten >@@ -97,12 +94,6 @@ > > public static final String PLUGIN_ID = "org.eclipse.mylar.tasklist"; > >- private static final String PROPERTY_PREFIX = "project.repository"; >- >- private static final String PROJECT_REPOSITORY_KIND = PROPERTY_PREFIX + ".kind"; >- >- private static final String PROJECT_REPOSITORY_URL = PROPERTY_PREFIX + ".url"; >- > private static final String NAME_DATA_DIR = ".mylar"; > > private static final char DEFAULT_PATH_SEPARATOR = '/'; >@@ -133,6 +124,8 @@ > > private ArrayList<IHyperlinkDetector> hyperlinkDetectors = new ArrayList<IHyperlinkDetector>(); > >+ private TreeSet<AbstractTaskRepositoryLinkProvider> repositoryLinkProviders = new TreeSet<AbstractTaskRepositoryLinkProvider>(new OrderComparator()); >+ > private TaskListWriter taskListWriter; > > private ITaskHighlighter highlighter; >@@ -147,6 +140,12 @@ > > private boolean eclipse_3_3_workbench = false; > >+ private static final class OrderComparator implements Comparator<AbstractTaskRepositoryLinkProvider> { >+ public int compare(AbstractTaskRepositoryLinkProvider p1, AbstractTaskRepositoryLinkProvider p2) { >+ return p1.getOrder()-p2.getOrder(); >+ } >+ } >+ > public enum TaskListSaveMode { > ONE_HOUR, THREE_HOURS, DAY; > @Override >@@ -296,7 +295,7 @@ > if (connector != null) { > ITaskDataHandler offlineHandler = connector.getTaskDataHandler(); > if (offlineHandler != null && repositoryTask.getTaskData().getLastModified() != null) { >- Date modified = repositoryTask.getTaskData().getAttributeFactory().getDateForAttributeType( >+ Date modified = offlineHandler.getDateForAttributeType( > RepositoryTaskAttribute.DATE_MODIFIED, repositoryTask.getTaskData() > .getLastModified()); > notification.setDate(modified); >@@ -382,22 +381,16 @@ > taskRepositoryManager = new TaskRepositoryManager(taskListManager.getTaskList()); > synchronizationManager = new RepositorySynchronizationManager(); > >- > // NOTE: initializing extensions in start(..) has caused race > // conditions previously > TasksUiExtensionReader.initStartupExtensions(taskListWriter); >- >- // The repositories need to be read before the tasks so that the getAttributeFactory >- // can use the repository to get the information it needs >- taskRepositoryManager.readRepositories(getRepositoriesFilePath()); >- > readOfflineReports(); > for (ITaskListExternalizer externalizer : taskListWriter.getExternalizers()) { > if (externalizer instanceof DelegatingTaskExternalizer) { > ((DelegatingTaskExternalizer) externalizer).init(offlineTaskManager); > } > } >- >+ taskRepositoryManager.readRepositories(getRepositoriesFilePath()); > taskListWriter.setTaskDataManager(offlineTaskManager); > > // NOTE: task list must be read before Task List view can be initialized >@@ -677,6 +670,11 @@ > this.hyperlinkDetectors.add(listener); > } > >+ public void addRepositoryLinkProvider(AbstractTaskRepositoryLinkProvider repositoryLinkProvider) { >+ if (repositoryLinkProvider != null) >+ this.repositoryLinkProviders.add(repositoryLinkProvider); >+ } >+ > public TaskListBackupManager getBackupManager() { > return taskListBackupManager; > } >@@ -742,6 +740,27 @@ > return getDataDirectory() + File.separator + TaskRepositoryManager.DEFAULT_REPOSITORIES_FILE; > } > >+ public boolean canSetRepositoryForResource(IResource resource) { >+ if (resource == null) { >+ return false; >+ } >+ >+ // find first provider that can link repository >+ for (AbstractTaskRepositoryLinkProvider linkProvider : repositoryLinkProviders) { >+ TaskRepository repository = linkProvider.getTaskRepository(resource, getRepositoryManager()); >+ if (repository != null) { >+ return linkProvider.canSetTaskRepository(resource); >+ } >+ } >+ // find first provider that can set new repository >+ for (AbstractTaskRepositoryLinkProvider linkProvider : repositoryLinkProviders) { >+ if (linkProvider.canSetTaskRepository(resource)) { >+ return true; >+ } >+ } >+ return false; >+ } >+ > /** > * Associate a Task Repository with a workbench project > * >@@ -752,21 +771,19 @@ > * @throws CoreException > */ > public void setRepositoryForResource(IResource resource, TaskRepository repository) throws CoreException { >- if (resource == null || repository == null || !resource.getProject().isOpen()) { >+ if (resource == null || repository == null) { > return; > } >- IProject project = resource.getProject(); >- if (project == null) >- return; >- IScopeContext projectScope = new ProjectScope(project); >- IEclipsePreferences projectNode = projectScope.getNode(PLUGIN_ID); >- if (projectNode != null) { >- projectNode.put(PROJECT_REPOSITORY_KIND, repository.getKind()); >- projectNode.put(PROJECT_REPOSITORY_URL, repository.getUrl()); >- try { >- projectNode.flush(); >- } catch (BackingStoreException e) { >- MylarStatusHandler.fail(e, "Failed to save task repository to project association preference", false); >+ >+ for (AbstractTaskRepositoryLinkProvider linkProvider : repositoryLinkProviders) { >+ TaskRepository r = linkProvider.getTaskRepository(resource, getRepositoryManager()); >+ boolean canSetRepository = linkProvider.canSetTaskRepository(resource); >+ if (r != null && !canSetRepository) { >+ return; >+ } >+ if (canSetRepository) { >+ linkProvider.setTaskRepository(resource, repository); >+ return; > } > } > } >@@ -776,25 +793,24 @@ > * project (or resource belonging to a project) > */ > public TaskRepository getRepositoryForResource(IResource resource, boolean silent) { >- if (resource == null) >+ if (resource == null) { > return null; >- IProject project = resource.getProject(); >- if (project == null) >- return null; >- TaskRepository taskRepository = null; >- IScopeContext projectScope = new ProjectScope(project); >- IEclipsePreferences projectNode = projectScope.getNode(PLUGIN_ID); >- if (projectNode != null) { >- String kind = projectNode.get(PROJECT_REPOSITORY_KIND, ""); >- String urlString = projectNode.get(PROJECT_REPOSITORY_URL, ""); >- taskRepository = getRepositoryManager().getRepository(kind, urlString); >- if (taskRepository == null && !silent) { >- MessageDialog >- .openInformation(null, "No Repository Found", >- "No repository was found. Associate a Task Repository with this project via the project's property page."); >+ } >+ >+ for (AbstractTaskRepositoryLinkProvider linkProvider : repositoryLinkProviders) { >+ TaskRepository repository = linkProvider.getTaskRepository(resource, getRepositoryManager()); >+ if (repository != null) { >+ return repository; > } > } >- return taskRepository; >+ >+ if (!silent) { >+ MessageDialog >+ .openInformation(null, "No Repository Found", >+ "No repository was found. Associate a Task Repository with this project via the project's property page."); >+ } >+ >+ return null; > } > > public boolean isEclipse_3_3_workbench() { >Index: src/org/eclipse/mylar/internal/tasks/ui/util/TasksUiExtensionReader.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/internal/tasks/ui/util/TasksUiExtensionReader.java,v >retrieving revision 1.15 >diff -u -r1.15 TasksUiExtensionReader.java >--- src/org/eclipse/mylar/internal/tasks/ui/util/TasksUiExtensionReader.java 7 Feb 2007 15:18:46 -0000 1.15 >+++ src/org/eclipse/mylar/internal/tasks/ui/util/TasksUiExtensionReader.java 21 Feb 2007 01:42:08 -0000 >@@ -28,6 +28,7 @@ > import org.eclipse.mylar.tasks.core.ITaskListExternalizer; > import org.eclipse.mylar.tasks.core.RepositoryTemplate; > import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi; >+import org.eclipse.mylar.tasks.ui.AbstractTaskRepositoryLinkProvider; > import org.eclipse.mylar.tasks.ui.TasksUiPlugin; > import org.eclipse.mylar.tasks.ui.editors.ITaskEditorFactory; > import org.eclipse.ui.plugin.AbstractUIPlugin; >@@ -41,6 +42,8 @@ > > public static final String EXTENSION_REPOSITORIES = "org.eclipse.mylar.tasks.ui.repositories"; > >+ public static final String EXTENSION_REPOSITORY_LINKS_PROVIDERS = "org.eclipse.mylar.tasks.ui.projectLinkProviders"; >+ > public static final String EXTENSION_TEMPLATES = "org.eclipse.mylar.tasks.core.templates"; > > public static final String EXTENSION_TMPL_REPOSITORY = "repository"; >@@ -69,6 +72,8 @@ > > public static final String ELMNT_REPOSITORY_CONNECTOR = "connectorCore"; > >+ public static final String ELMNT_REPOSITORY_LINK_PROVIDER = "linkProvider"; >+ > public static final String ELMNT_REPOSITORY_UI= "connectorUi"; > > public static final String ELMNT_EXTERNALIZER = "externalizer"; >@@ -174,8 +179,34 @@ > } > } > } >+ >+ IExtensionPoint linkProvidersExtensionPoint = registry.getExtensionPoint(EXTENSION_REPOSITORY_LINKS_PROVIDERS); >+ IExtension[] linkProvidersExtensions = linkProvidersExtensionPoint.getExtensions(); >+ for (int i = 0; i < linkProvidersExtensions.length; i++) { >+ IConfigurationElement[] elements = linkProvidersExtensions[i].getConfigurationElements(); >+ for (int j = 0; j < elements.length; j++) { >+ if (elements[j].getName().equals(ELMNT_REPOSITORY_LINK_PROVIDER)) { >+ readLinkProvider(elements[j]); >+ } >+ } >+ } >+ > } > >+ private static void readLinkProvider(IConfigurationElement element) { >+ try { >+ Object repositoryLinkProvider = element.createExecutableExtension(ATTR_CLASS); >+ if (repositoryLinkProvider instanceof AbstractTaskRepositoryLinkProvider) { >+ TasksUiPlugin.getDefault().addRepositoryLinkProvider((AbstractTaskRepositoryLinkProvider) repositoryLinkProvider); >+ } else { >+ MylarStatusHandler.log("Could not load repository link provider: " + repositoryLinkProvider.getClass().getCanonicalName(), >+ null); >+ } >+ } catch (CoreException e) { >+ MylarStatusHandler.log(e, "Could not load repository link provider extension"); >+ } >+ } >+ > private static void readHyperlinkDetector(IConfigurationElement element) { > try { > Object hyperlinkDetector = element.createExecutableExtension(ATTR_CLASS); >Index: src/org/eclipse/mylar/tasks/ui/ProjectPreferencesLinkProvider.java >=================================================================== >RCS file: src/org/eclipse/mylar/tasks/ui/ProjectPreferencesLinkProvider.java >diff -N src/org/eclipse/mylar/tasks/ui/ProjectPreferencesLinkProvider.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/tasks/ui/ProjectPreferencesLinkProvider.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,79 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 - 2006 Mylar committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylar.tasks.ui; >+ >+import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.resources.ProjectScope; >+import org.eclipse.core.runtime.preferences.IEclipsePreferences; >+import org.eclipse.core.runtime.preferences.IScopeContext; >+import org.eclipse.mylar.core.MylarStatusHandler; >+import org.eclipse.mylar.tasks.core.TaskRepository; >+import org.eclipse.mylar.tasks.core.TaskRepositoryManager; >+import org.osgi.service.prefs.BackingStoreException; >+ >+/** >+ * Default Task Repository link provider >+ * >+ * @author Eugene Kuleshov >+ */ >+public class ProjectPreferencesLinkProvider extends AbstractTaskRepositoryLinkProvider { >+ >+ private static final String PROPERTY_PREFIX = "project.repository"; >+ >+ private static final String PROJECT_REPOSITORY_KIND = PROPERTY_PREFIX + ".kind"; >+ >+ private static final String PROJECT_REPOSITORY_URL = PROPERTY_PREFIX + ".url"; >+ >+ public TaskRepository getTaskRepository(IResource resource, TaskRepositoryManager repositoryManager) { >+ IProject project = resource.getProject(); >+ if (project == null || !project.isAccessible()) { >+ return null; >+ } >+ >+ IScopeContext projectScope = new ProjectScope(project); >+ IEclipsePreferences projectNode = projectScope.getNode(TasksUiPlugin.PLUGIN_ID); >+ if (projectNode != null) { >+ String kind = projectNode.get(PROJECT_REPOSITORY_KIND, ""); >+ String urlString = projectNode.get(PROJECT_REPOSITORY_URL, ""); >+ return repositoryManager.getRepository(kind, urlString); >+ } >+ return null; >+ } >+ >+ >+ @Override >+ public boolean canSetTaskRepository(IResource resource) { >+ IProject project = resource.getProject(); >+ return project != null && project.isAccessible(); >+ } >+ >+ @Override >+ public boolean setTaskRepository(IResource resource, TaskRepository repository) { >+ IProject project = resource.getProject(); >+ if (project == null || !project.isAccessible()) { >+ return false; >+ } >+ >+ IScopeContext projectScope = new ProjectScope(project); >+ IEclipsePreferences projectNode = projectScope.getNode(TasksUiPlugin.PLUGIN_ID); >+ if (projectNode != null) { >+ projectNode.put(PROJECT_REPOSITORY_KIND, repository.getKind()); >+ projectNode.put(PROJECT_REPOSITORY_URL, repository.getUrl()); >+ try { >+ projectNode.flush(); >+ return true; >+ } catch (BackingStoreException e) { >+ MylarStatusHandler.fail(e, "Failed to save task repository to project association preference", false); >+ } >+ } >+ return false; >+ } >+ >+} >Index: schema/projectLinkProviders.exsd >=================================================================== >RCS file: schema/projectLinkProviders.exsd >diff -N schema/projectLinkProviders.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/projectLinkProviders.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,126 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.mylar.tasks.ui"> >+<annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.mylar.tasks.ui" id="projectLinkProviders" name="Task Repository Link Provider"/> >+ </appInfo> >+ <documentation> >+ Providers responsible for linking Workspace resources/projects to the Task Repositories. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <complexType> >+ <sequence> >+ <element ref="linkProvider"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="linkProvider"> >+ <complexType> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="java" basedOn="org.eclipse.mylar.tasks.ui.AbstractTaskRepositoryLinkProvider"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ <attribute name="order" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ [Enter the first release in which this extension point appears.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ [Enter extension point usage example here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="apiInfo"/> >+ </appInfo> >+ <documentation> >+ See org.eclipse.mylar.tasks.ui.TasksUiPlugin.getRepositoryForResource(IResource resource, boolean silent) >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="implementation"/> >+ </appInfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="copyright"/> >+ </appInfo> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ >+</schema> >Index: src/org/eclipse/mylar/tasks/ui/AbstractTaskRepositoryLinkProvider.java >=================================================================== >RCS file: src/org/eclipse/mylar/tasks/ui/AbstractTaskRepositoryLinkProvider.java >diff -N src/org/eclipse/mylar/tasks/ui/AbstractTaskRepositoryLinkProvider.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/tasks/ui/AbstractTaskRepositoryLinkProvider.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,62 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 - 2006 Mylar committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylar.tasks.ui; >+ >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExecutableExtension; >+import org.eclipse.mylar.tasks.core.TaskRepository; >+import org.eclipse.mylar.tasks.core.TaskRepositoryManager; >+ >+/** >+ * Abstract Task Repository link provider >+ * >+ * @author Eugene Kuleshov >+ */ >+public abstract class AbstractTaskRepositoryLinkProvider implements IExecutableExtension { >+ >+ private static final int DEFAULT_ORDER = 1000; >+ >+ private String id; >+ private String name; >+ private int order; >+ >+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) { >+ id = config.getAttribute("id"); >+ name = config.getAttribute("name"); >+ try { >+ order = Integer.parseInt(config.getAttribute("order")); >+ } catch(NumberFormatException ex) { >+ order = DEFAULT_ORDER; >+ } >+ } >+ >+ public abstract TaskRepository getTaskRepository(IResource resource, TaskRepositoryManager repositoryManager); >+ >+ public boolean canSetTaskRepository(IResource resource) { >+ return false; >+ } >+ >+ public boolean setTaskRepository(IResource resource, TaskRepository repository) { >+ return false; >+ } >+ >+ public String getId() { >+ return id; >+ } >+ >+ public String getName() { >+ return name; >+ } >+ >+ public int getOrder() { >+ return order; >+ } >+ >+}
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 159135
:
59419
|
59420
| 59443