com.imagero.gui.swing.tree.handler
Interface Handler
- All Known Implementing Classes:
- FileHandler, HTTPHandler, URLFileHandler, com.imagero.gui.swing.tree.handler.ZipHandler
- public interface Handler
HTreeNode delegates work to Handler.
Handler can populate and refresh HTreeNode's chiidren
Such important things as isLeaf(), getAllowsChildren() and toString()
also delegated to Handler.
HandlerFactory is used to get proper Handler for HTreeNode content.
Handler should register itself by HandlerFactory.
To determine if particular Handler can handle supplied Object,
HandlerFactory calls Handler's method canHandle(Object o).
If HandlerFactory finds more then 1 Handler, then method isGeneric() used to determine
which Handler should be used.
For example for *.zip file FileHandler and FileZipHandler returns true from canHandle(),
however FileHandler is generic and so FileZipHandler is choosed by HandlerFactory
canHandle
public boolean canHandle(java.lang.Object o)
getAllowsChildren
public boolean getAllowsChildren(HTreeNode node)
getComparator
public TreeNodeComparator getComparator()
isGeneric
public boolean isGeneric()
isLeaf
public boolean isLeaf(HTreeNode node)
populateChildren
public boolean populateChildren(HTreeNode node,
boolean descend,
boolean refreshNodes)
throws java.io.IOException
- Throws:
java.io.IOException
toString
public java.lang.String toString(HTreeNode node)