Class ScriptTreeModel
java.lang.Object
fr.ifremer.isisfish.ui.script.model.ScriptTreeModel
- All Implemented Interfaces:
TreeModel
Tree model for scripts edition.
Tree model is structured as this :
- root - vcs - categories - files
- Version:
- $Revision$ Last update : $Date$ By : $Author$
- Author:
- chatellier
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.jdesktop.swingx.tree.TreeModelSupport
static final int
Add node operationstatic final int
Delete Node operationstatic final int
Modify node operationCategories files for VCS.VCS list. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Notify for file addition.void
fileDeleted
(File file) Notify for file deletion.void
fileModified
(File file) Notify for file modification.int
getChildCount
(Object parent) int
getIndexOfChild
(Object parent, Object child) protected TreePath
getRecursiveTreePath
(File file, TreePath path) Find file in tree, and return tree path.getRoot()
getTreePathFor
(File file) Find tree path for a filegetVersionnableSortedFiles
(File[] filesArray) Filter input file array and return only sorted collection with only directories.boolean
void
protected boolean
updateChildren
(File file, TreePath path, int operation) Notify for tree operation.void
valueForPathChanged
(TreePath path, Object newValue)
-
Field Details
-
modelSupport
protected org.jdesktop.swingx.tree.TreeModelSupport modelSupport -
vcsList
VCS list. -
rootFiles
Categories files for VCS. -
OPERATION_ADD
public static final int OPERATION_ADDAdd node operation- See Also:
-
OPERATION_MODIFY
public static final int OPERATION_MODIFYModify node operation- See Also:
-
OPERATION_DELETE
public static final int OPERATION_DELETEDelete Node operation- See Also:
-
-
Constructor Details
-
ScriptTreeModel
public ScriptTreeModel()
-
-
Method Details
-
addTreeModelListener
- Specified by:
addTreeModelListener
in interfaceTreeModel
-
getChild
-
getChildCount
- Specified by:
getChildCount
in interfaceTreeModel
-
getIndexOfChild
- Specified by:
getIndexOfChild
in interfaceTreeModel
-
getRoot
-
isLeaf
-
removeTreeModelListener
- Specified by:
removeTreeModelListener
in interfaceTreeModel
-
valueForPathChanged
- Specified by:
valueForPathChanged
in interfaceTreeModel
-
getVersionnableSortedFiles
Filter input file array and return only sorted collection with only directories.- Parameters:
filesArray
- file array- Returns:
- sorted list
-
fileAdded
Notify for file addition.- Parameters:
file
- added file
-
fileModified
Notify for file modification.- Parameters:
file
- modified file
-
fileDeleted
Notify for file deletion. TODO must be called "before" effective deletion- Parameters:
file
- deleted file
-
updateChildren
Notify for tree operation.- Parameters:
file
-path
- path to updateoperation
- operation#OPERATION_DELETE #OPERATION_MODIFY
- Returns:
true
if path has been updated
-
getTreePathFor
Find tree path for a file- Parameters:
file
- to search- Returns:
- tree path
-
getRecursiveTreePath
Find file in tree, and return tree path.- Parameters:
file
-path
- path to update- Returns:
- tree path
-