Class Task
- java.lang.Object
-
- ca.cgjennings.apps.arkham.project.Member
-
- ca.cgjennings.apps.arkham.project.Task
-
- All Implemented Interfaces:
IconProvider
,java.lang.Comparable<Member>
,java.lang.Iterable<Member>
- Direct Known Subclasses:
TaskGroup
public class Task extends Member
A task is kind of subproject within a project; the type of a task determines the kinds of actions that may be performed within it.- Author:
- Chris Jennings
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
KEY_ICON
static java.lang.String
KEY_SUBTYPE
static java.lang.String
KEY_TYPE
protected static java.lang.String
TASK_SETTINGS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.io.File
createTask(java.io.File parentFolder, java.lang.String taskName, java.lang.String taskType)
Creates a new, empty task.static java.lang.String[]
getCustomIcons()
Returns an array of all registered custom icons.Settings
getSettings()
static boolean
isTaskFolder(java.io.File f)
void
readTaskSettings()
static void
registerCustomIcon(java.lang.String resource)
Add the resource path to a new custom task icon that can be selected by the user usingChangeIcon
.static void
unregisterCustomIcon(java.lang.String resource)
Remove the resource path to a new custom task icon that can be selected by the user usingChangeIcon
.void
writeTaskSettings()
-
Methods inherited from class ca.cgjennings.apps.arkham.project.Member
compareTo, deleteFile, equals, findChild, findChild, getBaseName, getChildAt, getChildCount, getChildren, getExcludedFilePatterns, getExtension, getFile, getIcon, getIndex, getMetadataSource, getName, getParent, getProject, getTask, getURL, hasChildren, hashCode, isAncestorOf, isFileExcluded, isFolder, iterator, registerMetadataSource, renameFile, setExcludedFilePatterns, synchronize, toString, unregisterMetadataSource
-
-
-
-
Field Detail
-
TASK_SETTINGS
protected static final java.lang.String TASK_SETTINGS
- See Also:
- Constant Field Values
-
KEY_TYPE
public static final java.lang.String KEY_TYPE
- See Also:
- Constant Field Values
-
KEY_SUBTYPE
public static final java.lang.String KEY_SUBTYPE
- See Also:
- Constant Field Values
-
KEY_ICON
public static final java.lang.String KEY_ICON
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Task
public Task(TaskGroup parent, java.io.File taskToOpen) throws java.io.IOException
Creates a task that represents a task already stored on disk.- Parameters:
taskToOpen
-- Throws:
java.io.IOException
-
-
Method Detail
-
isTaskFolder
public static boolean isTaskFolder(java.io.File f)
-
getSettings
public Settings getSettings()
-
createTask
public static java.io.File createTask(java.io.File parentFolder, java.lang.String taskName, java.lang.String taskType) throws java.io.IOException
Creates a new, empty task. If this succeeds, then the task can be opened using the returned file. This is a low-level method that creates the basic file structure for a task. To add a new task to a project, seeTaskGroup.addNewTask(ca.cgjennings.apps.arkham.project.NewTaskType, java.lang.String)
.- Parameters:
parentFolder
- the root project folder or aTaskGroup
foldertaskName
- a name for the tasktaskType
- a type descriptor for the project type- Returns:
- the root folder of the task
- Throws:
java.io.IOException
- if the parent folder does not exist, or if it exists but has a child with the same name as the new task name, or if the task folder cannot be created for some reason
-
writeTaskSettings
public void writeTaskSettings() throws java.io.IOException
- Throws:
java.io.IOException
-
readTaskSettings
public void readTaskSettings() throws java.io.IOException
- Throws:
java.io.IOException
-
registerCustomIcon
public static void registerCustomIcon(java.lang.String resource)
Add the resource path to a new custom task icon that can be selected by the user usingChangeIcon
.- Parameters:
resource
-- Since:
- 2.1a7
-
unregisterCustomIcon
public static void unregisterCustomIcon(java.lang.String resource)
Remove the resource path to a new custom task icon that can be selected by the user usingChangeIcon
.- Parameters:
resource
-- Since:
- 2.1a7
-
getCustomIcons
public static java.lang.String[] getCustomIcons()
Returns an array of all registered custom icons.- Returns:
- an array of registered custom icon resource paths
- Since:
- 2.1a7
-
-