Class de.unikl.AWTNode.RescanNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.unikl.AWTNode.RescanNode

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----de.unikl.AWTNode.cfContainer
                                   |
                                   +----de.unikl.AWTNode.NodeContainer
                                           |
                                           +----de.unikl.AWTNode.RescanNode

public class RescanNode
extends NodeContainer
This class implements the possibility that a node in a tree may create it sons, if you "open" the node.

Assume you have a directory tree view. If you look at the files it is clear that they can be deleted or renamed but if they are stored in your tree and you delete the correspondig file on the harddisk the tree is not updated! Thus there must be a mechanism which can be used do update a tree, or better to re-create a tree.

To achieve this goal you can use the new Variable [lRescan]:

Each time you "open" the NodeContainer (this means the state of the checkbox changes from true to false) the Object checks whether the variable lRescan is true or not. If lRescan is true, this means that the node should be updated and theObject calls the method Rescan.

the default in the method Rescan is : do nothing As an example a fairly simple implementation for a Directory would do the following steps:


simpliest solution
1. remove all sons of this node
2. re-read the directory
3. insert all the sons in the directoy to the current node
(this solution is simple and slow)

Constructor Index

 o RescanNode(Component)

Method Index

 o getRescan()
indicates wheter we call when a NodeContainer is "opened"
 o Rescan()
Overload this, if you want "rescan" abilities
 o setRescan(boolean)
Sets the Rescan Variable for this NodeContainer
 o setState(boolean)
if change to true, and lRescan == true we do a Rescan on the Node

Constructors

 o RescanNode
  public RescanNode(Component desc)

Methods

 o setState
  public void setState(boolean check)
if change to true, and lRescan == true we do a Rescan on the Node
Overrides:
setState in class NodeContainer
 o Rescan
  public void Rescan()
Overload this, if you want "rescan" abilities
 o getRescan
  public boolean getRescan()
indicates wheter we call when a NodeContainer is "opened"
 o setRescan
  public void setRescan(boolean lRescan)
Sets the Rescan Variable for this NodeContainer

All Packages  Class Hierarchy  This Package  Previous  Next  Index