Search in sources :

Example 1 with TaskRepositoryManager

use of org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager in project subclipse by subclipse.

the class SubclipseLinkedTaskInfo method init.

private void init() {
    TaskRepositoryManager repositoryManager = TasksUiPlugin.getRepositoryManager();
    String[] urls = null;
    ProjectProperties props = null;
    try {
        if (resource != null) {
            props = ProjectProperties.getProjectProperties(resource);
        } else if (logEntry != null) {
            ISVNResource svnres = logEntry.getResource();
            if (svnres != null) {
                if (svnres.getResource() != null) {
                    props = ProjectProperties.getProjectProperties(svnres.getResource());
                } else {
                    ISVNClientAdapter client = SVNProviderPlugin.getPlugin().getSVNClientManager().getSVNClient();
                    SVNProviderPlugin.disableConsoleLogging();
                    ISVNProperty[] properties = client.getProperties(svnres.getUrl());
                    SVNProviderPlugin.enableConsoleLogging();
                    for (int i = 0; i < properties.length; i++) {
                        ISVNProperty property = properties[i];
                        if ("bugtraq:url".equals(property.getName())) {
                            repositoryUrl = SubclipseTeamPlugin.getRepository(property.getValue(), repositoryManager).getRepositoryUrl();
                        // comments?
                        }
                    }
                }
            }
        }
    } catch (Exception ex) {
        // ignore?
        SVNProviderPlugin.enableConsoleLogging();
    }
    if (props != null) {
        if (repositoryUrl == null) {
            repositoryUrl = SubclipseTeamPlugin.getRepository(props.getUrl(), repositoryManager).getRepositoryUrl();
        }
        urls = props.getLinkList(getText()).getUrls();
    }
    if (urls == null || urls.length == 0) {
        urls = ProjectProperties.getUrls(getText()).getUrls();
    }
    if (urls != null && urls.length > 0) {
        taskFullUrl = urls[0];
    }
}
Also used : TaskRepositoryManager(org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager) ISVNResource(org.tigris.subversion.subclipse.core.ISVNResource) ProjectProperties(org.tigris.subversion.subclipse.ui.settings.ProjectProperties) ISVNProperty(org.tigris.subversion.svnclientadapter.ISVNProperty) TeamException(org.eclipse.team.core.TeamException) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Aggregations

TaskRepositoryManager (org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager)1 TeamException (org.eclipse.team.core.TeamException)1 ISVNResource (org.tigris.subversion.subclipse.core.ISVNResource)1 ProjectProperties (org.tigris.subversion.subclipse.ui.settings.ProjectProperties)1 ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)1 ISVNProperty (org.tigris.subversion.svnclientadapter.ISVNProperty)1