• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TaskDataCollector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: execute

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的package包/类
@Override
public void execute () throws CoreException {
    final Logger log = Logger.getLogger(this.getClass().getName());
    if (log.isLoggable(Level.FINE)) {
        Map<String, String> attrs = query.getAttributes();
        log.log(
                Level.FINE,
                "executing SimpleQueryCommand for query {0} on repository {1} with url \n\t{2} and parameters \n\t{3}", // NOI18N
                new Object[]{query.getSummary(), taskRepository.getUrl(), query.getUrl(), attrs != null ? attrs : null});
    }
    TaskDataCollector collector = new TaskDataCollector() {
        @Override
        public void accept (TaskData taskData) {
            try {
                Accessor acc = Accessor.getInstance();
                NbTask task = acc.getOrCreateTask(taskRepository, taskData.getTaskId(), true);
                taskDataManager.putUpdatedTaskData(acc.getDelegate(task), taskData, true);
                tasks.add(task);
            } catch (CoreException ex) {
                log.log(Level.INFO, "Cannot save task data " + taskData.getTaskId(), ex);
            }
        }
    };
    status = repositoryConnector.performQuery(taskRepository, query, collector, new SynchronizationSession(), monitor);
    if (status != null && status.getSeverity() == IStatus.ERROR) {
        if (status.getException() instanceof CoreException) {
            throw (CoreException) status.getException();
        } else {
            throw new CoreException(status);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:SimpleQueryCommand.java


示例2: performQuery

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的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


示例3: performQuery

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的package包/类
public void performQuery(TaskRepository repository, IRepositoryQuery query,
		TaskDataCollector collector, IProgressMonitor monitor)
		throws CoreException {
	try {
		//TODO integrate query
           List<Ticket> tickets = getTickets(monitor);
           for (Ticket ticket : tickets) {
               TaskData taskData = getTaskDataForTicket(repository, ticket);
               collector.accept(taskData);
           }
       } catch (ProjectOpenException e) {
       	ProjectOpenCorePlugin.getDefault().getLog().log(new Status(Status.INFO, ProjectOpenCorePlugin.PLUGIN_ID, Status.CANCEL, e.getMessage(), e));
           throw new CoreException(Status.CANCEL_STATUS);
       }
}
 
开发者ID:project-open,项目名称:po-mylyn-integration,代码行数:16,代码来源:RestfulProjectOpenClient.java


示例4: performQuery

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的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


示例5: GetMultiTaskDataCommand

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的package包/类
public GetMultiTaskDataCommand(AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository, TaskDataCollector collector, Set<String> ids) {
    this.taskRepository = taskRepository;
    this.repositoryConnector = repositoryConnector;
    this.ids = ids;
    this.collector = collector;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:GetMultiTaskDataCommand.java


示例6: PerformQueryCommand

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的package包/类
public PerformQueryCommand(AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository, TaskDataCollector collector, IRepositoryQuery query) {
    this.taskRepository = taskRepository;
    this.repositoryConnector = repositoryConnector;
    this.query = query;
    this.collector = collector;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:PerformQueryCommand.java


示例7: performQuery

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的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


示例8: performQuery

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的package包/类
void performQuery(TaskRepository repository, IRepositoryQuery query,
TaskDataCollector collector, IProgressMonitor monitor) throws CoreException;
 
开发者ID:project-open,项目名称:po-mylyn-integration,代码行数:3,代码来源:ProjectOpenClient.java


示例9: performQuery

import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; //导入依赖的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



注:本文中的org.eclipse.mylyn.tasks.core.data.TaskDataCollector类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ManagedAsync类代码示例发布时间:2022-05-22
下一篇:
Java GPUImageSaturationFilter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap