Search in sources :

Example 1 with IRepositoryQuery

use of org.eclipse.mylyn.tasks.core.IRepositoryQuery in project eclipse-integration-commons by spring-projects.

the class IdeUiUtils method getQuery.

private static IRepositoryQuery getQuery(String queryLabel) {
    TaskList taskList = TasksUiPlugin.getTaskList();
    Set<RepositoryQuery> queries = taskList.getQueries();
    for (RepositoryQuery query : queries) {
        if (queryLabel.equals(query.getSummary())) {
            // query already exists
            return query;
        }
    }
    return null;
}
Also used : RepositoryQuery(org.eclipse.mylyn.internal.tasks.core.RepositoryQuery) IRepositoryQuery(org.eclipse.mylyn.tasks.core.IRepositoryQuery) TaskList(org.eclipse.mylyn.internal.tasks.core.TaskList)

Example 2 with IRepositoryQuery

use of org.eclipse.mylyn.tasks.core.IRepositoryQuery in project eclipse-integration-commons by spring-projects.

the class IdeUiUtils method createQuery.

public static IRepositoryQuery createQuery(String repositoryUrl, String queryLabel, String queryUrl) {
    TaskRepository taskRepository = TasksUiPlugin.getRepositoryManager().getRepository(repositoryUrl);
    if (taskRepository == null) {
        StatusHandler.log(new Status(IStatus.WARNING, IdeUiPlugin.PLUGIN_ID, "Query initialization failed, repository configuration not found: " + repositoryUrl));
        return null;
    }
    IRepositoryQuery query = getQuery(queryLabel);
    if (query != null) {
        return query;
    }
    query = TasksUi.getRepositoryModel().createRepositoryQuery(taskRepository);
    query.setUrl(queryUrl);
    query.setSummary(queryLabel);
    TasksUiPlugin.getTaskList().addQuery((RepositoryQuery) query);
    TasksUiInternal.synchronizeRepository(taskRepository, false);
    return query;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) IRepositoryQuery(org.eclipse.mylyn.tasks.core.IRepositoryQuery) TaskRepository(org.eclipse.mylyn.tasks.core.TaskRepository)

Aggregations

IRepositoryQuery (org.eclipse.mylyn.tasks.core.IRepositoryQuery)2 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 RepositoryQuery (org.eclipse.mylyn.internal.tasks.core.RepositoryQuery)1 TaskList (org.eclipse.mylyn.internal.tasks.core.TaskList)1 TaskRepository (org.eclipse.mylyn.tasks.core.TaskRepository)1