本文整理汇总了Java中org.eclipse.mylyn.tasks.core.ITask.getSynchronizationState方法的典型用法代码示例。如果您正苦于以下问题:Java ITask.getSynchronizationState方法的具体用法?Java ITask.getSynchronizationState怎么用?Java ITask.getSynchronizationState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.mylyn.tasks.core.ITask
的用法示例。
在下文中一共展示了ITask.getSynchronizationState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: markTaskSeen
import org.eclipse.mylyn.tasks.core.ITask; //导入方法依赖的package包/类
void markTaskSeen (final ITask task, boolean seen) {
ITask.SynchronizationState syncState = task.getSynchronizationState();
taskDataManager.setTaskRead(task, seen);
if (!seen && syncState == task.getSynchronizationState()
&& syncState == ITask.SynchronizationState.OUTGOING
&& task instanceof AbstractTask) {
// mylyn does not set to CONFLICT status
try {
taskList.run(new ITaskListRunnable() {
@Override
public void execute (IProgressMonitor monitor) throws CoreException {
((AbstractTask) task).setSynchronizationState(ITask.SynchronizationState.CONFLICT);
}
});
taskList.notifyElementChanged(task);
} catch (CoreException ex) {
LOG.log(Level.INFO, null, ex);
}
}
task.setAttribute(ATTR_TASK_INCOMING_NEW, null);
}
示例2: toNbTasks
import org.eclipse.mylyn.tasks.core.ITask; //导入方法依赖的package包/类
Collection<NbTask> toNbTasks (Collection<ITask> tasks, boolean includeUnsubmittedNewTasks) {
Set<NbTask> nbTasks = new LinkedHashSet<NbTask>(tasks.size());
for (ITask task : tasks) {
if (includeUnsubmittedNewTasks || task.getSynchronizationState() != ITask.SynchronizationState.OUTGOING_NEW) {
// remember that unsubmitted tasks are local tasks and should not be included
// in tasks for local task repository
nbTasks.add(toNbTask(task));
}
}
return Collections.unmodifiableSet(nbTasks);
}
示例3: containersChanged
import org.eclipse.mylyn.tasks.core.ITask; //导入方法依赖的package包/类
@Override
public void containersChanged (Set<TaskContainerDelta> deltas) {
// listen on changes on all tasks
boolean change = false;
for (TaskContainerDelta delta : deltas) {
if (delta.getElement() instanceof ITask) {
ITask task = (ITask) delta.getElement();
NbTask nbTask = supp.toNbTask(task);
if (delta.getKind() == TaskContainerDelta.Kind.CONTENT) {
if (repository.getRepositoryUrl().equals(task.getRepositoryUrl())) {
// the task may change its status
change |= nbTask.isOutgoing() ? tasks.add(nbTask) : tasks.remove(nbTask);
}
} else if (delta.getKind() == TaskContainerDelta.Kind.DELETED) {
// the task was deleted permanently
change |= tasks.remove(nbTask);
} else if (delta.getKind() == TaskContainerDelta.Kind.ADDED
&& task.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW) {
// task may be added to the unsubmitted category
change |= taskList.getUnsubmittedContainer(repository.getRepositoryUrl())
.getChildren().contains(task) && tasks.add(nbTask);
}
}
}
if (change) {
fireIssuesChanged();
}
}
示例4: isUnsubmittedRepositoryTask
import org.eclipse.mylyn.tasks.core.ITask; //导入方法依赖的package包/类
boolean isUnsubmittedRepositoryTask (ITask task) {
return task.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW
&& task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND) != null;
}