Class Run
- java.lang.Object
-
- ca.cgjennings.apps.arkham.project.TaskAction
-
- ca.cgjennings.apps.arkham.project.Run
-
- All Implemented Interfaces:
IconProvider
public class Run extends TaskAction
Task action that runs or debugs a selected script. Action to run or debug a script.- Since:
- 2.1
- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description Run(boolean debugAction)Creates a new run or debug action, depending on the specified parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanappliesTo(Project project, Task task, Member member)Returnstrueif this action can be performed on the specified member of a project, project or a task.java.lang.StringgetActionName()Returns a unique internal name for this action.java.lang.StringgetDescription()Returns a longer description of the action, suitable for use as a tool tip.java.lang.StringgetLabel()Returns the human-readable name of this action.booleanperform(Project project, Task task, Member member)Perform this action on a member of a project, a project or a task.booleanrunFile(java.io.File f, Project project, Task task, Member member)Run a script file as if using this action.-
Methods inherited from class ca.cgjennings.apps.arkham.project.TaskAction
appliesToSelection, applyToChildren, getIcon, performOnSelection, resolveTarget, toString
-
-
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
Description copied from class:TaskActionReturns the human-readable name of this action.- Specified by:
getLabelin classTaskAction- Returns:
- the name used to create menu items for this action, localized if possible
-
getDescription
public java.lang.String getDescription()
Description copied from class:TaskActionReturns a longer description of the action, suitable for use as a tool tip.- Overrides:
getDescriptionin classTaskAction- Returns:
- a long description of the action, or
null
-
getActionName
public java.lang.String getActionName()
Description copied from class:TaskActionReturns a unique internal name for this action. Actions can be looked up by this name. The default implementation returns the class name, converted to lowercase.- Overrides:
getActionNamein classTaskAction- Returns:
- the internal name of this action
-
appliesTo
public boolean appliesTo(Project project, Task task, Member member)
Description copied from class:TaskActionReturnstrueif this action can be performed on the specified member of a project, project or a task. If the project itself is the target,taskandmemberwill benull. If a task is the target, thenmemberwill be null. If an error occurs while executing the task, then it is the action's responsibility to inform the user. This method can returnfalseto indicate that if the action is being applied to multiple members, it should stop immediately rather than continue to the next member.- Specified by:
appliesToin classTaskAction- Parameters:
project- the project that is being acted upontask- the task within the project that is being acted upon;nullif acting on a projectmember- the specific member within the task to act upon;nullif this is a project or task
-
perform
public boolean perform(Project project, Task task, Member member)
Description copied from class:TaskActionPerform this action on a member of a project, a project or a task. If the project itself is the target,taskandmemberwill benull. If a task is the target, thenmemberwill be null. If an error occurs while executing the task, then it is the action's responsibility to inform the user. This method can returnfalseto indicate that if the action is being applied to multiple members, it should stop immediately rather than continue to the next member.- Specified by:
performin classTaskAction- Parameters:
project- the project that is being acted upontask- the task within the project that is being acted upon;nullif acting on a projectmember- the specific member within the task to act upon;nullif this is a project or task
-
runFile
public boolean runFile(java.io.File f, Project project, Task task, Member member)Run a script file as if using this action. The variablesproject,task, andmemberare passed to the script but may benullif the script does not rely on them. If the script is currently being edited by the application, any unsaved changes will be saved before running.- Parameters:
f- the script file to runproject- the project instance to pass to the scripttask- the task instance to pass to the scriptmember- the member instance to pass to the script- Returns:
trueif the script is successfully loaded and run- Throws:
java.lang.NullPointerException- iffisnull
-
-