Template JTree
A tree containing Templates and Schemes.
Changes made through this tree's interface (e.g. adding, removing, copying) are immediately reflected in the currentTemplateList. The originalTemplateList is used only as a reference point to determine what changes have occurred, for example when isModified is called or when the end user requests that changes are (partially) reverted.
If changes are made outside of this tree's interface (i.e. by directly operating on the currentTemplateList instance that was passed in the constructor), this tree's internal model becomes desynchronized, and must be resynchronized by invoking reload. Except for reload, the behaviour of this tree is undefined while desynchronized.
Internally, the currentTemplateList is loaded into a TemplateJTreeModel. The TemplateJTree class is the corresponding user interface class, which additionally provides (1) toolbars and buttons for manipulating the model, (2) node expansion and selection, and (3) handling for tracking and reversing modifications.
Parameters
the (read-only) original templates without modifications
the current templates, including modifications
Types
Renders a cell in the tree.
Copies the selected scheme in the tree.
Moves the selected scheme down by one position in the tree.
Removes the selected scheme from the tree.
Resets the selected scheme to its original state, or removes it if it has no original state.
Properties
The list of currently-collapsed Templates by UUID.
The tree's model.
The currently selected node, or null
if no node is selected, or null
if the root is selected.
The currently selected scheme (or template), or null
if no scheme is currently selected.
The currently selected template, or the parent of the currently selected non-template scheme, or null
if no scheme is currently selected.
Functions
Returns a panel containing this tree decorated with accessible action buttons.
Returns true
if and only if moveSchemeByOnePosition can be invoked with these parameters.
Finds a good, unique name for template so that it can be inserted into this list without conflict.
Returns the arguments to pass to TemplateJTreeModel.moveRow or TemplateJTreeModel.canMoveRow to describe moving scheme up (if moveDown is false
) or down (if moveDown is true
).
Returns true
if and only if scheme has been modified with respect to originalTemplateList.
Notifies the tree that external changes have been made to currentTemplateList, and resynchronizes the tree's model with the template list.
Removes scheme from the tree, and selects an appropriate other scheme.
Runs lambda while ensuring that the selectedScheme and collapsed templates remain unchanged.