public class CellRendererToggle extends CellRenderer
setActive()
which you use to indicate
the particular DataColumnBoolean from the underlying TreeModel which will
provide the boolean values.Modifier and Type | Class and Description |
---|---|
static interface |
CellRendererToggle.Toggled
Signal emitted after user toggles the rendered toggle button in a cell.
|
Constructor and Description |
---|
CellRendererToggle(CellLayout vertical)
Construct a new CellRendererToggle.
|
Modifier and Type | Method and Description |
---|---|
void |
connect(CellRendererToggle.Toggled handler)
Hook up a signal handler to receive "toggled" events on this
CellRenderer.
|
boolean |
getActive()
Get the current state of the toggle button.
|
void |
setActivatable(boolean setting)
Indicate if the CellRendererToggle's toggle button is actually
activatable, which means that clicking the toggle button causes a
change in the CellRendererToggle's state.
|
void |
setActive(boolean setting)
Indicate if the CellRendererToggle's toggle button should be active.
|
void |
setActive(DataColumnBoolean column)
Indicate a DataColumnBoolean you want the state of the
CellRendererToggle to be bound to.
|
void |
setRadio(boolean setting)
Indicate the appearance of this CellRenderer.
|
setAlignment, setBackground, setBackground, setVisible, setWidth
public CellRendererToggle(CellLayout vertical)
public void connect(CellRendererToggle.Toggled handler)
final DataColumnBoolean column; final TreeView view; final ListStore store; final TreeViewColumn vertical; store = new ListStore(new DataColumn[] { column = new DataColumnBoolean() }); view = new TreeView(store); vertical = view.appendColumn(); CellRendererToggle renderer = new CellRendererToggle(vertical); renderer.setActive(column); renderer.connect(new TOGGLED() { public void onToggled(CellRendererToggle renderer, TreePath path) { System.out.println("Path " + path + " toggled to " + renderer.getActive()); } });
public boolean getActive()
public void setActivatable(boolean setting)
A CellRendererToggle is activatable by default.
public void setActive(boolean setting)
If you want to bind the state of the toggle button to a DataColumn you
might want to use the overloaded method
setActive()
.
public void setActive(DataColumnBoolean column)
public void setRadio(boolean setting)
true
a radio button is used instead of the default check
box.