|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ccg.swing.LookupINISectionEditor
public class LookupINISectionEditor
A graphical interface to allow a user to interact with a LookupINI object.
This class provides the graphical foundation to allow a user to
interact with the various sections found in a LookupINI object. This class works in conjunction with the LookupINIComboBoxModel object and provides
the following features:
LookupINI object.
monitor when the
user selects a new section.
add sections at will.
remove sections at will.
It should be noted, that one must fully configure the object
BEFORE retreiving the graphical component OR
adding any action listeners.
LookupINIComboBoxModel| Field Summary | |
|---|---|
(package private) JComboBox |
_Chooser
|
| Constructor Summary | |
|---|---|
LookupINISectionEditor()
Construct the object with using a default model. |
|
LookupINISectionEditor(LookupINIComboBoxModel model)
Construct the object with an already existant model. |
|
| Method Summary | |
|---|---|
void |
addActionListener(ActionListener al)
Add's a new action listener to be notified when the user selects a new section. |
protected JComboBox |
buildChooser()
Construct the JComboBox chooser for picking sections. |
protected JComponent |
buildFinalComponent(JComboBox chooser)
Build the final graphical component to present to the end user. |
JComponent |
getComponent()
Get the graphical component which the user will interact with. |
LookupINI |
getLookupINI()
Get the LookupINI object we are providing a model of. |
LookupINIComboBoxModel |
getModel()
Get the swing "model" used when we create the graphical component. |
protected String |
getUserSpecifiedSection()
Get the user's current section choice. |
boolean |
isAddEnabled()
Is the user able to "add" new sections? |
protected boolean |
isEditable()
Can the user edit the text choice displayed set? |
boolean |
isRemoveEnabled()
Can the user "remove" existing sections? |
void |
setAddEnabled(boolean val)
Set whether the user "add" new sections or not. |
protected void |
setEditable(boolean val)
Set whether the user can edit the text choice displayed. |
void |
setRemoveEnabled(boolean val)
Set whether the user can "remove" existing sections. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
JComboBox _Chooser
| Constructor Detail |
|---|
public LookupINISectionEditor(LookupINIComboBoxModel model)
model.
After construction, you may want to use some of the "set"
methods PRIOR to retrieving the graphical
component OR adding any action
listeners.
model - The model to be associated with the graphical component. Must
NOT be null.public LookupINISectionEditor()
model.
After construction, you may want to use some of the "set"
methods PRIOR to retrieving the graphical
component OR adding any action
listeners.
| Method Detail |
|---|
public void addActionListener(ActionListener al)
Use this method if you want to be notified whenever the user
chooses (or enters) a new section name. Note, invoking this
method causes the getComponent method to be
invoked as well. This means that you should do all of your
configuration of the object PRIOR to invoking this method.
al - The action listener to be notified.getComponent()public final LookupINIComboBoxModel getModel()
public final LookupINI getLookupINI()
LookupINI object we are providing a model of.
public final void setAddEnabled(boolean val)
NOTE: This can not be changed once the graphical component is retrieved! Also, enabling the "add" also enables the "editable" capacity.
val - New boolean value to assign.isAddEnabled()public final boolean isAddEnabled()
setAddEnabled(boolean)public final void setRemoveEnabled(boolean val)
NOTE: This can not be changed once the graphical component is retrieved!
val - New boolean value to assign.isRemoveEnabled()public final boolean isRemoveEnabled()
setRemoveEnabled(boolean)protected final void setEditable(boolean val)
val - New boolean value to assign.isEditable()protected final boolean isEditable()
setEditable(boolean)public final JComponent getComponent()
It should be noted that once the component is retrieved (or a
action listener is added, one will no
longer be able to adjust the properties of the object.
addActionListener(java.awt.event.ActionListener)protected JComboBox buildChooser()
JComboBox chooser for picking sections.
Typically derived classes will NOT override this
method. However, if yo want to provide your own custom JComboBox object used to allow the user to specify a
section name, you can do so here.
buildFinalComponent(javax.swing.JComboBox)protected JComponent buildFinalComponent(JComboBox chooser)
This method will be called at most one time for the
object. Its purpose is to build the complete graphical component
which the user can interact with. This default implementation
will add the "Add"/"Remove" buttons if the object has the add enabled and/or the remove enabled.
Derived classes will typically replace this ENTIRE method if they want to create their own custom look & feel.
chooser - The JComboBox object which the user has
access to to choose (and possibly type in) section names.
buildChooser()protected String getUserSpecifiedSection()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||