Class ScriptTreeModel

java.lang.Object
fr.ifremer.isisfish.ui.script.model.ScriptTreeModel
All Implemented Interfaces:
TreeModel

public class ScriptTreeModel extends Object implements 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 Details

    • modelSupport

      protected org.jdesktop.swingx.tree.TreeModelSupport modelSupport
    • vcsList

      protected List<VCS> vcsList
      VCS list.
    • rootFiles

      protected Map<VCS,List<File>> rootFiles
      Categories files for VCS.
    • OPERATION_ADD

      public static final int OPERATION_ADD
      Add node operation
      See Also:
    • OPERATION_MODIFY

      public static final int OPERATION_MODIFY
      Modify node operation
      See Also:
    • OPERATION_DELETE

      public static final int OPERATION_DELETE
      Delete Node operation
      See Also:
  • Constructor Details

    • ScriptTreeModel

      public ScriptTreeModel()
  • Method Details

    • addTreeModelListener

      public void addTreeModelListener(TreeModelListener l)
      Specified by:
      addTreeModelListener in interface TreeModel
    • getChild

      public Object getChild(Object parent, int index)
      Specified by:
      getChild in interface TreeModel
    • getChildCount

      public int getChildCount(Object parent)
      Specified by:
      getChildCount in interface TreeModel
    • getIndexOfChild

      public int getIndexOfChild(Object parent, Object child)
      Specified by:
      getIndexOfChild in interface TreeModel
    • getRoot

      public Object getRoot()
      Specified by:
      getRoot in interface TreeModel
    • isLeaf

      public boolean isLeaf(Object node)
      Specified by:
      isLeaf in interface TreeModel
    • removeTreeModelListener

      public void removeTreeModelListener(TreeModelListener l)
      Specified by:
      removeTreeModelListener in interface TreeModel
    • valueForPathChanged

      public void valueForPathChanged(TreePath path, Object newValue)
      Specified by:
      valueForPathChanged in interface TreeModel
    • getVersionnableSortedFiles

      protected List<File> getVersionnableSortedFiles(File[] filesArray)
      Filter input file array and return only sorted collection with only directories.
      Parameters:
      filesArray - file array
      Returns:
      sorted list
    • fileAdded

      public void fileAdded(File file)
      Notify for file addition.
      Parameters:
      file - added file
    • fileModified

      public void fileModified(File file)
      Notify for file modification.
      Parameters:
      file - modified file
    • fileDeleted

      public void fileDeleted(File file)
      Notify for file deletion. TODO must be called "before" effective deletion
      Parameters:
      file - deleted file
    • updateChildren

      protected boolean updateChildren(File file, TreePath path, int operation)
      Notify for tree operation.
      Parameters:
      file -
      path - path to update
      operation - operation #OPERATION_DELETE #OPERATION_MODIFY
      Returns:
      true if path has been updated
    • getTreePathFor

      public TreePath getTreePathFor(File file)
      Find tree path for a file
      Parameters:
      file - to search
      Returns:
      tree path
    • getRecursiveTreePath

      protected TreePath getRecursiveTreePath(File file, TreePath path)
      Find file in tree, and return tree path.
      Parameters:
      file -
      path - path to update
      Returns:
      tree path