org.wings.tree
Class SDefaultTreeCellRenderer

java.lang.Object
  extended by org.wings.SComponent
      extended by org.wings.SLabel
          extended by org.wings.tree.SDefaultTreeCellRenderer
All Implemented Interfaces:
Serializable, Cloneable, Renderable, STreeCellRenderer

public class SDefaultTreeCellRenderer
extends SLabel
implements STreeCellRenderer

Author:
Holger Engels, Armin Haaf
See Also:
Serialized Form

Field Summary
protected  SIcon closedIcon
          Icon used to show non-leaf nodes that aren't expanded.
protected  SIcon leafIcon
          Icon used to show leaf nodes.
protected  String nonSelectionStyle
          Style to use for the foreground for non-selected nodes.
protected  SIcon openIcon
          Icon used to show non-leaf nodes that are expanded.
protected  String selectionStyle
          Style to use for the foreground for selected nodes.
 
Fields inherited from class org.wings.SLabel
disabledIcon, horizontalTextPosition, icon, iconTextGap, text, verticalTextPosition, wordWrap
 
Fields inherited from class org.wings.SComponent
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME
 
Constructor Summary
SDefaultTreeCellRenderer()
          Create a SDefaultTreeCellRenderer with default properties.
 
Method Summary
 SIcon getClosedIcon()
          Returns the icon used to represent non-leaf nodes that are not expanded.
 SIcon getDefaultClosedIcon()
          Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are not expanded.
 SIcon getDefaultLeafIcon()
          Returns the default icon, for the current laf, that is used to represent leaf nodes.
 SIcon getDefaultOpenIcon()
          Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are expanded.
 SIcon getLeafIcon()
          Returns the icon used to represent leaf nodes.
 String getNonSelectionStyle()
          Returns the style the cell is drawn with when the cell isn't selected.
 SIcon getOpenIcon()
          Returns the icon used to represent non-leaf nodes that are expanded.
 String getSelectionStyle()
          Returns the style the cell is drawn with when the cell is selected.
 SComponent getTreeCellRendererComponent(STree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
           
protected  String name(SComponent component, int row)
           
 void setClosedIcon(SIcon newIcon)
          Sets the icon used to represent non-leaf nodes that are not expanded.
 void setLeafIcon(SIcon newIcon)
          Sets the icon used to represent leaf nodes.
 void setNonSelectionStyle(String newStyle)
          Sets the style the cell is drawn with when the cell isn't selected.
 void setOpenIcon(SIcon newIcon)
          Sets the icon used to represent non-leaf nodes that are expanded.
 void setSelectionStyle(String newStyle)
          Sets the style the cell is drawn with when the cell is selected.
 
Methods inherited from class org.wings.SLabel
getDisabledIcon, getHorizontalTextPosition, getIcon, getIconTextGap, getText, getVerticalTextPosition, isWordWrap, setCG, setDisabledIcon, setHorizontalTextPosition, setIcon, setIconTextGap, setText, setVerticalTextPosition, setWordWrap
 
Methods inherited from class org.wings.SComponent
addComponentListener, addDynamicStyle, addEventListener, addNotify, addParentFrameListener, addPropertyChangeListener, addPropertyChangeListener, addRenderListener, addScriptListener, addStyle, clone, fireComponentChangeEvent, fireFinalEvents, fireKeyEvents, fireRenderEvent, getActionMap, getBackground, getBorder, getCG, getClientProperty, getComponentPopupMenu, getDynamicStyle, getDynamicStyles, getFocusTraversalIndex, getFont, getForeground, getHorizontalAlignment, getInputMap, getInputMap, getListenerCount, getListenerList, getListeners, getLowLevelEventId, getName, getParent, getParentFrame, getPreferredSize, getRequestURL, getResidesInForm, getScriptListenerList, getScriptListeners, getSession, getShowAsFormComponent, getStyle, getToolTipText, getVerticalAlignment, invite, isDifferent, isEnabled, isFocusOwner, isRecursivelyVisible, isReloadForced, isUpdatePossible, isVisible, paramString, processComponentEvent, processKeyEvents, processLowLevelEvent, putClientProperty, reload, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, removeComponentListener, removeDynamicStyle, removeEventListener, removeNotify, removeParentFrameListener, removePropertyChangeListener, removePropertyChangeListener, removeRenderListener, removeScriptListener, removeStyle, requestFocus, scrollRectToVisible, setActionMap, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setBackground, setBorder, setCG, setComponentPopupMenu, setDynamicStyles, setEnabled, setFocusTraversalIndex, setFont, setForeground, setHorizontalAlignment, setInputMap, setInputMap, setName, setNameRaw, setParent, setParentFrame, setPreferredSize, setReloadForced, setShowAsFormComponent, setStyle, setToolTipText, setVerticalAlignment, setVisible, toString, update, updateCG, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

closedIcon

protected transient SIcon closedIcon
Icon used to show non-leaf nodes that aren't expanded.


leafIcon

protected transient SIcon leafIcon
Icon used to show leaf nodes.


openIcon

protected transient SIcon openIcon
Icon used to show non-leaf nodes that are expanded.


selectionStyle

protected String selectionStyle
Style to use for the foreground for selected nodes.


nonSelectionStyle

protected String nonSelectionStyle
Style to use for the foreground for non-selected nodes.

Constructor Detail

SDefaultTreeCellRenderer

public SDefaultTreeCellRenderer()
Create a SDefaultTreeCellRenderer with default properties.

Method Detail

getDefaultOpenIcon

public SIcon getDefaultOpenIcon()
Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are expanded.


getDefaultClosedIcon

public SIcon getDefaultClosedIcon()
Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are not expanded.


getDefaultLeafIcon

public SIcon getDefaultLeafIcon()
Returns the default icon, for the current laf, that is used to represent leaf nodes.


setOpenIcon

public void setOpenIcon(SIcon newIcon)
Sets the icon used to represent non-leaf nodes that are expanded.


getOpenIcon

public SIcon getOpenIcon()
Returns the icon used to represent non-leaf nodes that are expanded.


setClosedIcon

public void setClosedIcon(SIcon newIcon)
Sets the icon used to represent non-leaf nodes that are not expanded.


getClosedIcon

public SIcon getClosedIcon()
Returns the icon used to represent non-leaf nodes that are not expanded.


setLeafIcon

public void setLeafIcon(SIcon newIcon)
Sets the icon used to represent leaf nodes.


getLeafIcon

public SIcon getLeafIcon()
Returns the icon used to represent leaf nodes.


getTreeCellRendererComponent

public SComponent getTreeCellRendererComponent(STree tree,
                                               Object value,
                                               boolean selected,
                                               boolean expanded,
                                               boolean leaf,
                                               int row,
                                               boolean hasFocus)
Specified by:
getTreeCellRendererComponent in interface STreeCellRenderer

name

protected String name(SComponent component,
                      int row)

setSelectionStyle

public void setSelectionStyle(String newStyle)
Sets the style the cell is drawn with when the cell is selected.


getSelectionStyle

public String getSelectionStyle()
Returns the style the cell is drawn with when the cell is selected.


setNonSelectionStyle

public void setNonSelectionStyle(String newStyle)
Sets the style the cell is drawn with when the cell isn't selected.


getNonSelectionStyle

public String getNonSelectionStyle()
Returns the style the cell is drawn with when the cell isn't selected.



wingS Swings ;-)