• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ISynchronizationSession类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession的典型用法代码示例。如果您正苦于以下问题:Java ISynchronizationSession类的具体用法?Java ISynchronizationSession怎么用?Java ISynchronizationSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ISynchronizationSession类属于org.eclipse.mylyn.tasks.core.sync包,在下文中一共展示了ISynchronizationSession类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: performQuery

点赞 2

import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession; //导入依赖的package包/类
@Override
public @NonNull IStatus performQuery(@NonNull TaskRepository repository, @NonNull IRepositoryQuery query,
		@NonNull TaskDataCollector collector, @Nullable ISynchronizationSession session,
		@NonNull IProgressMonitor monitor) {

	try {

		List<CharmQueryResult> charmTasks = getClient(repository).queryTasks(monitor, query).getQueryResults();
		SubMonitor subMonitor = SubMonitor.convert(monitor, charmTasks.size());

		for (CharmQueryResult charmTask : charmTasks) {
			TaskData taskData = this.taskDataHandler.parseQueryResults(repository, charmTask, monitor);
			taskData.setPartial(true);
			collector.accept(taskData);
			subMonitor.split(1);
		}

	} catch (CharmException | CoreException e) {
		return new Status(IStatus.ERROR, CharmCorePlugin.PLUGIN_ID, NLS.bind("Query failed: ''{0}''", e.getMessage()),
				e);
	} finally {
		monitor.done();
	}

	return Status.OK_STATUS;

}
 

开发者ID:theits,
项目名称:CharmMylynConnector,
代码行数:28,
代码来源:CharmRepositoryConnector.java

示例2: performQuery

点赞 2

import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession; //导入依赖的package包/类
@Override
public IStatus performQuery(TaskRepository repository, IRepositoryQuery query,
        TaskDataCollector collector, ISynchronizationSession session, IProgressMonitor monitor) {
    ProjectOpenClient client = getClientManager().getClient(repository);

    try {
        client.performQuery(repository, query, collector, monitor);
    } catch (CoreException e) {
        return e.getStatus();
    }

    return Status.OK_STATUS;
}
 

开发者ID:project-open,
项目名称:po-mylyn-integration,
代码行数:14,
代码来源:ProjectOpenRepositoryConnector.java

示例3: performQuery

点赞 2

import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession; //导入依赖的package包/类
@Override
public IStatus performQuery(TaskRepository repository, IRepositoryQuery query,
    TaskDataCollector collector, ISynchronizationSession session, IProgressMonitor monitor) {
  AppraisePluginReviewClient client;

  try {
    client = getReviewClient(repository);
  } catch (GitClientException e) {
    AppraiseConnectorPlugin.logError("Failed to initialize git client", e);
    return Status.CANCEL_STATUS;
  }
  
  boolean reviewer =
      Boolean.parseBoolean(query.getAttribute(AppraiseConnectorPlugin.QUERY_REVIEWER));
  boolean requester =
      Boolean.parseBoolean(query.getAttribute(AppraiseConnectorPlugin.QUERY_REQUESTER));
  String reviewCommitPrefix =
      query.getAttribute(AppraiseConnectorPlugin.QUERY_REVIEW_COMMIT_PREFIX);

  List<ReviewResult> reviews = client.listReviews();
  if (reviews == null) {
    return new Status(Status.ERROR, AppraiseConnectorPlugin.PLUGIN_ID,
        "Error running review list query");
  }
  
  for (ReviewResult review : reviews) {
    TaskData taskData = taskDataHandler.createPartialTaskData(repository, review);
    boolean shouldAccept = false;
    if (!reviewer && !requester) {
      // Accept everything if no filters are set.
      shouldAccept = true;
    } else if (reviewer && review.isCurrentUserReviewer()) {
      shouldAccept = true;
    } else if (requester && review.isCurrentUserRequester()) {
      shouldAccept = true;
    }

    if (reviewCommitPrefix != null && !reviewCommitPrefix.isEmpty()) {
      shouldAccept = shouldAccept && review.getHash().startsWith(reviewCommitPrefix);
    }

    if (shouldAccept) {
      collector.accept(taskData);
    }
  }
  return Status.OK_STATUS;
}
 

开发者ID:google,
项目名称:git-appraise-eclipse,
代码行数:48,
代码来源:AppraiseRepositoryConnector.java

示例4: performQuery

点赞 1

import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession; //导入依赖的package包/类
@Override
public IStatus performQuery(TaskRepository repository, IRepositoryQuery query, TaskDataCollector collector,
		ISynchronizationSession session, IProgressMonitor monitor)
{
	
	TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository);
	
	
	
	monitor.beginTask("Performing query on repository.", 0);
	
	try
	{

		IRedmineClient client = getClientManager().getClient(repository);
		
		for(Project p : client.getCachedRepositoryConfiguration().getProjects())
		{
			
			for(Issue i : client.getIssuesByProject(p))
			{
				
				//boolean createdByMe = i.getAuthor().getId().equals(client.getCurrentUser().getId());
				//The && operator is short circuiting, if assignee is null the subsequent expression will not be evaluated
				boolean assignedToMe = i.getAssignee() != null  && i.getAssignee().getId().equals(client.getCurrentUser().getId());
				
				
				if(!(assignedToMe))
				{
					continue;
				}
					
				
				if(monitor.isCanceled())
				{
					return new RepositoryStatus(Status.CANCEL, RedmineCorePlugin.PLUGIN_ID, RepositoryStatus.OK, "Error performing query.");
				}
				
				TaskData t = taskDataHandler.createTaskDataFromIssue(repository, i, client.getCachedRepositoryConfiguration());
				t.setPartial(true);
				collector.accept(t);				
			}
		}
		
		monitor.done();
	}
	catch (RedmineException e)
	{
		return new RepositoryStatus(Status.ERROR, RedmineCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_NETWORK, "Error performing query.",e);
	}
	
	
			
	return RepositoryStatus.OK_STATUS;
}
 

开发者ID:andrea-rockt,
项目名称:mylyn-redmine-connector,
代码行数:56,
代码来源:RedmineRepositoryConnector.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)