|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.contrib.poibrowser.ExtendableTreeCellRenderer
public class ExtendableTreeCellRenderer
This is a TreeCellRenderer
implementation which is able
to render arbitrary objects. The ExtendableTreeCellRenderer
does not do the rendering itself but instead dispatches to
class-specific renderers. A class/renderer pair must be registered
using the register(java.lang.Class, javax.swing.tree.TreeCellRenderer)
method. If a class has no registered
renderer, the renderer of its closest superclass is used. Since the
ExtendableTreeCellRenderer
always has a default renderer
for the Object
class, rendering is always possible. The
default Object
renderer can be replaced by another renderer
but it cannot be unregistered.
Field Summary | |
---|---|
protected java.util.Map |
renderers
Maps classes to renderers. |
Constructor Summary | |
---|---|
ExtendableTreeCellRenderer()
|
Method Summary | |
---|---|
protected javax.swing.tree.TreeCellRenderer |
findRenderer(java.lang.Class c)
Find the renderer for the specified class. |
java.awt.Component |
getTreeCellRendererComponent(javax.swing.JTree tree,
java.lang.Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
Renders an object in a tree cell depending of the object's class. |
void |
register(java.lang.Class c,
javax.swing.tree.TreeCellRenderer renderer)
Registers a renderer for a class. |
void |
unregister(java.lang.Class c)
Unregisters a renderer for a class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map renderers
Maps classes to renderers.
Constructor Detail |
---|
public ExtendableTreeCellRenderer()
Method Detail |
---|
public void register(java.lang.Class c, javax.swing.tree.TreeCellRenderer renderer)
Registers a renderer for a class.
public void unregister(java.lang.Class c)
Unregisters a renderer for a class. The renderer for the
Object
class cannot be unregistered.
public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
Renders an object in a tree cell depending of the object's class.
getTreeCellRendererComponent
in interface javax.swing.tree.TreeCellRenderer
TreeCellRenderer.getTreeCellRendererComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int, boolean)
protected javax.swing.tree.TreeCellRenderer findRenderer(java.lang.Class c)
Find the renderer for the specified class.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |