Package ghidra.framework.task
Class GTaskGroup
java.lang.Object
ghidra.framework.task.GTaskGroup
Class for grouping several
GTask
s that all should be
executed before any new group of tasks are
executed, regardless of priority.- See Also:
-
Constructor Summary
ConstructorDescriptionGTaskGroup
(String description, boolean startNewTransaction) Creates a new named GTaskGroup. -
Method Summary
Modifier and TypeMethodDescriptionAdd a task to this group with the given priority.int
compareTo
(GTaskGroup group) Returns a description for the group.Returns the TaskMonitor that will be used to track the overall progress of tasks within this group.getTasks()
Returns a list scheduled tasks in the group.void
Cancels the group.void
void
Notification that a task in the group has been completed.toString()
boolean
Returns true if this group wants to start a new transaction when it runs.boolean
Returns true if this group was cancelled.
-
Constructor Details
-
GTaskGroup
Creates a new named GTaskGroup.- Parameters:
description
- the display name for the group.startNewTransaction
- if true, any existing transaction (if there is one) will be closed and a new transaction will be created. Otherwise, the tasks in this group will be executed in the same transaction as the previous group. Note that this can only happen if there was a previous group executing at the time this group is scheduled.
-
-
Method Details
-
addTask
Add a task to this group with the given priority. Tasks can only be added to this group before the group is added to the GTaskManager. After that, an IllegalStateException will be thrown.- Parameters:
task
- the task being added to this group.priority
- the priority for the task within the group.- Returns:
- the GScheduledTask created to schedule this task within the group.
- Throws:
IllegalStateException
- if this method is called after the group has been added to the GTaskManager.
-
getTasks
Returns a list scheduled tasks in the group.- Returns:
- a list scheduled tasks in the group.
-
getTaskMonitor
Returns the TaskMonitor that will be used to track the overall progress of tasks within this group.- Returns:
- the TaskMonitor that will be used to track the overall progress of tasks within this group.
-
wantsNewTransaction
public boolean wantsNewTransaction()Returns true if this group wants to start a new transaction when it runs. Otherwise, the group will add-on to any existing transaction from the previous group.- Returns:
- true if a new transaction should be started for this group.
-
getDescription
Returns a description for the group.- Returns:
- a description for this group.
-
compareTo
-
toString
-
setCancelled
public void setCancelled()Cancels the group. Any tasks that haven't yet started will never run. -
wasCancelled
public boolean wasCancelled()Returns true if this group was cancelled.- Returns:
- true if this group was cancelled.
-
taskCompleted
public void taskCompleted()Notification that a task in the group has been completed. The group keeps track of the overall progress of the tasks completed in this group. This call is used to notify the group that another one of its tasks was completed. -
setScheduled
public void setScheduled()
-