|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.renderer.ComponentProvider<JLabel>
org.jdesktop.swingx.renderer.LabelProvider
public class LabelProvider
A component provider which uses a JLabel.
Field Summary |
---|
Fields inherited from class org.jdesktop.swingx.renderer.ComponentProvider |
---|
alignment, defaultVisuals, formatter, rendererComponent |
Constructor Summary | |
---|---|
LabelProvider()
Instantiates a default component provider with LEADING horizontal alignment and default to-String converter. |
|
LabelProvider(int alignment)
Instantiates a default component provider with the given horizontal alignment and default to-String converter. |
|
LabelProvider(StringValue converter)
Instantiates a default component provider with LEADING horizontal alignment and the given to-String converter. |
Method Summary | |
---|---|
protected void |
configureState(CellContext context)
Configures the renderering component's state from the given cell context. Here: sets the Label's horizontal alignment to the alignment as configured in the controller. |
protected JLabel |
createRendererComponent()
Factory method to create and return the component to use for rendering. |
protected void |
format(CellContext context)
Formats the renderering component's content from the given cell context. Here: sets the labels text and icon property depending on the type of the context's value. |
Methods inherited from class org.jdesktop.swingx.renderer.ComponentProvider |
---|
configureContent, configureVisuals, createRendererController, getHorizontalAlignment, getRendererComponent, getRendererController, getStringValue, getToStringConverter, setHorizontalAlignment, setToStringConverter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabelProvider()
public LabelProvider(StringValue converter)
converter
- the converter to use for mapping the cell value
to a String representation.public LabelProvider(int alignment)
alignment
- the horizontal alignment.Method Detail |
---|
protected JLabel createRendererComponent()
createRendererComponent
in class ComponentProvider<JLabel>
protected void configureState(CellContext context)
configureState
in class ComponentProvider<JLabel>
context
- the cell context to configure from, must not be null.protected void format(CellContext context)
Icon
type, it's
used as the label's icon and the text is set to empty. Otherwise,
the icon is set to null and the text is set to the value as returned
from getStringValue. Note: this is the behaviour as implemented in core default list renderer. It is different from core default table renderer which handles icons in a subclass only.
format
in class ComponentProvider<JLabel>
context
- the cellContext to useComponentProvider.getStringValue(CellContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |