本文整理汇总了Java中org.eclipse.mylyn.tasks.core.TaskRepository类的典型用法代码示例。如果您正苦于以下问题:Java TaskRepository类的具体用法?Java TaskRepository怎么用?Java TaskRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskRepository类属于org.eclipse.mylyn.tasks.core包,在下文中一共展示了TaskRepository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createSubtask
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
public NbTask createSubtask (NbTask parentTask) throws CoreException {
ensureTaskListLoaded();
TaskRepository taskRepository = taskRepositoryManager.getRepository(parentTask.getDelegate().getRepositoryUrl());
if (taskRepository == null || parentTask.isUnsubmittedRepositoryTask()) {
throw new IllegalStateException("Task repository: " + parentTask.getDelegate().getRepositoryUrl()
+ " - parent: " + parentTask.isUnsubmittedRepositoryTask());
}
AbstractTask task = createNewTask(taskRepository);
AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind());
AbstractTaskDataHandler taskDataHandler = repositoryConnector.getTaskDataHandler();
TaskAttributeMapper attributeMapper = repositoryConnector.getTaskDataHandler().getAttributeMapper(taskRepository);
TaskData taskData = new TaskData(attributeMapper, repositoryConnector.getConnectorKind(), taskRepository.getRepositoryUrl(), "");
taskDataHandler.initializeSubTaskData(taskRepository, taskData, parentTask.getTaskDataState().getRepositoryData(), new NullProgressMonitor());
initializeTask(repositoryConnector, taskData, task, taskRepository);
return MylynSupport.getInstance().toNbTask(task);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:MylynSupport.java
示例2: initializeTask
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
private void initializeTask (AbstractRepositoryConnector repositoryConnector, TaskData taskData, AbstractTask task, TaskRepository taskRepository) throws CoreException {
ITaskMapping mapping = repositoryConnector.getTaskMapping(taskData);
String taskKind = mapping.getTaskKind();
if (taskKind != null && taskKind.length() > 0) {
task.setTaskKind(taskKind);
}
ITaskDataWorkingCopy workingCopy = taskDataManager.createWorkingCopy(task, taskData);
workingCopy.save(null, null);
repositoryConnector.updateNewTaskFromTaskData(taskRepository, task, taskData);
String summary = mapping.getSummary();
if (summary != null && summary.length() > 0) {
task.setSummary(summary);
}
if (taskRepository == localTaskRepository) {
taskList.addTask(task);
} else {
taskList.addTask(task, taskList.getUnsubmittedContainer(task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_REPOSITORY_URL)));
}
task.setAttribute(AbstractNbTaskWrapper.ATTR_NEW_UNREAD, Boolean.TRUE.toString());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:MylynSupport.java
示例3: setRepositoryUrl
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
public void setRepositoryUrl (TaskRepository repository, String url) throws CoreException {
String oldUrl = repository.getRepositoryUrl();
if (!url.equals(oldUrl)) {
ensureTaskListLoaded();
assert taskRepositoryManager.getRepositoryConnector(repository.getConnectorKind()) != null
: "Did you forget to implement RepositoryConnectorProvider?";
try {
for (ITask task : taskList.getAllTasks()) {
if (url.equals(task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_REPOSITORY_URL))) {
taskDataManager.refactorRepositoryUrl(task, task.getRepositoryUrl(), url);
} else if (oldUrl.equals(task.getRepositoryUrl())) {
taskDataManager.refactorRepositoryUrl(task, url, url);
}
}
} catch (Throwable t) {
// log, but set the rapository & co
LOG.log(Level.WARNING, null, t);
}
taskList.refactorRepositoryUrl(oldUrl, url);
repository.setRepositoryUrl(url);
taskRepositoryManager.notifyRepositoryUrlChanged(repository, oldUrl);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:MylynSupport.java
示例4: getTaskDataModel
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
NbTaskDataModel getTaskDataModel (NbTask task) {
assert taskListInitialized;
ITask mylynTask = task.getDelegate();
mylynTask.setAttribute(MylynSupport.ATTR_TASK_INCOMING_NEW, null);
TaskRepository taskRepository = getTaskRepositoryFor(mylynTask);
try {
ITaskDataWorkingCopy workingCopy = taskDataManager.getWorkingCopy(mylynTask);
if (workingCopy instanceof TaskDataState && workingCopy.getLastReadData() == null) {
((TaskDataState) workingCopy).setLastReadData(workingCopy.getRepositoryData());
}
return new NbTaskDataModel(taskRepository, task, workingCopy);
} catch (CoreException ex) {
MylynSupport.LOG.log(Level.INFO, null, ex);
return null;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:MylynSupport.java
示例5: setupTaskRepository
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
/**
* If oldUrl is not null, gets the repository for the oldUrl and rewrites it
* to the new url.
*/
private static TaskRepository setupTaskRepository (String name, String oldUrl, String url, String user,
char[] password, String httpUser, char[] httpPassword,
boolean shortLoginEnabled) {
TaskRepository repository;
if (oldUrl == null) {
repository = MylynSupport.getInstance().getTaskRepository(Bugzilla.getInstance().getRepositoryConnector(), url);
} else {
repository = MylynSupport.getInstance().getTaskRepository(Bugzilla.getInstance().getRepositoryConnector(), oldUrl);
try {
MylynSupport.getInstance().setRepositoryUrl(repository, url);
} catch (CoreException ex) {
Bugzilla.LOG.log(Level.WARNING, null, ex);
}
}
setupProperties(repository, name, user, password, httpUser, httpPassword, shortLoginEnabled);
return repository;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:BugzillaRepository.java
示例6: readComment
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
private void readComment(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository, String comment) throws CoreException {
// refresh
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
List<TaskAttribute> attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_COMMENT);
assertNotNull(attributes);
boolean fail = true;
for (TaskAttribute ta : attributes) {
if(ta.getMappedAttribute(TaskAttribute.COMMENT_TEXT).getValue().equals(comment)) {
fail = false;
break;
}
}
if(fail) {
fail("Couldn't find comment text [" + comment + "] for taskdata [" + data.getTaskId() + "]");
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:BugzillaTest.java
示例7: updateTaskData
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
private void updateTaskData(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws CoreException {
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
TaskAttribute attrModification1 = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION);
TaskAttribute rta = data.getRoot();
TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.USER_ASSIGNED);
ta = rta.getMappedAttribute(TaskAttribute.SUMMARY);
String val = ta.getValue();
ta.setValue(val + " updated");
Set<TaskAttribute> attrs = new HashSet<TaskAttribute>();
attrs.add(ta);
RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, attrs, new NullProgressMonitor());
assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED);
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
rta = data.getRoot();
ta = rta.getMappedAttribute(TaskAttribute.SUMMARY);
assertEquals(val + " updated", ta.getValue());
TaskAttribute attrModification2 = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION);
assertNotSame(attrModification1, attrModification2);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:BugzillaTest.java
示例8: addAttachement
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
private TaskData addAttachement(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository, String comment, String desc, String content) throws Exception {
// Task task = new Task(getRepository().getRepositoryUrl(), getRepository().getConnectorKind(), key, taskId, "");
File f = getAttachmentFile(content);
FileTaskAttachmentSource attachmentSource = new FileTaskAttachmentSource(f);
attachmentSource.setContentType("text/plain");
// List<TaskAttribute> attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_ATTACHMENT);
TaskAttribute attAttribute = new TaskAttribute(data.getRoot(), TaskAttribute.TYPE_ATTACHMENT);
TaskAttribute a = attAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION);
a.setValue(desc);
String bugId = data.getTaskId();
brc.getClientManager().getClient(repository, nullProgressMonitor)
.postAttachment(bugId, comment, attachmentSource, attAttribute, nullProgressMonitor);
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
List<TaskAttribute> attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_ATTACHMENT);
assertTrue(attributes.size() > 0);
return data;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:BugzillaTest.java
示例9: readAttachement
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
private void readAttachement(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository, String content) throws Exception {
// refresh
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
List<TaskAttribute> attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_ATTACHMENT);
TaskAttribute attribute = attributes.get(0);
TaskAttachmentMapper attachment = TaskAttachmentMapper.createFrom(attribute);
ByteArrayOutputStream os = new ByteArrayOutputStream();
InputStream is = brc.getClientManager().getClient(repository, nullProgressMonitor).getAttachmentData(attachment.getAttachmentId(), nullProgressMonitor);
FileUtils.copyStream(is, os);
try {
// byte[] d = new byte[4];
// os.read(d);
assertEquals(content, os.toString());
} finally {
if(os != null) os.close();
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:BugzillaTest.java
示例10: closeIssue
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
private void closeIssue(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws Exception {
//RepositoryConfiguration rc = brc.getClientManager().getClient(repository, nullProgressMonitor).getRepositoryConfiguration();
// refresh
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
Set<TaskAttribute> attrs = new HashSet<TaskAttribute>();
TaskAttribute rta = data.getRoot();
TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.OPERATION);
ta.setValue("resolve");
attrs.add(ta);
ta = rta.getMappedAttribute(TaskAttribute.STATUS);
ta.setValue("FIXED");
attrs.add(ta);
RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, attrs, nullProgressMonitor);
assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED);
data = brc.getTaskData(repository, rr.getTaskId(), nullProgressMonitor);
rta = data.getRoot();
ta = rta.getMappedAttribute(TaskAttribute.STATUS);
assertEquals("RESOLVED", ta.getValue());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:BugzillaTest.java
示例11: hasTaskChanged
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
@Override
public boolean hasTaskChanged(@NonNull TaskRepository taskRepository, @NonNull ITask task,
@NonNull TaskData taskData) {
Date changedAtTaskData = taskData.getAttributeMapper()
.getDateValue(taskData.getRoot().getAttribute(TaskAttribute.DATE_MODIFICATION));
Date changedAtTask = task.getModificationDate();
if (changedAtTask == null || changedAtTaskData == null)
return true;
if (!changedAtTask.equals(changedAtTaskData))
return true;
return false;
}
开发者ID:theits,项目名称:CharmMylynConnector,代码行数:17,代码来源:CharmRepositoryConnector.java
示例12: createSynchronizeQueriesCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
public SynchronizeQueryCommand createSynchronizeQueriesCommand (TaskRepository taskRepository, IRepositoryQuery iquery, IProgressMonitor monitor) {
assert iquery instanceof RepositoryQuery;
RepositoryQuery repositoryQuery;
if (iquery instanceof RepositoryQuery) {
repositoryQuery = (RepositoryQuery) iquery;
} else {
return null;
}
AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind());
return new SynchronizeQueryCommand(repositoryModel, repositoryConnector,
taskRepository, taskList, taskDataManager, repositoryQuery, monitor);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:CommandFactory.java
示例13: createPostAttachmentCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
public PostAttachmentCommand createPostAttachmentCommand (TaskRepository taskRepository, NbTask task,
TaskAttribute attAttribute, FileTaskAttachmentSource attachmentSource, String comment) {
AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind());
return new PostAttachmentCommand(repositoryConnector, taskRepository,
Accessor.getInstance().getDelegate(task),
attAttribute, attachmentSource, comment);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:CommandFactory.java
示例14: SynchronizeQueryCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
SynchronizeQueryCommand (RepositoryModel repositoryModel,
AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository,
TaskList taskList, TaskDataManager taskDataManager, RepositoryQuery query, IProgressMonitor monitor)
{
this.repositoryModel = repositoryModel;
this.repositoryConnector = repositoryConnector;
this.taskRepository = taskRepository;
this.taskList = taskList;
this.taskDataManager = taskDataManager;
this.query = query;
this.monitor = monitor;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SynchronizeQueryCommand.java
示例15: PostAttachmentCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
PostAttachmentCommand (AbstractRepositoryConnector repositoryConnector,
TaskRepository taskRepository,
ITask task,
TaskAttribute ta,
AbstractTaskAttachmentSource taskAttachmentSource,
String comment) {
this.attAttribute = ta;
this.task = task;
this.taskRepository = taskRepository;
this.repositoryConnector = repositoryConnector;
this.taskAttachmentSource = taskAttachmentSource;
this.comment = comment;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:PostAttachmentCommand.java
示例16: GetRepositoryTasksCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
GetRepositoryTasksCommand (AbstractRepositoryConnector connector,
TaskRepository taskRepository, Set<String> taskIds,
TaskDataManager taskDataManager) {
this.connector = connector;
this.taskRepository = taskRepository;
this.taskIds = taskIds;
this.taskDataManager = taskDataManager;
this.monitor = new CancelableProgressMonitor();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:GetRepositoryTasksCommand.java
示例17: GetAttachmentCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
GetAttachmentCommand(AbstractRepositoryConnector repositoryConnector,
TaskRepository taskRepository,
ITask task,
TaskAttribute ta,
OutputStream os) {
this.ta = ta;
this.task = task;
this.taskRepository = taskRepository;
this.repositoryConnector = repositoryConnector;
this.os = os;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:GetAttachmentCommand.java
示例18: SubmitTaskCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
SubmitTaskCommand (TaskDataManager taskDataManager,
AbstractRepositoryConnector repositoryConnector,
TaskRepository taskRepository, ITask task, TaskData taskData,
Set<TaskAttribute> changedOldAttributes) {
this.taskDataManager = taskDataManager;
this.repositoryConnector = repositoryConnector;
this.taskRepository = taskRepository;
this.task = task;
this.taskData = taskData;
this.changedOldAttributes = changedOldAttributes;
this.monitor = new CancelableProgressMonitor();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SubmitTaskCommand.java
示例19: SimpleQueryCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
SimpleQueryCommand (AbstractRepositoryConnector repositoryConnector,
TaskRepository taskRepository, TaskDataManager taskDataManager,
IRepositoryQuery query) {
this.taskRepository = taskRepository;
this.repositoryConnector = repositoryConnector;
this.query = query;
this.taskDataManager = taskDataManager;
this.monitor = new CancelableProgressMonitor();
tasks = new HashSet<NbTask>();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:SimpleQueryCommand.java
示例20: SynchronizeTasksCommand
import org.eclipse.mylyn.tasks.core.TaskRepository; //导入依赖的package包/类
SynchronizeTasksCommand (AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository,
RepositoryModel repositoryModel, TaskDataManager taskDataManager, TaskList taskList,
Set<NbTask> tasks, boolean isUserAction) {
this.repositoryConnector = repositoryConnector;
this.taskRepository = taskRepository;
this.repositoryModel = repositoryModel;
this.taskDataManager = taskDataManager;
this.taskList = taskList;
this.tasks = tasks;
this.monitor = new CancelableProgressMonitor();
this.user = isUserAction;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SynchronizeTasksCommand.java
注:本文中的org.eclipse.mylyn.tasks.core.TaskRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论