org.jdesktop.swingx.renderer
Class CellContext
- java.lang.Object
-
- org.jdesktop.swingx.renderer.CellContext
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ListCellContext, TableCellContext, TreeCellContext
public class CellContext extends java.lang.Object implements java.io.SerializableEncapsulates a snapshop of cell content and default display context for usage by aComponentProvider.One part is the super-set of properties that's traditionally passed into the core renderers' (Table-, List-, Tree-) getXXCellRendererComponent. Raw properties which define the context are
- selected
- focused
- expanded
- leaf
- foreground and background color
- border
- icon (relevant for trees only)
- editable
- PENDING: still incomplete? how about Font?
- PENDING: protected methods? Probably need to open up - derived properties should be accessible in client code.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description CellContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetCellRendererName()intgetColumn()Returns the cell's column index in view coordinates as set in the install.javax.swing.JComponentgetComponent()Returns the component the cell resides on, may be null.javax.swing.IcongetIcon()Returns the icon.intgetRow()Returns the cell's row index in view coordinates as set in the install.java.lang.ObjectgetValue()Returns the value of the cell as set in the install.booleanisEditable()Returns the cell's editability.booleanisExpanded()Returns the expanded state as set in the install.booleanisFocused()Returns the focused state as set in the install.booleanisLeaf()Returns the leaf state as set in the install.booleanisSelected()Returns the selected state as set in the install.java.lang.ObjectreplaceValue(java.lang.Object value)Replaces the value of this cell context with the given parameter and returns the replaced value.
-
-
-
Method Detail
-
replaceValue
public java.lang.Object replaceValue(java.lang.Object value)
Replaces the value of this cell context with the given parameter and returns the replaced value.- Parameters:
value- the new value of the cell context- Returns:
- the replaced value of the cell context
-
getComponent
public javax.swing.JComponent getComponent()
Returns the component the cell resides on, may be null. Subclasses are expected to override and return the component type they are handling.- Returns:
- the component the cell resides on, may be null.
-
getValue
public java.lang.Object getValue()
Returns the value of the cell as set in the install.- Returns:
- the content value of the cell.
-
getRow
public int getRow()
Returns the cell's row index in view coordinates as set in the install.- Returns:
- the cell's row index.
-
getColumn
public int getColumn()
Returns the cell's column index in view coordinates as set in the install.- Returns:
- the cell's column index.
-
isSelected
public boolean isSelected()
Returns the selected state as set in the install.- Returns:
- the cell's selected state.
-
isFocused
public boolean isFocused()
Returns the focused state as set in the install.- Returns:
- the cell's focused state.
-
isExpanded
public boolean isExpanded()
Returns the expanded state as set in the install.- Returns:
- the cell's expanded state.
-
isLeaf
public boolean isLeaf()
Returns the leaf state as set in the install.- Returns:
- the cell's leaf state.
-
isEditable
public boolean isEditable()
Returns the cell's editability. Subclasses should override to return a reasonable cell-related state.Here: false.
- Returns:
- the cell's editable property.
-
getIcon
public javax.swing.Icon getIcon()
Returns the icon. Subclasses should override to return a reasonable cell-related state.Here:
null.- Returns:
- the cell's icon.
-
getCellRendererName
public java.lang.String getCellRendererName()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG