|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ccg.values.ValuesConfigList
public final class ValuesConfigList
A configuration chooser (and optional editor) which lets the end user pick configurations from a named list.
This class is used to allow the user to scroll through the available configurations and optionally edit, add new, or remove existing configurations.
The general usage of this class goes as follows:
ValuesConfigModel must be
set.
ValuesConfigModel| Field Summary | |
|---|---|
static int |
ADD
Bit mask option which can be passed to setButtons to request a "Add" button. |
static int |
ALL
Bit mask option which can be passed to setButtons to request that all possible buttons be added. |
static int |
EAST
Bit mask option which controls where the buttons are placed. |
static int |
EDIT
Bit mask option which can be passed to setButtons to request a "Edit" button. |
static int |
REMOVE
Bit mask option which can be passed to setButtons to request a "Remove" button. |
static int |
SOUTH
Bit mask option which controls where the buttons are placed. |
| Constructor Summary | |
|---|---|
ValuesConfigList()
Default construction of the object - will NOT be ready for use. |
|
ValuesConfigList(ValuesConfigModel vcm,
ValuesEditor ve,
int bmask)
Allows one to fully configure the object at time of construction. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener cl)
Add a "change listener" to notify if the user modifies any of the values in the model. |
void |
addListSelectionListener(ListSelectionListener lsl)
Add a "list selection listener" to notify if the user selects a different configuration from the list. |
int |
getButtons()
Get the desired buttons to be included at the bottom of the configuration list. |
JComponent |
getComponent()
Get the Swing component the user will interact with. |
ValuesEditor |
getEditor()
Get the optional ValuesEditor to allow the
user to add/edit configurations. |
int |
getMinListRows()
Get the minimum number of rows to appear in the configuration list. |
ValuesConfigModel |
getModel()
Get the ValuesConfigModel associated
with the list. |
void |
removeChangeListener(ChangeListener l)
Remove a "change listener" that had been previously added. |
void |
removeListSelectionListener(ListSelectionListener lsl)
Remove a "list selection listener" which had previously been added. |
void |
setButtons(int val)
Set the desired buttons to be included at the bottom of the configuration list. |
void |
setEditor(ValuesEditor val)
Set the optional ValuesEditor to allow the
user to add/edit configurations. |
void |
setMinListRows(int val)
Set the minimum number of rows to appear in the configuration list. |
void |
setModel(ValuesConfigModel val)
Set the ValuesConfigModel associated
with the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int EDIT
setButtons to request a "Edit" button.
This constant is used to make a request that the "Edit" button
appear in addition to the list of configuration choices. This is
only a request and will only be honored if a non-null editor has been set.
setButtons(int),
Constant Field Valuespublic static final int ADD
setButtons to request a "Add" button.
This constant is used to make a request that the "Add" button
appear in addition to the list of configuration choices. This is
only a request and will only be honored if a non-null editor has been set.
setButtons(int),
Constant Field Valuespublic static final int REMOVE
setButtons to request a "Remove" button.
This constant is used to make a request that the "Remove" button appear in addition to the list of configuration choices.
setButtons(int),
Constant Field Valuespublic static final int SOUTH
This constant can be bit OR'ed with the other constants when
setting the button options. This flag
indicates that you want the buttons to appear south of the list
instead of the default position (which is east of the list).
setButtons(int),
Constant Field Valuespublic static final int EAST
This constant can be bit OR'ed with the other constants when
setting the button options. This flag
indicates that you want the buttons to appear east of the list
instead of the default position (which is east of the list).
setButtons(int),
Constant Field Valuespublic static final int ALL
setButtons to request that all possible buttons be added.
This constant is used to make a request that ALL of the available buttons which can be created, should be added to the list of configuration choices.
setButtons(int),
Constant Field Values| Constructor Detail |
|---|
public ValuesConfigList()
This default constructor leaves the object in a unusable
state. You must use the setModel method before
the object will be able to be used.
setModel(com.ccg.values.ValuesConfigModel)
public ValuesConfigList(ValuesConfigModel vcm,
ValuesEditor ve,
int bmask)
This method should fully construct and initialize the object
such that one can immediately use the getComponent method.
vcm - New ValuesConfigModel value to assign (must not be null).ve - The ValuesEditor to be used when allowing the user to edit/add
configurations (may be null).val - Bit mask of desired buttons (see setButtons.
NullPointerException - If you pass null.setModel(com.ccg.values.ValuesConfigModel),
setEditor(com.ccg.values.ValuesEditor),
setButtons(int)| Method Detail |
|---|
public void setModel(ValuesConfigModel val)
ValuesConfigModel associated
with the list.
This method allows one to configure the ValuesConfigModel associated with the list. It
is illegal to use this method if the component has already been
realized.
val - New ValuesConfigModel value to assign (must not be null).
NullPointerException - If you pass null.
IllegalStateException - If the graphical component has already been realized via
getComponent.getModel()public ValuesConfigModel getModel()
ValuesConfigModel associated
with the list.
setModel(com.ccg.values.ValuesConfigModel)public void setEditor(ValuesEditor val)
ValuesEditor to allow the
user to add/edit configurations.
If you would like to allow the user the ability to edit and/or
add configurations, you need to set a non-null editor (which is
compatible with your ValuesConfig model). If
you pass null (or do not specify one), then the ADD
and EDIT options will be ignored.
val - The ValuesEditor to be used when allowing the user to edit/add
configurations (may be null).
IllegalStateException - If the graphical component has already been realized via
getComponent.getEditor()public ValuesEditor getEditor()
ValuesEditor to allow the
user to add/edit configurations.
setEditor(com.ccg.values.ValuesEditor)public void setButtons(int val)
This method may only be used prior to getComponentMethod to indicate what (if any) actions should be
presented to the user. You can use the ALL to
indicate that you want all of the possible buttons, or use a bit
or combination of ADD, REMOVE and/or
EDIT.
Please note, that this is only a request. It is possible that
fewer buttons will appear (for example, if you request the EDIT button, but don't provied a editor, then the edit button will NOT be displayed).
val - New int value to assign.
IllegalStateException - If the graphical component has already been realized via
getComponent.getButtons()public int getButtons()
setButtons(int)public void setMinListRows(int val)
This parameter allows one to control how many rows (at a minimum) will appear in the scrollable configuration list area.
val - New int value to assign (must be in the range of [1,100].
IllegalArgumentException - If you pass a value which is out of range.getMinListRows()public int getMinListRows()
setMinListRows(int)public JComponent getComponent()
You should only use this method once you have specified all of
the desirable settings (you can't change settings once the
component has been realized). In particular, you MUST set the
values config model.
IllegalStateException - If the model wasn't set.public final void addChangeListener(ChangeListener cl)
This method allows developers to determine if the user has modified (removed, edited or added) a configuration. Currently, this doesn't tell you what happened - just that something changed.
NOTE: This does not include the selection of a choice from the
list - you can use the model to monitor
selection events.
cl - The ChangeListener to notify of
modifications.public final void removeChangeListener(ChangeListener l)
added.
cl - The ChangeListener to remove from the
notification list.public final void addListSelectionListener(ListSelectionListener lsl)
This method allows developers to determine if the user has chosen a different configuration from the list of available choices. It does not indicate that the configuration has been modified in any way, just that a configuration has been chosen.
cl - The ListSelectionListener to notify of
modifications.public final void removeListSelectionListener(ListSelectionListener lsl)
cl - The ListSelectionListener to
stop notifying of modifications.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||