org.jdesktop.swingx.renderer
Class ButtonProvider

java.lang.Object
  extended by org.jdesktop.swingx.renderer.ComponentProvider<AbstractButton>
      extended by org.jdesktop.swingx.renderer.ButtonProvider
All Implemented Interfaces:
Serializable

public class ButtonProvider
extends ComponentProvider<AbstractButton>

A component provider which uses a AbstractButton.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jdesktop.swingx.renderer.ComponentProvider
alignment, defaultVisuals, formatter, rendererComponent
 
Constructor Summary
ButtonProvider()
           
 
Method Summary
protected  void configureState(CellContext context)
          Configures the renderering component's state from the given cell context.
protected  AbstractButton 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.
protected  void setBorderPainted(boolean b)
           
 
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

ButtonProvider

public ButtonProvider()
Method Detail

format

protected void format(CellContext context)
Formats the renderering component's content from the given cell context.

Overridden to set the button's selected state. It's set to true if the context's value equals Boolean.TRUE, false otherwise.

Specified by:
format in class ComponentProvider<AbstractButton>
Parameters:
context - the cell context to configure from, must not be null.

configureState

protected void configureState(CellContext context)
Configures the renderering component's state from the given cell context.

Here: set's the buttons horizontal alignment and borderpainted properties to this controller's properties.

Specified by:
configureState in class ComponentProvider<AbstractButton>
Parameters:
context - the cell context to configure from, must not be null.

createRendererComponent

protected AbstractButton createRendererComponent()
Factory method to create and return the component to use for rendering.

Here: returns a JCheckBox as rendering component.

Specified by:
createRendererComponent in class ComponentProvider<AbstractButton>
Returns:
the component to use for rendering.

setBorderPainted

protected void setBorderPainted(boolean b)
Parameters:
b -