Class DocumentTask
- java.lang.Object
-
- ca.cgjennings.apps.arkham.project.NewTaskType
-
- ca.cgjennings.apps.arkham.project.DocumentTask
-
public class DocumentTask extends NewTaskType
A task for storing project documentation or other text.- Since:
- 2.1
- Author:
- Chris Jennings
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DocumentTask.DocumentType
A task action that creates a new, blank document for theDocumentTask
by copying a template file from a resource.
-
Field Summary
-
Fields inherited from class ca.cgjennings.apps.arkham.project.NewTaskType
CASEBOOK_TYPE, DECK_TYPE, DOCUMENTATION_TYPE, EXPANSION_BOARD_TYPE, FACTORY_SCRIPTED_SUBTYPE, FACTORY_TYPE, GENERIC_TYPE, PLUGIN_TYPE, TASK_GROUP_TYPE
-
-
Constructor Summary
Constructors Constructor Description DocumentTask()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
Returns the localized, human-readable description of this task type as a simple HTML document.static TaskAction[]
getDocumentTypes()
Returns an array of the registered document types.java.lang.String
getLabel()
Returns the localized, human-readable name of this task type.java.lang.String
getType()
Returns a string that describes the type of task created by thisNewTaskType
.boolean
initializeNewTask(Project project, Task task)
This method is called when this task type is added to a project.static void
registerDocumentType(TaskAction ta)
Registers support for a new kind of document to document tasks.static void
unregisterDocumentType(TaskAction ta)
Unregisters support for a previously registered document type.-
Methods inherited from class ca.cgjennings.apps.arkham.project.NewTaskType
getIconResource, getNewTaskTypes, getSubtype, isRegistered, register, toString, unregister
-
-
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
Description copied from class:NewTaskType
Returns the localized, human-readable name of this task type.- Specified by:
getLabel
in classNewTaskType
- Returns:
- the name displayed for this type in the new task dialog
-
getDescription
public java.lang.String getDescription()
Description copied from class:NewTaskType
Returns the localized, human-readable description of this task type as a simple HTML document.- Overrides:
getDescription
in classNewTaskType
- Returns:
- a description of the task supported by this task type
-
getType
public java.lang.String getType()
Description copied from class:NewTaskType
Returns a string that describes the type of task created by thisNewTaskType
. The default implementation returns "TASK", the generic task type. Returning "PROJECT" is illegal, because that type is reserved to identify project folders. The type setting of new tasks of this type will be set to the value returned by this method.TaskAction
s often decide whether or not they can be applied to a given file based on the type and/or subtype of the task folder they belong to.Note that the type identifier returned by this method does not have to be unique.
- Overrides:
getType
in classNewTaskType
- Returns:
- a non-
null
string describing the task type
-
initializeNewTask
public boolean initializeNewTask(Project project, Task task)
Description copied from class:NewTaskType
This method is called when this task type is added to a project. By the time this is called, the task folder will already exist and the type, subtype, and icon settings will be filled in using the values returned from this object, if any.The project view will be synchronized with the task after this method returns, so any new files added to the task folder will be detected immediately.
The default implementation does nothing, which means the user will simply have a new, empty task folder after adding the new task.
This method should return
true
if the initialization is successful. If it returnsfalse
, or the method throws an exception, then the task folder will be deleted. If an exception was thrown, then a generic error message will be displayed; if the method returnsfalse
then it is assumed that the method displayed its own, more specific message.- Overrides:
initializeNewTask
in classNewTaskType
- Parameters:
project
- the project that the task was added totask
- theMember
that represents the new task's folder- Returns:
true
if initialization succeeded
-
registerDocumentType
public static void registerDocumentType(TaskAction ta)
Registers support for a new kind of document to document tasks.- Parameters:
ta
- a task action that will create a new blank document in the desired format- See Also:
DocumentTask.DocumentType
-
unregisterDocumentType
public static void unregisterDocumentType(TaskAction ta)
Unregisters support for a previously registered document type.- Parameters:
ta
- the previously registered action
-
getDocumentTypes
public static TaskAction[] getDocumentTypes()
Returns an array of the registered document types.- Returns:
- an array of task actions that create supported document types
-
-