Class MergeSettings
- java.lang.Object
-
- ca.cgjennings.apps.arkham.project.TaskAction
-
- ca.cgjennings.apps.arkham.project.TaskActionTree
-
- ca.cgjennings.apps.arkham.project.MergeSettings
-
- All Implemented Interfaces:
IconProvider,java.lang.Iterable<TaskAction>
public class MergeSettings extends TaskActionTree
A task action that loads settings from a settings file into the shared settings or a game's settings. Useful when developing plug-ins that require certain settings to be available, such as DIY component scripts.- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description MergeSettings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, TaskAction ta)booleanappliesToSelection(Member[] members)Returnstrueif this action is applicable to any of the specifiedMembers.TaskActionget(int index)java.lang.StringgetLabel()Returns the human-readable name of this action.protected booleanisAppliesToShortCircuited()If this method returnstrue, then the evaluation ofTaskActionTree.appliesToSelection(ca.cgjennings.apps.arkham.project.Member[])andTaskActionTree.appliesTo(ca.cgjennings.apps.arkham.project.Project, ca.cgjennings.apps.arkham.project.Task, ca.cgjennings.apps.arkham.project.Member)will assume that every child action performs the same test.java.util.Iterator<TaskAction>iterator()intsize()-
Methods inherited from class ca.cgjennings.apps.arkham.project.TaskActionTree
add, appliesTo, findActionByName, getSectionIndex, indexOf, perform, remove, remove
-
Methods inherited from class ca.cgjennings.apps.arkham.project.TaskAction
applyToChildren, getActionName, getDescription, 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
-
add
public void add(int index, TaskAction ta)- Overrides:
addin classTaskActionTree
-
get
public TaskAction get(int index)
- Overrides:
getin classTaskActionTree
-
iterator
public java.util.Iterator<TaskAction> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<TaskAction>- Overrides:
iteratorin classTaskActionTree
-
size
public int size()
- Overrides:
sizein classTaskActionTree
-
appliesToSelection
public boolean appliesToSelection(Member[] members)
Description copied from class:TaskActionReturnstrueif this action is applicable to any of the specifiedMembers. By overriding this, you can modify whether an action is listed depending on which other members are selected. For example, you could create a command that can only be applied to a singleton selection by checking the length ofmembersand returningfalseif it is not 1, and otherwise calling the super implementation.- Overrides:
appliesToSelectionin classTaskActionTree- Parameters:
members- a list of zero or more members- Returns:
trueis the action can be applied to at least one member
-
isAppliesToShortCircuited
protected boolean isAppliesToShortCircuited()
If this method returnstrue, then the evaluation ofTaskActionTree.appliesToSelection(ca.cgjennings.apps.arkham.project.Member[])andTaskActionTree.appliesTo(ca.cgjennings.apps.arkham.project.Project, ca.cgjennings.apps.arkham.project.Task, ca.cgjennings.apps.arkham.project.Member)will assume that every child action performs the same test. Therefore, if the first child action tested does not apply, none of them can apply and the search ends immediately. Otherwise, every child action will be tested to see if it applies until at least one is found that does or they all fail.The base class returns
false.This action tree returns true since all of its children represent settings instances with which a settings file could be merged.
- Overrides:
isAppliesToShortCircuitedin classTaskActionTree- Returns:
true
-
-