public final class TaskManagerImpl extends TaskManager implements PersistentStateComponent<TaskManagerImpl.Config>, ChangeListDecorator, Disposable
Modifier and Type | Class and Description |
---|---|
static class |
TaskManagerImpl.Config |
TaskManager.VcsOperation
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<Task> |
TASK_UPDATE_COMPARATOR |
Constructor and Description |
---|
TaskManagerImpl(Project project) |
Modifier and Type | Method and Description |
---|---|
LocalTask |
activateTask(Task origin,
boolean clearContext) |
LocalTask |
activateTask(Task origin,
boolean clearContext,
boolean newTask) |
static void |
addBranches(LocalTask task,
VcsTaskHandler.TaskInfo[] info,
boolean original) |
LocalTask |
addTask(Task issue) |
void |
addTaskListener(TaskListener listener) |
void |
addTaskListener(TaskListener listener,
Disposable parentDisposable) |
void |
callProjectOpened() |
java.lang.String |
constructDefaultBranchName(Task task) |
void |
createBranch(LocalTask task,
LocalTask previousActive,
java.lang.String name,
VcsTaskHandler.TaskInfo branchFrom) |
void |
createChangeList(LocalTask task,
java.lang.String name) |
LocalTaskImpl |
createLocalTask(java.lang.String summary) |
void |
decorateChangeList(LocalChangeList changeList,
ColoredTreeCellRenderer cellRenderer,
boolean selected,
boolean expanded,
boolean hasFocus) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
LocalTask |
findTask(java.lang.String id) |
LocalTask |
getActiveTask() |
AbstractVcs |
getActiveVcs() |
TaskRepository[] |
getAllRepositories() |
LocalTask |
getAssociatedTask(LocalChangeList list) |
java.util.List<Task> |
getCachedIssues()
Returns already cached issues.
|
java.util.List<Task> |
getCachedIssues(boolean withClosed) |
ChangeListAdapter |
getChangeListListener() |
java.lang.String |
getChangelistName(Task task) |
java.util.List<Task> |
getIssues(java.lang.String query)
Queries all configured task repositories.
|
java.util.List<Task> |
getIssues(java.lang.String query,
boolean forceRequest) |
java.util.List<Task> |
getIssues(java.lang.String query,
int offset,
int limit,
boolean withClosed,
ProgressIndicator indicator,
boolean forceRequest)
Most arguments have the same meaning as the ones in
TaskRepository.getIssues(String, int, int, boolean, ProgressIndicator) . |
java.util.List<LocalTask> |
getLocalTasks() |
java.util.List<LocalTask> |
getLocalTasks(boolean withClosed) |
TaskManagerImpl.Config |
getState() |
void |
initializeComponent()
If class also is a component, then this method will be called after loading state (even if not state) but only once throughout the life cycle
|
boolean |
isLocallyClosed(LocalTask localTask) |
boolean |
isVcsEnabled() |
static java.util.ArrayList<TaskRepository> |
loadRepositories(Element element) |
void |
loadState(TaskManagerImpl.Config config)
This method is called when new component state is loaded.
|
void |
mergeBranch(LocalTask task) |
void |
prepareForNextTest() |
void |
removeTask(LocalTask task) |
void |
removeTaskListener(TaskListener listener) |
<T extends TaskRepository> |
setRepositories(java.util.List<T> repositories) |
void |
shelveChanges(LocalTask task,
java.lang.String shelfName) |
java.lang.String |
suggestBranchName(Task task) |
java.lang.String |
suggestBranchName(Task task,
java.lang.String separator) |
boolean |
testConnection(TaskRepository repository) |
void |
trackContext(LocalChangeList changeList) |
void |
updateIssues(java.lang.Runnable onComplete)
Update issue cache asynchronously
|
getManager
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
noStateLoaded
public static final java.util.Comparator<Task> TASK_UPDATE_COMPARATOR
public TaskManagerImpl(Project project)
public void prepareForNextTest()
public TaskRepository[] getAllRepositories()
getAllRepositories
in class TaskManager
public <T extends TaskRepository> void setRepositories(java.util.List<T> repositories)
public void removeTask(LocalTask task)
removeTask
in class TaskManager
public void addTaskListener(TaskListener listener)
addTaskListener
in class TaskManager
public void addTaskListener(TaskListener listener, Disposable parentDisposable)
addTaskListener
in class TaskManager
public void removeTaskListener(TaskListener listener)
removeTaskListener
in class TaskManager
public LocalTask getActiveTask()
getActiveTask
in class TaskManager
public LocalTask findTask(java.lang.String id)
findTask
in class TaskManager
public java.util.List<Task> getIssues(java.lang.String query)
TaskManager
getIssues
in class TaskManager
query
- text searchTaskManager.getCachedIssues()
public java.util.List<Task> getIssues(java.lang.String query, boolean forceRequest)
getIssues
in class TaskManager
public java.util.List<Task> getIssues(java.lang.String query, int offset, int limit, boolean withClosed, ProgressIndicator indicator, boolean forceRequest)
TaskManager
TaskRepository.getIssues(String, int, int, boolean, ProgressIndicator)
.getIssues
in class TaskManager
query
- optional pattern to filter tasks. One use case is the text entered in "Open Task" dialog.offset
- first issue, that should be returned by server. It's safe to use 0, if your server doesn't support pagination.
Or you could calculate it as pageSize * (page - 1)
if it does.limit
- maximum number of issues returned in one response. You can interpret it as page size.withClosed
- whether to include closed issues. Downloaded issues will be filtered by Task.isClosed()
anyway, but
filtering on server side can give more useful results in single request.indicator
- progress indicator to interrupt long-running requests.forceRequest
- whether to download issues anew or use already cached ones.public java.util.List<Task> getCachedIssues()
TaskManager
getCachedIssues
in class TaskManager
public java.util.List<Task> getCachedIssues(boolean withClosed)
getCachedIssues
in class TaskManager
public java.util.List<LocalTask> getLocalTasks()
getLocalTasks
in class TaskManager
public java.util.List<LocalTask> getLocalTasks(boolean withClosed)
getLocalTasks
in class TaskManager
public LocalTask addTask(Task issue)
addTask
in class TaskManager
public LocalTaskImpl createLocalTask(java.lang.String summary)
createLocalTask
in class TaskManager
public LocalTask activateTask(Task origin, boolean clearContext)
activateTask
in class TaskManager
public void shelveChanges(LocalTask task, java.lang.String shelfName)
public void createBranch(LocalTask task, LocalTask previousActive, java.lang.String name, VcsTaskHandler.TaskInfo branchFrom)
public void mergeBranch(LocalTask task)
public static void addBranches(LocalTask task, VcsTaskHandler.TaskInfo[] info, boolean original)
public boolean testConnection(TaskRepository repository)
testConnection
in class TaskManager
public TaskManagerImpl.Config getState()
getState
in interface PersistentStateComponent<TaskManagerImpl.Config>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public void loadState(TaskManagerImpl.Config config)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<TaskManagerImpl.Config>
config
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public static java.util.ArrayList<TaskRepository> loadRepositories(Element element)
public void callProjectOpened()
public void initializeComponent()
PersistentStateComponent
initializeComponent
in interface PersistentStateComponent<TaskManagerImpl.Config>
public void dispose()
Disposable
dispose
in interface Disposable
public void updateIssues(java.lang.Runnable onComplete)
TaskManager
updateIssues
in class TaskManager
onComplete
- callback to be invoked after updatingpublic boolean isVcsEnabled()
isVcsEnabled
in class TaskManager
public AbstractVcs getActiveVcs()
getActiveVcs
in class TaskManager
public boolean isLocallyClosed(LocalTask localTask)
isLocallyClosed
in class TaskManager
public LocalTask getAssociatedTask(LocalChangeList list)
getAssociatedTask
in class TaskManager
public void trackContext(LocalChangeList changeList)
trackContext
in class TaskManager
public void decorateChangeList(LocalChangeList changeList, ColoredTreeCellRenderer cellRenderer, boolean selected, boolean expanded, boolean hasFocus)
decorateChangeList
in interface ChangeListDecorator
public void createChangeList(LocalTask task, java.lang.String name)
public java.lang.String getChangelistName(Task task)
public java.lang.String suggestBranchName(Task task, java.lang.String separator)
public java.lang.String suggestBranchName(Task task)
public java.lang.String constructDefaultBranchName(Task task)
public ChangeListAdapter getChangeListListener()