public final class ListButtons
extends java.lang.Object
A Helper must be provided for the add and remove buttons to be included as the Helper is responsible for actioning those buttons.
Modifier and Type | Class and Description |
---|---|
static class |
ListButtons.Controller
A ListButtons Controller is repsonsible for controlling all of the
customisable behaviour of a ListButtons instance, e.g.
|
static interface |
ListButtons.Helper
Deprecated.
- use Controller
|
static class |
ListButtons.HelperAdapter
Deprecated.
- use Controller
|
Constructor and Description |
---|
ListButtons(javax.swing.JList list,
ListButtons.Controller controller) |
ListButtons(javax.swing.JTree tree,
ListButtons.Controller controller) |
ListButtons(SelectableComponent sc,
ListButtons.Controller controller) |
Modifier and Type | Method and Description |
---|---|
void |
addCustomButton(javax.swing.Icon icon,
java.lang.String text,
java.lang.String buttonName)
Adds a custom button to the bottom of the button list.
|
void |
enableButtons()
Enables/disables the buttons on the panel according to the rules of the
Helper registered.
|
javax.swing.JComponent |
getComponent()
Gets the component containing the list and all the buttons.
|
javax.swing.JLabel |
getLabel()
Gets the label from the title bar for the wrapped component.
|
SelectableComponent |
getSelectableComponent()
Returns the SelectableComponent wrapping the list (or tree) this
ListButtons is operating on.
|
void |
setAddButton(javax.swing.AbstractButton button)
Sets the add button to be used in the toolbar of the component.
|
void |
setEnabled(boolean enabled)
Enable/disable the panel and all the buttons.
|
void |
setRemoveButton(javax.swing.AbstractButton button)
Sets the add button to be used in the toolbar of the component.
|
public ListButtons(javax.swing.JList list, ListButtons.Controller controller)
public ListButtons(javax.swing.JTree tree, ListButtons.Controller controller)
public ListButtons(SelectableComponent sc, ListButtons.Controller controller)
public javax.swing.JLabel getLabel()
public javax.swing.JComponent getComponent()
public SelectableComponent getSelectableComponent()
public void setAddButton(javax.swing.AbstractButton button)
public void setRemoveButton(javax.swing.AbstractButton button)
public final void addCustomButton(javax.swing.Icon icon, java.lang.String text, java.lang.String buttonName)
ListButtons.Controller
for the customButtonPressed method.
You must have a ListButtons.Controller
registered to use this method.
icon
- the icon for the buttontttext
- the button's tooltip text (and accessible description)buttonName
- a unique name to identify the componentpublic void enableButtons()
ListButtons.Helper
public void setEnabled(boolean enabled)